Hi all,
I spent this morning chasing a very elusive bug that appeared to be in my key reading routine. It's a very simple polling routine that reads P0_1 which is connected to a pushbutton on my custom board. The problem is that no matter what, P0_1 always reads 1.
After a few hours I traced the bug down to the use of the internal temperature sensor in my ADC routine. In its initialisation I do:
TR0 = 0x01; // temp sensor connect to ch 14
ATEST = 0x01;
And this causes the P0_1 input to be read as 0 at no matter what the voltage on the pin actually is (the pin still is in input mode i.e. high impedance).Comment these two statements out, P0_1 is ok. So I have to conclude that somehow enabling the temperature sensor in this way has an effect on P0_1 so that it can't be used as an input anymore. I've read other posts on this forum where the above sequence was supposed to solve this problem, but it clearly does not.
I would be very interested in knowing whether someone else on this forum, or TI is aware of this and knows any workaround.
Regards,
Sjef.