AnsweredAssumed Answered

Has anyone had an issue with the port PD2 on the STM8S changing configuration during debug?

Question asked by Gary Anson on Jun 9, 2017


The port PD2 on the STM8S goes from being an analog input to a digital output when a break is hit during debug.

I have an analog signal being fed into the port PD2, pin 19 on STM8S103F3 and all seems to work fine during normal operation. When I run the debugger via IAR Embedded Workshop and hit a breakpoint or tell the debugger to break the pin suddenly slams up to the 3.3 volts supply level. After resuming the ADC counts are very high (712 or so) and this is an unexpected behavior, to say the least. This behavior causes my software to make erroneous decisions on invalid data - bummer.


Has anyone else had a similar problem and found a way to solve it? 


BTW. I have very similar analog circuits connected to PD3 & PD5 with no abnormal behavior.


Thanks in advance for any assistance you all can give.