You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
Hi All,
I need help to understand continuous ad configuration of ESP IDF.
I want to digitize 6 analog inputs with esp idf. Each channel should take a sample for 20ms in every 100us, it is 200 samples per channel.
The calculation process:
frame size: number of channels * number of samples * size of adc_digi_output_data_t. ( 6 * 200 * 2 = 2400 )
sample frequency: 10000 samples/seconds * number of channels ( 10000 * 6 = 60Khz )
I used the adc continuous sample application for the test.
I set the dma buffer size to 2 times the frame_size.
I turned on the AD log level to DEBUG, but I didn't see any log messages from ad driver.
I set the s_on_pool_ovf function to my own implementation, which only incremented a variable if a buffer overflow occurred.
In ad_init I print the ad parameters: I (680) ad: CHANNEL_NUMS:6, SAMPLES_PER_CHANNEL:200, sizeof(adc_digi_output_data_t):2, FRAME_SIZE:2400, sample freq:60000
I change a gpio pin in the ad DMA interrupt, so I can check the interrupt frequency with an oscilloscope, which is strangely 25ms instead of the desired 20ms.
I haven't processed the incoming data yet, I just calculated the number of data per channel in an array in each cycle.
The result of this was very strange (elen is the read_len from adc_continuous_read ): A/D cycles:3697, timeouts:0, size errors:0, invalid channels:0, ovf:0, elen:2400 ch0:1400 ch1:199 ch2:199 ch3:200 ch4:201 ch5:201
In total, there are 2400 samples, but 1400 of them are on the first channel, while the other channels each have 200 samples.
When I tried to set frame size to number of samples instead of bytes, I get the similar results, ch0 is 7 times larger than others:
I (679) ad: CHANNEL_NUMS:6, SAMPLES_PER_CHANNEL:200, sizeof(adc_digi_output_data_t):2, FRAME_SIZE:1200, sample freq:60000
`
Answers checklist.
General issue report
Hi All,
I need help to understand continuous ad configuration of ESP IDF.
I want to digitize 6 analog inputs with esp idf. Each channel should take a sample for 20ms in every 100us, it is 200 samples per channel.
The calculation process:
I used the adc continuous sample application for the test.
In ad_init I print the ad parameters:
I (680) ad: CHANNEL_NUMS:6, SAMPLES_PER_CHANNEL:200, sizeof(adc_digi_output_data_t):2, FRAME_SIZE:2400, sample freq:60000
I change a gpio pin in the ad DMA interrupt, so I can check the interrupt frequency with an oscilloscope, which is strangely 25ms instead of the desired 20ms.
I haven't processed the incoming data yet, I just calculated the number of data per channel in an array in each cycle.
The result of this was very strange (elen is the read_len from adc_continuous_read ):
A/D cycles:3697, timeouts:0, size errors:0, invalid channels:0, ovf:0, elen:2400
ch0:1400 ch1:199 ch2:199 ch3:200 ch4:201 ch5:201
In total, there are 2400 samples, but 1400 of them are on the first channel, while the other channels each have 200 samples.
When I tried to set frame size to number of samples instead of bytes, I get the similar results, ch0 is 7 times larger than others:
I (679) ad: CHANNEL_NUMS:6, SAMPLES_PER_CHANNEL:200, sizeof(adc_digi_output_data_t):2, FRAME_SIZE:1200, sample freq:60000
`
ch0:700 ch1:99 ch2:99 ch3:100 ch4:101 ch5:101
here is the code:
`
`
The text was updated successfully, but these errors were encountered: