This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I/O Port simulation

I monitering my I/O port from Peripherials -> I/O-ports -> Port 0

But the value of P0 and Pins are always diferrent
That is very strange..

I use P0 as an LCD data bus.
I set the value of P0, When I want to display a character on LCD.

but Pins bits can't reflect the value of P0

So my LCD display can't work normally.

Does any one known what happens?

thank you..

Parents Reply Children
  • Actually, to be even MORE precise, the signal function should appear as follows:

    define char P0_copy
    
    P0_copy = P0;
    
    signal void pullup_p0 (void) {
    while (1) {
      wwatch (D:0x80);
      PORT0 = (PORT0 | ~P0_copy) & P0;
      P0_copy = P0;
      }
    }
    
    pullup_p0 ();

    This handles the problem of setting an input port pin to a value of 0 and writing P0 with a 1. This signal makes the input bit stay at 0.

    Jon