User manual
mikroBasic PRO for PIC32
MikroElektronika
563
UARTx_Init_Advanced
Prototype
sub procedure UARTx_Init_Advanced(dim baud_rate, freq_Khz as dword, dim
high_low, parity, stop_bits as byte)
Description Congures and initializes the UART module with user dened settings.
Parameters - baud_rate: requested baud rate
- freq_Khz: Peripheral Bus Clock frequency in kHz.
- high_low_speed: High/low speed selection parameter. Valid values:
- parity: Parity and data selection parameter. Valid values:
- stop_bits: stop bit selection parameter. Valid values:
Data/Parity Mode
Description Predened library const
8-bit data, no parity _UART_8BIT_NOPARITY
8-bit data, even parity _UART_8BIT_EVENPARITY
8-bit data, odd parity _UART_8BIT_ODDPARITY
9-bit data, no parity _UART_9BIT_NOPARITY
Stop bits
Description Predened library const
One stop bit _UART_ONE_STOPBIT
Two stop bits _UART_TWO_STOPBITS
High/Low Speed
Description Predened library const
Low Speed UART _UART_LOW_SPEED
Hi Speed UART _UART_HI_SPEED
Returns Nothing.
Requires Routine requires the UART module.
Example
Notes Refer to the device data sheet for baud rates allowed for specic Fosc.
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 6.
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.