User’s Manual
131
12.7.1 Controlling an RS-485 Driver and Receiver
RS-485 uses a half-duplex method of communication. One station enables its driver and
sends a message. After the message is complete, the station disables the driver and listens
to the line for a reply. The driver must be enabled before the start bit is sent and not dis-
abled until the stop bit has been sent. The transmitter idle interrupt is normally used to dis-
able the RS-485 driver and possibly enable the receiver.
12.7.2 Transmitting Dummy Characters
It may be desired to operate the serial transmitter without actually sending any data. “Dummy”
characters are transmitted to pass time or to measure time.
The output of the transmitter may be disconnected from the transmitter output pin by manip-
ulating the control registers for parallel port C or D, which are used as output pins. For
example, if serial port B is to be temporarily disconnected from its output pin, which is bit
4 of parallel port C, this can be done as follows.
1. Store a "1" in bit 4 of the parallel port data output register to provide the quiescent state
of the drive line.
2. Clear bit 4 of the parallel port C function register so that the output no longer comes
from the serial port. Of course, this should not be done until the transmitter is idle.
A similar procedure can be used if the serial port is set up to use alternate output pins on
port D. Only serial ports A and B can use alternate outputs on parallel port D.
If an RS-485 driver is being used, dummy characters can be transmitted by disabling the
driver after the stop bit has been sent. This is an alternative to the above procedure.
12.7.3 Transmitting and Detecting a Break
A break is created when the output of the transmitter is driven low for an extended period.
If a break is received, it will appear as a series of characters filled with zeros and with the
9th bit detected low. This could only be confused with a legitimate message if a protocol
using the 9th bit was in effect. Break is not usually used as a message in such protocols.
A break can be transmitted by transmitting a byte of zeros at a very slow baud rate.
Another and probably better method is to disconnect the transmitter from the output pin,
and use the parallel port bit to set the line low while sending dummy characters to time out
the break.
The use of break as a signaling device should be avoided because it is slow, erratically sup-
ported by different types of hardware, and usually creates more problems than it solves.
12.7.4 Using A Serial Port to Generate a Periodic Interrupt
A serial port may be used to generate a periodic interrupt by continuously transmitting
characters. Since the Tx output via parallel port C or D can be disabled, the transmitted
characters are transmitted to nowhere. Because the character output path is double-buff-
ered, there will be no gaps in the character transmission, and the interrupts will be exactly
periodic. The interrupts can happen every 9, 10 or 11 baud times, depending on whether 7
or 8 bits are transmitted and on whether the 9th (8th) bit is sent.
Содержание 2000
Страница 1: ...Rabbit 2000 Microprocessor User s Manual 019 0069 041018 M...
Страница 12: ...6 Rabbit 2000 Microprocessor...
Страница 46: ...40 Rabbit 2000 Microprocessor...
Страница 54: ...48 Rabbit 2000 Microprocessor...
Страница 76: ...70 Rabbit 2000 Microprocessor...
Страница 96: ...90 Rabbit 2000 Microprocessor...
Страница 142: ...136 Rabbit 2000 Microprocessor...
Страница 154: ...148 Rabbit 2000 Microprocessor...
Страница 170: ...164 Rabbit 2000 Microprocessor...
Страница 174: ...168 Rabbit 2000 Microprocessor...
Страница 180: ...174 Rabbit 2000 Microprocessor...
Страница 202: ...196 Rabbit 2000 Microprocessor...
Страница 206: ...200 Rabbit 2000 Microprocessor...
Страница 226: ......
Страница 230: ...224 Rabbit 2000 Microprocessor...