Summary of 2000

  • Page 1

    Rabbit 2000™ microprocessor designers handbook revision c.

  • Page 2

    Rabbit 2000 microprocessor rabbit 2000 microprocessor designer’s handbook part number 019-0070 • revision c last revised on july 5, 2000 • printed in u.S.A. Copyright © 2000 rabbit semiconductor • all rights reserved. Rabbit semiconductor reserves the right to make changes and improvements to its pr...

  • Page 3

    Designer’s handbook 1. Introduction.....................................................................................................................1 2. Hardware design overview............................................................................................3 3. How dynamic c cold-boo...

  • Page 4

    Rabbit 2000 microprocessor.

  • Page 5

    Designer’s handbook 1 1. Introduction this manual is intended for the engineer designing a system using the rabbit micropro- cessor and z-world’s dynamic c development environment. It explains how to develop a rabbit-based microprocessor system that can be programmed with z-world’s dynamic c. This m...

  • Page 6

    2 rabbit 2000 microprocesssor.

  • Page 7

    Designer’s handbook 3 2. Hardware design overview because of the glueless nature of the external interfaces, especially the memory interface, it is easy to design hardware in a rabbit-based system. More details on hardware design are given in the rabbit 2000 microprocessor user’s manual. Generally a...

  • Page 8

    4 rabbit 2000 microprocessor if the main oscillator is turned off and the microprocessor is operated at 32.768 khz from the clock oscillator, the current will drop to about 200 µa exclusive of the current required by the memory. The level of power consumption can be fine-tuned by adding memory wait ...

  • Page 9

    Designer’s handbook 5 3. How dynamic c cold-boots the target system dynamic c assumes that target controller boards using the rabbit cpu have no pre- installed firmware. It takes advantage of the rabbit’s bootstrap (cold boot) mode that allows memory and i/o writes to take place over the programming...

  • Page 10

    6 rabbit 2000 microprocessor program reaches address zero the boot mode is disabled and instruction fetching resumes at address zero. Wait states are automatically inserted during the fetching of bytes 3, 5 and 7 to wait for the serial or parallel port ready. The wait states continue indefinitely un...

  • Page 11

    Designer’s handbook 7 6. The program enters a loop where it receives a fixed number of bytes which comprise a secondary loader program (pilot.Bin sent by the pc) and writes those bytes to memory location 0x4100. After all of the bytes are received, program execution jumps to 0x4100. 7. The secondary...

  • Page 12

    8 rabbit 2000 microprocessor.

  • Page 13

    Designer’s handbook 9 4. Dynamic c rabbit programming overview when dynamic c compiles the user’s program it includes a bios or basic input-output system. The bios a fairly small piece of code that provides a variety of low level services for the user’s program. The bios also takes care of microproc...

  • Page 14

    10 rabbit 2000 microprocessor this degree of control is not desired for a particular situation, then certain pins can be left unconnected in the connecting cable, limiting the functionality of the connector to serial communications. Z-world will be developing products and software that assume the pr...

  • Page 15

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

  • Page 16

    12 rabbit 2000 microprocessor • extended code—instructions not in root that often require 20-bit addressing for access. These are accessed via the extended code segment, which is an 8k page for executing code. Up to a megabyte of code can be executed by moving the mapping of the 8k window using spec...

  • Page 17

    Designer’s handbook 13 to flash memory. It may be mapped to ram for debugging, or if it is decided to copy code to ram to take advantage of faster access time offered by ram. The root segment holds a mixture of code and constants. C functions or assembly language programs that are com- piled to the ...

  • Page 18

    14 rabbit 2000 microprocessor cannot execute from flash. In some cases the ram may require fewer wait states so code executes faster if copied to ram. 4.1.3 the stack segment the stack segment normally is from 52k to 56k. It is mapped to ram and holds the sys- tem stack. If there are multiple stacks...

  • Page 19

    Designer’s handbook 17 5. The rabbit bios the dynamic c programming system for the rabbit uses the concept of a bios (basic input output system). The bios is a separate program file that contains the basic code needed to interface with dynamic c. It also normally contains a software interface to the...

  • Page 20

    18 rabbit 2000 microprocessor in addition, a number of origin declarations are made in the bios to tell the dynamic c compiler where to place different types of code and data. The compiler maintains a num- ber of assembly counters that it uses to place or allocate root code, extended code, data cons...

  • Page 21

    Designer’s handbook 19 5.3 internally defined macros some macros used in the bios are defined internally by dynamic c before the bios is compiled. They are defined using tests done in the bootstrap loading, or by reading vari- ables set in the gui. These are: _flash_, _ram_ - used for conditional co...

  • Page 22

    20 rabbit 2000 microprocessor cloningbaudrate the default value of 1 makes cloning happen at 115,200 baud, zero makes the cloning baud rate 57,600. Dataorg beginning logical address for the data segment. The default is 0x6000. This should only be changed to multiples of 0x1000. Increasing it increas...

  • Page 23

    Designer’s handbook 21 directives to decide where to place code and data in logical memory and its mapping to physical memory through a segment register value. The directives are normally specified in the bios. However, the directives may also be useful in the user program for certain tasks such as ...

  • Page 24

    22 rabbit 2000 microprocessor dynamic c defines macros that include information about compiling to ram or flash and identifying memory device types, memory sizes, and board type. The origin setup shown above differs from that included in the standard bios included with dynamic c as the standard bios...

  • Page 25

    Designer’s handbook 23 6. The system id block the bios supports a system identification block to be placed at the top of flash memory. Identification information for each device can be placed in it for access by the bios, flash driver, and users. This block will contain specific part numbers for the...

  • Page 26

    24 rabbit 2000 microprocessor int idblockcrc; // crc of this block (when this // field is set to zero) char marker[6]; // should be 0x55 0xaa 0x55 0xaa // 0x55 0xaa } sysidblock; 6.2 access the bios will read the system id block during startup, so all a user needs to do is access the system id block...

  • Page 27

    Designer’s handbook 25 2. The top six bytes of the buffer (read from 0x7fff8-0x7ffff) are checked for an alter- nating sequence of 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa. If this is not found, the block does not exist and an error (-2) is retured. 3. The id block size (=size) is determined from the firs...

  • Page 28

    26 rabbit 2000 microprocessor 2fh 4 crystal frequency (hertz) 33h 6 media access control (mac) address 39h 24 serial number (as a null-terminated string) 51h 30 product name (as a null-terminated string) 6fh n reserved (variable size) size - 10h 4 size of this id block size - 0ch 2 size of user bloc...

  • Page 29

    Designer’s handbook 27 7. Bios support for program cloning a program can be loaded into a controller by compiling it using dynamic c. However, this is awkward and slow in some situations. If cloning is enabled in the bios, a rabbit- based system can copy itself into another controller by connecting ...

  • Page 30

    28 rabbit 2000 microprocessor both ends. Once this is done, reset the master, and the cloning process will begin. While the cloning is occurring, the led on the cable will blink several times per second; if the led stops blinking then an error has occurred. Once the cloning is complete, the led will...

  • Page 31

    Rabbit version 341 8. Low-power design and support to get the most computation for a given power level, the operating voltage should be approximately 3.3 v. At a given operating voltage, the clock speed should be reduced as much as possible to obtain the minimum power consumption that is acceptable....

  • Page 32

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

  • Page 33

    Rabbit version 343 tem clock is at 32.768 khz. The 48-bit battery backable clock continues to operate without interruption. Usually the programmer will want to reduce power consumption to a minimum, either for a fixed time period or until some external event takes place. On entering sleepy mode by c...

  • Page 34

    344 dynamic c user’s manual.

  • Page 35

    Designer’s handbook 33 9. Memory planning the following requirements should be considered when planning memory configuration for a rabbit system. • the size of the code anticipated. Usually code size up to 512k is handled by one flash memory chip. Static data tables can be conveniently placed in the...

  • Page 36

    34 rabbit 2000 microprocessor.

  • Page 37

    Designer’s handbook 35 10. Flash memories the flash memories listed in table 3 below have been qualified for use with the rabbit 2000 microprocessor. Table 3. 32-pin flash memories supported by the rabbit 2000 vendor device name device size (bytes) sector size (bytes) number of sectors write mode be...

  • Page 38

    36 rabbit 2000 microprocessor 10.1 writing your own flash driver if a user wishes to install a flash memory not listed in table 3, custom functions need to be written for the new flash. This section explains the requirements of these three user-writ- ten functions. _initflashdriver called from the b...

  • Page 39

    Designer’s handbook 37 with it. You will probably be required to copy the function from flash to a ram buffer in the flash initialization sequence. The field writemode specifies the method that particular flash device uses to write data. Currently, only two common modes are defined: “sector-writing”...

  • Page 40

    38 rabbit 2000 microprocessor _writeflash this function writes exactly one sector of data from a buffer in ram to the flash mem- ory. It is called from the bios as well as several libraries, and should be written to con- form to the following requirements: • it should assume that the source data is ...

  • Page 41

    Designer’s handbook 39 11. Hardware bring-up procedure when a user has designs a new microprocessor system around the rabbit and carefully follows the rabbit design conventions, it is possible that the system will not boot up when dynamic c is connected to the programming connector. This can happen ...

  • Page 42

    40 rabbit 2000 microprocessor uppermost bit must be zero and the write must be to the first 32k of the memory space. The user should see the 9 bytes transmitted at 2400 bps or 416 µs per bit. The status bit will initially toggle fairly rapidly during the transmission of the first triplet because the...

  • Page 43

    Designer’s handbook 41 80 24 80 //terminate bootstrap, start at address 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 lines must be function...

  • Page 44

    42 rabbit 2000 microprocessor.

  • Page 45

    Designer’s handbook 41 legal notice rabbit semiconductor products are not authorized for use as critical components in life- support devices or systems unless a specific written agreement regarding such intended use is entered into between the customer and rabbit semiconductor prior to use. Life- su...