AnsweredAssumed Answered

can GPIO read a HIGH due to internal pull up

Question asked by Swetha Krishnamurthy on May 25, 2018
Latest reply on Jun 1, 2018 by Swetha Krishnamurthy

I am using MCF5272 and trying to use a previously unused GPIO pin to give me indication of a new capability on the next board spin. On the existing board the port A GPIO pin was unused, set as output and not connected (floating?) . The idea was that in the next board spin, we would pull the pin low using an external pull-down resistor. MCF5272 GPIO documentation indicates that there are internal pull up resistors , so expectation was that when this port pin is made an input instead of an output and when the pin is read, it will read a HIGH (even though the pin doesn't have any external pull ups or pull downs)  where as the next board spin would have this pin deliberately pulled LOW and so would provide the distinction we need. But it is not working this way.

In my boot application if I first write a '1' to the data register PADAT and then set the data direction register PADDR to make the port pin an input, then I consistently read back a '1' . If I don't follow this sequence and simply configure the PADDR and read, it reads a '0'.  

   Write32Register(MCF5272_PACNT,0x00000000);   

   Write16Register(MCF5272_PADAT,0x3310);
   Write16Register(MCF5272_PADDR,0x7910);

I follow the exact same initialization sequence in the application code but I cannot read back a '1', it keeps reading a '0'.

Question  -

1) Is the presumption of reading a HIGH on this pin due to internal pull-up wrong? 

2) Why does the same initialization sequence result in different results  in boot and application?

3) Should I be doing anything different to try and get a reliable read out of this not-connected GPIO pin ?

 

I cannot really hook a probe or look at the voltage on this pin as leads aren't exposed on the board.

Outcomes