2025-03-09 12:58 AM
i want to read every 10 seconds a few samples from a adc channel and let the dma bring the data to my variables.
i have that working with 1 sample. the timer trigger the adc. adc trigger the dma channel and my
Solved! Go to Solution.
2025-03-09 3:57 AM
no os . i use HAL .. and i solved it already.
the adc can do multiple conversions .. i add rank1 rank2 .. for my aim to get 2 or 4 fast samples every 10 seconds, i just use this ranks 1 and 2 and give the same channel again.
now when timer trigger the adc, adc will do the number of conversions.. here 2! and channel is same.. so it will get 2 samples frome the same channel. exactly what i want.
in real i use 2 adc and each adc watch 2 channel and with the ranks trick i get 2 samples from each channel and from each adc .. the data is transfered by 2 dma channels.. i got a complete-callback where i can use all the sample data. all good. i do it every 100 microseconds and have 5 samples from the 4 wires, 4Mega samples per sec speed.
i do the calculations in the 100 micro secs windows , need about 20usec.. plenty of room.
the question is solved.
2025-03-09 1:13 AM
In these kind of problems, OS plays a vital role.
With AZRTOS, we have one thread per device-type and we could keep all under control with very fast sample rate and reliability. what is your OS?
2025-03-09 3:57 AM
no os . i use HAL .. and i solved it already.
the adc can do multiple conversions .. i add rank1 rank2 .. for my aim to get 2 or 4 fast samples every 10 seconds, i just use this ranks 1 and 2 and give the same channel again.
now when timer trigger the adc, adc will do the number of conversions.. here 2! and channel is same.. so it will get 2 samples frome the same channel. exactly what i want.
in real i use 2 adc and each adc watch 2 channel and with the ranks trick i get 2 samples from each channel and from each adc .. the data is transfered by 2 dma channels.. i got a complete-callback where i can use all the sample data. all good. i do it every 100 microseconds and have 5 samples from the 4 wires, 4Mega samples per sec speed.
i do the calculations in the 100 micro secs windows , need about 20usec.. plenty of room.
the question is solved.