cancel
Showing results for 
Search instead for 
Did you mean: 

Analog input pin for Discovery board

lee23
Associate II
Posted on June 04, 2015 at 22:00

I'm trying to get an ADC input to work on the Discovery STM32L053 board. The VREF calibration value is 0x68D, reading channel 17 shows 0x5E9, which by my calculations makes VDD 3.325 volts, which matches what I read on the scope, so it seems like I'm getting that much right.

But now I want to measure an actual pin. When I measure PA7 (ADC_IN7), I get a value of about 0.6 volts, even with the pin tied to ground or with a voltage input. Apparently the Discovery board steals this one for the touch sensor. The best sample code I've found uses PC4, but that's not available on the Discovery board.

Should I be able to use PA7 and I'm doing something wrong, or is there a better pin I should use instead? I'm just doing simple one-shot software triggered readings.

2 REPLIES 2
lee23
Associate II
Posted on June 04, 2015 at 22:22

Got it working on PA4. That seems to be the only pin available. Now to just fine-tune.

Posted on June 04, 2015 at 22:39

The manual for the board should break down which pins are free. In most of the DISCO series the analogue pins are a small subset of those available. When you need more resources you'd have to review the schematic and remove extraneous circuitry.

You may want to scan eBay, or equivalents, for STM32 boards with higher pin count devices, or more purely break-out boards.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..