rs232<->DIO on BL4S160

Hi! I’d like to use a serial port on a BL4S160 board to send/receive data on the DIO ports.

I’d like to detect when a DIO input has changed, and if it has, send DIO information out thru the rs232 port. I’d also like to be able to receive information thru the rs232 port to be able to update the DIO ports.

Since tihs is pretty basic stuff I’d hate to spend time re-inventing the wheel again, so I’m wondering if there are any examples out there for doing this, or any example code snippets, etc. which would help in implementing this.

Thanks in advance!

A little more info…

There will be no PC’s involved in this implementation. I’ll be using 2 of the BL4S160 boards for communication to each other. They’ll be connected via wireless rs232 link. One board will be a ‘master’ with a control box (buttons/switches/lights) tied to it, and the other will be a ‘slave’ box which will control and monitor DIO (might add A/D monitoring too at a later date).