manualshive.com logo in svg
background image

Designer’s

 

Handbook

11

Static

 RAM memory may or may not be battery-backed, which means it retains its data 

when

 power is off.  Static RAM chips typically used for Rabbit systems are 32K, 64K. 

128K,

 256K, or 512K. When the memory is battery-backed, power is supplied at 2 V to 

3 V

 from a backup battery.  The shutdown circuitry must keep the chip select line high 

while

 preserving memory contents with battery power.

A

 basic Rabbit system has two static memory chips, one flash memory chip and one RAM 

memory

 chip.  Additional static memory chips may be added.  If the user’s application 

requires

 storing data in flash memory, particularly a lot of data, then it will often be pru-

dent

 to add another flash memory chip for the user’s data, creating a system with three 

memory

 chips—two flash memory chips and one RAM chip. Trying to use a single flash 

memory

 chip to store both the user’s program and live data that most be frequently 

changed

 often creates software problems. When data are written to a small-sector flash 

memory,

 the memory becomes inoperative during the 5 ms or so that it takes to write a 

sector.

 If the same memory chip is used to hold data and the program, then the execution 

of

 code must cease during this write time. The 5 ms is timed out by a small routine execut-

ing

 from RAM while system interrupts are disabled, effectively freezing the system for 5 

ms.

 The 5 ms lockup period can seriously affect real-time operation. 

From

 the point of view of a Dynamic C programmer, there are a number of different uses 

of

 memory. Each memory use occupies a different segment in the 16-bit address space. 

The

 four segments are shown in Figure 1 on page 12. 

The

 segments are named the root segment, the data segment, the stack segment, and the 

extended

 code segment. 

Note:

 Logical addresses above 0xDFFF are referred to as extended memory, and some-

times

 all of the logical memory below that is sometimes referred to as “root” memory. 

However

 root in the following context refers to lowest segment in logical memory, which 

usually

 comprises only a part of the non-extended memory.

Root

 Code—Instructions in the root segment. Instructions may also be stored in the 

extended

 code segment.  Code in the root segment operates slightly faster and plays a 

special

 role for certain special uses.  The root segment is normally mapped to flash 

memory

 since the code does not change except when the system is reprogrammed.

Root

 Constants—C constants, such as quoted strings or data tables are stored in flash 

memory

 in the root segment.  This constants intermixed with root code.  The constants 

only

 change when the system is reprogrammed. 

Root

 Variables—Root variables are stored in the data segment which is mapped to 

RAM.

  Variables include C variables, including structures and arrays that are not initial-

ized

 to a fixed value. 

Stack

 Memory—Stack is implemented in the stack segment.  The stack segment is nor-

mally

 4K long and is always mapped to RAM.  Multiple stacks may be implemented by 

defining

 several stacks in the 4k space or by remapping the 4K space to different loca-

tions

 in physical RAM memory, or by using both approaches. 

Содержание 2000

Страница 1: ...Rabbit 2000 Microprocessor Designers Handbook Revision C...

Страница 2: ...between the customer and Rabbit Semiconductor prior to use Life support devices or systems are devices or systems intended for surgical impantation into the body or to sustain life and whose failure...

Страница 3: ...17 5 2 BIOS Flowchart 18 5 3 Internally defined macros 19 5 4 Modifying the BIOS 19 5 5 Origin Directives to the Compiler 20 6 The System ID Block 23 6 1 Definition 23 6 2 Access 24 6 3 Reading the ID...

Страница 4: ...Rabbit 2000 Microprocessor...

Страница 5: ...mming cable connects a PC serial port to the pro gramming connector of the target microprocessor system Figure 1 Dynamic C Programming The Rabbit programming cable is a smart cable with an active circ...

Страница 6: ...2 Rabbit 2000 Microprocesssor...

Страница 7: ...ximum computation per watt is obtained in the range of 3 0 V to 3 6 V The highest clock speeds require 5 V The maximum clock speed with a 3 3 V sup ply is 18 9 MHz but it will usually be convenient to...

Страница 8: ...nt can be reduced by executing long strings of multiply zero by zero instructions Keep in mind that a Rabbit operating at 3 68 MHz has the compute power of a Z180 microproces sor operating at approxim...

Страница 9: ...mode after reset 3 1 How the Cold Boot Mode Works In Detail The microprocessor starts executing a 12 byte program contained in an internal ROM The program contains the following code origin zero 00 ld...

Страница 10: ...from the PC in to a tar get in cold boot mode 2 Run the initial loader and load a secondary loader pilot BIOS at 19200 baud 3 Run the secondary loader and load the BIOS as Dynamic C compiles it 4 Run...

Страница 11: ...up the serial port for 115200 baud setting up serial interrupts and starting a new FSM 11 The BIOS code modifies a jump instrucction near the beginning of the program so that the next time it runs it...

Страница 12: ...8 Rabbit 2000 Microprocessor...

Страница 13: ...in some flash memory can be debugged debugging and program download is faster to RAM There are also types of flash memory that can be used but they cannot support debugging Connect a flash memory tha...

Страница 14: ...arger memory The view from the window can be adjusted so that the window points to different blocks in the larger memory Figure 2 on page 12 shows the memory mapping schematically The Rabbit has a bas...

Страница 15: ...of a Dynamic C programmer there are a number of different uses of memory Each memory use occupies a different segment in the 16 bit address space The four segments are shown in Figure 1 on page 12 The...

