THE SERIAL CONNECTION

NOTE: RS-232 owners should disregard this section. The RS-232 MicronEye does not use the 6850 ACIA. The RS-232 MicronEye connects directly to an RS-232 port. Configuring the port properly depends on your computer and is discussed on the chapter discussing the RS-232 MicronEye. The RS-232 MicronEye user should disregard the discussion on reading and writing the ACIA status register as this is taken care of by the computer's RS-232 circuitry and firmware. The RS-232 MicronEye user need only worry about sending commands to the MicronEye as discussed in the following section and receiving images from the MicronEye.

The interface between the MicronEye and the computer is a serial link utilizing a Motorola 6850 ACIA. The connection is via a 6-line telephone cable. The lines are used for Vcc, ground, receive, transmit, and external clock. The 6th line is not connected. The operating speed is controlled by the baud rate jumper setting on the MicronEye circuit board. When using real- time image processing, the programmer must make certain that the time required to perform special tasks between bytes does not exceed the time available.

The ACIA is composed of a data register and a status register. Writing to the status register allows the user to configure items such as parity, stop bits, start bits, clocking, etc. Before accessing the MicronEye, the ACIA has to be initialized to the proper configuration, as follows:

VERSION A

Write to status register:

hex $03

followed by hex $14

 

VERSION B

Write to status register:

hex $C0

followed by hex $28

The first byte performs a master reset on the ACIA, while the second byte specifies that the transmission protocol is 1 start bit, followed by 8 data bits, followed by 1 stop bit; and a x1 clock mode is to be used. (x1 clock mode requires that an external clock accompany the data to and from the computer which is furnished by the standard MicronEye interface card.

Reading the status register allows the user to determine when new data has been received and when the ACIA is ready to send data. The status bits, when set, mean:

VERSION A STATUS BIT DESCRIPTION (READ)

Bit 0 Data has been received from MicronEye. In normal use, this bit is only checked when seeing if data is available from the MicronEye.

Bit 1 A command may be sent to the MicronEye.

Bit 4 Received data improperly framed. Usually only used in a debug mode.

Bit 5 Bit 2 Data received before previous byte read.

VERSION B STATUS BIT DESCRIPTION (READ)

Bit 7 Data has been received from MicronEye. In normal use, this bit is only checked when seeing if data is available from the MicronEye.

Bit 6 A command may be sent to the MicronEye.

Bit 3 Received data improperly framed. Usually only used in a debug mode.

Bit 2 Bit 2 Data received before previous byte read.

Usually only used in a debug mode. Once the status register indicates that a command can be sent to the MicronEye, write the command to the data register. Conversely, when receiving an image from the MicronEye, read the data register when the status register indicates that data is available. When receiving an image from the MicronEye, it is a good idea to incorporate a timeout mechanism in case the MicronEye stops sending bytes before the program expects. Otherwise the program can hang if the software misses even a single byte.