Rabbit Semiconductor was formed expressly to design a a better microprocessor for use in
small- and medium-scale single-board computers. The first microprocessors were the
Rabbit 2000, Rabbit 3000, and the Rabbit 4000. The latest microprocessor is the Rabbit
5000. Rabbit microprocessor designers have had years of experience using Z80, Z180, and
HD64180 microprocessors in small single-board computers. The Rabbit microprocessors
share a similar architecture and a high degree of compatibility with these microprocessors,
but represent a vast improvement.
The Rabbit 5000 is a high-performance microprocessor with low electromagnetic interference (EMI), and is designed specifically for embedded control, communications, and network connectivity. Extensive integrated features and glueless architecture facilitate rapid
hardware design, while a C-friendly instruction set promotes efficient development of
even the most complex applications.
The Rabbit 5000 is the first Rabbit microprocessor to have a full 16-bit internal bus architecture, providing significant performance improvements when used with external 16-bit
memory devices. It also has the ability to support both 8-bit and 16-bit external memory
devices.
The Rabbit 5000 is also the fastest microprocessor from Rabbit, now a Digi International
brand, running at up to 100 MHz, with compact code and support for up to 16 MB of
memory. Operating with a 1.8 V core and 3.3 V I/O, the Rabbit 5000 boasts eight channels
of DMA, six serial ports with IrDA, 48+ digital I/O, quadrature decoder, PWM outputs,
and pulse capture and measurement capabilities. It also features a battery-backable realtime clock, glueless memory and I/O interfacing, and ultra-low power modes. Four levels
of interrupt priority allow fast response to real-time events. Its compact instruction set and
high clock speeds give the Rabbit 5000 exceptionally fast math, logic, and I/O performance.
The Rabbit 5000 contains 128 KB of internal high-speed 16-bit SRAM, which can be used
for code and/or data. It is capable of booting off of a standard serial flash, so a microcontroller application with no external parallel memory is possible.
The Rabbit 5000 provides two options for network connectivity — a full 10/100Base-T
Ethernet MAC with a standard MII PHY interface, and a wireless 802.11b/g MAC
compatible with several standard Wi-Fi transceivers. The two network interfaces share both
internal resources and I/O pins, and so only one can be enabled at a time.
Chapter 1 The Rabbit 5000 Processor13
1.2 Features
The Rabbit 5000 has several powerful design features that practically eliminate EMI problems, which is essential for OEMs who need to pass CE and regulatory radio-frequency
emissions tests. The amplitude of any electromagnetic radiation is reduced by the internal
spectrum spreader, by gated clocks (which prevent unnecessary clocking of unused registers), and by separate power planes for the processor core and I/O pins (which reduce
noise crosstalk). An external I/O bus can be used by designers to enable separate buses for
I/O and memory, or to limit loading the memory bus to reduce EMI and ground bounce
problems when interfacing external peripherals to the processor. The external I/O bus
accomplishes this by duplicating the Rabbit's data bus on Parallel Port A, and uses Parallel
Port B to provide the processor's six or eight least significant address lines for interfacing
with external peripherals.
The high-performance instruction set offers both greater efficiency and execution speed of
compiler-generated C code. Instructions include numerous single-byte opcodes that execute
in two clock cycles, 16-bit and 32-bit loads and stores, 16-bit and 32-bit logical and arithmetic operations, 16 × 16 multiply (executes in 12 clocks), long jumps and returns for
accessing a full 16 MB of memory, and one-byte prefixes to turn memory-access instructions into internal and external I/O instructions. Hardware-supported breakpoints ease
debugging by trapping on code execution or data reads and writes.
The Rabbit 5000 requires no external memory driver or interface-logic. Its 24-bit address
bus, 8-bit or 16-bit data bus, three chip-select lines, two output-enable lines, and two
write-enable lines can be interfaced directly with up to six memory devices. Up to 1 MB
of memory can be accessed directly via the Dynamic C development software, and up to
16 MB can be interfaced with additional software development. The Rabbit 5000 also
contains 128 KB of internal high-speed 16-bit SRAM, which can be used in addition to
any external memory devices.
A built-in slave port allows the Rabbit 5000 to be used as master or slave in multi-processor
systems, permitting separate tasks to be assigned to dedicated processors. An 8-line data
port and five control signals simplify the exchange of data between devices. A remote cold
boot enables startup and programming via a serial port, a slave port, or from a standard
external serial flash device.
The Rabbit 5000 features six 8-bit parallel ports, yielding a total of 48 digital I/O. Six
CMOS-compatible serial ports are available. All six are configurable as asynchronous
(including output pulses in IrDA format), while four are configurable as clocked serial
(SPI) and two are configurable as SDLC/HDLC. The various internal peripherals share the
parallel port’s I/O pins.
The Rabbit 5000 also offers many specialized peripherals. Two input-capture channels
each have a 16-bit counter, clocked by the output of an internal timer, that can be used to
capture and measure pulses. These measurements can be extended to a variety of functions
such as measuring pulse widths or for baud-rate autodetection. Two Quadrature Decoder
channels each have two inputs, as well as an 8- or 10-bit up/down counter. Each quadrature
14Rabbit 5000 Microprocessor User’s Manual
decoder channel provides a direct interface to optical encoder units. Four independent pulsewidth modulator (PWM) outputs, each based on a 1024-pulse frame, are driven by the output of a programmable internal timer. The PWM outputs can be filtered to create a 10-bit
D/A converter or they can be used directly to drive devices such as motors or solenoids.
Two external interrupt vectors can multiplex inputs from up to six external pins.
The Rabbit 5000 has three timer systems. Timer A consists of ten 8-bit counters, each of
which has a programmed time constant. Six of them can be cascaded from the primary
Timer A counter. Timer B contains a 10-bit counter, two match registers, and two step
registers. An interrupt can be generated or the output pin can be updated when the counter
reaches a match value, and the match value can then be incremented automatically by the
step value. Timer C is a 16-bit counter that counts up to a programmable limit. It contains
eight match registers so that up to four PWM (both synchronous and variable-phase) or
quadrature decoder signals can be created.
The Rabbit 5000 also provides support for protected operating systems. Support for two
levels of operation, known as system and user modes, allow application-critical code to
operate in safety while user code is prevented from inadvertently disturbing the setup of
the processor. Memory blocks as small as 4 KB can be write-protected against accidental
writes by user code, and stack over/underflows can be trapped by high-priority interrupts.
Security features are also available in the Rabbit 5000. Portions of the new instruction set
were introduced to increase encryption algorithm speeds dramatically, and 32 bytes of
battery-backed RAM can store an encryption key away from prying eyes.
The Rabbit 5000 supports eight channels of DMA access to internal or external memory,
internal I/O addresses, and the external I/O bus. Directing a DMA channel to or from an
internal peripheral such as a serial port or the Ethernet port automatically connects DMA
enable signals. Burst size, priority, and guaranteed cycles for the processor are all under
program control.
The Rabbit 5000 contains an 802.11b/g wireless MAC peripheral, also designed to operate
with the DMA peripheral. It includes support for all standard Wi-Fi features, including infrastructure and ad-hoc modes. The high-speed internal A/D converter and D/A converter
and clocked-serial control port provide a generic interface to several common Wi-Fi
transceivers. A low-speed A/D converter is also available to monitor the transmit signal
strength if desired. The two A/D converters and single D/A converter are available for
customer use when the Wi-Fi peripheral is disabled.
The Rabbit 5000 also contains a full-featured 10/100Base-T Ethernet MAC peripheral.
Designed to operate with the DMA peripheral, the Ethernet peripheral is fully compliant
with the 802.3 Ethernet standard, including support for auto-negotiation, link detection,
multicast filtering, and broadcast addresses. An industry-standard MII interface is used to
connect to an external PHY device.
Chapter 1 The Rabbit 5000 Processor15
1.3 Block Diagram
/RESET
/IOWR
/IORD
/BUFEN
SMODE0
SMODE1
STATUS
/WDTOUT
CLK
RESOUT
Data
Buffer
Memory
Management/
Control
Address
Buffer
Memory Chip
Interface
Parallel Ports
Port A
Port B
Port C
Port D
Port E
Port H
Global Power
Save & Clock
Distribution
Fast
Clock
Timer A
Timer C
Real-Time
Clock
32.768 kHz
Clock Input
Watchdog
Timer
Periodic
Interrupt
External I/O
Chip Interface
External
Interrupts
DATA BUS
(16 bits)
D[7:0]
(8-bit mode)
or
D[15:0]
(16-bit mode)
A[23:0]
CLKI
CLKIEN
CLK32K
INT0A, INT1A
INT0B, INT1B
/CS2, /CS1, /CS0
/OE1, /OE0
/WE1, /WE0
PA [7:0]
PB[7:0]
PC[7:0]
PD[7:0]
PE[7:0]
TXA, RXA, CLKA,
ATXA, ARXA
TXB, RXB, CLKB,
ATXB, ARXB
TXC, RXC, CLKC
TXD, RXD, CLKD
ADDRESS BUS
(15 bits)
Asynch
Serial
Synch
Serial
Asynch
Bootstrap
Synch
Bootstrap
Serial Port A
Asynch Serial IrDA
Serial Ports
B,C,D
Asynch Serial IrDA
Asynch
Serial
Synch
Serial
Serial Ports
E, F
Asynch Serial IrDA
Asynch
Serial
HDLC
SDLC
HDLC/SDLC IrDA
TXE, RXE
TCLKE, RCLKE
Slave Port
Slave Interface
SD[7:0]
SA[1:0],
/SCS, /SRD, /SWR,
/SLAVEATTN
Bootstrap Interface
TXF, RXF
TCLKF, RCLKF
Spectrum
Spreader
Clock
Doubler
Pulse Width
Modulation
PWM[3:0]
Quadrature
Decoder
QD1A, QD1B
QD2A, QD2B
AQD1A, AQD1B
AQD2A, AQD2B
Input
Capture
PC[7,5,3,1]
PD[7,5,3,1]
PE[7,5,3,1]
IrDA Bootstrap
Timer B
DMA
(8 channels)
25 MHz
DREQ0[B:A]
DREQ1[B:A]
TIMER C[3:0]
Secondary
Watchdog
VBAT RAM
(32 bytes)
battery-
backable
WAIT
ID[7:0]
IA[7:0]
I[7:0]
PH[7:0]
External Interface
CPU
SYSTEM/USER
128K
SRAM
10-bit High-Speed
DAC
20 MHz
10-bit High-Speed
ADC
10-bit slow ADC
802.11a/b/g
Wi-Fi
10/100Base-T
Ethernet
25
shared I/O
{
16Rabbit 5000 Microprocessor User’s Manual
1.4 Basic Specifications
Two versions of the Rabbit 5000 are available—the standard 289-ball BGA and a compact
196-ball BGA for specialty Wi-Fi applications. The larger package is intended for most
Rabbit applications; the smaller package has specific features and limitations, and is not
presently offered for sale. If you need further information, please contact your Rabbit sales
representative.
Table 1-1. Rabbit 5000 Specifications and Features
Package289-ball BGA196-ball BGA
Package Size15 mm × 15 mm × 1.4 mm 12 mm × 12 mm × 1.2 mm
Operating Voltage1.8 V DC core, 3.3 V DC I/O ring
Operating Current
Operating Temp.-40°C to +85°C
Maximum Clock Speed100 MHz
Digital I/O
Network Interfaces
Serial Ports6 CMOS-compatible2 CMOS-compatible
Baud RateClock speed/8 max. asynchronous
Address Bus20/24-bit8-bit
Data Bus8/16-bit8/16-bit
Timers
Real-Time ClockYes, battery-backable
RTC Oscillator CircuitryExternal
Watchdog Timer/SupervisorYes
48+ (arranged in
802.11b/g Wi-Fi
0.57 mA/MHz @ 1.8 V/3.3 V
(Wi-Fi and Ethernet diabled)
six 8-bit ports)
10/100Base-T
Ten 8-bit, one 10-bit with 2 match registers,
and one 16-bit with 8 match registers
19
802.11b/g Wi-Fi
Clock Modes1×, 2×, /2, /3, /4, /6, /8
Power-Down Modes
External I/O Bus8 data, 8 address linesNo
A/D Converters
D/A Converters10-bit, 2 synchronous channels, up to 40 megasamples/s
Chapter 1 The Rabbit 5000 Processor17
Sleepy (32 kHz)
Ultra-Sleepy (16, 8, 2 kHz)
10-bit, 2 synchronous channels, up to 40 megasamples/s
10-bit, single channel, up to 300 ksamples/s
1.5 Comparing Rabbit Microprocessors
The Rabbit 2000, Rabbit 3000, Rabbit 4000, and Rabbit 5000 features are compared
below.
The Rabbit 5000 supports up to three separate clocks at once—the main clock, the 32 kHz
clock, and the 20 MHz Wi-Fi clock. The main clock is used to drive the processor clock
and the peripheral clock inside the processor. The 32 kHz clock is used to drive the asynchronous serial bootstrap, the real-time clock, the periodic interrupt, and the watchdog
timers.
The Rabbit 5000 has a spectrum spreader on the main clock that shortens and lengthens
clock cycles. This has the net effect of reducing the peak energy of clock harmonics by
spreading the spectral energy into nearby frequencies, which reduces EMI and facilitates
government-mandated EMI testing. Gated clocks are used whenever possible to avoid
clocking unused portions of the processor, and separate power-supply pins for the core and
I/O ring further reduce EMI from the Rabbit 5000.
The main clock can be doubled or divided by 2, 4, 6, or 8 to reduce EMI and power
consumption. The 32 kHz clock (which can be divided by 2, 4, 8, or 16) can be used
instead of the main clock to generate processor and peripheral clocks as low as 2 kHz for
significant power savings. Note that dividing the 32 kHz clock only affects the processor
and peripheral clocks; the full 32 kHz signal is still provided to the real-time clock and
watchdog timer peripherals that use it directly. The periodic interrupt is disabled automatically since there is not enough time to process it when running off the 32 kHz clock.
There is also a 25 MHz Ethernet clock that is provided to the external PHY chip if you are
using the Ethernet option, but this Ethernet clock is not applied directly to the Rabbit
5000. The Ethernet clock can be driven by the processor clock, the processor clock
divided by 2, or by the input on PE6. The Ethernet clock needs to be 25 MHz to conform to
the 10/100Base-T specification. See Chapter 22 for more details on the Ethernet clock.
Chapter 2 Clocks21
2.1.1 Block Diagram
Wi-Fi
Clock
GCSR
CPU Clock
Peripheral Clock
GOCR
Divide
by 2
CLK Pin
Divide by
2, 4, 6, 8
Clock
Doubler
Spectrum
Spreader
CLKI
Divide by
2, 4, 8, 16
CLK32K
Clock
Disable
CLKIEN
CLK_IN
GCMxR
GCDRGCSR
GPSCR
Real-Time Clock
Periodic Interrupt
Asynch. Serial Bootstrap
Watchdog Timer
MAIN CLOCK
GCSR
PLL
2.1.2 Registers
Register NameMnemonicI/O AddressR/WReset
Global Control/Status RegisterGCSR0x0000R/W11000000
Global Clock Modulator 0 RegisterGCM0R0x000AW00000000
Global Clock Modulation 1 RegisterGCM1R0x000BW00000000
Global Clock Double RegisterGCDR0x000FR/W00000000
22Rabbit 5000 Microprocessor User’s Manual
2.2 Dependencies
2.2.1 I/O Pins
The main clock input is on the CLKI pin. There is an internal Schmitt trigger on this pin to
mitigate any noise problems associated with slowly transitioning signals.
The main clock disable output is on the CLKIEN pin. Its state is changed by one of the bit
combinations of bits 4:2 in GCSR. The CLKIEN pin will output low to disable an external
main oscillator when the 32 kHz mode with main oscillator disabled is selected, and will
output high for all other clock modes
The 32 kHz clock input is on the CLK32K pin. There is an internal Schmitt trigger on this
pin as well.
The peripheral clock or peripheral clock divided by 2 may be optionally output on the
CLK pin by enabling it via bits 7:6 in GOCR.
The 20 MHz Wi-Fi clock input is located on the CLK_IN pin; a PLL multiplies clocks up
to the 80 MHz required for the Wi-Fi peripheral.
2.2.2 Other Registers
RegisterFunction
GOCRUsed to set up the CLK output pin.
Chapter 2 Clocks23
2.3 Operation
2.3.1 Main Clock
The main clock is input on the CLKI pin, and is optionally sent through the spectrum
spreader and then the clock doubler. Both of these are described in greater detail below.
Different main clock modes may be selected via the GCSR, as shown in Table 2-1. Note
that one GCSR setting slows the processor clock while the peripheral clock operates at full
speed; this allows some power reduction while keeping settings like serial baud rates and
the PWM at their desired values.
Table 2-1. Clock Modes
GCSR SettingProcessor ClockPeripheral Clock
xxx010xxMain clockMain clock
xxx011xxMain clock / 2Main clock / 2
xxx110xxMain clock / 4Main clock / 4
xxx111xxMain clock / 6Main clock / 6
xxx000xxMain clock / 8Main clock / 8 (default on startup)
xxx001xxMain clock / 8Main clock
xxx100xx32 kHz clock (possibly divided)
32 kHz clock (possibly divided);
xxx101xx
main clock disabled via CLKIEN
output signal
32 kHz clock (possibly divided
via GPSCR)
32 kHz clock (possibly divided
via GPSCR)
When the 32 kHz clock is enabled in GCSR, it can be further divided by 2, 4, 6, or 8 to
generate even lower frequencies by enabling those modes in bits 0–2 of GPSCR. See
Table 2-4 for more details.
24Rabbit 5000 Microprocessor User’s Manual
2.3.2 Spectrum Spreader
FREQUENCY (MHz)
AMPLITUDE (dB)
400
405
4104154204254304354
-10
-20
-30
-40
-50
Spectrum Spreader
Disabled
Spectrum Spreader
Enabled (normal setting)
When enabled, the spectrum spreader stretches and compresses the main clock in a complex
pattern that spreads the energy of the clock harmonics over a wider range of frequencies.
There are three settings that correspond to normal and strong spreading in the 0–50 MHz
and >50 MHz main clock range. Each setting will affect the clock cycle differently; the
maximum cycle shortening (at 1.8 V and 25°C) is shown in Table 2-2 below.
0–50 MHz> 50 MHz
NormalStrong0x00
Strong—0x80
Chapter 2 Clocks25
Figure 2-1. Effects of Spectrum Spreader
Table 2-2. Spectrum Spreader Settings
GCM0R
Value
—Normal0x40
Normal spreading of frequencies over
50 MHz
Normal spreading of frequencies up to
50 MHz; strong spreading of
frequencies over 50 MHz
Strong spreading of frequencies up to
50 MHz; normal spreading of
frequencies over 50 MHz
Description
Max. Cycle
Shortening
2.3 ns
3 ns
4.5 ns
The spectrum spreader either stretches or shrinks the low plateau of the clock by a maximum
15
10
5
10050200150250
350
300
Normal Spreading
Strong Spreading
Frequency (MHz)
Harmonics (dB)
of 3 ns for the normal spreading and up to 4.5 ns for the strong spreading. If the clock
doubler is used, this will cause an additional asymmetry between alternate clock cycles.
Both normal and strong modes reduce clock harmonics by approximately 15 dB for frequencies above 100 MHz; for lower frequencies the strong setting has a greater effect in
reducing the peak spectral strength as shown in Figure 2-2.
Figure 2-2. Peak Spectral Amplitude Reduction by Spectrum Spreader
Two registers control the clock spectrum spreader. These registers must be loaded in a specific manner with proper time delays. GCM0R is only read by the spectrum spreader at the
moment when the spectrum spreader is enabled by storing 0x080 in GCM1R. If GCM1R
is cleared (when disabling the spectrum spreader), there is up to a 500-clock delay before
the spectrum spreader is actually disabled. The proper procedure is to clear GCM1R, wait
for 500 clocks, set GCM0R, and then enable the spreader by storing 0x080 in GCM1R.
The spectrum spreader is applied to the main clock before the clock doubler, so if both are
enabled there will be additional asymmetry between alternate clock cycles.If the clock
doubler is used, the spectrum spreader affects every other cycle and reduces the clock high
time. If the doubler is not used, then the spreader affects every clock cycle, and the clock
low time is reduced.
26Rabbit 5000 Microprocessor User’s Manual
2.3.3 Clock Doubler
The clock doubler allows a lower frequency crystal to be used for the main oscillator and
to provide an added range over which the clock frequency can be adjusted. The clock
doubler is controlled via the Global Clock Double Register (GCDR).
The clock doubler uses an on-chip delay circuit that must be programmed by the user at
startup if there is a need to double the clock. Table 2-3 lists the recommended delays in
GCDR for various oscillator or crystal frequencies.
Table 2-3. Recommended Delays Set In GCDR for Clock Doubler
Recommended GCDR ValueFrequency Range
0x0F7.3728 MHz
0x0B7.3728–11.0592 MHz
0x0911.0592–16.5888 MHz
0x0616.5888–20.2752 MHz
0x0320.2752–52.8384 MHz
0x0152.8384–77.4144 MHz
0x00>77.4144 MHz
Chapter 2 Clocks27
When the clock doubler is used and there is no subsequent division of the clock, the output
Oscillator
Oscillator delayed
and inverted
Doubled clock
Delay
time
48%52%
P
0.48P0.52P0.48P0.52P
Data out
Example
Write
Cycle
Write pulse
Early write pulse
option
Address / CS
Address / CS
Output enb
Early output enb
option
Data out from mem
Example
Read
Cycle
clock will be asymmetric, as shown in Figure 2-3.
Figure 2-3. Effect of Clock Doubler
The doubled-clock low time is subject to wide (50%) variation since it depends on process
parameters, temperature, and voltage. The times given above are for a core supply voltage
of 1.8 V and a temperature of 25°C. The values increase or decrease by 1% for each 5°C
increase or decrease in temperature. The doubled clock is created by xor’ing the delayed
and inverted clock with itself. If the original clock does not have a 50-50 duty cycle, then
alternate clocks will have a slightly different length. Since the duty cycle of the built-in
oscillator can be as asymmetric as 52%/48%, the clock generated by the clock doubler will
exhibit up to a 4% variation in period on alternate clocks. The memory access time is not
affected because the memory bus cycle is 2 clocks long and includes both a long and a short
28Rabbit 5000 Microprocessor User’s Manual
clock, resulting in no net change due to asymmetry. However, if an odd number of wait
states is used, then the memory access time will be affected slightly
The maximum allowed clock speed must be reduced slightly if the clock is supplied via the
clock doubler. The only signals clocked on the falling edge of the clock are the memory
and I/O write pulses, and the early option memory output enable. See Chapter 5 for more
information on the early output enable and write enable options.
The power consumption is proportional to the clock frequency, and for this reason power
can be reduced by slowing the clock when less computing activity is taking place. The
clock doubler provides a convenient method of temporarily speeding up or slowing down
the clock as part of a power management scheme.
Chapter 2 Clocks29
2.3.4 32 kHz Clock
C1 values may vary or
C1 may be eliminated
R2
R1
R1 and R2 control the
power consumed by the
unbuffered inverter.
VBAT
R
s
C1
C2
32.768 kHz
CL = 5-12 pF
R
p
C
in
U1A
U2A
SN74AHC1GU04
NC7SP14
The 32.768 kHz clock is used to drive the asynchronous serial bootstrap, the real-time
clock, the periodic interrupt, and the watchdog timers. If these features are not used in a
design, the use of the 32 kHz clock is optional.
A simplified version of the recommended oscillator circuit for the Rabbit 5000 is shown
below. The values of resistors and capacitors may need to be adjusted for various frequencies and crystal load capacitances. Technical Note TN235, “External 32.768 kHz Oscillator Circuits“, is available on the Rabbit Web site and goes into this circuit in detail.
Figure 2-4. Basic 32.768 kHz Oscillator Circuit
The 32.768 kHz circuit consumes microampere-level currents and has a very high impedance, making it susceptible to noise, moisture, and environmental contaminants. It is
strongly recommended to conformally coat this circuit to limit the effects of humidity and
dust on the oscillation frequency. Details about this requirement are available in Technical
Note TN303, “Conformal Coating”, from the Rabbit Web site.
The 32.768 kHz oscillator is slow to start oscillating after power-on. The startup delay
may be as much as 5 seconds. For this reason, a wait loop in the BIOS waits until this
oscillator is oscillating regularly before continuing the startup procedure. If the clock is
battery-backed, there will be no startup delay since the oscillator is already oscillating.
Crystals with low series resistance (R < 35 k) will start faster.
30Rabbit 5000 Microprocessor User’s Manual
The 32 kHz oscillator can be used to drive the processor and the peripheral clock to provide
significant power savings in “ultra-sleepy” modes. The 32 kHz oscillator can be divided
by 2, 4, 8, or 16 to provide clock speeds as low as 2.048 kHz. Special self-timed chip
selects are available to keep the memory devices enabled for as short a time as possible
when an ultra-sleepy mode is enabled; see Chapter 29 for more details on reducing power
consumption.
Table 2-4. Ultra-Sleepy Clock Modes
GPSCR
Setting
xxxxx00032.768 kHz
xxxxx10016.384 kHz
xxxxx1018.192 kHz
xxxxx1104.096 kHz
xxxxx1112.048 kHz
Processor and
Peripheral Clock
When the 32 kHz clock is enabled, the periodic interrupt is disabled automatically. The
real-time clock and watchdog timers keep running, and use the full 32 kHz clock speed
even when the processor and peripheral clocks use a divider on the 32 kHz clock.
Chapter 2 Clocks31
2.4 Register Descriptions
Global Control/Status Register(GCSR)(Address = 0x0000)
Bit(s)ValueDescription
7:600No reset or watchdog timer timeout since the last read.
(rd-only)01The watchdog timer timed out. These bits are cleared by a read of this register.
10This bit combination is not possible.
11Reset occurred. These bits are cleared by a read of this register.
50No effect on the periodic interrupt. This bit will always be read as zero.
1Force a periodic interrupt to be pending.
4:2000
001
010
011
100
101
110
111
1:000Periodic interrupts are disabled.
Processor clock from the main clock, divided by 8.
Peripheral clock from the main clock, divided by 8.
Processor clock from the main clock, divided by 8.
Peripheral clock from the main clock.
Processor clock from the main clock.
Peripheral clock from the main clock.
Processor clock from the main clock, divided by 2.
Peripheral clock from the main clock, divided by 2.
Processor clock from the 32 kHz clock, optionally divided via GPSCR.
Peripheral clock from the 32 kHz clock, optionally divided via GPSCR.
Processor clock from the 32 kHz clock, optionally divided via GPSCR.
Peripheral clock from the 32 kHz clock, optionally divided via GPSCR.
The main clock is disabled.
Processor clock from the main clock, divided by 4.
Peripheral clock from the main clock, divided by 4.
Processor clock from the main clock, divided by 6.
Peripheral clock from the main clock, divided by 6.
01Periodic interrupts use Interrupt Priority 1.
10Periodic interrupts use Interrupt Priority 2.
11Periodic interrupts use Interrupt Priority 3.
32Rabbit 5000 Microprocessor User’s Manual
Global Clock Modulator 0 Register(GCM0R)(Address = 0x000A)
Bit(s)ValueDescription
7:600
Clock dither in 1 ns steps, from 0 ns to 26 ns. Do not modify while the dither
function is enabled.
01Clock dither in 0.5 ns steps, from 0 ns to 13 ns.
10Clock dither in 2 ns steps, from 0 ns to 52 ns.
11This bit combination is reserved and must not be used.
5:0These bits are reserved and should be written with zeros.
Global Clock Modulator 1 Register(GCM1R)(Address = 0x000B)
Bit(s)ValueDescription
70
Disable the clock dither function. The disable does not take effect until the dither
pattern has returned to the 0 ns base delay value.
1Enable the clock dither function.
6:0These bits are reserved and should be written with zeros.
Chapter 2 Clocks33
Global Clock Double Register(GCDR)(Address = 0x000F)
Bit(s)ValueDescription
7:5These bits are reserved and should be written with zeros.
4:000000The clock doubler circuit is disabled.
000016 ns nominal low time.
000107 ns nominal low time.
000118 ns nominal low time.
001009 ns nominal low time.
0010110 ns nominal low time.
0011011 ns nominal low time.
0011112 ns nominal low time.
0100013 ns nominal low time.
0100114 ns nominal low time.
0101015 ns nominal low time.
0101116 ns nominal low time.
0110017 ns nominal low time.
0110118 ns nominal low time.
0111019 ns nominal low time.
0111120 ns nominal low time.
100013 ns nominal low time.
100104 ns nominal low time.
100115 ns nominal low time.
otherAny bit combination not listed is reserved and must not be used.
34Rabbit 5000 Microprocessor User’s Manual
Global Output Control Register(GOCR)(Address = 0x000E)
Bit(s)ValueDescription
7:600CLK pin is driven with peripheral clock.
01CLK pin is driven with peripheral clock divided by 2.
10CLK pin is low.
11CLK pin is high.
5:400STATUS pin is active (low) during a first opcode byte fetch.
01STATUS pin is active (low) during an interrupt acknowledge.
10STATUS pin is low.
11STATUS pin is high.
3:200/WDTOUT pin functions normally.
01Enable /WDTOUT for test mode. Rserved for internal use only.
10/WDTOUT pin is low (1 cycle min, 2 cycles max, of 32 kHz).
11This bit combination is reserved and should not be used.
1:000/BUFEN pin is active (low) during external I/O cycles.
01/BUFEN pin is active (low) during data memory accesses.
10/BUFEN pin is low.
11/BUFEN pin is high.
Chapter 2 Clocks35
36Rabbit 5000 Microprocessor User’s Manual
3. RESETAND BOOTSTRAP
3.1 Overview
The Rabbit 5000’s /RESET pin initializes everything in the processor except for the realtime clock registers and the contents of the battery-backed onchip-encryption RAM. If a
write cycle is in progress, it waits until the write cycle is completed to avoid potential
memory corruption.
After reset, the Rabbit 5000 checks the state of the SMODE and SYSCFG pins. Depending
on the state of the SMODE pins, it either begins normal operation by fetching instruction
bytes from memory bank zero, which is mapped to either /CS0 or /CS3 depending on the
state of the SYSCFG0 pin, or it enters a special bootstrap mode where it fetches bytes
from either Serial Port A or the slave port. In this mode, bytes can be written to internal
registers to set up the Rabbit 5000 for a particular configuration, or to memory to load a
program. The processor can begin normal operation once the bootstrap operation is
completed.
Chapter 3 Reset and Bootstrap37
3.1.1 Block Diagram
Reset
Delay
/RESET
Reset
CPU
Clock
Rabbit
5000
Master Reset
Bootstrap
Selection
SMODE0
Bootstrap
SMODE1
Asynch Serial Bootstrap
Serial Flash Bootstrap
Slave Port Bootstrap
Normal Operation
SPCR
SRAM
Chip
Select
SYSCFG0
Internal SRAM is on /CS0
Internal SRAM is on /CS3
3.1.2 Registers
Register NameMnemonicI/O AddressR/WReset
Slave Port Control RegisterSPCR0x0024R/W0xx00000
38Rabbit 5000 Microprocessor User’s Manual
3.2 Dependencies
3.2.1 I/O Pins
SMODE0, SMODE1 — When the Rabbit 5000 is first powered up or when it is reset, the
state of the SMODE0 and SMODE1 pins controls its operation.
SYSCFG0 — When the Rabbit 5000 is first powered up or when it is reset, the state of
this pin controls whether memory bank zero is mapped to /CS0 or the internal SRAM
(/CS3).
SYSCFG1 — This pin should always be tied to ground.
/RESET — Pulling the /RESET pin low will initialize everything in the Rabbit 5000
except for the real-time clock registers and the onchip-encryption RAM.
/CS1 — During reset the impedance of the /CS1 pin is high, and all other memory and I/O
control signals are held high. The special behavior of /CS1 allows an external RAM to be
powered by the same source as the VBATIO pin (which powers /CS1). In this case, a pullup resistor is required on /CS1 to keep the RAM deselected during powerdown.
RESOUT — The RESOUT pin, which is powered by the backup battery, is high during
reset and powerdown as long as VBAT and VBATIO are present, but low at all other
times, and can be used to control an external power switch to disconnect VDDIO from
VBATIO when the main power source is removed.
3.2.2 Clocks
The processor requires a 32 kHz clock input to generate the 2400 bps internal clock
required for asynchronous serial bootstrap, which is used when booting via Dynamic C
and the Rabbit Field Utility. No 32 kHz clock is required for either clocked serial or slave
port bootstrap.
When the processor comes out of reset, the CPU clock and peripheral clocks are both in
divide-by-8 mode.
3.2.3 Other Registers
RegisterFunction
SPCR
Enable/disable processor monitoring of SMODE
pins; read current state of SMODE pins.
3.2.4 Interrupts
There are no interrupts associated with reset or bootstrap.
Chapter 3 Reset and Bootstrap39
3.3 Operation
Pulling the /RESET pin low will initialize everything in the Rabbit 5000 except for the
real-time clock registers and the onchip-encryption RAM. The reset of the Rabbit 5000 is
delayed until any write cycles in progress are completed; the reset takes effect as soon as
no write cycles are occurring. The reset sequence requires a minimum of 128 cycles of the
main clock to complete in either case.
During reset, the impedance of the /CS1 pin is high and all other memory and I/O control
signals are held high. The special behavior of /CS1 allows an external RAM to be powered
by the same source as the VBATIO pin (which powers /CS1). In this case, a pullup resistor
is required on /CS1 to keep the RAM deselected during powerdown. The RESOUT pin,
which is powered by the backup battery, is high during reset and powerdown as long as
VBAT and VBATIO are present, but low at all other times, and can be used to control an
external power switch to disconnect VDDIO from VBATIO when the main power source
is removed.
Table 3-1 lists the condition of the processor after reset takes place. The state of all registers
after reset is provided in the chapter describing the specific peripheral.
Table 3-1. Rabbit 5000 Condition After Reset
FunctionOperation After Reset
CPU Clock,
Peripheral Clock
Clock Doubler,
Clock Dither
Memory Bank 0
Control Register
Memory Advanced
Control Register
CPU Registers:
PC, SP, IIR, EIR,
SU, HTR
Interrupt Priority
(IP Register)
Watchdog TimerEnabled (2 seconds)
Secondary
Watchdog Timer
Divide-by-8 mode
Disabled
/CS0, /OE0, write-protected,
4 wait states
8-bit interface
0x0000
0xFF (Priority 3)
Disabled
40Rabbit 5000 Microprocessor User’s Manual
The processor checks the SMODE and SYSCFG0 pins after the /RESET signal is inactive.
Table 3-2 summarizes what happens.
Table 3-2. SMODE Pin Settings
SMODE Pins [1,0]SYSCFG0Operation
000
001
01xBootstrap from the slave port.
10xBootstrap from Serial Port A, serial flash mode.
11xBootstrap from Serial Port A, asynchronous mode.
No bootstrap; code is fetched from address 0x0000
on /CS0, /OE0.
No bootstrap; code is fetched from address 0x0000
on /CS3, /OE0. The internal SRAM is enabled as a
16-bit memory device.
If both SMODE pins are zero, the Rabbit 5000 begins fetching instructions from the
memory device mapped into memory bank 0. When SYSCFG0 is low, memory bank 0 is
set to /CS0 and /OE0. If SYSCFG0 is high, memory bank 0 is set to /CS3 and /OE0, and
the internal SRAM is selected in 16-bit mode. If a 16-bit memory is used in memory bank 0,
the first section of code must immediately select the 16-bit bus mode. Chapter 5 provides
a short sample program to do this.
If either of the SMODE pins is high, the processor will enter the bootstrap mode and
accept triplets from Serial Port A, the serial flash bootstrap port, or the slave port, depending on the SMODE pin selection. It is good practice to place pulldown resistors on the
SMODE pins to ensure the proper operation of your design.
In the bootstrap mode, the processor inhibits the normal memory fetch, and instead fetches
instructions from a small internal boot ROM. This program reads triplets of three bytes
from the selected peripheral. The first byte is the most-significant byte of a 16-bit address,
the second byte is the least-significant byte of the address, and the third byte is the data to
be written. If the uppermost bit of the address is 1, then the address is assumed to be an
internal register address instead of a memory address, and the data are written to the
appropriate register instead. For example, a triplet of (0x04, 0x34, 0x5A) will write 0x5A
to logical memory address 0x0434, while a triplet of (0x80, 0x34, 0x5A) will write 0x5A
to processor register 0x34. Processor registers with addresses above 0xFF are not accessible in the bootstrap mode.
The boot ROM program waits for data to be available; each byte received automatically
resets the watchdog timer with a 2-second timeout. Bytes must be received quickly
enough to prevent timeout (or the watchdog must be disabled).
The device checks the state of the SMODE pins each time it jumps back to the start of the
ROM program and responds according to the current state. In addition, by setting bit 7 of
Chapter 3 Reset and Bootstrap41
the Slave Port Control Register (SPCR) high, the processor can be told to ignore the state
of the SMODE pins and continue normal operation.
Note that the processor can be told to re-enter bootstrap mode at any time by setting bit 7
of SPCR low; once this occurs and the least significant four bits of the current PC address
are zero, the processor will sample the state of the SMODE pins and respond accordingly.
This feature allows in-line downloading from the selected bootstrap port; once the download is complete, bit 7 of SPCR can be set high and the processor will continue operating
from where it left off.
As a security feature, any attempt to enter the bootstrap mode from either the SMODE
pins or by writing to bit 7 of the SPCR will erase the data stored in the onchip-encryption
RAM. This prevents loading a small program in memory to read out the data.
3.3.1 Asynchronous Serial Bootstrap
When the asynchronous serial bootstrap mode is selected by the SMODE pins, the Rabbit
5000 will being accepting triplets at 2400 bps on Serial Port A. The baud rate is generated
from the 32 kHz clock input, so a 32 kHz clock is required for this mode.
3.3.2 Serial Flash Bootstrap
When the serial flash bootstrap mode is selected by the SMODE pins, the Rabbit 5000
will enable the SPI serial flash bootstrap port on pins PD4, PD5, PD6, and PB0; the pins’
functionality is listed in Table 3-3 below. Note that these pins can be used for Serial Port B
in normal operation, so the serial flash may use the serial port as a regular serial port if
desired.
Table 3-3. Serial Flash Bootstrap Pin Functions
PinSPI SignalOperation
PD4MOSIRabbit data transmit (to serial flash)
PD5MISORabbit data receive (from serial flash)
PD6CSChip select (to serial flash)
PB0SCKSerial clock (output to serial flash)
The Rabbit 5000 divides the main clock by 64 to provide the SPI clock for the serial flash
bootstrap. Once this mode is entered, the Rabbit 5000 will send the byte sequence "0x03
0x00 0x00 0x00", which is an industry-standard command that enables continuous read
mode starting at serial flash address 0x0. Figure 3-1 provides a sample timing diagram.
The Rabbit 5000 will then read triplets out of the serial flash until the bootstrap mode is
exited.
42Rabbit 5000 Microprocessor User’s Manual
Figure 3-1. SPI Timing Diagram for Serial Flash Bootstrap Mode
012345678
15
1623 24
31 32
39 4047 487055 56
63
64
CE#
SCK
SI
SO
MODE 3
MODE 0
MSB
MSB
HIGH IMPEDANCE
MSB
O3
ADDADDADD
D
OUTDOUTDOUTDOUTDOUT
N
N + 1
N + 2N + 3
N + 4
3.3.3 Parallel Bootstrap
When the parallel bootstrap mode is selected by the SMODE pins, the Rabbit 5000 will
enable the parallel slave port interface on Parallel Ports A and B, and will wait for triplets
to be sent to that interface. See Chapter 19 for more details on the operation of the slave
port.
Chapter 3 Reset and Bootstrap43
3.4 Register Descriptions
Slave Port Control Register(SPCR)(Address = 0x0024)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
1Ignore the SMODE pins program fetch function.
6:5ReadThese bits report the state of the SMODE pins.
WriteThese bits are ignored and should be written with zero.
4:2000Disable the slave port. Parallel Port A is a byte-wide input port.
001Disable the slave port. Parallel Port A is a byte-wide output port.
010Enable the slave port, with /SCS from Parallel Port E bit 7.
011
100This bit combination is reserved and should not be used.
101This bit combination is reserved and should not be used.
110Enable the slave port, with /SCS from Parallel Port B bit 6.
111
1:000Slave port interrupts are disabled.
01Slave port interrupts use Interrupt Priority 1.
10Slave port interrupts use Interrupt Priority 2.
11Slave port interrupts use Interrupt Priority 3.
Enable the external I/O bus. Parallel Port A is used for the data bus and Parallel
Port B[7:2] is used for the address bus.
Enable the external I/O bus. Parallel Port A is used for the data bus and Parallel
Port B[7:0] is used for the address bus.
44Rabbit 5000 Microprocessor User’s Manual
4. SYSTEM MANAGEMENT
4.1 Overview
There are a number of basic system peripherals in the Rabbit 5000 processor, some of
which are covered in later chapters. The peripherals covered in this chapter are the periodic
interrupt, the real-time clock, the watchdog timers, the battery-backed onchip-encryption
RAM, and some of the miscellaneous output pins and their control and processor registers
that provide the processor ID and revision numbers.
The periodic interrupt, when enabled, is generated every 16 clocks of the 32 kHz clock
(every 488 µs, or 2.048 kHz). This interrupt can be used to perform periodic tasks.
The real-time clock (RTC) consists of a 48-bit counter that is clocked by the 32 kHz clock.
It is powered by the VBAT pin, and so can be battery-backed. The value in the counter is
not affected by reset, and can only be set to zero by writing to the RTC control register.
The 48-bit width provides a 272-year span before rollover occurs.
There are two watchdog timers in the Rabbit 5000, both clocked by the 32 kHz clock. The
main watchdog timer can be set to time out from 250 ms to 2 seconds, and resets the processor if not reloaded within that time. Its purpose is to restart the processor when it
detects that a program gets stuck or disabled.
The secondary watchdog timer can time out from 30.5 µs up to 7.8 ms, and generates a
Priority 3 secondary watchdog interrupt when it is not reset within that time. The primary
use for the secondary watchdog is to act as a safety net for the periodic interrupt — if the
secondary watchdog is reloaded in the periodic interrupt, it will count down to zero if the
periodic interrupt stops occurring. In addition, it can be used as a periodic interrupt on its
own.
The battery-backed onchip-encryption RAM consists of 32 bytes of memory that are
powered by the VBAT pin. Their values are not affected by reset, but are erased if the state
of the SMODE pins changes. These 32 bytes are intended for storing sensitive data (such
as an encryption key) somewhere other than an external memory device. The “tamperprotection” erase feature prevents loading a program into the onchip-encryption RAM via
the programming port and reading out the bytes.
The following other registers are also described in this chapter.
• Global Output Control Register (GOCR), which controls the behavior of the CLK,
STATUS, /WDT, and /BUFEN pins
• Global CPU Register (GCPU), which holds the identification number of the processor.
• Global Revision Register (GREV), which hold the revision number of the processor.
Chapter 4 System Management45
4.1.1 Block Diagram
Basic System Peripherals
Periodic Interrupt
(488 µs)
32 kHz Clock
Interrupt
Request
GCSR
Interrupt
Generation
Real-Time Clock
RTCxR
RTCCR
Watchdog
Timer
Secondary
Watchdog Timer
WDTCR
WDTTR
WDTCR
SWDTR
Interrupt
Request
Interrupt
Generation
Master Reset
/WDTOUT Pin
46Rabbit 5000 Microprocessor User’s Manual
4.1.2 Registers
Register Name
MnemonicI/O AddressR/W
Reset
Global Control/Status RegisterGCSR0x0000R/W11000000
Real-Time Clock Control RegisterRTCCR0x0001W00000000
Global Output Control RegisterGOCR0x000ER/W00000000
Global ROM Configuration RegisterGROM0x002CR0xx00000
Global RAM Configuration RegisterGRAM0x002DR0xx00000
Global CPU Configuration RegisterGCPU0x002ER0xx00010
Global Revision RegisterGREV0x002FR0xx00000
Battery-Backed Onchip-Encryption RAM Byte
00–1F
VRAM00–
VRAM1F
0x0600–0x061FR/Wxxxxxxxx
Chapter 4 System Management47
4.2 Dependencies
4.2.1 I/O Pins
The CLK, STATUS, /WDTOUT, and /BUFEN pins are controlled by GOCR. Each of
these pins can be used as general-purpose outputs by driving them high or low.
• The CLK pin can output the peripheral clock, the peripheral clock divided by two, or be
driven high or low.
• The STATUS pin can be active low during the first byte of each opcode fetch, active
low during an interrupt acknowledge, or driven high or low.
• The /WDTOUT pin can be active low whenever the watchdog timer resets the device or
driven low.
• The /BUFEN pin can be active low during external I/O cycles, active low during data
memory cycles, or driven high or low.
The values in the battery-backed onchip-encryption RAM bytes are cleared if the signal
on the SMODE pins changes state.
4.2.2 Clocks
The periodic interrupt, real-time clock, watchdog timer, and secondary watchdog timer
require the 32 kHz clock.
4.2.3 Interrupts
The periodic interrupt is enabled in GCSR, and will occur every 488 µs. It is cleared by
reading GCSR. It can operate at Priority 1, 2, or 3.
The secondary watchdog interrupt will occur whenever the secondary watchdog is
enabled and allowed to count down to zero. It is cleared by restarting the secondary watchdog by writing to WDTCR. The secondary watchdog interrupt always occurs at Priority 3.
48Rabbit 5000 Microprocessor User’s Manual
4.3 Operation
4.3.1 Periodic Interrupt
The following steps explain how a periodic interrupt is used.
1. Write the vector to the interrupt service routine to the internal interrupt table.
2. Enable the periodic interrupt by writing to GCSR.
3. The interrupt request is cleared by reading from GCSR.
A sample interrupt handler is shown below.
periodic_isr::
push af
ioi ld a, (GCSR) ; clear the interrupt request and get status
; handle any periodic tasks here
pop af
ipres
ret
4.3.2 Real-Time Clock
The real-time clock consists of six 8-bit registers that together comprise a 48-bit value.
The real-time clock is not synchronized to the read operation, so the least-significant bit
should be read twice and checked for matching values; if the two reads do not match, then
the real-time clock may have been updating during the read and should be read again.
Writing to RTC0R latches the current real-time clock value into the RTCxR holding registers, so the following sequence should be used to read the real-time clock.
1. Write any value to RTC0R and then read back a value from RTC0R.
2. Write a value to RTC0R again, and again read back a value from RTC0R.
3. If the two values do not match, repeat Step 2 until the last two readings are identical.
4. At this point, registers RTC1R through RTC6R can also be read and used.
Note that the periodic interrupt and the real-time clock are clocked by the same edge of the
32 kHz clock; if read from the periodic interrupt, the count is guaranteed to be stable and
only needs to be read once (assuming it occurs within one clock of the 32 kHz clock).
The real-time clock can be reset by writing the sequence 0x40 – 0x80 to RTCCR. It can be
reset and left in the byte increment mode by writing 0x40 – 0xC0 to RTCCR and then
writing bytes repeatedly to RTCCR to increment the appropriate bytes of the real-time
clock. The byte increment mode is disabled by writing 0x00 to RTCCR.
Chapter 4 System Management49
4.3.3 Watchdog Timer
The watchdog timer is enabled on reset with a 2-second timeout. Unless specific data are
written to WDTCR before that time expires, the processor will be reset. The watchdog
timer can be disabled by writing a sequence of two bytes to WDTTR as described in the
register description.
Table 4-1. Watchdog Timer Settings
WDTCR ValueEffect
0x5ARestart watchdog timer with 2-second timeout.
0x57Restart watchdog timer with 1-second timeout.
0x59Restart watchdog timer with 500-millisecond timeout.
0x53Restart watchdog timer with 250-millisecond timeout.
0x5FRestart the secondary watchdog timer.
The watchdog timer also contains a special test mode that speeds up the timeout period by
clocking it with the peripheral clock instead of the 32 kHz clock. This mode can be
enabled by writing to WDTTR.
4.3.4 Secondary Watchdog Timer
The secondary watchdog timer is disabled on reset. The following steps explain how to
use the secondary watchdog timer.
1. Write the vector to the interrupt service routine to the internal interrupt table.
2. Write the desired timeout period to SWDTR. This also enables the secondary watchdog
timer.
3. Restart the secondary watchdog timer by either writing the timeout period to SWDTR
or writing 0x5F to WDTCR.
If the secondary watchdog timer counts down to zero, a Priority 3 secondary watchdog
interrupt will occur. This interrupt request is cleared by writing a new timeout value to
SWDTR. A sample interrupt handler is shown below.
secwd_isr::
push af
; determine why the interrupt occurred and take appropriate action
ld a, 0x40 ; timeout period of 0x40/32kHz = 1.95ms
ioi ld (SWDTR), a ; clear the interrupt request
pop af
ipres
ret
50Rabbit 5000 Microprocessor User’s Manual
4.4 Register Descriptions
Global Control/Status Register(GCSR)(Address = 0x0000)
Bit(s)ValueDescription
7:600No reset or watchdog timer timeout since the last read.
(Read-
only)
50No effect on the periodic interrupt. This bit will always be read as zero.
4:2000
01The watchdog timer timed out. These bits are cleared by a read of this register.
10This bit combination is not possible.
11Reset occurred. These bits are cleared by a read of this register.
1Force a periodic interrupt to be pending.
Processor clock from the main clock, divided by eight.
Peripheral clock from the main clock, divided by eight.
001
010
011
100
101
Processor clock from the main clock, divided by eight.
Peripheral clock from the main clock.
Processor clock from the main clock.
Peripheral clock from the main clock.
Processor clock from the main clock, divided by two.
Peripheral clock from the main clock, divided by two.
Processor clock from the 32 kHz clock, optionally divided via GPSCR.
Peripheral clock from the 32 kHz clock, optionally divided via GPSCR.
Processor clock from the 32 kHz clock, optionally divided via GPSCR.
Peripheral clock from the 32 kHz clock, optionally divided via GPSCR.
The main clock is disabled.
110
111
1:000Periodic interrupts are disabled.
01Periodic interrupts use Interrupt Priority 1.
10Periodic interrupts use Interrupt Priority 2.
11Periodic interrupts use Interrupt Priority 3.
Chapter 4 System Management51
Processor clock from the main clock, divided by four.
Peripheral clock from the main clock, divided by four.
Processor clock from the main clock, divided by six.
Peripheral clock from the main clock, divided by six.
Real-Time Clock Control Register(RTCCR)(Address = 0x0001)
Bit(s)ValueDescription
7:00x00
No effect on the real-time clock counter, or disable the byte increment function,
or cancel the real-time clock reset command.
Arm the real-time clock for reset or byte increment. This command must be
0x40
written prior to either the real-time clock reset command or the first byte
increment write.
0x80
0xC0
Reset all six bytes of the real-time clock counter to 0x00. The reset must be
preceded by writing 0x40 to arm the reset function.
Reset all six bytes of the real-time clock counter to 0x00, and remain in byteincrement mode in preparation for setting the time.
7:601This bit combination must be used with every byte-increment write.
5:00No effect on the real-time clock counter.
1Increment the corresponding byte of the real-time clock counter.
Real-Time Clock x Register(RTC0R)(Address = 0x0002)
7:0ReadThe current value of the 48-bit real-time clock counter is returned.
Write
Writing to RTC0R transfers the current count of the real-time clock to a holding
register while the real-time clock continues counting.
Watchdog Timer Control Register(WDTCR)(Address = 0x0008)
Bit(s)ValueDescription
7:00x5ARestart the watchdog timer with a 2-second timeout period.
0x57Restart the watchdog timer with a 1-second timeout period.
0x59Restart the watchdog timer with a 500 ms timeout period.
0x53Restart the watchdog timer with a 250 ms timeout period.
0x5FRestart the secondary watchdog timer.
otherNo effect on watchdog timer or secondary watchdog timer.
52Rabbit 5000 Microprocessor User’s Manual
Watchdog Timer Test Register(WDTTR)(Address = 0x0009)
Bit(s)ValueDescription
7:00x51Clock the least significant byte of the watchdog timer from the peripheral clock.
0x52Clock the most significant byte of the watchdog timer from the peripheral clock.
0x53Clock both bytes of the watchdog timer, in parallel, from the peripheral clock.
Disable the watchdog timer. This value, by itself, does not disable the watchdog
0x54
timer. Only a sequence of two writes, where the first write is 0x51, 0x52, or
0x53, followed by a write of 0x54, actually disables the watchdog timer. The
watchdog timer will be re-enabled by any other write to this register.
otherNormal clocking (32 kHz clock) for the watchdog timer.
The time constant for the secondary watchdog timer is stored. This time constant
will take effect the next time that the secondary watchdog counter counts down
7:0
to zero. The timer counts modulo n + 1, where n is the programmed time constant.
The secondary watchdog timer can be disabled by writing the sequence 0x5A –
0x52 – 0x44 to this register.
Global ROM Configuration Register(GROM)(Address = 0x002C)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
(Read-
only)
1Ignore the SMODE pins program fetch function.
6:5ReadThese bits report the state of the SMODE pins.
4:000000ROM identifier for this version of the chip.
Global RAM Configuration Register(GRAM)(Address = 0x002D)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
(Read-
only)
1Ignore the SMODE pins program fetch function.
6:5ReadThese bits report the state of the SMODE pins.
4:000001RAM identifier for this version of the chip.
Chapter 4 System Management53
Global Output Control Register(GOCR)(Address = 0x000E)
Bit(s)ValueDescription
7:600CLK pin is driven with peripheral clock.
01CLK pin is driven with peripheral clock divided by 2.
10CLK pin is low.
11CLK pin is high.
5:400STATUS pin is active (low) during a first opcode byte fetch.
01STATUS pin is active (low) during an interrupt acknowledge.
10STATUS pin is low.
11STATUS pin is high.
3:200/WDTOUT pin functions normally.
01Enable /WDTOUT for test mode. Reserved for internal use only.
10/WDTOUT pin is low (1 cycle min, 2 cycles max, of 32 kHz).
11This bit combination is reserved and should not be used.
1:000/BUFEN pin is active (low) during external I/O cycles.
01/BUFEN pin is active (low) during data memory accesses.
10/BUFEN pin is low.
11/BUFEN pin is high.
Global CPU Register(GCPU)(Address = 0x002E)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
(Read-
only)
1Ignore the SMODE pins program fetch function.
6:5ReadThese bits report the state of the SMODE pins.
4:000011CPU identifier for this version of the chip.
Global Revision Register(GREV)(Address = 0x002F)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
(Read-
only)
1Ignore the SMODE pins program fetch function.
6:5ReadThese bits report the state of the SMODE pins.
4:000011CPU identifier for this version of the chip.
7:0General-purpose RAM locations. Cleared by Intrusion Detect conditions.
Chapter 4 System Management55
56Rabbit 5000 Microprocessor User’s Manual
5. MEMORY MANAGEMENT
5.1 Overview
The Rabbit 5000 supports both 8-bit and 16-bit external flash and SRAM devices; three
chip selects and two read/write-enable strobes allow up to six external devices to be
attached at once. The 8-bit mode allows 0, 1, 2, or 4 wait states to be specified for each
device, and the 16-bit mode allows 0 to 7 wait states depending on the settings. Both 8-bit
and 16-bit page-mode devices are also supported.
In addition, the Rabbit 5000 contains 128 KB of internal SRAM that resides on its own
chip select signal. It can be enabled in either 8- or 16-bit mode.
The Rabbit 5000’s physical memory space contains four consecutive banks, each of which
can be mapped to an individual chip-select/enable strobe pair. The banks can be set for
equal sizes ranging from 128 KB up to 4 MB, providing a total physical memory range
from 512 KB up to 16 MB. Figure 5-1 shows a sample configuration.
Chapter 5 Memory Management57
Either one or both of the two most significant address bits (which are used to select the
1MB
0x00000
0x40000
0x3FFFF
0x80000
0x7FFFF
0xC0000
0xBFFFF
0xFFFFF
Memory Bank 3
MB3CR = 0x86
Memory Bank 2
MB2CR = 0xC5
Memory Bank 1
MB1CR = 0xC0
Memory Bank 0
MB0CR = 0xC0
1 wait state
/CS2
/OE1
/WE1
0 wait states
/CS1
/OE1
/WE1
0 wait states
/CS0
/OE0
/WE0
512KB
Flash
256KB
SRAM
256KB
SRAM
quadrant) can be inverted, providing the ability to bank-switch other pages from a larger
memory device into the same memory bank.
Code is executed in the 64 KB logical memory space, which is divided into four segments:
root, data, stack, and XMEM. The root segment is mapped directly to physical address
0x000000, while the data and stack segments can be mapped to 4 KB boundaries anywhere in the physical space. The boundaries between the root and data segments and the
data and stack segments can be adjusted in 4 KB blocks as well.
The XMEM segment is a fixed 8 KB, and points to a physical memory address block
specified in the XPC register. It is possible to run code in the XMEM window, providing
an easy means of storing and executing code beyond the 64 KB logical memory space.
Special call and return instructions to physical addresses are provided that automatically
update the XPC register as necessary.
58Rabbit 5000 Microprocessor User’s Manual
Figure 5-1. Mapping Rabbit 5000 Physical Memory Space
Figure 5-2. Logical and Physical Memory Mapping
64 KB
16 MB
LOGICAL
ADDRESS MAP
PHYSICAL
ADDRESS MAP
ROOT
DATA
SEGMENT
STACK
SEGMENT
XPC
000000
FFFFFF
0000
FFFF
E000
x000
y000
SEGSIZE
REGISTER
(0x13) R/W
7 4 3 0
y
x
Chapter 5 Memory Management59
The Rabbit 2000 and 3000 had numerous instructions for reading and writing data to logical
Memory Bank
Control
Interrupt
Request
MMIDR
MECR
RAMSR
STKSEG*
DATSEG*
SEGSIZE
WPCR
WPxR
WPSyR
WPSyLR
WPSyHR
STKCR
STKzLR
MBxCR
MTCR
MACR
ACSxCR
Logical or
Physical
Access
Interrupt
Handler
Memory
Protection
MMU
/CSx
/WEx
/OEx
D[15:0]
A[23:0]
Physical
Address
addresses, but only had limited support for reading and writing data to a physical memory
address. In the Rabbit 4000, a wide range of instructions was provided to read and write to
physical addresses. The same instructions can be used to write to logical addresses. All of
these instructions are available in the Rabbit 5000.
The 64 KB logical memory space limitation can also be expanded by using the separate
instruction and data space mode. When this mode is enabled, address bit A16 is inverted
for all data accesses in the root and/or data segments, and address bit A19 is inverted for
all data accesses in the root and/or data segments before bank selection (physical device)
occurs. These two features allow both code and data to access separate 64 KB logical
spaces instead of sharing a single space.
It is possible to protect memory in the Rabbit 5000 at three different levels—each of the
memory banks can be made read-only, physical memory can be write-protected in 64 KB
blocks, and two of those 64 KB blocks can be protected with a granularity of 4 KB. A
Priority 3 interrupt will occur if a write is attempted in one of the protected 64 KB or 4 KB
blocks. In addition, it is possible to place limits around the code execution stack and generate
an interrupt if a stack-related write occurs within 16 bytes of those limits.
Memory Bank 0 Control RegisterMB0CR0x0014R/W00001000
Memory Bank 1 Control RegisterMB1CR0x0015R/Wxxxxxxxx
Memory Bank 2 Control RegisterMB2CR0x0016R/Wxxxxxxxx
Memory Bank 3 Control RegisterMB3CR0x0017R/Wxxxxxxxx
MMU Expanded Code RegisterMECR0x0018R/W00000000
Memory Timing Control RegisterMTCR0x0019R/W00000000
Memory Alternate Control RegisterMACR0x001DR/W00000000
Advanced /CS0 Control RegisterACS0CR0x0410R/W00000000
Advanced /CS1 Control RegisterACS1CR0x0411R/W00000000
Advanced /CS2 Control RegisterACS2CR0x0412R/W00000000
RAM Segment RegisterRAMSR0x0448R/W00000000
Write-Protect Control RegisterWPCR0x0440R/W00000000
Write-Protect x RegisterWPxR0x460+xW00000000
Write-Protect Segment A RegisterWPSAR0x0480W00000000
Write-Protect Segment A Low RegisterWPSALR0x0481W00000000
Write-Protect Segment A High RegisterWPSAHR0x0482W00000000
Write-Protect Segment B RegisterWPSBR0x0484W00000000
Write-Protect Segment B Low RegisterWPSBLR0x0485W00000000
Write-Protect Segment B High RegisterWPSBHR0x0486W00000000
Stack Limit Control RegisterSTKCR0x0444R/W00000000
Stack Low Limit RegisterSTKLLR0x0445Wxxxxxxxx
Stack High Limit RegisterSTKHLR0x0446Wxxxxxxxx
Chapter 5 Memory Management61
5.2 Dependencies
5.2.1 I/O Pins
There are three chip select pins, /CS0, /CS1, and /CS2; two read strobes, /OE0 and /OE1;
and two write strobes, /WE0 and /WE1. /CS3 is available to the internal SRAM only and
does not come out to a pin.
There are eight dedicated data bus pins, D0 through D7. If the 16-bit mode is enabled, then
PH0–PH7 automatically act as the upper byte of the data bus, D8 through D15.
There are 20 dedicated address pins, A0 through A19. Up to four more address pins can be
enabled on PE0–PE3, representing A20 through A23.
Pin PE4 can be enabled as /A0 to allow byte reads and writes in 16-bit SRAM devices.
5.2.2 Clocks
All memory operations are clocked by the processor clock.
5.2.3 Other Registers
RegisterFunction
PEFR, PEALR, PEAHR Enable A20-A23 and /A0.
5.2.4 Interrupts
When a write is attempted to a write-protected 64 KB or 4 KB block, a write-protection
violation interrupt is generated. The interrupt request is cleared when it is handled. The
write-protection violation interrupt vector is in the IIR at offset 0x090. It is always set to
Priority 3.
When a stack-related write is attempted to a region outside that set by the stack limit registers, a stack limit violation occurs. The interrupt request is cleared when it is handled. The
stack limit violation interrupt vector is in the IIR at offset 0x1B0. It is always set to Priority 3.
62Rabbit 5000 Microprocessor User’s Manual
5.3 Operation
5.3.1 Memory Management Unit (MMU)
Code execution takes place in the 64 KB logical memory space, which is divided into four
segments: root, data, stack, and extended (XMEM). The root segment is always mapped
starting at physical address 0x000000, but the other segments can be remapped to start at
any physical 4 KB block boundary.
The data and stack segment mappings are set by writing to the appropriate register, as shown
in Table 5-1. The DATASEG and STACKSEG registers provide backwards compatibility
to the Rabbit 2000 and 3000 processors; these registers map directly to DATASEGL and
STACKSEGL, but the contents of DATASEGH and STACKSEGH are set to zero.
Table 5-1. Memory Management Registers
RegisterSegmentSizeComments
DATASEGData8 bits
DATASEGLData8 bits—
DATASEGHData4 bits—
STACKSEGStack8 bits
STACKSEGLStack8 bits—
STACKSEGHStack4 bits—
XPCXMEM8 bits
LXPCXMEM12 bits
Maps to DATASEGL;
DATASEGH set to 0x00
Maps to STACKSEGL;
STACKSEGH set to 0x00
Loaded via instructions
LD XPC,A and LD A,XPC
Loaded via instructions:
LD LXPC,HL and LD HL,LXPC
Each of these registers provides a 4 KB offset that is added to the logical address to provide
a physical address as shown in Figure 5-3.
Chapter 5 Memory Management63
Figure 5-3. MMU Operation
0
DATASEG
16-bit logical address
20-bit physical address
0
+
16-bit logical address
+
DATASEGL
DATASEGH
16-bit logical address
+
0
16-bit logical address
20-bit physical address
0
+
STKSEGSTKSEGL
24-bit physical address
24-bit physical address
STKSEGH
16-bit logical address
+
24-bit physical address
0
16-bit logical address
20-bit physical address
0
+
XPC
LXPC
5.3.2 Memory Bank Operation
On startup the Rabbit 5000 checks the status of the SYSCFG pins. To provide support for
external memory, both SYSCFG pins should be set low and Memory Bank 0 enabled to
use /CS0, /OE0, and /WE0 in 8-bit mode with four wait states and write protection
enabled. It is expected that an external flash device containing startup code is attached to
those strobes. The other memory banks come up undefined and their controls should be set
via the appropriate MBxCR register to a valid setting before use.
If SYSCFG0 is high and SYSCFG1 is low, Memory Bank 0 is enabled to use /CS3, /OE0,
and /WE0 in 16-bit mode. This allows the processor to start operation directly out of the
internal SRAM.
The size of the memory banks is defined in the MECR register. The default size is 256 KB
(the bank selection looks at the two most significant address bits), but this value can be
adjusted down to 128 KB or up to 4 MB per bank.
64Rabbit 5000 Microprocessor User’s Manual
The two address bits used to select the bank can be inverted in MBxCR, which enables
0x00000
0x40000
0x3FFFF
0x80000
0x7FFFF
0xC0000
0xBFFFF
0xFFFFF
1MB
Memory
Device
A18, A19 normal
Memory
Bank 0
Memory
Bank 1
.
.
.
0x00000
0x40000
0x3FFFF
0x80000
0x7FFFF
0xC0000
0xBFFFF
0xFFFFF
1MB
Memory
Device
A18 normal,
A19 inverted
Memory
Bank 0
Memory
Bank 1
.
.
.
0x00000
0x40000
0x3FFFF
0x00000
0x40000
0x3FFFF
mapping different sections of a memory device larger than the current memory bank into
memory. Figure 5-4 shows an example of this feature.
Figure 5-4. Mapping Different Sections of a Memory Device
Larger Than the Current Memory Bank
It is possible to extend the timing of the /OE and/or /WE strobes by one half of a clock.
This provides slightly longer strobes for slower memories; see the timing diagrams in
Chapter 31. These options are available in MTCR.
It is possible to force /CS1 to be always active in MMIDR; enabling this will cause conflicts
only if a device shares a /OE or /WE strobe with another device. This option allows faster
access to particular memory devices.
Chapter 5 Memory Management65
5.3.3 Memory Modes
The Rabbit 5000 supports both 8-bit and 16-bit memories on all chip selects, including the
internal SRAM. It also provides support for page-mode devices. The mode for each chip
select is set in MACR; 8-bit mode is the default for all chip selects.
When in basic 8-bit mode, the wait states are selected in the memory bank registers,
MBxCR; the options are 0, 1, 2, or 4 wait states. Note that this may put an upper bound on
the processor clock speed, depending on the access time of your 8-bit memory device.
When in 16-bit or page-mode (either 8- or 16-bit), the wait states are selected by both the
MBxCR and the advanced chip select registers, ACSxCR.
When the 16-bit mode is enabled, Parallel Port H is used for the high byte of the data, and
is configured automatically for this operation, overriding any other Parallel Port H function.
Table 5-2. Memory Modes
Mode
8-bitYesNoNoMBxCR0, 1, 2, 4
16-bitSelectableYesYes
8-bit Page ModeYesNoNo
16-bit Page ModeSelectableYesYes
Byte
Writes?
Word
Reads?
Word
Writes?
Wait State
Register
MBxCR
ACSxCR
MBxCR
ACSxCR
MBxCR
ACSxCR
Wait State
Options
0–11
0–11 first access,
0–7 page accesses
0–11 first access,
0–7 page accesses
A 16-bit memory device may or may not support byte writes, so there is an option to select
between these two cases in ACSxCR. With the default option any byte writes or unaligned
word writes to a 16-bit memory will be suppressed (i.e., the /WE will not be asserted).
Any aligned word reads or writes are recognized internally and are combined into just one
write transaction on the external bus. The other option for the 16-bit bus does not inhibit
byte writes or unaligned word writes, and replicates the byte data on both halves of the
data bus in these cases. In this mode the A0 and /A0 signals must be used by the memory
to enable the individual bytes.
Table 5-3. A0 and /A0 Signals for Various Transaction Types
Transaction TypeA0/A0
Word Read (prefetch only)LowLow
Word WriteLowLow
Byte Read or Write — Even AddressLowHigh
Byte Read or Write — Odd AddressHighLow
66Rabbit 5000 Microprocessor User’s Manual
All of the power-saving modes in Chapter 29 can be used with the 16-bit mode.
The second advanced bus mode is the Page Mode. This mode also can be enabled for any
external chip select, and can be used with either 8-bit or 16-bit memories connected to
these chip selects. Page-Mode memories provide for a faster access time if the requested
data are in the same page as the previous data. In the Rabbit 5000 (and most memory
devices) a page can be selected as either 8 or 16 bytes. Thus, if an address is identical to
the previous address except in the lower four bits, the access time is assumed to be faster.
These wait-state options are also controlled in the ACSxCR.
In Page Mode the chip select and /OE remain active from one page access to the next, and
only the three or four least-significant bits of the address change to request the new data.
This obviously interferes with a number of the power-saving modes and will take precedence over them for chip select accesses, as appropriate. The power-saving modes will
still apply to the other chip select and output-enable signals. The logic recognizes which
/OE is being used with each chip select in the Page Mode.
As mentioned previously, the ACSxCR registers each contain three fields to control the
generation of wait states in the advanced bus modes. These settings are in addition to the
wait-state setting in MBxCR when an advanced bus mode is enabled. When the 16-bit bus
is enabled, one to seven automatic wait states for memory read bus cycles can be enabled
in addition to the zero to four wait states in MBxCR. This setting is also used for the first
access when the Page Mode is enabled; a second setting selects the number of wait states
for all subsequent reads in the Page Mode, allowing from zero to three automatic wait
states for the same-page accesses in the Page Mode. The choices available for the
advanced bus wait states are sufficient to allow interfacing to a variety of standard memories for any Rabbit 5000 speed grade.
When a 16-bit memory is connected to /CS0, the first few instructions must program the
device to operate in 16-bit mode. This code is shown below. This code should be the first
thing executed by your device. Because the processor is fetching bytes from a 16-bit
memory device that is not connected to A0, only one-byte instructions can be used, and
they must occur in pairs.
ORG0000h
XORA ; a <= 00000000
XORA
LD H, A ; h <= 00000000
LD H, A
SCF
SCF
RLA; a <= 00000001
RLA; a <= 00000010
LD B, A ; b <= 00000010
LD B, A
SCF
SCF
ADCA, B ; a <= 00000101
ADCA, B ; a <= 00000111
ADDA, A ; a <= 00001110
Chapter 5 Memory Management67
ADDA, A ; a <= 00011100
SCF
SCF
ADCA, H ; a <= 00011101
ADCA, H
LD L, A ; l <= 00011101
LD L, A
IOI ; two IOIs same as one
IOI
LD(HL), B; MACR <= 00000010
LD(HL), B; dummy memory write (no /WE)
NOP ; required delay to start
NOP ; up the 16-bit bus
5.3.4 Separate Instruction and Data Space
To make better use of the 64 KB of logical space, an option is provided to map code and
data accesses in the same address space to separate devices. This is accomplished by
enabling the inversion of A16 and the most-significant bit of the bank select bits for accesses
in the root and data segments. Careful use of these features allows both code and data to
separately use up to 64 KB of logical memory.
The RAM segment register (RAMSR) provides a shortcut for updating code by accessing
it as data. It provides a “window” that uses the instruction address decoding when read or
written as data. This mapping will only occur when the RAMSR is within the root or data
segments; the RAMSR will be ignored if it is mapped to the stack segment or XPC
window.
The Rabbit 5000 Designer’s Handbook provides further details on the use of the separate
instruction and data space feature.
5.3.5 Memory Protection
Memory blocks may be protected at three separate granularities, as shown in Table 5-4.
Writes can be prevented to any memory bank by writing to MBxCR. Writes can be prevented and trapped at a resolution of 64 KB by enabling protection for that block in the
appropriate WPxR register. For further control, two of those 64 KB blocks can be further
subdivided into 4 KB blocks by selecting them as the write protect segments A or B.
When a write is attempted to a block protected in WPxR, WPSxLR, or WPSxHR, a
Priority 3 write-protect interrupt occurs. This feature is automatically enabled by writing to
the block protection registers; to disable it, set all the write-protect block registers to zero.
The Rabbit 5000 provides stack overflow and underflow protection. Low and high logical
address limits can be set in STKLLR and STKHLR; a Priority 3 stack-violation interrupt
occurs when a stack-based write occurs within the 16 bytes below the upper limit or
within the 16 bytes above the lower limit. Note that the writes will still occur even if they
are within the 16 bytes surrounding the limits, but the interrupt can serve as a warning to
the application that the stack is in danger of being over or underrun.
The stack checking can be enabled or disabled by writing to STKCR.
Internal I/O addresses are decoded using only the lower eight bits of the internal
70
1
6This bit is reserved an must be written with zero.
I/O address bus. This restricts internal I/O addresses to the range 0x0000–
0x00FF.
Internal I/O addresses are decoded using all 15 bits of the address internal I/O
address bus. This option must be selected to access internal I/O addresses of
0x0100 and higher.
50
1
40Normal /CS1 operation.
1
30Normal operation.
1
20Normal operation.
1For a data segment access, invert A16
10Normal operation.
1
00Normal operation.
Enable A16 and bank select address MSB inversion independent of
instruction/data.
Enable A16 and bank select address MSB inversion for data accesses only. This
enables the instruction/data split.
Force /CS1 always active. This will not cause any conflicts as long as the
memory using /CS1 does not also share an output enable or write enable with
another memory.
For a data segment access, invert bank select address MSB before MBxCR
decision.
For a root segment access, invert bank select address MSB before MBxCR
decision.
7:00Disable write protection for the corresponding 64 KB segment.
Enable write protection for the corresponding 64 KB segment. The eight-bit
1
address of the segment to be write-protected is formed using bits [4:0] of the
WPxR register address concatenated with the bit address of the corresponding bit
in the register.
Chapter 5 Memory Management77
Write-Protect Segment x Register(WPSAR)(Address = 0x0480)
(WPSBR)(Address = 0x0484)
Bit(s)ValueDescription
7:0
When these eight bits [23:16] match bits of the physical address, write-protect
that 64 KB range in 4 KB increments using WPSxLR and WPSxHR.
Write-Protect Segment x Low Register(WPSALR)(Address = 0x0481)
(WPSBLR)(Address = 0x0485)
Bit(s)ValueDescription
70Disable 4 KB write protect for relative address 0x7000–0x7FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x7000–0x7FFF in WP Segment x.
60Disable 4 KB write protect for relative address 0x6000–0x6FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x6000–0x6FFF in WP Segment x.
50Disable 4 KB write protect for relative address 0x5000–0x5FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x5000–0x5FFF in WP Segment x.
40Disable 4 KB write protect for relative address 0x4000–0x4FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x4000–0x4FFF in WP Segment x.
30Disable 4 KB write protect for relative address 0x3000–0x3FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x3000–0x3FFF in WP Segment x.
20Disable 4 KB write protect for relative address 0x2000–0x2FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x2000–0x2FFF in WP Segment x.
10Disable 4 KB write protect for relative address 0x1000–0x1FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x1000–0x1FFF in WP Segment x.
00Disable 4 KB write protect for relative address 0x0000–0x0FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x0000–0x0FFF in WP Segment x.
78Rabbit 5000 Microprocessor User’s Manual
Write-Protect Segment x High Register(WPSAHR)(Address = 0x0482)
(WPSBHR)(Address = 0x0486)
Bit(s)ValueDescription
70Disable 4 KB write protect for relative address 0xF000–0xFFFF in WP Segment x.
1Enable 4 KB write protect for relative address 0xF000–0xFFFF in WP Segment x.
60Disable 4 KB write protect for relative address 0xE000–0xEFFF in WP Segment x.
1Enable 4 KB write protect for relative address 0xE000–0xEFFF in WP Segment x.
50Disable 4 KB write protect for relative address 0xD000–0xDFFF in WP Segment x.
1Enable 4 KB write protect for relative address 0xD000–0xDFFF in WP Segment x.
40Disable 4 KB write protect for relative address 0xC000–0xCFFF in WP Segment x.
1Enable 4 KB write protect for relative address 0xC000–0xCFFF in WP Segment x.
30Disable 4 KB write protect for relative address 0xB000–0xBFFF in WP Segment x.
1Enable 4 KB write protect for relative address 0xB000–0xBFFF in WP Segment x.
20Disable 4 KB write protect for relative address 0xA000–0xAFFF in WP Segment x.
1Enable 4 KB write protect for relative address 0xA000–0xAFFF in WP Segment x.
10Disable 4 KB write protect for relative address 0x9000–0x9FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x9000–0x9FFF in WP Segment x.
00Disable 4 KB write protect for relative address 0x8000–0x8FFF in WP Segment x.
1Enable 4 KB write protect for relative address 0x8000–0x8FFF in WP Segment x.
Stack Limit Control Register(STKCR)(Address = 0x0444)
Bit(s)ValueDescription
7:1These bits are reserved and should be written with zeros.
Lower limit for stack-limit checking. If a stack operation or stack-relative
7:0
memory access is attempted at an address less than {STKLLR, 0x10}, a stacklimit violation interrupt is generated.
Chapter 5 Memory Management79
Stack High Limit Register(STKHLR)(Address = 0x0446)
Bit(s)ValueDescription
Upper limit for stack-limit checking. If a stack operation or stack-relative
7:0
memory access is attempted at an address greater than {STKHLR, 0xEF}, a
stack-limit violation interrupt is generated.
80Rabbit 5000 Microprocessor User’s Manual
6. INTERRUPTS
6.1 Overview
The Rabbit 5000 can operate at one of four priority levels, 0–3, with Priority 0 being the
expected standard operating level. The current priority and up to three previous priority
levels are kept in the processor’s 8-bit IP register, where bits 0–1 contain the current
priority. Every time an interrupt is handled or an IPSET instruction occurs, the value in the
register is shifted left by two bits, and the new priority placed in bits 0–1. When an IPRES
or IRET instruction occurs, the value in IP is shifted right by two bits (bits 0–1 are shifted
into bits 6–7). On reset, the processor starts at Priority 3.
Most interrupts can be set to be Priority 1–3. A pending interrupt will be handled only if
its interrupt priority is greater than the current processor priority. This means that even a
Priority 3 interrupt can be blocked if the processor is currently at Priority 3. The System
Mode Violation, Stack Limit Violation, Write Protection Violation, secondary watchdog,
and breakpoint interrupts are always enabled at Priority 3. In addition, when the System/
User Mode is enabled and the processor is in the User Mode, the processor will not actually enter Priority 3; any attempt to enter Priority 3 will actually be requested as Priority 2.
When an interrupt is handled, a call is executed to a fixed location in the interrupt vector
tables. This operation requires 11 clocks, the minimum interrupt latency for the Rabbit
5000. There are two vector tables, the internal and the external interrupt vector tables, that
can be located anywhere in logical memory by setting the processor’s IIR and EIR registers.
The IIR and EIR registers hold the upper byte of each table’s address. For example, if IIR
is loaded with 0xC4, then the internal interrupt vector table will start at the logical memory
address 0xC400.
The internal interrupt vector table occupies 512 bytes, and the external interrupt vector
table is 256 bytes in size. Since the RST and SYSCALL vectors use all eight bits of the
IIR for addressing, the lowermost bit of IIR should always be set to zero so to keep some
vectors from inadvertently overlapping.
Each interrupt’s vector begins on a 16-byte boundary inside the vector tables. It may be
possible to fit a small routine into that space, but it is typical to place a call to a separate
routine in that location.
Some Rabbit 5000 instructions are “chained atomic,” which means that an interrupt cannot
occur between that instruction and the following instruction. These instructions are useful
for doing things like exiting interrupt handlers properly or updating semaphores.
Chapter 6 Interrupts81
6.2 Operation
To ensure proper operation, all interrupt handler routines should be written according to
the following guidelines.
• Push all registers to be used by the routine onto the stack before use, and pop them off
the stack before returning from the ISR.
• Keep the ISR as short and fast as possible. The use of assembly code is strongly recom-
mended.
• If the ISR will run for some time, lower the interrupt priority as soon as possible within
the ISR to allow other interrupts to occur.
• A number of special rules apply to interrupts when operating in the system/user mode;
please see the appropriate chapter for more details.
6.3 Interrupt Tables
Table 6-1 shows the structure of the internal interrupt vector table. The first column is the
vector address offset within the table. The second column shows the vectors in the first
256 bytes of the table, and the third column shows the vectors in the second 256 bytes.
There is a priority among interrupts if multiple requests are pending, as shown in Table 6-3.
Interrupts marked as “cleared automatically” have their requests cleared when the interrupt is first handled.
Chapter 6 Interrupts83
Table 6-3. Interrupt Priorities
PriorityInterrupt SourceAction Required to Clear the Interrupt
HighestBreakpointRead the status from BDCR.
System Mode Violation Cleared automatically.
Stack Limit Violation Cleared automatically.
Write Protection Violation Cleared automatically.
Secondary WatchdogRestart secondary watchdog by writing to WDTCR.
External Interrupt 1 Cleared automatically.
External Interrupt 0 Cleared automatically.
Periodic InterruptRead the status from GCSR.
Quadrature DecoderRead the status from QDCSR.
Timer BRead the status from TBCSR.
Timer ARead the status from TACSR.
Input CaptureRead the status from ICCSR.
PWMWrite any PWM register.
Timer CRead the status from TCCSR.
Slave Port
Rd: Read from SPD0R, SPD1R or SPD2R.
Wr: Write to SPD0R, SPD1R, SPD2R or dummy write to SPSR.
DMA 7 Cleared automatically.
DMA 6 Cleared automatically.
DMA 5 Cleared automatically.
DMA 4 Cleared automatically.
DMA 3 Cleared automatically.
DMA 2 Cleared automatically.
DMA 1 Cleared automatically.
DMA 0 Cleared automatically.
Network Port B/CRead interrupt status from NBCSR or NCCSR.
Serial Port E
Serial Port F
Serial Port A
Serial Port B
Rx: Read from SEDR or SEAR.
Tx: Write to SEDR, SEAR, SELR or dummy write to SESR.
Rx: Read from SFDR or SFAR.
Tx: Write to SFDR, SFAR, SFLR or dummy write to SFSR.
Rx: Read from SADR or SAAR.
Tx: Write to SADR, SAAR, SALR or dummy write to SASR.
Rx: Read from SBDR or SBAR.
Tx: Write to SBDR, SBAR, SBLR or dummy write to SBSR.
Serial Port C
LowestSerial Port D
84Rabbit 5000 Microprocessor User’s Manual
Rx: Read from SCDR or SCAR.
Tx: Write to SCDR, SCAR, SCLR or dummy write to SCSR.
Rx: Read from SDDR or SDAR.
Tx: Write to SDDR, SDAR, SDLR or dummy write to SDSR.
7. EXTERNAL INTERRUPTS
External Interrupts
Enable and
Edge Detection
PD0
External
Interrupt 0
Request
Enable and
Edge Detection
Enable and
Edge Detection
Interupt 0
Generation
PE0
PE4
Enable and
Edge Detection
Enable and
Edge Detection
Enable and
Edge Detection
PD1
PE1
PE5
Interrupt 1
Generation
External
Interrupt 1
Request
I0CR
I1CR
I0CR
I1CR
7.1 Overview
The Rabbit 5000 has six external interrupts available, and they share two interrupt vectors.
In the case of multiple interrupts sharing an interrupt vector, the data register corresponding to the parallel port(s) being used can be read. Each interrupt vector can be set to trigger
on a rising edge, a falling edge, or either edge.
The signal on the external interrupt pin must be present for at least three peripheral clock
cycles to be detected. In addition, the Rabbit 5000 has a minimum latency of 11 clocks to
respond to an interrupt, so the minimum external interrupt response time is three peripheral clock cycles plus 11 processor clock cycles.
7.2 Block Diagram
Chapter 7 External Interrupts85
7.2.1 Registers
Register NameMnemonicI/O AddressR/WReset
Interrupt 0 Control RegisterI0CR0x0098R/Wxx000000
Interrupt 1 Control RegisterI1CR0x0099R/Wxx000000
7.3 Dependencies
7.3.1 I/O Pins
The external interrupts can be enabled on pins PD0, PD1, PE0, PE1, PE4, and PE5. Each
pin is associated with a particular interrupt vector as shown in Table 7-1 below.
Table 7-1. Rabbit 5000 Interrupt Vectors
VectorRegisterPins
Interrupt 0I0CRPD0, PE0, PE4
Interrupt 1I1CRPD1, PE1, PE5
7.3.2 Clocks
The external interrupts are controlled by the peripheral clock. A pulse must be present for
at least three peripheral clock cycles to trigger an interrupt.
7.3.3 Interrupts
An external interrupt is generated whenever the selected edge occurs on an enabled pin.
The interrupt request is automatically cleared when the interrupt is handled.
The external interrupt vectors are in the EIR at offsets 0x000 and 0x010. They can be set
as Priority 1, 2, or 3 in the appropriate IxCR.
7.4 Operation
The following steps must be taken to enable the external interrupts.
1. Write the vector(s) to the interrupt service routine to the external interrupt table.
2. Configure IxCR to select which pins are enabled for external interrupts, what edges are
detected on each pin, and the interrupt priority.
3. When an interrupt occurs, read PDDR and/or PEDR to determine which pin has a signal if more than one pin is enabled for a given external interrupt.
86Rabbit 5000 Microprocessor User’s Manual
7.4.1 Example ISR
A sample interrupt handler is shown below.
extInt_isr::
; respond to external interrupt here
; interrupt is automatically cleared by interrupt acknowledge
ipres
ret
Chapter 7 External Interrupts87
7.5 Register Descriptions
Interrupt x Control Register(I0CR)(Address = 0x0098)
(I1CR)(Address = 0x0099)
Bit(s)ValueDescription
7:600Parallel Port D low nibble interrupt disabled.
01Parallel Port D low nibble interrupt on falling edge.
10Parallel Port D low nibble interrupt on rising edge.
11Parallel Port D low nibble interrupt on both edges.
5:400Parallel Port E high nibble interrupt disabled.
01Parallel Port E high nibble interrupt on falling edge.
10Parallel Port E high nibble interrupt on rising edge.
11Parallel Port E high nibble interrupt on both edges.
3:200Parallel Port E low nibble interrupt disabled.
01Parallel Port E low nibble interrupt on falling edge.
10Parallel Port E low nibble interrupt on rising edge.
11Parallel Port E low nibble interrupt on both edges.
Parallel Port A is a byte-wide port that can be used as an input or an output port. Parallel
Port A is also used as the data bus for the slave port and external I/O bus. The Slave Port
Control Register (SPCR) is used to configure how Parallel Port A is used. Parallel Port A
is an input at startup or reset. If the SMODE pins have selected the slave port bootstrap
mode, Parallel Port A will be the slave port data bus until disabled by the processor. Parallel
Port A can also be used as an external I/O data bus to isolate external I/O from the main
data bus.
Table 8-1. Parallel Port A Pin Alternate Output Functions
Pin Name
PA[7:0]SD[7:0]ID[7:0]
Slave Port
Data Bus
External I/O
Bus
8.1.1 Block Diagram
8.1.2 Registers
Port A Data RegisterPADR0x0030R/Wxxxxxxxx
Register NameMnemonicI/O AddressR/WReset
Chapter 8 Parallel Port A89
8.2 Dependencies
8.2.1 I/O Pins
Parallel Port A uses pins PA0 through PA7. These pins can be used as follows.
• General-purpose 8-bit data input (write 0x080 to SPCR)
• General-purpose 8-bit data output (write 0x084 to SPCR)
• Slave port data bus (write 0x088 to SPCR)
• External I/O data bus (write 0x08C to SPCR)
All Parallel Port A bits are inputs at startup or reset.
See the associated peripheral chapters for details on how they use Parallel Port A.
8.2.2 Clocks
Any outputs on Parallel Port A are clocked by the peripheral clock.
8.2.3 Other Registers
RegisterFunction
SPCRUsed to set up Parallel Port A.
8.2.4 Interrupts
There are no interrupts associated with Parallel Port A, except when the slave port is being
used.
8.3 Operation
The following steps explain how to set up Parallel Port A.
1. Select the desired mode using SPCR.
2. If the slave port or external I/O bus is selected, refer to the chapters for those peripherals for further setup.
Once Parallel Port A is set up, data can be read or written by accessing PADR. Note that
Parallel Port A is not available for general-purpose I/O while the slave port or the external
I/O bus is selected. Selecting these options for Parallel Port A affects Parallel Port B
because Parallel Port B is then used for address and control signals.
90Rabbit 5000 Microprocessor User’s Manual
8.4 Register Descriptions
Parallel Port A Data Register(PADR)(Address = 0x0030)
Bit(s)ValueDescription
7:0ReadThe current state of Parallel Port A pins PA7–PA0 is reported.
Write
Slave Port Control Register(SPCR)(Address = 0x0024)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
1Ignore the SMODE pins program fetch function.
6:5readThese bits report the state of the SMODE pins.
writeThese bits are ignored and should be written with zero.
4:2000Disable the slave port. Parallel Port A is a byte-wide input port.
001Disable the slave port. Parallel Port A is a byte-wide output port.
010Enable the slave port, with /SCS from Parallel Port E bit 7.
011
100This bit combination is reserved and should not be used.
The Parallel Port A buffer is written with this value for transfer to the Parallel
Port A output register on the next rising edge of the peripheral clock.
Enable the external I/O bus. Parallel Port A is used for the data bus and Parallel
Port B[7:2] is used for the address bus.
101This bit combination is reserved and should not be used.
110Enable the slave port, with /SCS from Parallel Port B bit 6.
111
1:000Slave port interrupts are disabled.
01Slave port interrupts use Interrupt Priority 1.
10Slave port interrupts use Interrupt Priority 2.
11Slave port interrupts use Interrupt Priority 3.
Chapter 8 Parallel Port A91
Enable the external I/O bus. Parallel Port A is used for the data bus and Parallel
Port B[7:0] is used for the address bus.
92Rabbit 5000 Microprocessor User’s Manual
9. PARALLEL PORT B
9.1 Overview
Parallel Port B is a byte-wide port with each bit programmable for direction. The Parallel
Port B pins are also used to access other peripherals on the chip—the slave port, the
auxiliary I/O address bus, and clock I/O for clocked serial mode option for Serial Ports A
and B. The Slave Port Control Register (SPCR) is used to configure how Parallel Port B is
used when selecting the slave port or the external I/O bus modes.
When the slave port is enabled, either under program control or during parallel bootstrap,
Parallel Port B pins carry the Slave Attention output signal, and the Slave Read strobe, Slave
Write strobe, and Slave Address inputs. The Slave Chip Select can also be programmed to
come from a Parallel Port B pin.
When the external I/O bus option is enabled, either six or eight pins carry the external I/O
address signals selected in SPCR.
Two pins are used for the clocks for Serial Ports A and B when they are configured for the
clocked serial mode. These two inputs can be used as clock outputs for these ports if
selected in the respective serial port control registers. Note that the clocked serial output
clock selection overrides all other programming for the two relevant Parallel Port B pins.
Table 9-1. Parallel Port B Pin Alternate Output Functions
Pin NameSlave Port
PB7/SLVATTN—IA5
PB6/SCS—IA4
PB5SA1—IA3
PB4SA0—IA2
PB3/SRD—IA1
PB2/SWR—IA0
PB1—SCLKAIA7
PB0—SCLKBIA6
Chapter 9 Parallel Port B93
Serial Ports
A–D
External I/O
Bus
9.1.1 Block Diagram
Parallel Port B
SPCR
PBDDR
SACR
SBCR
PBDR
Data
7:0
7:2
1:0
External I/O
Address
Serial Ports A & B
Clocks
SA1, SA0, /SLAVATT N
/SCS, /SRD, /SWR
7:2, 7:0
9.1.2 Registers
Register NameMnemonicI/O AddressR/WReset
Port B Data RegisterPBDR0x0040R/W00xxxxxx
Port B Data Direction RegisterPBDDR0x0047R/W11000000
9.2 Dependencies
9.2.1 I/O Pins
Parallel Port B uses pins PB0 through PB7. These pins can be used individually as data
inputs or outputs; as the address bits for the external I/O bus; as control signals for the
slave port; or as clocks for Serial Ports A and B.
On startup, bits 6 and 7 are outputs set low for backwards compatibility with the Rabbit
2000. All other pins are inputs.
Note that when the external I/O bus or slave port is enabled in SPCR, the Parallel Port B
pins associated with those peripherals perform those actions, no matter what the settings
are in PBDR or PBDDR. See the associated peripheral chapters for details on how they
use Parallel Port B.
9.2.2 Clocks
All outputs on Parallel Port B are clocked by the peripheral clock (perclk).
9.2.3 Other Registers
94Rabbit 5000 Microprocessor User’s Manual
SPCR
RegisterFunction
Sets the Parallel Port B function for some pins if the
slave port or external I/O bus is enabled.
9.2.4 Interrupts
There are no interrupts associated with Parallel Port B, except when the slave port is being
used.
9.3 Operation
The following steps must be taken before using Parallel Port B.
1. Select the desired input/output direction for each pin via PBDDR. Note that this setting
is superseded for some pins if the slave port or external I/O bus is enabled in SPCR or if
the clocked serial mode is enabled for Serial Ports A or B.
2. If the slave port or the external I/O bus is selected, refer to the chapters for those
peripherals for further setup information.
Once the port is set up, data can be read or written by accessing PBDR. The value in
PBDR of an output pin will reflect its current output value, but any value written to an
input pin will not appear on that pin until that pin becomes an output.
9.4 Register Descriptions
Parallel Port B Data Register(PBDR)(Address = 0x0040)
Bit(s)ValueDescription
7:0ReadThe current state of Parallel Port B pins PB7–PB0 is reported.
Write
Parallel Port B Data Direction Register(PBDDR)(Address = 0x0047)
Bit(s)ValueDescription
7:00The corresponding port bit is an input.
1The corresponding port bit is an output.
The Parallel Port B buffer is written with this value for transfer to the Parallel
Port B output register on the next rising edge of the peripheral clock.
Chapter 9 Parallel Port B95
Slave Port Control Register(SPCR)(Address = 0x0024)
Bit(s)ValueDescription
70Program fetch as a function of the SMODE pins.
1Ignore the SMODE pins program fetch function.
6:5ReadThese bits report the state of the SMODE pins.
WriteThese bits are ignored and should be written with zero.
4:2000Disable the slave port. Parallel Port A is a byte-wide input port.
001Disable the slave port. Parallel Port A is a byte-wide output port.
010Enable the slave port, with /SCS from Parallel Port E bit 7.
011
Enable the external I/O bus. Parallel Port A is used for the data bus and Parallel
Port B[7:2] is used for the address bus.
100This bit combination is reserved and should not be used.
101This bit combination is reserved and should not be used.
110Enable the slave port, with /SCS from Parallel Port B bit 6.
111
Enable the external I/O bus. Parallel Port A is used for the data bus and Parallel
Port B[7:0] is used for the address bus.
1:000Slave port interrupts are disabled.
01Slave port interrupts use Interrupt Priority 1.
10Slave port interrupts use Interrupt Priority 2.
11Slave port interrupts use Interrupt Priority 3.
96Rabbit 5000 Microprocessor User’s Manual
10. PARALLEL PORT C
10.1 Overview
Parallel Port C is a byte-wide port with each bit programmable for data direction and drive
level. These are simple inputs and outputs controlled and reported in the Port C Data Register (PCDR).
All the Parallel Port C pins have alternate output functions, and most of them can be used
as inputs to various on-chip peripherals.
Table 10-1. Parallel Port C Pin Alternate Output Functions
Pin NameAlt Out 0Alt Out 1Alt Out 2Alt Out 3
PC7TXAI7PWM3SCLKC
PC6TXAI6PWM2TXE
PC5TXBI5PWM1RCLKE
PC4TXBI4PWM0TCLKE
PC3TXCI3TIMER C3SCLKD
PC2TXCI2TIMER C2TXF
PC1TXDI1TIMER C1RCLKF
PC0TXDI0TIMER C0TCLKF
Table 10-2. Parallel Port C Pin Alternate Input Functions
Pin NameInput Capture
PC7
PC6———
PC5
PC4——TCLKE
PC3
PC2———
PC1
PC0——TCLKF
×
×
×
×
Serial Ports
A–D
RXARXE
RXBRCLKE
RXCRXF
RXDRCLKF
Serial Ports
E–F
Chapter 10 Parallel Port C97
After reset, the default condition for Parallel Port C is four outputs (the even-numbered
Parallel Port C
PCFR
PCALR
PCAHR
PCDDR
PCDCR
PCDR
Data
7:0
7:4
External I/O
Strobes
Serial Ports AF
Tx, Rx, Clocks
PWM Output
Timer C Output
Input Capture
7:0
7:0
3:0
7, 5, 3, 1
bits) and four inputs (the odd-numbered bits). For compatibility with the Rabbit 2000 and
the Rabbit 3000 microprocessors, these outputs are driven with a logic zero (low) on PC6
and a logic one (high) on PC4, PC2, and PC0. When PCDR is read, the value of the voltage on the pin is returned. If the pin is an output, the value it is set to is returned.
10.1.1 Block Diagram
10.1.2 Registers
Register NameMnemonicI/O AddressR/WReset
Port C Data RegisterPCDR0x0050R/W00010101
Port C Data Direction RegisterPCDDR0x0051R/W01010101
Port C Alternate Low RegisterPCALR0x0052R/W00000000
Port C Alternate High RegisterPCAHR0x0053R/W00000000
Port C Drive Control RegisterPCDCR0x0054R/W00000000
Port C Function RegisterPCFR0x0055R/W00000000
98Rabbit 5000 Microprocessor User’s Manual
10.2 Dependencies
10.2.1 I/O Pins
Parallel Port C uses pins PC0 through PC7. These pins can be used individually as data
inputs or outputs; as serial port transmit and receive for Serial ports A–F; as clocks for
Serial Ports C–F; as external I/O strobes; or as outputs for the PWM and Timer C peripherals. The input capture peripheral can also watch pins PC7, PC5, PC3, and PC1.
On startup, PC4, PC2, and PC0 are outputs set high, PC6 is set low, and the other pins are
inputs for compatibility with the Rabbit 3000.
The individual pins can be set to be open-drain via PCDCR.
See the associated peripheral chapters for details on how they use Parallel Port C.
10.2.2 Clocks
All outputs on Parallel Port C are clocked by the peripheral clock.
10.2.3 Other Registers
RegisterFunction
SACR, SBCR, SCCR,
SDCR, SECR, SFCR
ICS1R, ICS2R
Select a Parallel Port C pin as serial data (and
optional clock) input.
Select a Parallel Port C pin as a start/stop condition
for Input Capture input.
10.2.4 Interrupts
There are no interrupts associated with Parallel Port C.
10.3 Operation
The following steps must be taken before using Parallel Port C.
1. Select the desired input/output direction for each pin via PCDDR.
2. Select driven or open-drain functionality for outputs via PCDCR.
3. If an alternate peripheral output function is desired for a pin, select it via PCALR or
PCAHR and then enable it via PCFR. Refer to the appropriate peripheral chapter for
further use of that pin.
Once the port is set up, data can be read or written by accessing PCDR. The value in
PCDR of an output pin will reflect its current output value, but any value written to an
input pin will not appear on that pin until that pin becomes an output.
Chapter 10 Parallel Port C99
10.4 Register Descriptions
Parallel Port C Data Register(PCDR)(Address = 0x0050)
Bit(s)ValueDescription
7:0ReadThe current state of Parallel Port C pins PC7–PC0 is reported.
Write
Parallel Port C Data Direction Register(PCDDR)(Address = 0x0051)
Bit(s)ValueDescription
7:00The corresponding port bit is an input.
1The corresponding port bit is an output.
Parallel Port C Alternate Low Register(PCALR)(Address = 0x0052)
Bit(s)ValueDescription
7:600Parallel Port C bit 3 alternate output 0 (TXC).
01Parallel Port C bit 3 alternate output 1 (I3).
10Parallel Port C bit 3 alternate output 2 (TIMER C3).
11Parallel Port C bit 3 alternate output 3 (SCLKD).
The Parallel Port C buffer is written with this value for transfer to the Parallel
Port C output register on the next rising edge of the peripheral clock.
5:400Parallel Port C bit 2 alternate output 0 (TXC).
01Parallel Port C bit 2 alternate output 1 (I2).
10Parallel Port C bit 2 alternate output 2 (TIMER C2).
11Parallel Port C bit 2 alternate output 3 (TXF).
3:200Parallel Port C bit 1 alternate output 0 (TXD).
01Parallel Port C bit 1 alternate output 1 (I1).
10Parallel Port C bit 1 alternate output 2 (TIMER C1).
11Parallel Port C bit 1 alternate output 3 (RCLKF).
1:000Parallel Port C bit 0 alternate output 0 (TXD).
01Parallel Port C bit 0 alternate output 1 (I0).
10Parallel Port C bit 0 alternate output 2 (TIMER C0).
11Parallel Port C bit 0 alternate output 3 (TCLKF).
100Rabbit 5000 Microprocessor User’s Manual
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.