I have a port which has the first 4 pins as inputs and the second 4 pins as outputs.
Reading the inputs and the outputs is pretty easy as I just masked them such as:
DigIn = (PortD & $F) 'Lower 4 bits
DigOut = (PortD >> 4) 'Upper 4 bits
Now I want to change the outputs, so say I write:
NewOuts = 240
PortD = NewOuts 'Turns on all the upper 4 bits.
This works fine, but I think it's automatically turning my lower 4 pins into outputs?
How is the best way to do this?
PortD = PortD OR NewOuts
Bookmarks