Positron Compiler Documentation

HSerialx_ChangeBaud

Positron8 · Revision 4.0.6.5 · PDF page 231

Hserial1_ChangeBaud Baud Value, { Display Actual Baud }

or

Hserial2_ChangeBaud Baud Value, { Display Actual Baud }

or

Hserial3_ChangeBaud Baud Value, { Display Actual Baud }

or

Hserial4_ChangeBaud Baud Value, { Display Actual Baud }

or

Hserial5_ChangeBaud Baud Value, { Display Actual Baud }

Changes the Baud rate of a USART for the HRsoutX/HRsinX and HSeroutX/HSerinX commands.

Baud Value is a constant value that signifies which Baud rate to set the USART at. Display Actual Baud is an optional constant of 0 or 1 that will produce a reminder message in the IDE that indicates what the actual Baud rate is, and its error ratio.

Device = 18F25K20
Declare Xtal = 20  ' Tell the compiler the device will be operating at 20MHz
Declare Hserial_Baud = 9600      ' Set Baud rate to 9600 for HRsoutLn

HRsoutLn "Hello World at 9600 Baud"
DelayMs 2000                    ' Wait for 2 seconds

HSerial1_ChangeBaud 115200       ' Change the Baud rate to 115200 for USART1
HRsoutLn "Hello World at 115200 Baud"
Stop
View original PDF page 231Open page in PDFOriginal PDF page 231