|
;external BAUDRATE | BAUDRATE is a literal that determines the communications rate. Simple set the BAUDRATE to the desired communications rate in Hz. |
;external CLOCKFREQ | CLOCKFREQ is a literal that determines the clock frequency. Simply set the CLOCKFREQ to the used clock frequency in kHz. For example, if the chip is using a 20 MHz crystal, set CLOCKFREQ equ 20000. |
;external FEF & PEF |
FEF and PEF are declarations defined in serialh.inc that aid in decifering the status code returned by UART_Rx or UART_Tx. FEF equ 1 << 1 is a framing error. PEF equ 1 << 0 is a parity Error |
;external RXLATENCY | RXLATENCY is a literal that specifies the latency (in cycles) from the startof an interrupt to the call of UART_Rx. RXLATENCY should include 2 cycles forthe call statement of UART_Rx. If interrupts are not used RXLATENCY should bezero. |
;external RXPIN | RXPIN is a literal that determines the recieving pin on the recieve port |
;external RXPORT | RXPORT is a literal that determines the recieve port |
;external SERIAL_CONF |
SERIAL_CONF is a literal that determines the configuration of the serial port. The following constants are declarations that aid in assigning SERIAL_CONF. NEGPOLARITY equ 1 << 7. If bit seven is set then a logic zero is +5V on the serial port and logic one is 0V. PARITYON equ 1 << 6. If bit six is set then a parity bit is added to each eight bit word and parity checks are implemented. STICKYPARITY equ 1 << 5. If bit five is set then sticky parity is used. Sticky parity means that the parity bit is either one or zero all the time. ODDPARITY equ 1 << 4. If bit four is set then odd parity is used. Otherwise even parity is used. Odd parity sets the parity bit so that the total number of ones in the nine bit word is odd. Even parity sets the parity bit so that the total number of ones in the nine bit word is even. If STICKYPARITY is used, odd parity means that the parity bit is always one and even parity means that the parity bit is always zero. RXINTERRUPT equ 1 << 3. If bit 3 is set, then recieve should be interrupt Driven. Setting bit 3 prevents the software from polling for a start bit before beginning to recieve. STOPONEANDHALF equ 2 Stop bit lasts for 1.5 bit cycle time. STOPTWO equ 1. Stop bit lasts for 2 bit cycle time. For example, if you wanted no parity bit, with positive polarity then you would set SERIAL_CONF equ 0. If you wanted an odd parity bit, with negative polarity then you would set SERIAL_CONF equ NEGPOLARITY + PARITYON + ODDPARITY |
;external TXLATENCY | TXLATENCY is a literal that specifies the latency (in cycles) from the end of an transmit call to the beginning of the next closest transmit call.TXLATENCY is used to shorten the stop bit and allow the software to processthe next byte (while holding Tx high) before sending the start bit of the nextbyte. TXLATENCY should include 2 cycles for the call statement of UART_Tx. |
;external TXPIN | TXPIN is a literal that determines the transmitting pin on the transmit port |
;external TXPORT | TXPORT is a literal that determines the transmit port |
UART_Initialize macro |
UART_Initialize macro | |
Description: | |
Initializes the software UART |