Updated: October 28, 2024 |
The DIO-144 card has 144 bits of digital I/O, and you can configure them as inputs or outputs by 8-bit or (for some ports) 4-bit chunks. This gives you a fair bit of flexibility, but also presents some problems for the driver. There is no analog I/O on this card.
All of the programming for this card is done by reading and writing I/O ports.
The hardest part of the DIO-144 software driver design is setting up the bits to be input or output. Once you have the card configured, reading from it involves calling several in8() functions, and writing involves calling several out8() functions. The only trick to writing is that you often need to change just one bit—so the software will have to keep a current image of the other 7 bits, because the hardware allows only 8-bit-at-a-time writes.