USART3 Declares for use with HRsin3, HSerin3, HRsout3 and HSerout3.
Declare HSerout3_Pin = Port.Pin For devices that have PPS (Peripheral Pin Select), the port and pin used for the TX3 line must be given, so that the compiler can setup the PPS SFRs before the program starts. This may be any valid port on the microcontroller, but check the datasheet to see if the Port is valid for the peripheral.
Declare HSerin3_Pin = Port.Pin For devices that have PPS (Peripheral Pin Select), the port and pin used for the RX3 line must be given, so that the compiler can setup the PPS SFRs before the program starts. This may be any valid port on the microcontroller, but check the datasheet to see if the Port is valid for the peripheral.
Declare Hserial3_Baud = Constant value Sets the Baud rate that will be used to transmit a value serially. The Baud rate is calculated using the Xtal frequency declared in the program. The compiler will assign the best values to the SFRs for the Baud rate required. Within the asm file listing are the Baud rate achieved and the error percentage. Once compiled, press the F2 button and view the asm listing.
Declare Hserial3_Parity = Odd or Even Enables/Disables parity on the serial port. For HRsout3, HRsin3, HSerout3 and HSerin3. The default serial data format is 8N1, 8 data bits, no parity bit and 1 stop bit. 7E1 (7 data bits, even parity, 1 stop bit) or 7O1 (7data bits, odd parity, 1 stop bit) may be enabled using the Hserial2_Parity declare.
Declare Hserial3_Parity = Even ' Use if even parity desired
Declare Hserial3_Parity = Odd ' Use if odd parity desired
Declare Hserial3_Clear = On or Off Clear the overflow error bit before commencing a read.
Because the hardware serial port only has a 2-byte input buffer, it can easily overflow is characters are not read from it often enough. When this occurs, the USART stops accepting any new characters, and requires resetting, so the program will not know if an error occurred while reading, therefore some characters may be lost.
Declare Hserial3_Clear = On
