IO Pi ports
1 Views - Created 03/08/2023
If you wire up the first four pins from the bus on the IO Pi to your PIC micro you can use it as a four bit port with the write_port(port,0xXX) instruction.
The following python code would create an instance of the IOPi object on address 0x20 and set the first four pins to be high.
iobus = IOPi(0x20)
# set port 0 as outputs
If it is easier you can use a binary number instead of hex so you can see which of the pins are being set as high and low. The code below would set pins 1 and 3 as low and 2 and 4 as high.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.