BAUD1

Top  Previous  Next

Action

Changes the baud rate for the second hardware UART.

 

 

Syntax

BAUD1 = var

BAUD1 #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.

 

Do not confuse the BAUD1 statement with the $BAUD1 compiler directive.

 

And do not confuse $CRYSTAL and CRYSTAL

 

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

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

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

 

 

See also

$CRYSTAL , $BAUD , $BAUD1 , BAUD

 

 

ASM

NONE

 

 

Example

'-------------------------------------------------------------------------------

'copyright                : (c) 1995-2005, MCS Electronics

'micro                    : Mega162

'suited for demo          : yes

'commercial addon needed  : no

'purpose                  : demonstrates BAUD1 directive and BAUD1 statement

 

'-------------------------------------------------------------------------------

$regfile = "M162def.dat"

$baud1 = 2400

$crystal= 14000000 ' 14 MHz crystal

 

Open "COM2:" For BINARY As #1

 

Print #1 , "Hello"

'Now change the baud rate in a program

Baud1 = 9600                                               '

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

Close #1

End