BAUD

Top  Previous  Next

Action

Changes the baud rate for the hardware UART.

 

 

Syntax

BAUD = var

BAUD #x , const

 

 

Remarks

Var

The baud rate that you want to use.

X

The channel number of the software UART.

Const

A numeric constant for the baud rate that you want to use.

 

notice Do not confuse the BAUD statement with the $BAUD compiler directive.

 

And do not confuse $CRYSTAL and CRYSTAL

 

$BAUD overrides the compiler setting for the baud rate and BAUD will change the current baud rate.

So $BAUD is a global project setting in your source code while BAUD will change the baud rate during run time.

You could use BAUD to change the baud rate during run time after the user changes a setting.

 

BAUD = ... will work on the hardware UART.

 

BAUD #x, yyyy will work on the software UART.

 

 

See also

$CRYSTAL , $BAUD , BAUD1

 

 

ASM

NONE

 

 

 

 

Example

$regfile = "m48def.dat"

$crystal = 4000000

$baud = 19200

Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0

 

Print "Hello"

 

'Now change the baud rate in a program

Baud = 9600

Print "Did you change the terminal emulator baud rate too?"

End