Страница 16: ...e memory space needed for root code and as the memory needed for constants or variables increases the amount of code that can be stored in root must decline by moving code to extended memory The rel a...

Страница 17: ...ess that are frequently called will use sig nificantly less execution time if placed in the root because of the faster calling linkage for 16 bit versus 20 bit addresses A call and return using 16 bit...

Страница 18: ...s most of the code is compiled to extended memory This code executes in the 8K window from E000 to FFFF This 8K window uses paged access Instructions that use 16 bit addressing can jump within the pag...

Страница 19: ...tions Set Up By the BIOS The BIOS sets up initial values for the following registers by means of code and declara tions The four memory bank control registers MB0CR MB1CR MB2CR and MB3CR are 8 bit reg...

Страница 20: ...a block size 5 2 BIOS Flowchart The following flowchart summarizes the functionality of the BIOS Figure 5 BIOS Flowchart Start at address 0 Initialize BIOS Flag Yes Relocate BIOS if necessary Clear fl...

Страница 21: ...be done one step at a time making it easy to detect any problems The source code for the Universal BIOS is in BIOS RABBITBIOS C Dynamic C uses this source code for the BIOS by default but the user ca...

Страница 22: ...number of bytes available to the debugger for compiling watch expres sion The default value for both is 0x400 Decreasing these increases the amount of RAM available for root data NUM_RAM_WAITST NUM_F...

Страница 23: ...fter the rcodorg and rvarorg directives Likewise xcodorg statement should appear before any code is compiled to xmem origin name creates an identifier associated with that particular directive segment...

Страница 24: ...ace programs in different places in root memory or in order to compile a boot strapping program such as a pilot BIOS or coldloader origin statements may be used in the user s program code For example...

Страница 25: ...e The reserved field will expand and or shrink to compensate for the change in size typedef struct int tableVersion ver num for this table layout int productID Z World part int vendorID 1 Z World char...

Страница 26: ...uadrants mapped to flash Examples 0x01 quadrant 0 only 0x03 quadrants 0 and 1 0x0C quadrants 2 and 3 RETURN VALUE 0 if successful 1 if error reading from flash 2 if ID block missing 3 if ID block inva...

Страница 27: ...ed for the entire ID block except the reserved field and compared to the saved value If they do not match the block is considered invalid and an error 3 is returned The CRC field is then restored The...

Страница 28: ...ull terminated string 6Fh N Reserved variable size SIZE 10h 4 Size of this ID block SIZE 0Ch 2 Size of user block SIZE 0Ah 2 Offset of user block location from start of this block SIZE 08h 2 CRC value...

Страница 29: ...BIOS begins running Finally the master sends blocks of data at high speed and the data are written to the flash memory Data transfer can take place at 57 600 bps or 115 200 bps When the entire flash...

Страница 30: ...will blink several times per second if the LED stops blinking then an error has occurred Once the cloning is complete the LED will blink in a distinctive pattern of four flashes than a pause before f...

Страница 31: ...this is the power that is dependent on frequency The power drawn while switching is used to charge capacitance or is used when both N and P FETs are simultaneously on for a brief period during a trans...

Страница 32: ...large sector flash in your product design you can debug your application in RAM by using the Compile to RAM compiler option or use a board with small sector flash for development only The Rabbit low p...

Страница 33: ...le a routine updateTimers that can be called periodically to keep Dynamic C time variables updated These time variables keep track of seconds and milliseconds are normally used by Dynamic C routines t...

Страница 34: ...344 Dynamic C User s Manual...

Страница 35: ...RAM memory will be required Many programs can subsist on 32K of RAM Having more RAM on the system is convenient for debug ging since debugging and program testing generally operates more powerfully an...

Страница 36: ...34 Rabbit 2000 Microprocessor...

Страница 37: ...T29LV040 512K 256 2048 sector 200 3 0 3 6 4 6 50 and later Mosel Vitelic V29C51001T 128K 512 256 byte 45 4 5 5 5 1 2 4 6 50 and later Mosel Vitelic V29C51001B 128K 512 256 byte 45 4 5 5 5 1 2 4 6 50 a...

Страница 38: ...early in the BIOS to fill this struct before any accesses to the flash struct char flashXPC XPC required to access flash via XMEM int sectorSize byte size of one flash memory sector int numSectors nu...

Страница 39: ...needs to perform the following actions 1 Load _FlashInfo XPC with the proper XPC value to access flash memory address 00000h via XMEM address E000h The quadrant num ber for the start of flash memory...

Страница 40: ...see below Otherwise it should perform the actual write oper ation required by the particular flash used Interrupts should be turned off set the interrupt level to 3 whenever writes are occur ring to...

Страница 41: ...Diagnostic Test 2 This test goes through a series of steps repeatedly The steps are 1 Apply the reset for approximately 1 4 second and then release the reset 2 In cold boot send the following sequenc...

Страница 42: ...e starts again If this test fails to function it may be that the programming connector is connected improp erly or the proper pull up resistors are not installed on the SMODE lines Other possibili tie...

Страница 43: ...ss zero test program ld hl 1 ld b 16 loop ld a hl add hl hl shift left djnz loop 16 steps jp 0 continue test If this test runs it will toggle the first 16 address lines In addition all of the data lin...

Страница 44: ...42 Rabbit 2000 Microprocessor...

Страница 45: ...stems intended for surgical impantation into the body or to sustain life and whose failure to perform when properly used in accor dance with instructions for use provided in the labeling and user s ma...

Отзывы: