Question
STM32L1 strange ADC reading
Posted on February 21, 2014 at 10:14
Hi, please I need a little help.
I'm using a STM32L151RCT6A in a project. We need to distiguish the hardware version of boards, so to use a single pin, we read the voltage on a partitor made of two resistor.It is connected to pin PC5, corresponding to analog input 15.Actually, lower resistor is 1,3k? and upper is 10k?. On 12 bits, I expect to read 471.Now, the strange behaviour: the value read is greater, approx. 1300 to 1500 instead.I tried to add delays, or some tests to control if value decreased because any discharge, but not, it stays at those levels.But if I set a breakpoint after conversion, and then I retry to convert, value is correct!I tried also to read with same code another ADC channel (nr. 4) where battery is connected, and it reads correctly.Someone has an idea? #show-code