ProfHuster
Active member
I've spent six hours trying to get the Teensy 3.2 and 4.0 ADC examples going.
I reinstalled Teensyduino 1.8.19, Teensy Loader = 1.56 on my MacBook Pro (14-inch, 2021), MacOS Monterey12.3.1
I need to do timed dma two channel ADC for a project with a sample rate of 320 kHz. I am using a Teensy 4.0, but when I couldn't get the examples to work, I tried a 3.2.
Tried the Examples -> Examples for Teensy 4.0 -> ADC -> various
and Examples for Teensy 3.2/3.2
Various included adc_timer, adc_test , adc_dma, adc_pdb, adc_timer_dma, and adc_timer_dma_oneshot.
Results (Y=worked, N=nope):
Program | 3.2 | 4.0 | Notes
adc_test | Y | Y. | 3.2 has much more output than 4.0!
adc_pdb | Y | N | "Valid for Teensy 3.0 and 3.1"
adc_dma | N | N | No ADC_USE_DMA
adc_dma | N | N | Define ADC_USE_DMA, then "unref AnalogBufferDMA::init" for both
adc_timer | N | N | No ADC_USE_TIMER
adc_timer | Y | Y | defined ADC_USE_TIMER
synchronizedMeasirements | N | N | both No ADC_DUAL_ADCS
synchronizedMeasirements | Y | Y | defined No ADC_DUAL_ADCS
None of the DMA examples worked. The preprocessor did not have ADC_USE_DMA defined. When I manually defined it, I got errors like
The same errors for both T4.0 and T3.2. I looked at @pedvide's github library and thought is might be unsigned char versus int8_t, so I tried casting ADC_0 and ADC_1 to int8_t. Got the same error.
Am I missing something very obvious? These are straight from the Examples. The pedvide examples also don't work.
I reinstalled Teensyduino 1.8.19, Teensy Loader = 1.56 on my MacBook Pro (14-inch, 2021), MacOS Monterey12.3.1
I need to do timed dma two channel ADC for a project with a sample rate of 320 kHz. I am using a Teensy 4.0, but when I couldn't get the examples to work, I tried a 3.2.
Tried the Examples -> Examples for Teensy 4.0 -> ADC -> various
and Examples for Teensy 3.2/3.2
Various included adc_timer, adc_test , adc_dma, adc_pdb, adc_timer_dma, and adc_timer_dma_oneshot.
Results (Y=worked, N=nope):
Program | 3.2 | 4.0 | Notes
adc_test | Y | Y. | 3.2 has much more output than 4.0!
adc_pdb | Y | N | "Valid for Teensy 3.0 and 3.1"
adc_dma | N | N | No ADC_USE_DMA
adc_dma | N | N | Define ADC_USE_DMA, then "unref AnalogBufferDMA::init" for both
adc_timer | N | N | No ADC_USE_TIMER
adc_timer | Y | Y | defined ADC_USE_TIMER
synchronizedMeasirements | N | N | both No ADC_DUAL_ADCS
synchronizedMeasirements | Y | Y | defined No ADC_DUAL_ADCS
None of the DMA examples worked. The preprocessor did not have ADC_USE_DMA defined. When I manually defined it, I got errors like
Code:
/Users/whoever/Documents/Arduino/my_adc_dma/my_adc_dma.ino:78: undefined reference to `AnalogBufferDMA::init(ADC*, signed char)'
/Users/whoever/Documents/Arduino/my_adc_dma/my_adc_dma.ino:84: undefined reference to `AnalogBufferDMA::init(ADC*, signed char)'
collect2
Am I missing something very obvious? These are straight from the Examples. The pedvide examples also don't work.