I have an application that would like to receive a one-bit input
from an external device. I am trying to use the GPI2 pin on the
edge connector. I have written an application that examines the
GPIO bit in the UART baud control register.
The bit always reads zero from that register. I have tried connecting
the pin to ground. I have tried connecting it to pin 2 via a 20K
resistor as suggested in Palm's description on the pin-out. I have
tried letting it float. But it always reads zero. What input do I
need to make it change?
The code fragment is...
unsigned short *pUBCRreg = (unsigned short *)0xfffff902;
SerOpen(serialRefno, port, baud);
*pUBCRreg = (*pUBCRreg) & 0xdfff;
if ((*pUBCRreg) & 0x4000)
gpioOn = 1;
else
gpioOn = 0;
SerClose(serialRefno);
If I display the value of the register, I do see the divider and prescaler
values.
Howard Katseff