int e l CHAPTER 4 Description of Statements 4.1 DESCRIPTION OF STATEMENTS STATEMENT: BAUD [expr] MODE: COMMAND AND/OR RUN TYPE: CONTROL The BAUD [expr] statement is used to set the baud rate for the software line printer port resident on the MCS BASIC-52 device. In order for this STATEMENT to properly calculate the baud rate, the crystal (special function operator -- XTAL) must be correctly assigned (e.g. XTAL = 9000000). MCS BASIC- 52 assumes a crystal value of 11.0592 MHz if no XTAL value is assigned. The software line printer port is P1.7 on the 8052AH device. The main purpose of the software line printer port is to let the user make a "hard copy" of program listings and/or data.
The COMMAND LIST# and the STATEMENT PRINT# direct outputs to the software line printer port. If the BAUD [expr] STATEMENT is not executed before a LIST# or PRINT# command/statement is entered, the output to the software line printer port will be at about 1 BAUD and it will take A LONG TIME to output something. You may even think that BASIC has crashed, but it hasn't. It's just outputting at a VERY SLOW rate. So be sure to assign a BAUD rate to the software printer port BEFORE using LIST# or PRINT#. The maximum baud rate that can be assigned by the BAUD statement depends on the crystal. In general, 4800 is a reasonable maximum baud- rate.
however the user may want to experiment with different rates. The software serial transmits 8 data bits, 1 start bit, and two stop bits. No parity is transmitted. EXAMPLE: BAUD 1200 Will cause the line printer port to output data at 1200 BAUD. VARIATIONS: None. - 28 -