IOCPbios

Basic Input/Output Software for IOCP-74 I/O Coprocessor

Stock Number: 100-7599

DESCRIPTION

The IOCP-74 is supplied with an integrated set of assembly language routines and macros which directly control many of the module's basic core functions. Collectively these routines, or firmware, are called IOCPbios. The routines by themselves do not satisfy any particular application but instead offer a reasonable starting point upon which a user can build and customize the IOCP-74 to meet specific needs. The software is provided in ASCII format, which is easily modified and enhanced by the user. The source code may be combined with other languages such as BASIC or C, or directly complied using MPLAB or the MPASM PIC assembler available from Microchip at no charge. Other brand compilers may also be used.

FEATURES

  • PIC assembly language routines eases "Hardware Abstraction" from IOCP-74 and PIC microcontroller
  • Fully documented source code is easily modified and customized by user
  • Can be merged with other languages including PIC Basic and C
  • Compact size uses only 550 words of E(E)PROM and 120 bytes of RAM

DOCUMENTATION

Example Software

This software fragment shows a simple data acquisition application. Each of the three 8-bit analog inputs is measured and their values are placed in the IOCP-74 read array for examination by the host computer. This example illustrates just how easily the IOCP-74 can be applied using functions provided by the IOCPbios.

iocp example code

IOCPbios Function Overview

Note: IOCPbios PIC assembly language routines originally written for Microchip PIC16C74 microcontroller. Some editing and modifications are likely required to integrate with users application software.

FunctionDescription
Data Acquisition
adc_updateDigitizes the voltages appearing at the two 12-bit analog input channels.
dac_updateUpdates the voltages produced by the two 12-bit analog outputs.
rd_pic_adcDigitizes the voltage applied to the designated 8-bit PIC analog input channel.
set_dig_dirConfigures the data direction of the digital I/O channels
update_dig_ioPerforms a write to digital channels configured as outputs and a read of digital channels configured as inputs.
Mathematical
addPerforms addition of two 16-bit numbers
divDivides 16-bit dividend by a 16-bit divisor resulting in a 16-bit quotient and 16-bit remainder.
mulPerforms 16-bit x 16-bit unsigned multiplication producing a 32-bit result
Non-Volatile Memory
rd_eememReads a block of data bytes from non-volatile serial EEPROM.
wr_eememStores a block of data bytes into non-volatile serial EEPROM.
SPI (Serial-Peripheral-Interface)
spi_selectActivates the designated SPI device
spi_xferPerforms a complete SPI transfer using the PIC SSP hardware
Asynchronous Serial Communications
serial_rxReceives a string of bytes into a buffer using asynchronous serial communications. Performed in background by means of an interrupt driven routine and the PIC USART.
serial_txTransmits a string of bytes from a buffer using asynchronous serial communications. Uses the PIC USART and an interrupt driven routine to perform the transmission in background.
setbaudConfigures the USART for popular serial communication baud rates.
Miscellaneous
gen_host_irqGenerates a hardware interrupt request to the host computer
push_w_regPushes the contents of the W register onto the virtual data stack
pop_w_regLoads the W register from the most recent value pushed onto the virtual data stack