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

 

GENERAL INFORMATION
Stock Number: 100-7599
Availability (low quantity): Stock - 2wk
Download IOCPbios: a7599a.zip
Pricing (Budgetary, Per unit, US Dollars): Supplied at no cost with purchase of IOCP-74

FEATURES

TYPICAL APPLICATIONS

PRODUCT 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 directly from Microchip at no charge. Other brand compilers may also be used.

IOCPbios
Function Description
Data Acquistion
adc_update Digitizes the voltages appearing at the two 12-bit analog input channels.
dac_update Updates the voltages produced by the two 12-bit analog outputs.
rd_pic_adc Digitizes the voltage applied to the designated 8-bit PIC analog input channel.
set_dig_dir Configures the data direction of the digital I/O channels
update_dig_io Performs a write to digital channels configured as outputs and a read of digital channels configured as inputs.
Mathematical
add Performs addition of two 16-bit numbers
div Divides 16-bit dividend by a 16-bit divisor resulting in a 16-bit quotient and 16-bit remainder.
mul Performs 16-bit x 16-bit unsigned multiplication producing a 32-bit result
Non-Volatile Memory
rd_eemem Reads a block of data bytes from non-volatile serial EEPROM.
wr_eemem Stores a block of data bytes into non-volatile serial EEPROM.
SPI (Serial-Peripheral-Interface)
spi_select Activates the designated SPI device
spi_xfer Performs a complete SPI transfer using the PIC SSP hardware
Asynchronous Serial Communications
serial_rx Receives 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_tx Transmits 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.
setbaud Configures the USART for popular serial communication baud rates.
Miscellaneous
gen_host_irq Generates a hardware interrupt request to the host computer
push_w_reg Pushes the contents of the W register onto the virtual data stack
pop_w_reg Loads the W register from the most recent value pushed onto the virtual data stack

Programming Example
This software fragment shows a simple data acquisition application. Each of the three 8-bit analog inputs is measured and its value 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.

 
    main:
    loop:       BANK0                                   ;Switch to bank-0
    		btfss opsys_var0,CYC_SYNC_BIT    	;TMR-0 timeout? (13.1ms)
    		goto loop                        	;No, try again
    		bcf opsys_var0, CYC_SYNC_BIT     	;Yes, clear bit for next time
    		clrwdt 		                 	;Clear the watch-dog
	
		;--- Read IOCP-74 AIN-2 (PIC AN0)
    		movlw 0                          	;Set channel to digitize
    		call  rd_pic_adc                 	;Do call, w returns with value
    		movwf psp_read_ary+0             	;Store it for host access 
    
    		;--- Read IOCP-74 AIN-3 (PIC AN1)
    		movlw 1                          	;Set channel to digitize
    		call  rd_pic_adc                 	;Do call, w returns with value
    		movwf psp_read_ary+1             	;Store it for host access 

    		;--- Read IOCP-74 AIN-4 (PIC AN2)
    		movlw 2                          	;Set channel to digitize
    		call  rd_pic_adc                 	;Do call, w returns with value
    		movwf psp_read_ary+2             	;Store it for host access 

    		goto loop                               ;Repeat the loop
    	

Related Topics
IOCP-74PC/104 Coprocessora7599a.zipDownload IOCPbios