I've read that ADSL uses frequency-divided multiplexing and only analog signals use FDM. Then why there's the term 'digital' in ADSL(Asymmetric digital subscriber line) if it uses analog signals?
A simple way to imagine it, digital signal is broken into different frequencies like a piano keys.
Then each tone is sent down the copper wire like a sound, this is then picked up at the far end and then Demodulated back into a digital string of 1s a nd 0s.
A modems name is created from the job it does as a Modulator / Demodulator.
The signal is digital, the line encoding that implements this signal is described in the real macro world with analog.
Related
I have been using the Teensy 3.6 microcontroller board (180 MHz ARM Cortex-M4 processor) to try and implement a driver for a sensor. The sensor is controlled over SPI and when it is commanded to make a measurement, it sends out the data over two lines, DOUT and PCLK. PCLK is a 5 MHz clock signal and the bits are sent over DOUT, measured on the falling edges of the PCLK signal. The data frame itself consists of 1,024 16-bit values.
My first attempt consisted a relatively naïve approach: I attached an interrupt to the PCLK pin looking for falling edges. When it detects a falling edge, it sets a bool that a new bit is available and sets another bool to the value of the DOUT line. The main loop of the program generates a uint_16 value from these bits and collects 1,024 of these values for the full measurement frame.
However, this program locks up the Teensy almost immediately. From my experiments, it seems to lock up as soon as the interrupt is attached. I believe that the microprocessor is being swamped by interrupts.
I think that the correct way of doing this is by using the Teensy's DMA controller. I have been reading Paul Stoffregen's DMAChannel library but I can't understand it. I need to trigger the DMA measurements from the PCLK digital pin and have it read in bits from the DOUT digital pin. Could someone tell me if I am looking at this problem in the correct way? Am I overlooking something, and what resources should I view to better understand DMA on the Teensy?
Thanks!
I put this on the Software Engineering Stack Exchange because I feel that this is primarily a programming problem, but if it is an EE problem, please feel free to move it to the EE SE.
Is DMA the Correct Way to Receive High-Speed Digital Data on a Microprocessor?
There is more than one source of 'high speed digital data'. DMA is not the globally correct solution for all data, but it can be a solution.
it sends out the data over two lines, DOUT and PCLK. PCLK is a 5 MHz clock signal and the bits are sent over DOUT, measured on the falling edges of the PCLK signal.
I attached an interrupt to the PCLK pin looking for falling edges. When it detects a falling edge, it sets a bool that a new bit is available and sets another bool to the value of the DOUT line.
This approach would be call 'bit bashing'. You are using a CPU to physically measure the pins. It is a worst case solution that I see many experienced developers implement. It will work with any hardware connection. Fortunately, the Kinetis K66 has several peripherals that maybe able to assist you.
Specifically, the FTM, CMP, I2C, SPI and UART modules may be useful. These hardware modules are capable of reducing the work load from processing each bit to groups of bits. For instance, the FTM support a capture mode. The idea is to ignore the PCLK signal and just measure the time between edges. These times will be fixed in a bit period/CLK. If the timer captures a two bit period, then you know that two ones or zeros were sent.
Also, your signal seems like SSI which is an 'digital audio' channel. Unfortunately, the K66 doesn't have an SSI module. Typical I2C is open drain and it always has a start bit and fixed word size. It maybe possible to use this if you have some knowledge of the data and/or can attach some circuit to fake some bits (to be removed later).
You could use the UART and time between characters to capture data. The time will be a run of bits that aren't the start bit. However it looks like this UART module requires stop bits (the SIM feature are probably very limited).
Once you do this, the decision between DMA, interrupt and polling can be made. There is nothing faster than polling if the CPU uses the data. DMA and interrupts are needed if you need to multiplex the CPU with the data transfer. DMA is better if the CPU doesn't need to act on most of the data or the work the CPU is doing is not memory intensive (number crunching). Interrupts depend on your context save overhead. This can be minimized depending on the facilities your main line uses.
Some glue circuitry to adapt the signal to one of the K66 modules could go a long way to making a more efficient solution. If you can't change the signal, another (NXP?) SOC with an SSI module would work well. The NXP modules usually support chaining to an eDMA module as well as interrupts.
I have a sdr-device, an Ettus USRP B200 and I was given the task to convey information from the audio file on the air . I have tried to do this through the program SDR#, but it only works on reception.
How can I achieve audio transmission?
The USRP is a kind of universal transmitter; it doesn't take audio and does a specific kind of modulation to transmit it over the air, but it takes complex samples representing a base band signal that represents the signal as you want to transmit it at the radio frequency.
You will have to use some kind of modulator that converts your audio file to a transmittable complex baseband signal.
Typical analog radio stations use FM (Frequency Modulation). There's plenty of options out there, but I would try to get the GNU Radio live DVD, which comes with GNU Radio, and that has examples how to do FM transmission. It's really not that hard to create a FM receiver, and a transmitter is equally simple.
I am using Arduino UNO board. I have 24 analog channel which gives me 0~5v analog out put. Now my problem is I have only 5 analog channel. I wanted to read value from each channel for every 2 min and then switch to other channel. Can anyone suggest me in Hardware how can get analog value ?
I am planning to use 8:1 multiplexer or 16:1 multiplexer . Will it is correct way of doing it. Can you suggest other way of doing it in hardware ?
74HC4051,74HCT4051,ADG708,MD14051B,
IC I am planning to Use.dep[end on so,s1,s2 just switch the channel
As a start, you might need to know that even Arduino Uno also have internal MUX. In my experience of reading multiple analog channel, this is the approach that I take. However by taking this approach, I suggest you to recheck the analog value so adding MUX will not generate any error or bias.
This could be done by comparing the output of measurement with the MUX and output of measurement without the MUX. I used 74HC4051 and it works brilliantly, just make sure not to leave any pin floating. The only disadvantage of this method is that you will need to use some I/O to control the MUX, but if that is not an issue for you, then go ahead.
Any other method could be more complicated. It would require your analog channels to correlate with each other, and you need to find a way method to combine multiple analog channel into a single channel.
e.g: if your aim is to compare two analog value, instead of measuring the value and comparing the value in software, you could make use of op-amp comparison circuit to compare the value for you and take the comparison result instead.
Use the photon-pixel coupling method, it is a new approach in science for sampling an unlimited number of sensors in parallel.
Basically, each sensor output is an LED. If you have 10000 sensors, the output of all of them is inserted in a LED array, a LED matrix as the authors say. After that, the LED array is filmed by a video camera and the images are processed in real time by a computer. A software reads one pixel from each LED from the LED array and converts it to numerical values. So, your LED array will be converted in a matrix (with 10000 elements) filled with numbers that can be processed as you wish in your software. I don't know if I was explicit but you can read their article here: https://www.sciencedirect.com/science/article/pii/S2215016119300901
Note that classic multiplexing is serial, this approach is parallel.
The photon-pixel coupling method is truly ingenious because it solves two main problems in engineering: an unlimited number of sensors and their parallel sampling at video rate frequencies. Just imagine, we can read as many sensors as we wish. What I wander is if we can adapt the photon-pixel coupling to Arduino. I am new in the world of microcontrollers but I know Arduino can support a cam, so it should be possible.
If you are a PhD student then:
P.A. Gagniuc, C. Ionescu-Tirgoviste, R.G. Serban, E. Gagniuc. Photon-pixel coupling: A method for parallel acquisition of electrical signals in scientific investigations. MethodsX, 6:968-979, 2019.
To read more analog channels than inputs you have, an analog multiplexer is a good option. All the ones you suggested will work, but personally, I like the Analog Devices ICs for analog circuits, so I would take the ADG708, but this is just a personal preference.
I am trying to sample a 8bit input using sample clock and 'start sampling' trigger. Here's how I configure the task:
DAQmxErrChk(DAQmxCreateTask("",&samplHandle));
DAQmxErrChk(DAQmxCreateDIChan(samplHandle,"Dev1/port1/line2:7,Dev1/port2/line0:1","",DAQmx_Val_ChanForAllLines)); // choose my 8 bit DI lines PFI2:PFI9
DAQmxErrChk(DAQmxCfgSampClkTiming(samplHandle,"/Dev1/PFI0",1000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,length));
DAQmxErrChk(DAQmxCfgDigEdgeStartTrig(samplHandle,"/Dev1/PFI1",DAQmx_Val_Rising));
DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(samplHandle,DAQmx_Val_Acquired_Into_Buffer,length,0,Callback,this));
DAQmxErrChk(DAQmxTaskControl(samplHandle,DAQmx_Val_Task_Commit));
When I run it in QT Creator it gives me this error:
DAQmx Error: Specified property is not supported by the device or is not applicable to the task.
Property: DAQmx_StartTrig_Type
Task Name: _unnamedTask<0>
Status Code: -200452
DAQmx Error: Task specified is invalid or does not exist.
Status Code: -200088
Previously, when I used analog input instead of digital, I did not have any problems. Any one has a clue what's wrong with my channel configuration?
I am using PCI6259 and BNC2110.
You can use the PCI 6259 to do what you describe, but you need to configure the card a little differently. You would think it would be as straightforward as assigning a start trigger signal and terminal, like you're doing, but M Series devices are not as flexible as the newer X Series devices.
First, M Series devices do not support start triggers for digital tasks [1]:
M Series devices do not have an independent DI or DO Start Trigger for
digital waveform acquisition or generation.
Second, M Series devices can only acquire digital waveforms on port 0, and not on port 1 or 2. Before you can update your program, you will need to rewire your external connections and use lines from port 0. Your device, the NI 6259, has 32 lines for digital waveform measurements [2]:
Waveform Characteristics (Port 0 Only) -- NI 6254/6259: Port 0 (P0.<0..31>)
PFI/Port 1/Port 2 Functionality -- Static digital input, static digital output, timing input, timing output
Once you switch to port 0, there are two approaches you can take:
Use another subsystem on the card to provide the trigger and clock.
Use "change detection" to acquire a sample whenever any line has a transition.
Using another subsystem
M Series devices have analog input and counter/frequency output subsystems, and either one of these can be used to provide a start trigger and sample clock for your digital input measurements [1a]:
For example, consider the case where you are using AI Sample Clock as the
source of DI Sample Clock. To initiate pulses on AI Sample Clock (and
therefore on DI Sample Clock), you use AI Start Trigger to trigger the start
of an AI operation. The AI Start Trigger causes the M Series device to
begin generating AI Sample clock pulses, which in turn generates
DI Sample clock pulses.
If you are using a Counter output as the source of DI Sample Clock, the
counter’s start trigger, enables the counter which drives DI Sample Clock.
NI-DAQmx installs C examples that show how to use the API to configure tasks [3]. There are few that you can mix together to accomplish your design:
Continuously Read Digital Channel - External Clock
This can be the basis for the digital task settings
Continuously Acquire Voltage Samples - External Clock - Digital Start
This shows how to configure an analog task for an external sample clock and external digital start trigger, which can be doubled as the sample clock and start trigger for the digital task
Continuous Analog Input and Read Digital Channel
This is how you can synchronize the analog and digital subsystems
Generate Digital Pulse Train - Continuous - Digital Start
This is how you would configure a counter task to be the sample clock and start trigger
Keep in mind that the file names on disk for the examples are abbreviated.
Using change detection
M Series devices can detect rising edges, falling edges, or either edge individually on each DIO line. You can configure the task to raise an interrupt whenever a change is detected [1b]:
The DAQ devices synchronize each DI signal to 80MHzTimebase, and then sends the
signal to the change detectors. The circuitry ORs the output of all enabled
change detectors from every DI signal. The result of this OR is the Change
Detection Event signal.
As long as your input signals change slowly (100 Hz or less), you can use this technique to acquire the data. If they change must faster, it is unlikely that the program would be able to service the interrupts quickly enough. Because of this constraint, I would recommend trying the first approach.
The DAQmx C example [3] for this type of measurement is called Read Digital Channel - Change Detection.
References
[1a] M Series User Manual :: Digital Waveform Triggering (page 99..100)
[1b] M Series User Manual :: DI Change Detection (page 104..105)
http://digital.ni.com/manuals.nsf/websearch/2025C99AB0614F9E8625748000577B9A
[2] NI 625x Specifications :: Digital I/O/PFI
http://digital.ni.com/manuals.nsf/websearch/210C73CBF91128B9862572FF0076BE85
[3] Text Based NI-DAQmx Data Acquisition Examples :: ANSI C
http://www.ni.com/white-paper/6999/en/#ANSIC
What is the difference between SPI and serial? In reading an article talking about inter-processor communications, it states that serial interfaces are being replaced with SPI for better/faster comms? What exactly is the difference?
The word "serial" doesn't mean much. But I'll assume that you are talking about traditional serial communication standards. What's fundamentally different about SPI is that it is synchronous. As opposed to, say, RS-232, an asynchronous signaling standard.
An important property of asynchronous signaling is the baudrate, the frequency at which the bits in a byte are sent. The receiver has to do extra work to recover the clock that was used by the transmitter. A typical UART does so by over-sampling the signal at a rate 16 times the baudrate. The start-bit is important, which synchronizes the over-sampling clock. Delays between bytes can be arbitrary, the receiver re-synchronizes for each individual byte. Problems with this scheme are a mismatch between the transmitter and the receiver clock frequencies and clock jitter, effectively limiting the baudrate.
This is not a problem with SPI, it has an extra signal line that carries the clock signal so that both the transmitter and receiver uses the exact same clock. And is therefore immune from mismatches and jitter, allowing higher transfer rates. No stability requirements at all in the clock frequency, the signals can simply be generated in software. Typical four line wiring looks like this:
SCLK is the clock signal. MOSI and MISO carry the data, SS is a chip select signal. Common ground is assumed. More about it in this Wikipedia article. electronics.stackexchange.com is a good site to ask more questions about it.
The previous answer is somewhat misleading.
SPI and UART both transfer binary data as bytes and/or words, depending on the hardware. As explained above, one is synchronous and one is asynchronous. Both require an extra data line to be bidirectional. ASCII is an agreed upon interpretation of the binary data and is not actually a factor in either.
The first answer is almost correct with some small comments:
1) SPI is a subtype of SSI (another example is RS-422)
2) SPI uses the master/slave concept with CS/SS (chips select, slave select) pin ...
Thus a master can have multiple slaves and select between them using the SS pin. Also, on some chips, using the SS the chip can be switched from master to slave.
SPI is a bidirectional data protocol. The difference is that SPI uses an exchange of binary data. And UART uses ASCII, making it much slower data transfer