Download Print this page
Hide thumbs Also See for 4000:

Advertisement

Quick Links

®
Rabbit 4000
Microprocessor
Designer's Handbook
019-0156 • 060901-C
The latest revision of this manual is available on the Rabbit Semiconductor Web
site, www.rabbit.com, for free, unregistered download.

Advertisement

loading
Need help?

Need help?

Do you have a question about the 4000 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Rabbit 4000

  • Page 1 ® Rabbit 4000 Microprocessor Designer’s Handbook 019-0156 • 060901-C The latest revision of this manual is available on the Rabbit Semiconductor Web site, www.rabbit.com, for free, unregistered download.
  • Page 2 These copies of the manuals may not be let or sold for any reason without the express written permission of Rabbit Semiconductor. Rabbit Semiconductor reserves the right to make changes and improvements to its products without providing notice. Trademarks ®...
  • Page 3: Table Of Contents

    3.2 Floating Inputs............................8 3.3 Basic Memory Design ..........................9 3.3.1 Memory Access Time........................10 3.3.2 Interfacing External I/O with Rabbit 4000 Designs ................10 3.4 PC Board Layout and Memory Line Permutation .................. 11 3.5 PC Board Layout and Electromagnetic Interference................11 3.5.1 Rabbit 4000 Low EMI Features ......................
  • Page 4 8.3.2 Different Flash Types .........................35 8.3.3 Different Memory Sizes........................35 8.3.4 Design Restrictions ..........................35 Chapter 9. Low-Power Design and Support ..................37 9.1 Details of the Rabbit 4000 Low-Power Features..................38 9.1.1 Special Chip Select Features......................38 9.1.2 Reducing Clock Speed ........................39 9.1.3 Preferred Crystal Configuration......................39 9.2 To Further Decrease Power Consumption ....................40...
  • Page 5: Chapter 1. Introduction

    Connect a static RAM having at least 128 KB to the Rabbit 4000 using /CS1, /OE1 and /WE1. • Connect a flash memory that is on the approved list and has at least 128 KB of storage to the Rabbit 4000 using /CS0, /OE0 and /WE0.
  • Page 6 Figure 1-1 The Rabbit 4000 Microprocessor and Dynamic C PC Hosts Dynamic C Rabbit Programming Rabbit Cable Microprocessor Level Conversion Target System PC Serial Programming Port Connector Dynamic C programming uses serial port A for software development. However, it is possible for the user’s application to also use serial port A, with the restriction that debugging is not available.
  • Page 7: Chapter 2. Rabbit Hardware Design Overview

    2. Rabbit 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 4000-based system. More details on hardware design are given in the Rabbit 4000 Microprocessor User’s Manual.
  • Page 8: Rabbit Programming Connector

    This connection is made with the Rabbit Cloning Board. The cloning board connects to the programming ports of both systems. A push of a button starts the transfer of the program and an LED displays the progress of the transfer.
  • Page 9: Operating Voltages

    2.2 Operating Voltages The operating voltage in Rabbit 4000 based systems will usually be 1.8 V ±10% for the processor core and 3.3 V ±10% for the I/O. The I/O ring can also be run at 1.8 V ±10%. The maximum computation per watt is obtained in the range of 3.0 V to 3.6 V. The highest clock speed requires 3.3 V.
  • Page 10: Through-Hole Technology

    Most design advice given for the Rabbit 4000 assumes the use of surface-mount technology. However, it is possible to use the older through hole technology and develop a Rabbit 4000 system. One can use a Rabbit 4000-based Core Module, a small circuit board with a complete Rabbit 4000 core that includes memory and oscillators.
  • Page 11: Chapter 3. Core Design And Components

    “Support” tab; this will take you to a list of links for available user manuals. 3.1 Clocks The Rabbit 4000 has input pins for both the fast clock and the 32.768 kHz clock. The fast clock drives the Rabbit 4000 CPU and peripheral clocks, whereas the 32.768 kHz clock is used for the battery-backable clock (also known as the real-time clock), the watchdog timer, the periodic interrupt timer and the asyn- chronous cold boot function.
  • Page 12: Floating Inputs

    (except that some inputs may float briefly during power-on sequencing). Most unused inputs on the Rabbit 4000 can be made into outputs by proper software initialization to remove the floating property. Pull-up resistors will be needed on a few inputs that cannot be programmed as outputs. An alter- native to a pull-up resistor is to tie an unused output to the unused inputs.
  • Page 13: Basic Memory Design

    If this special feature is used to speed up access time for battery-backed RAM then no other memory chips should be connected to OE1 and WE1. Table 3-1 Typical Interface between the Rabbit 4000 and Memory Primary Flash SRAM...
  • Page 14: Memory Access Time

    For core modules based on the Rabbit 4000, fewer pins are required to exit the core module since the slave port and the I/O bus can share the same pins and the memory bus no longer needs to exit the module to provide I/O capabil- ity.
  • Page 15: Pc Board Layout And Memory Line Permutation

    Technical Note 221, “PC Board Layout Suggestion for the Rabbit 3000 Microprocessor.” This docu- ment is available at: www.rabbit.com/docs/app_tech_notes.shtml. 3.5.1 Rabbit 4000 Low EMI Features The Rabbit 4000 has powerful built-in features to minimize EMI. They are noted here. For details please see The Rabbit 4000 Microprocessor User’s Manual. •...
  • Page 16 Core Design and Components...
  • Page 17: Chapter 4. How Dynamic C Cold Boots The Target System

    SMODE1 SMODE1 The Rabbit programming cable is a smart cable with an active circuit board in its middle. The circuit board converts RS-232 voltage levels used by the PC serial port to CMOS voltage levels used by the Rabbit 4000. The level converter is powered from the power supply voltage present on the Rabbit 4000 program- ming connector.
  • Page 18: How The Cold Boot Mode Works In Detail

    I/O space. Cold boot mode is entered by having one or both of the SMODE pins pulled high when the Rabbit is reset. The pin settings determine the source of the incoming triplets: SMODE1 = 0, SMODE0 = 1 cold boot from slave port.
  • Page 19: Program Loading Process Overview

    4.2 Program Loading Process Overview On start up, Dynamic C first uses the PC’s DTR line on the serial port to assert the Rabbit 4000 RESET line and put the processor in cold boot mode. Next, Dynamic C uses a four stage process to load a user pro- gram: 1.
  • Page 20 14.If the programming cable is removed and the target board is reset, the user’s program will start running automatically because the BIOS will check the SMODE pins to determine whether to run the user application or enter the debug kernel. rabbit.com How Dynamic C Cold Boots the Target System...
  • Page 21: Chapter 5. Rabbit Memory Organization

    Designer’s Handbook describes the Rabbit’s 8-bit memory mode. While it does not contain information on the 16-bit memory mode of the Rabbit 4000 or the use of far pointers, it does contain general information about logical and physical memory, a thorough description of separate I&D space, and some useful details on customizing interrupts.
  • Page 22 Rabbit Memory Organization...
  • Page 23: Chapter 6. The Rabbit Bios

    6. The Rabbit BIOS This chapter is not currently available. Complete and accurate information regarding the Rabbit BIOS will be made available in this manual as soon as possible and will be posted on the Rabbit website: www.rabbit.com rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 24 The Rabbit BIOS...
  • Page 25: Chapter 7. The System Identification And User Blocks

    BIOS, flash driver, and users. This block contains specific part numbers for the flash and RAM devices installed, the product’s serial number, Media Access Control (MAC) address if an Ethernet device, and so on. The earliest version of the System ID for Rabbit 4000 products is version 4, which is a mirrored images type.
  • Page 26: System Id Block Details

    CRC value of SysIDBlock.idBlockCRC } SysIDBlockType2; typedef struct { // version number for this table layout** tableVersion; // Rabbit part # productID; // 1 = Rabbit vendorID; // YY/M/D H:M:S char timestamp[7]; // Manufacturer ID/ Product ID, 1st flash * long flashID;...
  • Page 27 // offset in bytes of start of User block from this one** unsigned userBlockLoc; // CRC of this block (when this field is set to 0) ** idBlockCRC; // should be 0x55 0xAA 0x55 0xAA 0x55 0xAA** char marker[6]; } SysIDBlock; rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 28: Reading The System Id Block

    0x03 = quadrants 0 and 1 0x0C = quadrants 2 and 3 RETURN VALUE: 0: Successful -1: Error reading from flash -2: ID block missing -3: ID block invalid (failed CRC check) LIBRARY IDBLOCK.LIB rabbit.com The System Identification and User Blocks...
  • Page 29: Determining The Existence Of The System Id Block

    Flash size (in 1000h pages) Flash sector size (in bytes) Number of sectors in flash Flash access time (nanoseconds) Flash ID, 2nd flash Flash size (in 1000h pages), 2nd flash Flash sector size, 2nd flash (in bytes) rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 30 Offset, in bytes, of User block location from start SIZE - of this block CRC value of System ID block (when this field = SIZE - 0000h) SIZE - Marker, should = 55h AAh 55h AAh 55h AAh rabbit.com The System Identification and User Blocks...
  • Page 31: Writing The System Id Block

    7.1.3 Writing the System ID Block The WriteFlash() function does not allow writing to the System ID block. If the System ID block needs to be rewritten, a utility to do so is available for download from the Rabbit website: www.rabbitsemiconductor.com/downloads/files/Write_idblock.zip or contact Rabbit Semiconductor’s Technical Support.
  • Page 32: Reserved Flash Space

    8. Edit the write_idblock.c utility to set the required number of 4 KB blocks, and write a new ID block onto the target board. 9. Repeat the previous steps for every board which is to be programmed with the application(s) compiled using the updated MAX_USERBLOCK_SIZE macro value. rabbit.com The System Identification and User Blocks...
  • Page 33: Reading The User Block

    ID/User blocks size hard-coded in the libraries because their FLASHWR.LIB IDBLOCK.LIB stored calibration constants are in a nonstandard place. For this reason, Rabbit strongly recom- mends not attempting to make System ID/User block changes on these board families. 7.2.3 Reading the User Block readUserBlock int readUserBlock(void *dest, unsigned addr, unsigned numbytes);...
  • Page 34 Address offset in User block to read from. addr RETURN VALUE 0: Success -1: Invalid address or range -2: No valid System ID block found (block version 3 or later) LIBRARY IDBLOCK.LIB rabbit.com The System Identification and User Blocks...
  • Page 35: Writing The User Block

    However, to prevent errors arising from incompatible large sector configurations, this will only work if the flash type is small sector. Rabbit manufactured boards with large sector flash will have valid System and User ID blocks, so this should not be problem on Rabbit-based boards.
  • Page 36 8K bytes starting 16K bytes from the top of the primary flash are designated User block area. This only works if the flash type is small sector. Rabbit manufactured boards with large sector flash will have valid System ID and User blocks, so is not a problem on Rabbit-based boards.
  • Page 37: Chapter 8. Bios Support For Program Cloning

    The BIOS supports copying designated portions of flash memory from one controller (the master) to another (the clone). The Rabbit Cloning Board connects to the programming port of the master and to the programming port of the clone. This simple circuit can easily be incorporated into test fixtures for fast pro- duction.
  • Page 38: Creating A Clone

    When cloning completes, the LED stays on. If any error occurs, the LED will start blinking quickly. Older versions of cloning used different LED patterns, but the Rabbit 4000 is only supported by versions that use the pattern described here.
  • Page 39: Cloning Questions

    It is recommended that the cloning master and slave both have the same RAM and flash sizes. 8.3.4 Design Restrictions Digital I/O line PB1 should not be used in the design if cloning is to be used. rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 40 BIOS Support for Program Cloning...
  • Page 41: Chapter 9. Low-Power Design And Support

    Before looking at the Rabbit 4000 low-power features in greater detail, please note that some of the power consumption in an embedded system is unaffected by the clever design features of the microprocessor. As shown in the table below, the current (and thus power) consumption of a microprocessor-based system generally consists of a part that is independent of frequency and a part that depends on frequency.
  • Page 42: Details Of The Rabbit 4000 Low-Power Features

    NOTE: Short chip selects and self-timed chip selects only take place during memory reads. During writes the chip selects behave normally. For a detailed description of the chip select features, please see the Rabbit 4000 Microprocessor User’s Manual. rabbit.com...
  • Page 43: Reducing Clock Speed

    9.1.3 Preferred Crystal Configuration The preferred configuration for a Rabbit 4000 based system is to use an external crystal or resonator that has a frequency ½ the maximum internal clock frequency. The oscillator frequency can be doubled and/or divided by 2, 4, 6 or 8, giving a variety of operating speeds from the same crystal frequency.
  • Page 44: To Further Decrease Power Consumption

    Power consumption is dramatically decreased in sleepy mode. The VDD_{core}current consumption is often reduced to the region of 22 µA 3.3 V and 32.768 kHz. The Rabbit 4000 executes about 6 instructions per millisecond at this low clock speed. Generally, when the speed is reduced to this extent, the Rabbit will be in a tight polling loop looking for an event that will wake it up.
  • Page 45: External 32 Khz Oscillator

    9.2.3 External 32 kHz Oscillator Unlike the Rabbit 2000, the Rabbit 4000 has no internal 32 kHz oscillator. Instead there is a clock input. The recommended external crystal oscillator circuit and the associated battery backup circuit are discussed in Technical Note 235 available on our website: www.rabbit.com.
  • Page 46: Baud Rates In Sleepy Mode

    Debugging is not supported in sleepy modes. However, running with no polling (Alt-F9) will avoid the loss of target communications when execution enters sections of code using sleepy mode, and debug com- munications will resume when the normal operation mode is reenabled. rabbit.com Low-Power Design and Support...
  • Page 47: Chapter 10. Supported Flash Memories

    10. Supported Flash Memories There are many flash memories that have been qualified for use with the Rabbit 4000 microprocessor. Both small and large sector flash devices are supported. To incorporate a large-sectored flash into an end product, the best strategy is have a small-sectored development board.
  • Page 48: Writing Your Own Flash Driver

    • While the flash driver is running you lose access to most of the application code and to all of its con- stants. See the Rabbit 3000 Designer’s Handbook for more details. 10.2.1 Required Information for Flash Memory Below is the data structure used by the flash driver to hold the required information about the installed flash memory.
  • Page 49: Flash Driver Functions

    Rabbit Semiconductor as new flash devices are used. Table 10-1 Defined Flash Write Modes Value of Description _FlashInfo.writeMode For small sector, sector erase (0x30) byte write For small sector, sector write...
  • Page 50 It should return a zero in HL if the operation was successful, a -3 if a time-out occurred during the wait, or a -4 if an attempt was made to write over the System ID block. rabbit.com Supported Flash Memories...
  • Page 51: Chapter 11. Troubleshooting Tips For New Rabbit-Based Systems

    Rabbit-Based Systems If the Rabbit design conventions were followed and Dynamic C cannot establish target communications with the Rabbit 4000-based system, there are a number of initial checks and some diagnostic tests that can help isolate the problem. 11.1 Initial Checks Perform the first two checks with the /RESET line tied to ground.
  • Page 52 The second diagnostic program checks the processor/RAM interface. This example provides more detail in terms of how the triplets were derived. After reading through these examples, you will be able to write diagnostic programs suited for your unique board design. rabbit.com Troubleshooting Tips for New Rabbit-Based Systems...
  • Page 53: Diagnostic Test #1: Toggle The Status Pin

    SMODE lines. Other possibilities are that one of the oscil- lators is not working or is operating at the wrong frequency, or the reset could be failing. 11.2.2.1 Using serialIO.exe This test is available as StatusTgl.Diag, one of the diagnostic samples downloaded in ser_io_rab20.zip. rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 54: Diagnostic Test #2

    SRAM and functioning or the program will not execute correctly. A series of triplets are sent to the Rabbit via one of the bootstrap ports to set up the necessary control regis- ters and write several instructions to RAM. Finally the bootstrap termination code is sent and the program begins executing instructions in RAM starting at address 0x00.
  • Page 55 The triplets shown in #3 may be rewritten as: ;Address 0000 21 01 00;ld hl,1 06 10;ld b,16 7E ;ld a,hl 29 ;add hl,hl 10 FC;djnz loop C3 00 00;jp 0 ;Triplet rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 56 Troubleshooting Tips for New Rabbit-Based Systems...
  • Page 57: Appendix A. Supported Rabbit 4000 Baud Rates

    Appendix A: Supported Rabbit 4000 Baud Rates This table contains divisors to put into TATxR registers. All frequencies that allow 57600 baud up to 30MHz are shown (as well as a few higher frequencies). All of the divisors listed here were calculated with the default equation given on the next page.
  • Page 58 CPU frequency in Hz --------------------------------------------------- 1 divisor – × × baud rate Timer A clocked by , serial data rate = 8 x clock: PCLK CPU frequency in Hz --------------------------------------------------- 1 divisor – × baud rate rabbit.com Supported Rabbit 4000 Baud Rates...
  • Page 59: Notice To Users

    “reasonable commercial efforts.” All Rabbit products are functionally tested. Although our tests are comprehensive and carefully constructed, 100% test coverage of every possible defect is not practical. Our products are specified for operation under certain environmental and electrical conditions.
  • Page 60 rabbit.com...
  • Page 61: Index

    ..........4 programming cable ....... 1, 3, 13, 15, 16, 48 programming cable connector ......4 programming cable connector ........4 diagnostic tests ............47 DTR line ..............15 Dynamic C start sequence ........15 rabbit.com Rabbit 4000 Designer’s Handbook...
  • Page 62 ..............24 writing ..............27 target communications protocol ......16 through-hole ..............6 triplets ..............15, 49 troubleshooting tips ..........47 User block ...............21 reading ..............29 sizes of ..............24 writing ..............31 wait states ............10, 15 write enable ...............3 write method .............16, 44 rabbit.com Index...