background image

342

Dynamic

 

C

 

User’s

 

Manual

For

 extreme low-power operation it should be taken into account that some memory chips 

draw

 substantial current at zero frequency.  For example, a Samsung static RAM (part 

number

 KM684000BPL-7L) was found to draw 1 mA at 5 V when chip select and output 

enable

 were held enabled and all the other signals were held at fixed levels (a long read).   

When

 the microprocessor is operating at the slowest frequency (32 kHz clock), the mem-

ory

 cycle is about 64 µs and the memory chip spends most of its time with the chip enable 

and

 output enable on.  The current draw during a long read cycle is not specified in most 

memory

 data sheets.  The Samsung chip, according the data sheet, typically draws about 

4 mA

 per megahertz when it is operating.  However, it appears that current consumption 

curve

 flattens out at about  250 kHz because of the constant 1 mA draw during a long read.

In

 order to take full advantage of the Rabbit’s ultra slow sleepy execution modes, a mem-

ory

 that does not consume power during a static read is required.  Advanced Micro 

Devices

 has a line of 3 V flash memories  (AM29LV010, AM29LV040) that power down 

automatically

 whenever the address (and control) lines do not change for period of time 

slightly

 longer than the access time. These memories will consume on the order of 30 µA 

when

 operated at a data rate of 1/64 MHz.

Currently,

 Dynamic C does not allow debugging in with flash chips having sector sizes 

greater

 than 4096 bytes, nor do the flash drivers support provided in the Dynamic C librar-

ies

 support such flash chips. To use a 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-power sleepy mode of operation is achieved by switching the main clock 

to

 the 32.768 kHz clock and then disabling the main oscillator.  In this mode, the Rabbit 

executes

 about 3 instructions every millisecond.  Adding memory wait states can further 

slow

 the processor to about 500 instructions per second or one every 2 ms.  At these 

speeds

 the power consumed by the microprocessor, exclusive  of the 32.768 kHz oscilla-

tor,

  is very low, in the area of  50 µA to 100 µA.  The Rabbit will generally test for some 

external

 event and leave sleeping mode when that event is detected.  The 32.768 kHz 

oscillator

 is a major consumer of power, requiring approximately 80 µA at 3.3 V.  This 

drops

 dramatically to about 18 µA at 2.2 V.   For the lowest standby power it may be desir-

able

 to use an external oscillator to generate the 32.768 kHz clock.  The Intersil (formerly 

Harris)

 part HA7210 can be used to construct a 32.768 kHz oscillator that consumes 

approximately

 5 µA at 3.3 V.

For

 the very lowest power consumption the processor can execute a long string of mul 

instructions

 with the de and bc registers set to zero.  Few if any internal registers change 

during

 the execution of a string of mul zero by zero, and a memory cycle takes place only 

once

 in every 12 clocks.  By combining all these techniques it may be possible to get the 

sleepy

 current under 50 µA.

8.1

  Software Support for Low-Power Sleepy Modes

In

 sleepy mode the microprocessor executes instructions too slowly to support most inter-

rupts.

  The serial ports can function but cannot generate standard baud rates since the sys-

Summary of Contents for 2000

Page 1: ...Rabbit 2000 Microprocessor Designers Handbook Revision C...

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

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

Page 4: ...Rabbit 2000 Microprocessor...

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

Page 6: ...2 Rabbit 2000 Microprocesssor...

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

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

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

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

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

Page 12: ...8 Rabbit 2000 Microprocessor...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Page 34: ...344 Dynamic C User s Manual...

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

Page 36: ...34 Rabbit 2000 Microprocessor...

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

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

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

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

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

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

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

Page 44: ...42 Rabbit 2000 Microprocessor...

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

Reviews: