2023-01-09 07:17 AM
I'm measuring on ADC1_IN0, triggered by a timer. I'm using an output pin to indicate the timing of the conversion start and completion. The ADC clock is 60MHz, clock prescaler async / 4. A 16 bit conversion appears to be taking about 6uS. What do I need to do to speed this up? STM32H745, Disco board.
2023-01-09 10:37 AM
There are 2 types of typical adc, binary search which uses resistor dividers, and 12 bit is near state of the art at cost, extra bit is oversampling, typically 2 samples for 13 bit, 4 samples for 14 bit, 16 samples fod 15 bit, etc... digital filter is a non brute force way to explore.
The other one is sigma delta 1 bit adc, which requires more time to get 16 bits. Some STM32 have them,.maybe STM32F3xxx
2023-01-09 11:37 AM
The STM32H745 data sheet suggests it should be capable of 3.6Msamples.
2023-01-09 11:50 AM
the adc can run at 3,6 Msps . depend, how you set it.
2023-01-10 05:02 AM
How do you configure sampling rate in CubeMX?
I can see via the debugger that the default sampling setting is SMPx(2:0) = 000.
I've set the ADC clock source at 30MHz.
With sampling set at 1.5 or 2.5 clocks, a conversion appears to be taking about 4uS, judging by an IO pin set at trigger and cleared when the data is taken.
Sampling for 64.5 clocks, it takes about 22uS, 810.5 clocks, 240uS.
Clearly I am missing something.
I've another timer toggling an led at 1Hz, just to be sure by clock tree is working as I expect.
2023-01-10 05:33 AM
Oo - simple calculation : 240us / 810 = 0,3us ; so clk about 3 MHz ! (not 30 ! )
so you are about 10x too slow (from clock) and get 4us , but 0.4us would be possible.
>How do you configure sampling rate in CubeMX?
2023-01-10 05:46 AM
2023-01-10 06:07 AM
(i am on H743 , single core ; maybe you have to select core M4 or/and M7 )
but nothing should be red color !! this will not work the "right" way.
+
in clock tree
+
+
try.
2023-01-10 06:20 AM
2023-01-17 07:01 AM
An update - I've raised a support ticket, and received an example project running the ADC at 1MHz and DMAing into memory. This works fine. Now to figure out why my code didn't...