Author | Stef Mientki, Copyright (c) 2002..2006, all rights reserved. |
Adapted-by | Sebastien Lelong. |
Compiler | >=2.4g |
software RS232 library Library supports software RS232 send and receive procedure on any IO-pin. Both the inverted and non-inverted routines are available, so it should fit any hardware. Baudrate can be set between 110 and 230_400 (for 20 Mhz Xtal), for lower Xtal frequencies the maximum baudrate will be equally lower. Baudrates are optimized, so even the high baudrates shouldn't be a problem (my [Stef] standard = 115_200 Baud, which has never given me any problems). Interrupts should be disabled during transmissions. Transmission parameters are 8 databits, 2 stopbits, no parity, no handshake.
No dependency found
const OL_TX = ( _NINSTR / ( 3 * 255 )) + 1
var byte ilval0
const _NINSTR2 = 5 + ( _NINSTR / 2)
var byte ilval
var byte olval
const _NINSTR = target_clock / (4 * serial_sw_baudrate)
const _IL_TX = ( ( _NINSTR - ( 4 * OL_TX ) ) - 16 ) / ( 3 * OL_TX )
var byte IL_TX = _IL_TX
serial_sw_data'put(byte in data)
serial_sw_write(byte in data)
serial_sw_init()
serial_sw_read_wait(byte out data)
const OL_TX = ( _NINSTR / ( 3 * 255 )) + 1
No documentation found
var byte ilval0
No documentation found
const _NINSTR2 = 5 + ( _NINSTR / 2)
No documentation found
var byte ilval
No documentation found
var byte olval
No documentation found
const _NINSTR = target_clock / (4 * serial_sw_baudrate)
No documentation found
const _IL_TX = ( ( _NINSTR - ( 4 * OL_TX ) ) - 16 ) / ( 3 * OL_TX )
No documentation found
var byte IL_TX = _IL_TX
No documentation found
serial_sw_data'put(byte in data)
Here the serial_sw_write procedure is declared as a pseudo variable so you can use it in the following way: {{{ serial_sw_write = 0x33 }}}
serial_sw_write(byte in data)
Waits untill a character is received. Interrupts will be disabled during this routine, but restored afterwards. Also here the code is doubled (inverting and non-inverting) and selection is done by a compiler-directive.
serial_sw_init()
No documentation found
serial_sw_read_wait(byte out data)
Waits untill a character is received. Interrupts will be disabled during this routine, but restored afterwards. Also here the code is doubled (inverting and non-inverting) and selection is done by a compiler-directive.
serial_sw_data'get() return byte
Here the serial_sw_read_wait procedure is declared as a pseudo variable so you can use it in the following way {{{ Data = serial_sw_write }}}
serial_sw_read(byte out data) return bit
Waits untill a character is received or time out is reached. Interrupts will be disabled during this routine, but restored afterwards. Also here the code is doubled (inverting and non-inverting) and selection is done by a compiler-directive.
sample | 16f88_serial_sw_echo.jal |