cancel
Showing results for 
Search instead for 
Did you mean: 

ADC or DMA issue with stm32f0_stdperiph_lib example

mvonahnen
Associate III
Posted on July 30, 2012 at 20:11

I am trying to run the RTC and ADC_DMA example code together on my

http://www.st.com/internet/evalboard/product/252994.jsp

board.  I adjusted the code to remove the LCD display and send the ADC data output to the console.

It appears to me that some of the ADC channels are getting swapped.  The ADC reading that would have come from the potentiometer appears to be correct, it shows up in the first index of the array.

The second index, which should be the temperature sensor , appears to be reading the battery voltage (I disconnected it from the 3V rail).

The third index, which is the voltage reference appears to read correctly, it is always reading 1.3 V.

The fourth index, which is supposed to be the battery voltage, appears to be the temperature sensor.  The reading changes with the temperature of the device.

I am also confused why the ADC is configured for ''ADC_ScanDirection_Backward'' when the data read from the DMA is being treated like it is being read forward (ascending order).

Is this expected or is the due to the fact that I added in the RTC code or removed the LCD code?
1 REPLY 1
raptorhal2
Lead
Posted on July 31, 2012 at 18:55

Except for the pot array location, this appears normal. The F0 has a different ADC from other Fx's, and will actually scan backwards. If you are still stumped, post the code.

Cheers, Hal