Mikroelektronika MIKROE-350 データシート

ページ / 526
SOFTWARE UART LIBRARY
The mikroBasic PRO for AVR provides routines for implementing Software UART
communication. These routines are hardware independent and can be used with
any MCU. The Software UART Library provides easy communication with other
devices via the RS232 protocol.
Note: The Software UART library implements time-based activities, so interrupts
need to be disabled when using it.
External dependencies of Software UART Library
Library Routines
- Soft_UART_Init 
- Soft_UART_Read 
- Soft_UART_Write 
- Soft_UART_Break 
351
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
The following variables
must be defined in all
projects using Software
UART Library:
Description: 
Example : 
dim Soft_UART_Rx_Pin
as sbit sfr external
Receive line.
dim Soft_UART_Rx_Pin
as sbit at PIND.B0
dim Soft_UART_Tx_Pin
as sbit sfr external
Transmit line.
dim Soft_UART_Tx_Pin
as sbit at PORTD.B1
dim
Soft_UART_Rx_Pin_Dire
ction 
as sbit sfr
external
Direction of the Receive
pin.
dim
Soft_UART_Rx_Pin_Dire
ction 
as sbit at
DDRD.B0
dim
Soft_UART_Tx_Pin_Dire
ction 
as sbit sfr
external
Direction of the Transmit
pin.
dim
Soft_UART_Tx_Pin_Dire
ction 
as sbit at
DDRD.B1