User`s manual

Rabbit 4000 Designer’s Handbook rabbit.com 83
11.2.2 Diagnostic Test #1: Toggle the Status Pin
This test toggles the status pin.
1. Apply the reset for at least ¼ second and then release the reset. This enables the cold boot mode for
asynchronous serial port A if the programming cable is connected to the target’s programming connec-
tor.
2. Send the following sequence of triplets.
80 0E 20 ; sets status pin low
80 0E 30 ; sets status pin high
80 0E 20 ; sets status pin low again
3. Wait for approximately ¼ second and then repeat starting at step #1.
While the test is running, an oscilloscope can be used to observe the results. The scope can be triggered by
the reset line going high. It should be possible to observe the data characters being transmitted on the RXA
pin of the processor or the programming connector. The status pin can also be observed at the processor or
programming connector. Each byte transmitted has 8 data bits preceded by a start bit which is low and fol-
lowed by a stop bit which is high (viewed at the processor or programming connector). The data bits are
high for 1 and low for 0.
The cold boot mode and the triplets sent are described in Section 4.1 on page 20. Each triplet consists of a
2-byte address and a 1-byte data value. The data value is stored in the address specified. The uppermost bit
of the 16-bit address is set to one to specify an internal I/O write. The remaining 15 bits specify the
address. If the write is to memory then the uppermost bit must be zero and the write must be to the first 32
KB of the memory space.
The user should see the 9 bytes transmitted at 2400 bps or 416 µs per bit. The status bit will initially toggle
fairly rapidly during the transmission of the first triplet because the default setting of the status bit is to go
low on the first byte of an opcode fetch. While the triplets are being read, instructions are being executed
from the small cold boot program within the microprocessor. The status line will go low after the first trip-
let has been read. It will go high after the second triplet is read and return to low after the third triplet is
read. The status line will stay low until the sequence starts again.
If this test fails to function it may be that the programming connector is connected improperly or the
proper pull-up resistors are not installed on the SMODE lines. Other possibilities are that one of the oscil-
lators is not working or is operating at the wrong frequency, or the reset could be failing.
11.2.2.1 Using serialIO.exe
This test is available as StatusTgl.Diag, one of the diagnostic samples downloaded in
ser_io_rab20.zip.