2015-06-04 01:00 PM
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.2015-06-04 01:22 PM
Got it working on PA4. That seems to be the only pin available. Now to just fine-tune.
2015-06-04 01:39 PM
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.