3 setting up the rs-232 terminal, 4 changing the speed of communication, Setting up the rs-232 terminal -3 – Motorola MC68VZ328 User Manual

Page 309: Changing the speed of communication -3

Advertising
background image

Bootstrap Mode Operation

Bootstrap Mode

17-3

17.1.3

Setting Up the RS-232 Terminal

To set up communication between your target system and the PC, set the communication specifications to
19,200 bps, no parity, 8-bit, and 1 stop bit. It is permissible to pause after each line (b-record) is transferred
to ensure that each transferred ASCII character is echoed.

After the hardware is set up, the system is powered up, and bootstrap mode is entered, sending any ASCII
character to the target system will initiate the link. The bootloader automatically determines which UART
port is being used for bootstrap by sensing the receive FIFO in each UART. The first UART to have data is
selected. Next, the bootloader adjusts the baud rate to match the 32.768 kHz or 38.400 kHz crystal by
reading the first received character. If the link is successful, the bootloader returns a unique character (@)
as an acknowledgement. In addition, the bootloader echoes to the target system the same ASCII character
that the target system initially transmitted.

NOTE:

The TXD2 pin of UART 2 is not enabled by default. Therefore, no
character is echoed before bit 5 (TXD2) of the Port J select register is
cleared. To re-enable the TXD2 pin in bootstrap mode, download the
following b-record: “FFFFF43B01CF.”

17.1.4

Changing the Speed of Communication

The communication baud rate may be changed after 19,200 bps is initially used to set up the RS-232
terminal. Simply issue a b-record to reinitialize the baud control register of the UART controller, which is
described in Section 14.4.2, “UART 1 Baud Control Register,” on page 14-12. For example, if the system
uses a 32.768 kHz external crystal, the baud control register is initialized to 0x0126 after 19,200 bps is set
up, assuming that the system clock is 16.58 MHz (the default). Changing the baud control register from
0x0126 to 0x0026 will switch the baud rate from 19,200 bps to 38,400 bps by issuing a b-record. After the
last character of this b-record is sent (0), the echo of this last character will be in the new speed
(38,400 bps). At this time, the host speed must immediately be adjusted to 38,400 bps.

The baud control register is a 2-byte register, and bootstrap mode data transfers are byte-sized write cycles.
Therefore, changing both bytes of the baud control register requires two steps, and each byte change must
be issued at the standard communication speed for the host to set up new communication. For example, to
change the speed from 19,200 bps to 115,200 bps, follow these steps:

1. Issue the b-record “FFFFF9020100” to change the baud control register from 0x0126 to

0x0026, and the new speed changes to 38,400 bps. Next, change the host speed to 38,400 bps
to synchronize with the target system.

2. Issue another b-record to change the baud control register from 0x0026 to 0x0038 of the

final 115,200 bps speed, and readjust the host speed to 115,200 bps.

Advertising