Hi everyone,
I’m having a question regarding the DMA capabilities of the Teensy 4.1. In special I’m interested if there is any interaction (performance and timing wise) between the General Purpose DMA and the USB DMA. As far as I understand it from reviewing the docu and this post from Paul (https://forum.pjrc.com/threads/66740-Teensy-4-1-USB-Serial-with-DMA) the USB DMA should be independent from the GP DMA. Do I understand this right?
Background:
I’m using a Teensy 4.1 to read data from two 16-bit ADC’S (AD4004) @ 400 kSPS. I’m using the DMA to generate the conversion clock for the ADC's and read the ADC data from the SPI Bus to a buffer.
To generate the conversion clock I’m using the periodic triggering capabilities of the DMA (together with a PIT timer) to turn on and off a GPIO pin. Everything works fine as long as I do not send data using the Serial.write() function during the sampling in the main. I have confirmed that by reading the SPI data directly with my oscilloscope. I also checked the DMA writing addresses during sampling (at a very low sample rate) and that looks also fine.
The plan is to have a continues data stream to a PC. If I do so the noise floor of the ADC raises a random manner. I’m doing a 4096 Pt. FFT on the PC and every few FFTs the noise floor raises by up to 30 dB.
If I
everything works also fine.
This behavior makes me think if it is possible that the timing of the sampling clock gets disturbed by the USB DMA.
At the moment I'm not able to share the code of the project.
I’m thankful for every input.
Greetings
Oliver
I’m having a question regarding the DMA capabilities of the Teensy 4.1. In special I’m interested if there is any interaction (performance and timing wise) between the General Purpose DMA and the USB DMA. As far as I understand it from reviewing the docu and this post from Paul (https://forum.pjrc.com/threads/66740-Teensy-4-1-USB-Serial-with-DMA) the USB DMA should be independent from the GP DMA. Do I understand this right?
Background:
I’m using a Teensy 4.1 to read data from two 16-bit ADC’S (AD4004) @ 400 kSPS. I’m using the DMA to generate the conversion clock for the ADC's and read the ADC data from the SPI Bus to a buffer.
To generate the conversion clock I’m using the periodic triggering capabilities of the DMA (together with a PIT timer) to turn on and off a GPIO pin. Everything works fine as long as I do not send data using the Serial.write() function during the sampling in the main. I have confirmed that by reading the SPI data directly with my oscilloscope. I also checked the DMA writing addresses during sampling (at a very low sample rate) and that looks also fine.
The plan is to have a continues data stream to a PC. If I do so the noise floor of the ADC raises a random manner. I’m doing a 4096 Pt. FFT on the PC and every few FFTs the noise floor raises by up to 30 dB.
If I
- sample data
- stop sampling
- send the data
- sample data
- ...
everything works also fine.
This behavior makes me think if it is possible that the timing of the sampling clock gets disturbed by the USB DMA.
At the moment I'm not able to share the code of the project.
I’m thankful for every input.
Greetings
Oliver