Positron Compiler Documentation

USART1 Declares for Hserin, Hserout, Hrsin and Hrsout.

Positron16 · Revision 1.1.3.5 · PDF page 415

Declare HRsout_Pin Port.Pin Declares the port and pin used for USART1 transmission (TX). The location of the port and pin is dictated by the device's PPS (Peripheral Pin Select) options. Note that this declare will not alter any PPS (Peripheral Pin Select) SFRs.

There is no default setting for this Declare and it must be used within the BASIC program.

Declare HRsin_Pin Port.Pin Declares the port and pin used for USART1 reception (RX). The location of the port and pin is dictated by the device's PPS (Peripheral Pin Select) options. Note that this declare will not alter any PPS (Peripheral Pin Select) SFRs.

There is no default setting for this Declare and it must be used within the BASIC program.

Declare Hserial_Baud Constant value Sets the Baud rate that will be used to transmit or receive a byte serially. The Baud rate is calculated using the Xtal frequency declared in the program. The default Baud rate if the Declare is not included in the program listing is 9600 Baud.

Declare Hserial_Parity Odd or Even Enables/Disables parity on the serial port. For Hrsin, Hrsout, Hserin and Hserout. 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 Hserial_Parity declare.

 Declare Hserial_Parity = Even    ' Use if even parity desired
 Declare Hserial_Parity = Odd    ' Use if odd parity desired

Declare Hserial_Clear On or Off Clear the overflow error bit before commencing a read.

Declare Hrsout_Pace 0 to 65535 microseconds (us) Implements a delay between characters transmitted by the Hrsout or HSerout command.

On occasion, the characters transmitted serially are in a stream that is too fast for the receiver to catch, this results in missed characters. To alleviate this, a delay may be implemented between each individual character transmitted by Hrsout or HSerout.

If the Declare is not used in the program, then the default is no delay between characters.

View original PDF page 415Open page in PDFOriginal PDF page 415