49
5.3.3 16-bit and Page Modes
The Rabbit 4000 supports two additional memory modes to access both 16-bit and page-
mode devices on /CS0 and /CS1, and can be enabled by writing to MACR. The first mode
supports a 16-bit memory device in addition to the normal 8-bit memory devices. With
this option, the memory device connected to /CS0 or /CS1 (or both) is assumed to have a
16-bit data path. Parallel Port D is used for the high byte of the data, and is configured auto-
matically for this operation when a 16-bit mode is enabled, overriding any other Parallel
Port D function.
Only instruction fetches from the 16-bit memory space actually read 16 bits. All data reads
from the 16-bit memory space are eight bits, with the proper byte-lane swapping being
done internally by the processor. In addition, because the processor can only handle a
byte-wide stream of instructions, enabling the advanced 16-bit mode also enables an
instruction prefetch queue. This queue is three bytes deep (in addition to the instruction
register), but the prefetch mechanism only tries to keep it full with one byte. The other two
bytes are for those cases where a prefetch was started in anticipation of the queue being
emptied.
The prefetch mechanism tracks the instructions being fetched and executed to minimize
bus conflicts between the prefetch mechanism and other bus transactions. These conflicts
can occur if the execution (two clocks per byte minimum) is faster than the instruction
prefetch (three clocks per two bytes minimum). The prefetch mechanism also attempts to
minimize the impact of program branches. If a jump or subroutine call is decoded and the
target address is being fetched the prefetch mechanism automatically stops prefetching
once all of the target address is in the queue, in anticipation of taking the program branch
One special case of the prefetch mechanism is the block instructions. Because these
instructions are interruptible and may rewind the PC, the prefetch mechanism will always
empty the queue and restart the prefetching when leaving the block sequence while these
instructions are being used.
Table 5-2. Advanced Memory Modes
Mode
MACR
Bit
Setting
Prefetch
Queue?
Word
Writes?
Byte
Writes?
Wait State
Register
Primary
Use
8-bit
00x
No
N/A
Yes
MBxCR
Any 8-bit
device
Basic 16-bit
10x
No
Yes
No
ACSxCR
Data in 16-
bit SRAM
Advanced
16-bit
01x
Yes
No
MBxCR
Code in 16-
bit flash
11x
Yes
ACSxCR
Code in 16-
bit SRAM