serial_software

Software RS232 library

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong, Albert Faber
Compiler >=2.4l

Description

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 are disabled during transmissions.
Transmission parameters are 8 databits, 2 stopbits, no parity, no handshake.
const serial_sw_stopbits = 1 ; setup for one stopbit.                                                


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • 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.
    

Functions

  • 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.
    


Related samples

Here are the list of samples which use this library:

16f8816f88_serial_sw_echo.jal