![Rabbit Rabbit 4000 User Manual Download Page 146](http://html1.mh-extra.com/html/rabbit/rabbit-4000/rabbit-4000_user-manual_3116714146.webp)
136
Rabbit 4000 Microprocessor User’s Manual
16.3.2 Clocked Serial Mode
The following steps explain how to set up Serial Ports A – D for the clocked serial mode.
When the internal clock is selected, the Rabbit 4000 is in control of all transmit and
receive operations. When an external clock is selected the other device controls all trans-
mit and receive operation. For both situations the decision between polling and interrupt-
driven methods is application dependent.
1. Write the interrupt vector for the interrupt service routine to the internal interrupt table.
2. Set up the desired data transmit and clock pins by writing to the appropriate parallel
port function register (PxFR) and alternate output register (PxALR or PxAHR).
3. Select the appropriate mode by writing to SxCR (receive input port and clock source).
Also select the interrupt priority.
4. Select additional options by writing to SxER (clock polarity, bit order, and clock source
if external).
5. Write the desired divider value to TATxR for the appropriate serial port, or else write a
divider to the dedicated 15-bit divider in SxDLR and SxDHR. If the dedicated divider
is to be used, write a 1 to the most-significant bit of SxDHR to enable it.
6. There are two methods to transfer a byte:
write the byte to SxDR and then write 10 (or 11) to bits 6-7 of SxCR to enable the
transfer;
write the byte to SxAR which will automatically start the transfer.
If the internal clock is selected, the transmission will begin immediately; if an external
clock is selected, the transmission will begin when the clock is detected.
7. To receive a byte, write 01 to bits 6-7 of SxCR to start the receive operation. If the
internal clock is selected, the clock will begin immediately and the data will be read; if
an external clock is selected, the receive will occur when the clock is detected.
Summary of Contents for Rabbit 4000
Page 1: ...Rabbit 4000 Microprocessor User s Manual 019 0152 070720 H...
Page 18: ...8 Rabbit 4000 Microprocessor User s Manual...
Page 40: ...30 Rabbit 4000 Microprocessor User s Manual...
Page 74: ...64 Rabbit 4000 Microprocessor User s Manual...
Page 82: ...72 Rabbit 4000 Microprocessor User s Manual...
Page 86: ...76 Rabbit 4000 Microprocessor User s Manual...
Page 96: ...86 Rabbit 4000 Microprocessor User s Manual...
Page 182: ...172 Rabbit 4000 Microprocessor User s Manual...
Page 240: ...230 Rabbit 4000 Microprocessor User s Manual...
Page 248: ...238 Rabbit 4000 Microprocessor User s Manual...
Page 256: ...246 Rabbit 4000 Microprocessor User s Manual...
Page 310: ...300 Rabbit 4000 Microprocessor User s Manual...
Page 330: ...320 Rabbit 4000 Microprocessor User s Manual...
Page 348: ...338 Rabbit 4000 Microprocessor User s Manual...