My idea is to have a quite fast communication between Due-Computer, an analog sensor reading with a frequency sampling that can be set by the user, and a SPI-communicaiton for a sensor reading with the same sampling frequency.Ĭonsidering that the maximum sampling frequency of the application must be 500 KHz, I would like to use DMA to release the CPU completely from the ADC and SPI task, so it is completely focus on the communication task. Maybe I did not explain my goal quite well. What you gonna to do with 8 samples of data? Last time I did experiment to supply same name of the buffer as current and next one - doesn't work out, sampling stops after buffer was filled up. that is a way how SAM3X wired, it needs two buffer to set up uninterruptable sampling subroutine. Here I'm not completely sure, but my understanding. You are not using interruption from the timer, timer starts ADC conversion w/o invoking CPU, DMA plays role to transfer conversion results to memory, again not bothering CPU. Using a buffer with DMA is a requirements. I am asking this because DMA is a new concept for me, and what I saw on the forum was people using 2 buffers, so that they never lost any information, however since I will just use the last values of the ADC, I was thinking of having a circular buffer and don't care much but about the last values. If I just want to have a buffer with the last 8 values of the ADC, do I need to set up also the "next_buffer" of the DMA? Or could I use a single buffer in a circular configuration? My idea is to use a buffer for the ADC using DMA, and besides it, one timer interruption with my sample frequency, so that every time I get the interruption from the timer, I read the last value that was wrote on the buffer. Since I have never used DMA, I would like to explain my idea, and I would like you to let me know If it feasible and if I am write with it. After writing in the forum, and I made a deeper research on the web, and I end up with one idea, that I think it is the same thing you are advising me. You can drive ADC from timer interrupts too, which uses more CPU. FAST SERIAL COMMUNICATION ARDUINO SOFTWAREThe latest release has fast analogRead(), it you want fast continuous ADC you are bestĬoding up a timer-driver DMA'ing ADC - then you'll need minimum software I would like to go for the Due, but I am afraid of the communication, because if I can't achieve it, I need to figure out some other way to connect my sensors with the PC. I wanted to clarify those 2 things before buying anything. Since I have never worked with the atmega Due and I couldn't find that much information about ACD converter opinions, I wanted to know if it is real the 1Mhz sampling rate, or it has limitations. The Mega could do the task with 8 bits resolution (but not with 10), but it seems that the Due might go to 1 Mhz sampling rate and 12 bits conversion. The second problem is the ADC conversion. Can anybody explain me why the 250000 bps limitation or link me to some post explaining it? That applies to both, the Mega and Due, but I do not understand, since in the datasheet of the Mega is written that baudrates up to 1 MHz are fine and for the Due even much more. FAST SERIAL COMMUNICATION ARDUINO PCLooking into the forum, I have found some threads explaining that the maximum real baudrate is 250000, despite that you can set a higher baudrate on the PC and the Arduino. The first problem is the USART communication for the baudrate. SPI communication for reading a 3rd sensor. First, I would like to explain my requirements:Ĭommunication with PC with a baudrate of 500000 bps or higher.ĪDC conversion with sampling rate of minimum 20KHz, because I have 2 sensors that I have to read with a 10 Khz sampling rate. I am developing one project where either the Arduino Due or the Mega seem to be the ones that fit the best, nevertheless I found on the forum some complains regarding the Due, and I would like to clarify them a bit better. I am not sure that his question should be here, if it shouldn't, let me know and I will move.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |