User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
620
UART Library
The UART hardware module is available with a number of dsPIC30/33 and PIC24 MCUs. The mikroPascal PRO for
dsPIC30/33 and PIC24 UART Library provides comfortable work with the Asynchronous (full duplex) mode.
You can easily communicate with other devices via RS-232 protocol (for example with PC, see the gure at the end
of the topic – RS-232 HW connection). You will need a MCU with hardware integrated UART, for example ATmega16.
Then, simply use the functions listed below.
Important:
- UART library routines require you to specify the module you want to use. To select the desired UART module, simply
change the letter x in the routine prototype for a number from 1 to 4.
- Switching between the UART modules in the UART library is done by the UART_Set_Active function (UART modules
have to be previously initialized).
- Number of UART modules per MCU differs from chip to chip. Please, read the appropriate datasheet before utilizing
this library.
Library Routines
- UARTx_Init
- UARTx_Init_Advanced
- UARTx_Data_Ready
- UARTx_Tx_Idle
- UARTx_Read
- UARTx_Read_Text
- UARTx_Write
- UARTx_Write_Text
- UART_Set_Active