ZBasic Language Reference
220
ZBasic Microcontrollers
Clock Source
Serial Interface
In many cases, youll want to provide serial interface circuitry to convert the AVR serial channel signals
to/from RS-232 levels. Note that not all AVR chips have on-board serial hardware (UART) but if it does
and you elect to install the ZBasic bootloader (or other bootloader) youll probably need the serial
interface circuitry for serial channel Com1. The recommended serial interface circuitry is shown below.
This circuit has two sub components. The MAX232 chip functions as an RS-232 level converter that
translates the 0-Vcc signals of the AVR to/from the standard RS-232 voltage levels.
The second component is the ATN circuitry that is used to signal the AVR to go into download mode
when using the ZBasic bootloader. The ATN circuitry is that portion connected between pin 4 of the DB-9
serial connector and the /RST pin of the AVR. If you do not intend to use the ZBasic bootloader, the ATN
circuitry can be omitted. You may want to include a jumper in the ATN circuitry so that it can be
disconnected when downloads are not required. With the ATN circuitry connected, the AVR will receive a
reset pulse on every positive transition of pin 4 (DTR) of the serial connector. If alternate component
values are chosen you must ensure that the AVR receives a reset pulse of at least 2uS on every positive
transition of the DTR signal on pin 4 of the serial connector.
One advantage to using this recommended circuit is that the MAX232 chip includes a DC-DC converter
that produces nominally +/- 10V from the positive Vcc source. This is particularly useful if your application
requires one or more of these voltages. For example, some LCD devices require a low-current negative
supply for their backlight circuitry. The positive voltage is available on pin 2 of the MAX232 while the
negative voltage is available on pin 6. Consult the datasheet for the MAX232 device for information on
the current capacity of these supplies. Also note that the MAX232 may not operate at the voltage level
that youve chosen for your AVR. There are alternate RS-232 level converter chips that operate at
different or wider voltage ranges. For example, the MAX3232E can operate from 3.3V to 5V.
|