Part Number: MSP430FR2311
Hi Team,
I have very strange problem with P1.0 of MSP430FR2311IRGY
I want to use port P1.0 for reading HW version of board. It may be connected via 0 Ohm resistor to ground or to be float.
Now it is float and I expect that when I switch on pull up resistor I expect to read 1.
But after power up sometimes I read from P1.0 1 and sometimes 0. It is random. Pull up is ON as you see
Other ports P1.4 and P1.5 that I also use to read HW version works absolutely properly.
I emphasis that I use this only after power up to read board HW version. I do not use after that.
In debugger always works properly
I use IAR compiler, maximum code size optimization.
Controller clocked 8MHz from internal clock. No crystal.
Before function that read HW version port 1 initialized this way
P1REN = 0x00;
P1SEL0=0xCE;
P1SEL1=0x00;
P1DIR=0x00;
When I want to read HW version I switch pull up resistors also on port 1.0, read it and switch pull up resistors OFF
void ReadHWVersion(void)
{
volatile int I;
volatile unsigned char uHWVersion;
P1OUT = 0x031; //Pull up resistors
P1REN = 0x31; //Pull up resistors enable
for(i=0;i<200;i++){
__no_operation();
}
uHWVersion = P1IN;
for(i=0;i<200;i++){
__no_operation();
}
P1OUT = 0x0; //Pull up resistors disable
P1REN = 0x0;
}
Thanks,
Shlomi