Mikroelektronika MIKROE-350 Scheda Tecnica

Pagina di 526
UARTx_Init
470
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure UARTx_Init(dim baud_rate as longint)
Returns
Nothing.
Description
Configures and initializes the UART module.
The internal UART module module is set to: 
- receiver enabled 
- transmitter enabled 
- frame size 8 bits 
- 1 STOP bit 
- parity mode disabled 
- asynchronous operation 
Parameters : 
baud_rate:
requested baud rate 
Refer to the device data sheet for baud rates allowed for specific Fosc.
Requires
You'll need AVR MCU with hardware UART.
UARTx_Init needs to be called before using other functions from UART Library.
Example
'This will initialize hardware UART1 module and establish the
communication at 2400 bps
UART1_Init(2400)