Rabbit 4000 Microprocessor
User's Manual
PREV INDEX NEXT


5. Memory Management

5.1 Overview

The Rabbit 4000 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 9 wait states depending on the settings. Both 8-bit and 16-bit page-mode devices are also supported.

The Rabbit 4000'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 128KB up to 4MB, providing a total physical memory range from 512KB up to 16MB. Figure 5-1 shows a sample configuration.


Figure 5-1. Mapping Rabbit 4000 Physical Memory Space

Either of the two most significant address bits (which are used to select the 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 64KB 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 4KB boundaries anywhere in the physical space. The boundaries between the root and data segments and the data and stack segments can be adjusted in 4KB blocks as well.

The XMEM segment is a fixed 8KB and points to a physical memory address 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 64KB logical memory space. Special call and return instructions to physical addresses are provided that automatically update the XPC register as necessary.


Figure 5-2. Logical and Physical Memory Mapping

The Rabbit 2000 and 3000 had numerous instructions for reading and writing data to logical addresses, but only limited support for reading and writing data to a physical memory address. This has changed for the Rabbit 4000—a wide range of instructions has been provided to read and write to physical addresses. It is possible to use the same instructions to write to logical addresses as well.

The 64KB 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, while 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 64KB logical spaces instead of sharing a single space.

It is possible to protect memory in the Rabbit 4000 at three different levels: each of the memory banks can be made read-only, physical memory can be write-protected in 64KB blocks, and two of those 64KB blocks can be protected with a granularity of 4KB. A Priority 3 interrupt will occur if a write is attempted in one of the protected 64KB or 4KB 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.

5.1.1 Block Diagram


5.1.2 Registers

Register Name

Mnemonic

I/O Address

R/W

Reset

MMU Instruction/Data Register
MMIDR
0x0010
R/W
00000000
Stack Segment Register
STKSEG
0x0011
R/W
00000000
Stack Segment LSB Register
STKSEGL
0x001A
R/W
00000000
Stack Segment MSB Register
STKSEGH
0x001B
R/W
00000000
Data Segment Register
DATSEG
0x0012
R/W
00000000
Data Segment LSB Register
DATSEGL
0x001E
R/W
00000000
Data Segment MSB Register
DATSEGH
0x001F
R/W
00000000
Segment Size Register
SEGSIZE
0x0013
R/W
11111111
Memory Bank 0 Control Register
MB0CR
0x0014
R/W
00001000
Memory Bank 1 Control Register
MB1CR
0x0015
R/W
xxxxxxxx
Memory Bank 2 Control Register
MB2CR
0x0016
R/W
xxxxxxxx
Memory Bank 3 Control Register
MB3CR
0x0017
R/W
xxxxxxxx
MMU Expanded Code Register
MECR
0x0018
R/W
00000000
Memory Timing Control Register
MTCR
0x0019
R/W
00000000
Memory Alternate Control Register
MACR
0x001D
R/W
00000000
Advanced /CS0 Control Register
ACS0CR
0x0410
R/W
00000000
Advanced /CS1 Control Register
ACS1CR
0x0411
R/W
00000000
RAM Segment Register
RAMSR
0x0448
R/W
00000000
Write-Protect Control Register
WPCR
0x0440
R/W
00000000
Write-Protect x Register
WPxR
0x460+x
W
00000000
Write-Protect Segment A Register
WPSAR
0x0480
W
00000000
Write-Protect Segment A Low Register
WPSALR
0x0481
W
00000000
Write-Protect Segment A High Register
WPSAHR
0x0482
W
00000000
Write-Protect Segment B Register
WPSBR
0x0484
W
00000000
Write-Protect Segment B Low Register
WPSBLR
0x0485
W
00000000
Write-Protect Segment B High Register
WPSBHR
0x0486
W
00000000
Stack Limit Control Register
STKCR
0x0444
R/W
00000000
Stack Low Limit Register
STKLLR
0x0445
W
xxxxxxxx
Stack High Limit Register
STKHLR
0x0446
W
xxxxxxxx


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.

There are eight dedicated data bus pins, D0 through D7. If the 16-bit mode is enabled, then PD0–PD7 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

Register

Function

PEFR, PEALR
Enable A20-A23 and /A0.


5.2.4 Interrupts

When a write is attempted to a write-protected 64KB or 4KB 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.

5.3 Operation

5.3.1 Memory Management Unit (MMU)

Code execution takes place in the 64KB 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 4KB 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 corresponding uppermost four bits are set to zero.

Table 5-1. Memory Management Registers

Register

Segment

Size

Comments

DATASEG
Data
8 bits
Maps to DATASEGL;
DATASEGH set to 0x00
DATASEGL
Data
8 bits

DATASEGH
Data
4 bits

STACKSEG
Stack
8 bits
Maps to STACKSEGL;
STACKSEGH set to 0x00
STACKSEGL
Stack
8 bits

STACKSEGH
Stack
4 bits

XPC
XMEM
8 bits
Loaded via instructions
LD XPC,A and LD A,XPC
LXPC
XMEM
12 bits
Loaded via instructions:
LD LXPC,HL and LD HL,LXPC


Each of these registers provides a 4KB offset that is added to the logical address to provide a physical address as shown in Figure 5-3.


Figure 5-3. MMU Operation

5.3.2 8-bit Operation

On startup Memory Bank 0 is enabled to use /CS0, /OE0, and /WE0 with four wait states and write protection enabled; it is expected that an external flash device containing startup code be attached to those strobes. The other memory banks come up undefined and should be set via the appropriate MBxCR register to a valid setting before use.

The size of the memory banks can be defined in the MECR register. The default size is 256KB (the bank selection looks at address bits 18 and 19), but this value can be adjusted down to 128KB or up to 4MB per bank.

The two address bits used to select the bank can be inverted in MBxCR, which enables mapping different sections of a memory device larger than the current memory bank into memory. An example of this feature is shown in Figure 5-4.


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 28. 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.

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 automatically for this operation when a 16-bit mode is enabled, overriding any other Parallel Port D function.

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
Yes
No
MBxCR
Code in 16-bit flash
11x
Yes
Yes
Yes
ACSxCR
Code in 16-bit SRAM


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.

The 16-bit memory device connected to /CS0 or /CS1 may or may not support byte writes, so there is an option to select between these two cases. Flash devices with a 16-bit bus do not support byte writes, so any byte writes or unaligned word writes to the 16-bit memory space will be suppressed (i.e., the /WE will not be asserted) with this option. Any aligned word writes are recognized internally and are combined into just one write transaction on the external bus. Internally the two writes still occur. The RAM 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 Type

A0

/A0

Word Read (prefetch only)
Low
Low
Word Write
Low
Low
Byte Read or Write — Even Address
Low
High
Byte Read or Write — Odd Address
High
Low


All of the power-saving modes in Chapter 26 can still be used with the 16-bit mode. Because it is anticipated that the 16-bit memory may be slower than the normal 8-bit memories, separate wait-state controls for the 16-bit bus are provided in separate registers (ACS0CR and ACS1CR).

The second advanced bus mode is the Page Mode. This mode also can be enabled for either /CS0 or /CS1, 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 is in the same page as the previous data. In the Rabbit 4000 (and most memory devices) a page is 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 ACS0CR and ACS1CR.

In Page Mode the chip select and /OE remain active from one page access to the next, and only the 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 /CS0 or /CS1 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 ACS0CR and ACS1CR registers each contain three settings to control the generation of wait states in the advanced bus modes. These settings are used in place of the wait-state setting in MBxCR when an advanced bus mode is enabled. When the 16-bit bus is enabled, from one to seven automatic wait states for memory read bus cycles can be enabled. 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 third setting selects from five to nine automatic wait states for memory-write bus cycles. The choices available for the advanced bus wait states are sufficient to allow interfacing to a variety of standard memories for any Rabbit 4000 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.

5.3.4 Separate Instruction and Data Space

To make better use of the 64KB 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 64KB 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.

The Rabbit 4000 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 64KB by enabling protection for that block in the appropriate WPxR register. For further control, two of those 64KB blocks can be further subdivided into 4KB 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.

Table 5-4. Memory Protection Options

Method

Block Size

Registers Used

Memory Bank
128KB – 4MB
MBxCR, MECR
Write-Protect Blocks
64KB
WPCR, WPxR
Write Protect Segment A/B
4KB
WPSxR, WPSxLR, WPSxHR


5.3.6 Stack Protection

The Rabbit 4000 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.

When stack protection is enabled and a DMA transfer is occurring, the stack protection interrupt will occur if the lower 16 bits of a DMA transfer's physical write address match the 16 bits of the stack protection's logical address limits.

5.4 Register Descriptions

MMU Instruction/Data Register (MMIDR) (Address = 0x0010)

Bit(s)

Value

Description

7
0
Internal I/O addresses are decoded using only the lower eight bits of the internal I/O address bus. This restricts internal I/O addresses to the range 0x0000–0x00FF.
1
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.
6
This bit is reserved an must be written with zero.
5
0
Enable A16 and bank select address MSB inversion independent of instruction/data.
1
Enable A16 and bank select address MSB inversion for data accesses only. This enables the instruction/data split.
4
0
Normal /CS1 operation.
1
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.
3
0
Normal operation.
1
For a data segment access, invert bank select address MSB before MBxCR decision.
2
0
Normal operation.
1
For a data segment access: invert A16
1
0
Normal operation.
1
For a root segment access, invert bank select address MSB before MBxCR decision.
0
0
Normal operation.
1
For a root segment access: invert A16


Stack Segment Register (STKSEG) (Address = 0x0011)

Bit(s)

Value

Description

7:0
Read
The current contents of this register are reported.
Write
Eight LSBs (MSBs are set to zero by write) of physical address offset to use if
SEGSIZ[7:4] Addr[15:12] < 0xE


Stack Segment Low Register (STKSEGL) (Address = 0x001A)

Bit(s)

Value

Description

7:0
Read
The current contents of this register are reported.
Write
Eight LSBs of physical address offset to use if SEGSIZ[7:4] Addr[15:12] < 0xE


Stack Segment High Register (STKSEGH) (Address = 0x001B)

Bit(s)

Value

Description

7:4
These bits are reserved and should always be written as zero. These bits always return zeros when read.
3:0
Read
The current contents of this register are reported.
Write
Four MSBs of physical address offset to use if SEGSIZ[7:4] Addr[15:12] < 0xE


Data Segment Register (DATSEG) (Address = 0x0012)

Bit(s)

Value

Description

7:0
Read
The current contents of this register are reported.
Write
Eight LSBs (MSBs are set to zero by write) of physical address offset to use if: SEGSIZ[3:0] Addr[15:12] < SEGSIZ[7:4]


Data Segment Low Register (DATSEGL) (Address = 0x001E)

Bit(s)

Value

Description

7:0
Eight LSBs of physical address offset to use if: SEGSIZ[3:0] Addr[15:12] < SEGSIZ[7:4]


Data Segment High Register (DATSEGH) (Address = 0x001F)

Bit(s)

Value

Description

7:4
These bits are reserved and should always be written as zero. These bits always return zeros when read.
3:0
Four MSBs of physical address offset to use if:
SEGSIZ[3:0] <= Addr[15:12] < SEGSIZ[7:4]


Segment Size Register (SEGSIZ) (Address = 0x0013)

Bit(s)

Value

Description

7:0
Read
The current contents of this register are reported.
7:4
Write
Boundary value for switching from DATSEG to STKSEG for translation.
3:0
Write
Boundary value for switching from none to DATSEG for translation.


Memory Bank x Control Register (MB0CR) (Address = 0x0014)
(MB1CR) (Address = 0x0015)
(MB2CR) (Address = 0x0016)
(MB3CR) (Address = 0x0017)

Bit(s)

Value

Description

7:6
00
Four (five for writes) wait states for accesses in this bank.
01
Two (three for writes) wait states for accesses in this bank.
10
One (two for writes) wait states for accesses in this bank.
11
Zero (one for writes) wait states for accesses in this bank.
5
0
Pass bank select address MSB for accesses in this bank.
1
Invert bank select address MSB for accesses in this bank.
4
0
Pass bank select address LSB for accesses in this bank.
1
Invert bank select address LSB for accesses in this bank.
3:2
00
/OE0 and /WE0 are active for accesses in this bank.
01
/OE1 and /WE1 are active for accesses in this bank.
10
/OE0 only is active for accesses in this bank (i.e., read-only). Transactions are normal in every other way.
11
/OE1 only is active for accesses in this bank (i.e., read-only). Transactions are normal in every other way.
1:0
00
/CS0 is active for accesses in this bank.
01
/CS1 is active for accesses in this bank.
10
/CS2 is active for accesses in this bank.
11
This bit combination is reserved and should not be used.


MMU Expanded Code Register (MECR) (Address = 0x0018)

Bit(s)

Value

Description

7:5
000
Bank select address is A[19:18].
001
Bank select address is A[20:19].
010
Bank select address is A[21:20].
011
Bank select address is A[22:21].
100
Bank select address is A[23:22].
101
This bit combination is reserved and should not be used.
110
This bit combination is reserved and should not be used.
111
Bank select address is A[18:17].
4:3
These bits are reserved and should be written with zeros. Read returns zeros.
2:0
000
Normal operation.
001
This bit combination is reserved and should not be used.
010
This bit combination is reserved and should not be used.
011
This bit combination is reserved and should not be used.
100
For an XPC access, use MB0CR independent of bank select address.
101
For an XPC access, use MB1CR independent of bank select address.
110
For an XPC access, use MB2CR independent of bank select address.
111
For an XPC access, use MB3CR independent of bank select address.


Memory Timing Control Register (MTCR) (Address = 0x0019)

Bit(s)

Value

Description

7:4
These bits are reserved and should be written with zeros.
3
0
Normal timing for /OE1 (rising edge to rising edge, one clock minimum).
1
Extended timing for /OE1 (one-half clock earlier than normal).
2
0
Normal timing for /OE0 (rising edge to rising edge, one clock minimum).
1
Extended timing for /OE0 (one-half clock earlier than normal).
1
0
Normal timing for /WE1 (rising edge to falling edge, one and one-half clocks minimum).
1
Extended timing for /WE1 (falling edge to falling edge, two clocks minimum).
0
0
Normal timing for /WE0 (rising edge to falling edge, one and one-half clocks minimum).
1
Extended timing for /WE0 (falling edge to falling edge, two clocks minimum).


Memory Alternate Control Register (MACR) (Address = 0x001D)

Bit(s)

Value

Description

7:6
These bits are reserved and must not be used.
5:4
00
Normal 8-bit operation for /CS1. Use MBxCR for wait states unless Page Mode.
01
Advanced 16-bit operation for /CS1. Enable prefetch mechanism for instructions and word-write accelerator for 16-bit write operations. Enable byte-lane swapping for byte data reads. Byte writes are not supported. Only aligned word writes to /CS1 are allowed. Use ACS1CR for wait states.
10
Enable basic 16-bit operation for /CS1. Reads and writes are still byte-wide, but byte-lane swapping is enabled for reads. Data is replicated for writes. Use MBxCR for wait states unless Page Mode.
11
Advanced 16-bit operation for /CS1. Enable prefetch mechanism for instructions and word-write accelerator for 16-bit write operations. Enable byte-lane swapping for byte data reads. Byte writes are supported. Use ACS1CR for wait states.
3
0
Page-mode operation disabled for /CS1.
1
Page-mode operation enabled for /CS1. Pages are 16 bytes. Page-mode accesses for program fetches only. Use ACS1CR for wait states.
2:1
00
Normal 8-bit operation for /CS0. Use MBxCR for wait states unless Page Mode.
01
Advanced 16-bit operation for /CS0. Enable prefetch mechanism for instructions and word-write accelerator for 16-bit write operations. Enable byte-lane swapping for byte data reads. Byte writes are not supported. Only aligned word writes to /CS0 are allowed. Use ACS0CR for wait states.
10
Enable basic 16-bit operation for /CS0. Reads and writes are still byte-wide, but byte-lane swapping is enabled for reads. Data is replicated for writes. Use MBxCR for wait states unless Page Mode.
11
Advanced 16-bit operation for /CS0. Enable prefetch mechanism for instructions and word-write accelerator for 16-bit write operations. Enable byte-lane swapping for byte data reads. Byte writes are supported. Use ACS0CR for wait states.
0
0
Page-mode operation disabled for /CS0.
1
Page-mode operation enabled for /CS0. Pages are 16 bytes. Page-mode accesses for program fetches only. Use ACS0CR for wait states.


Advanced Chip Select x Control Register (ACS0CR) (Address = 0x0410)
(ACS1CR) (Address = 0x0411)

Bit(s)

Value

Description

7:5
000
Seven wait states for 16-bit bus read or first page-mode access.
001
Six wait states for 16-bit bus read or first page-mode read access.
010
Five wait states for 16-bit bus read or first page-mode access.
011
Four wait states for 16-bit bus read or first page-mode read access.
100
Three wait states for 16-bit bus read or first page-mode read access.
101
Two wait states for 16-bit bus read or first page-mode read access.
110
One wait state for 16-bit bus read or first page-mode read access.
111
This bit combination is reserved and must not be used.
4:3
00
Three wait states for subsequent page-mode accesses.
01
Two wait states for subsequent page-mode accesses.
10
One wait states for subsequent page-mode accesses.
11
Zero wait states for subsequent page-mode accesses.
2:0
000
Nine (advanced) or seven (basic) wait states for 16-bit bus write access.
001
Eight (advanced) or six (basic) wait states for 16-bit bus write access.
010
Seven (advanced) or five (basic) wait states for 16-bit bus write access.
011
Six (advanced) or four (basic) wait states for 16-bit bus write access.
100
Five (advanced or three (basic) wait states for 16-bit bus write access.
101
Four (advanced) or two (basic) wait states for 16-bit bus write access.
110
Three (advanced) or one (basic) wait states for 16-bit bus write access.
111
This bit combination is reserved and must not be used.


RAM Segment Register (RAMSR) (Address = 0x0448)

Bit(s)

Value

Description

7:2
Compare value for RAM segment limit checking.
1:0
00
Disable RAM segment limit checking.
01
Select data-type MMU translation if PC[15:10] is equal to RAMSR[7:2].
10
Select data-type MMU translation if PC[15:11] is equal to RAMSR[7:3].
11
Select data-type MMU translation if PC[15:12] is equal to RAMSR[7:4].


Write Protection Control Register (WPCR) (Address = 0x0440)

Bit(s)

Value

Description

7:1
These bits are reserved and should be written with zeros.
0
0
Write protection in User Mode only.
1
Write protection in System and User modes.


Write-Protect x Register (WP0R) (Address = 0x0460)
(WP1R) (Address = 0x0461)
(WP2R) (Address = 0x0462)
(WP3R) (Address = 0x0463)
(WP4R) (Address = 0x0464)
(WP5R) (Address = 0x0465)
(WP6R) (Address = 0x0466)
(WP7R) (Address = 0x0467)
(WP8R) (Address = 0x0468)
(WP9R) (Address = 0x0469)
(WP10R) (Address = 0x046A)
(WP11R) (Address = 0x046B)
(WP12R) (Address = 0x046C)
(WP13R) (Address = 0x046D)
(WP14R) (Address = 0x046E)
(WP15R) (Address = 0x046F)
(WP16R) (Address = 0x0470)
(WP17R) (Address = 0x0471)
(WP18R) (Address = 0x0472)
(WP19R) (Address = 0x0473)
(WP20R) (Address = 0x0474)
(WP21R) (Address = 0x0475)
(WP22R) (Address = 0x0476)
(WP23R) (Address = 0x0477)
(WP24R) (Address = 0x0478)
(WP25R) (Address = 0x0479)
(WP26R) (Address = 0x047A)
(WP27R) (Address = 0x047B)
(WP28R) (Address = 0x047C)
(WP29R) (Address = 0x047D)
(WP30R) (Address = 0x047E)
(WP31R) (Address = 0x047F)

Bit(s)

Value

Description

7:0
0
Disable write protection for the corresponding 64K segment.
1
Enable write protection for the corresponding 64K block.
The 8 MSBs of the 24-bit physical address of any specific 64K block can be used to determine which write-protect register to use.
Since there are 256 64K blocks in the 16MB memory space, the 8 MSBs (the memory block must be on a 64K boundary) of the physical address is divided by 256. In total there are 32 write-protect registers, so the result is further divided by 32. This number is then added to the address of the first write-protect register (0x460) to give the address of the write-protect register that controls the 64K block in question.
    physaddr = xxxxxxh
    blk64 = physaddr 16
    regnum = blk64 3
    register address = regnum + 0x460
Each write-protect register controls 8 64K blocks. Now that you have the register address, you need to know that the register bit selects the correct 64K block. This is calculated using blk64, a value between 0–255.
    bitnum = blk64 & 0x7 


Write-Protect Segment x Register (WPSAR) (Address = 0x0480)
(WPSBR) (Address = 0x0484)

Bit(s)

Value

Description

7:0
When these eight bits [23:16] match bits of the physical address, write-protect that 64K range in 4K increments using WPSxLR and WPSxHR.


Write-Protect Segment x Low Register (WPSALR) (Address = 0x0481)
(WPSBLR) (Address = 0x0485)

Bit(s)

Value

Description

7
0
Disable 4K write protect for physical address 0x7000–0x7FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x7000–0x7FFF in WP Segment x.
6
0
Disable 4K write protect for physical address 0x6000–0x6FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x6000–0x6FFF in WP Segment x.
5
0
Disable 4K write protect for physical address 0x5000–0x5FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x5000–0x5FFF in WP Segment x.
4
0
Disable 4K write protect for physical address 0x4000–0x4FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x4000–0x4FFF in WP Segment x.
3
0
Disable 4K write protect for physical address 0x3000–0x3FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x3000–0x3FFF in WP Segment x.
2
0
Disable 4K write protect for physical address 0x2000–0x2FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x2000–0x2FFF in WP Segment x.
1
0
Disable 4K write protect for physical address 0x1000–0x1FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x1000–0x1FFF in WP Segment x.
0
0
Disable 4K write protect for physical address 0x0000–0x0FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x0000–0x0FFF in WP Segment x.

Write-Protect Segment x High Register (WPSAHR) (Address = 0x0482)
(WPSBHR) (Address = 0x0486)

Bit(s)

Value

Description

7
0
Disable 4K write protect for physical address 0xF000–0xFFFF in WP Segment x.
1
Enable 4K write protect for physical address 0xF000–0xFFFF in WP Segment x.
6
0
Disable 4K write protect for physical address 0xE000–0xEFFF in WP Segment x.
1
Enable 4K write protect for physical address 0xE000–0xEFFF in WP Segment x.
5
0
Disable 4K write protect for physical address 0xD000–0xDFFF in WP Segment x.
1
Enable 4K write protect for physical address 0xD000–0xDFFF in WP Segment x.
4
0
Disable 4K write protect for physical address 0xC000–0xCFFF in WP Segment x.
1
Enable 4K write protect for physical address 0xC000–0xCFFF in WP Segment x.
3
0
Disable 4K write protect for physical address 0xB000–0xBFFF in WP Segment x.
1
Enable 4K write protect for physical address 0xB000–0xBFFF in WP Segment x.
2
0
Disable 4K write protect for physical address 0xA000–0xAFFF in WP Segment x.
1
Enable 4K write protect for physical address 0xA000–0xAFFF in WP Segment x.
1
0
Disable 4K write protect for physical address 0x9000–0x9FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x9000–0x9FFF in WP Segment x.
0
0
Disable 4K write protect for physical address 0x8000–0x8FFF in WP Segment x.
1
Enable 4K write protect for physical address 0x8000–0x8FFF in WP Segment x.


Stack Limit Control Register (STKCR) (Address = 0x0444)

Bit(s)

Value

Description

7:1
These bits are reserved and should be written with zeros.
0
0
Disable stack-limit checking.
1
Enable stack-limit checking.


Stack Low Limit Register (STKLLR) (Address = 0x0445)

Bit(s)

Value

Description

7:0
Lower limit for stack-limit checking. If a stack operation or stack-relative memory access is attempted at an address less than {STKLLR, 0x10}, a stack-limit violation interrupt is generated.


Stack High Limit Register (STKHLR) (Address = 0x0446)

Bit(s)

Value

Description

7:0
Upper limit for stack-limit checking. If a stack operation or stack-relative memory access is attempted at an address greater than {STKHLR, 0xEF}, a stack-limit violation interrupt is generated.



Rabbit Semiconductor
www.rabbit.com
PREV INDEX NEXT