Tiburon ROV Data Concentrator Isolated IO Board Software Functionality Andrew Pearce 17 Feb 1995 Hardware Summary The IBC Isolated I/O Board (ISO_IO - assembly 40xx) provides one 8 bit wide digital input port, one 8 bit wide digital output port and four 8 bit D to A Output ports (DAC). The hardware provides one write-only register which controls the state of the output port, one read-only register which returns the state of the digital input port, four write-only registers for controlling the DAC outputs and pseudo-register which controls the state of the on-board LED. The Isolated I/O board does not generate interrupts. An IBC Bus reset, at power up or under software control, will switch off the output switches, set the DAC outputs to 0 volts and switch off the LED. Refer to the Design and Programming Notes for more detailed information. Software Summary The software library for the ISO_IO board provides functions to switch On/Off the digital outputs, read the state of the digital input port and control the DAC output voltage. A board identification and initialization function is provided to locate the board, insert an entry in the IBC Card table and initialize the Isolated I/O board. Directories and Files All files for the ISO_IO board software are located in the iso_io directory. C Source for the library functions is contained in iso_io.c. Hardware register offsets, various bit definitions, a definition for the iso_IO_BoardEntry data structure and function prototypes for the function library are located in the header file iso_io.h. An appropriate make file is also provided. Software Functionality Initialization All IBC Microcontroller applications execute an IBC board identification procedure at power up. For the ISO_IO board this function is called iso_IO_BoardSearch. The function searches for Isolated I/O boards at predefined addresses (C0H, C4H, C8H) by calling the iso_IO_BoardInit function with the address as a parameter. The iso_IO_BoardInit function checks for the presence of a board by reading the input port register for the specified board address and checking for an IBC bus timeout. A NULL iso_IO_BoardEntry pointer is returned if an IBC bus timeout occurs during the read. If the board responds then an iso_IO_BoardEntry data structure is allocated and initialized with appropriate default values. All output channels are switched OFF, the DAC outputs are set to 0 Volts and the LED is switched ON. Library Functions The iso_IO_ReadPort function returns the 8 bit wide value of the digital input port for ISO_IO board address specified. The iso_IO_WritePort function writes a value to the 8 bit wide digital output port for ISO_IO board address specified. The value is saved in the board data structure to allow other functions to manipulate individual port bits. The iso_IO_SetPortBit function sets an individual digital output port bit to the state specified (TRUE or FALSE) by the state parameters. Positive true logic is used so TRUE sets the bit high (5V). The iso_IO_WriteDacPort function writes an 8 bit value to the DAC output channel for ISO_IO board address specified and so changes the channel's output voltage. The iso_IO_ReadPortCmd, iso_IO_WritePortCmd, iso_IO_SetPortBitCmd and iso_IO_WriteDacCmd provide an interface between serial interface command set and the ISO_IO board functions described above. The functions process commands from the serial port by decoding and range checking the command parameters, checking for the presence of the ISO_IO board specified and calling the appropriate ISO_IO board function. All Cmd functions return CMD_OK if the function executes correctly, CMD_ERROR if an error occurs or EARGUMENT if inappropriate parameters are supplied. The iso_IO_ReadPortCmd function also returns the value of the digital input port.