Mitsubishi DS5000TK- Manuals
Mitsubishi DS5000TK– User Manual, Manual in PDF format online.
Manuals:
User Manual Mitsubishi DS5000TK
Summary
USER’S GUIDE 050396 1/173 2 SECTION 1: INTRODUCTION The Secure Microcontroller family is a line of8051–compatible devices that utilize nonvolatile RAM(NV RAM) rather than ROM for program storage. Theuse of NV RAM allows the design of a “soft” microcon-troller which provides a number of unique featur...
USER’S GUIDE 050396 2/173 3 LARGE NONVOLATILE MEMORY Soft Microprocessor chips provide nonvolatile memorycontrol for standard CMOS SRAM. Modules combinethe microprocessor chip with memory and lithium back-up. This includes conditionally write protected chip en-ables and a power supply output that sw...
USER’S GUIDE 050396 3/173 4 PRODUCT DESCRIPTION All devices listed below have the standard 8051 familyfeature set listed once here for convenience, but not re-peated for each device. • 8051–compatible instruction set • Addresses 64K program and 64K data memory • Four 8–bit pseudo–bidirectional I/O p...
USER’S GUIDE 050396 4/173 5 DS2251T 128K Soft Microcontroller Module The DS2251T is a SIMM based on the DS5001. It pro-vides up to 128K bytes of on–board NV RAM and hasthe Byte–wide bus available at the connector. This isused with the decoded peripheral enables for memorymapped peripherals such as a...
USER’S GUIDE 050396 5/173 6 SECTION 2: SELECTION GUIDE The following configurations are available. Speeds arerated maximums, but all members of the Secure Micro- controller family are fully static and can be run as slowas desired. CHIP DESCRIPTION MAXIMUM SPEED PART NUMBER DS5000FP–16 Soft Microproc...
USER’S GUIDE 050396 6/173 7 SECTION 3: SECURE MICROCONTROLLERARCHITECTURE Introduction The Secure Microcontroller family is based on an 8051compatible core with a memory interface and I/O logicbuild around it. Many functions are identical to standard8051s and are documented here for completeness. In...
USER’S GUIDE 050396 7/173 8 SECURE MICROCONTROLLER ARCHITECTURAL BLOCK DIAGRAM Figure 3–1 15 8 CE1 CE2 R/W ADDRESS ENCRYPT OR DA T A ENCRYPT OR TIMING AND CONTROL TA MCON SECURITY LOCK LOGIC PCON TIMED ACCESS LOGIC MEMOR Y ALLOCA TIONS CTL. LOGIC NONVOLA TILE CONTROL INTERRUPT CONTROL IP IE INTERNAL...
USER’S GUIDE 050396 8/173 9 Parallel I/O Four SFR’s provide access for the four parallel I/O portlatches. These I/O ports are denoted as P0, P1, P2, andP3. A total of 32 bits of parallel I/O is available throughthese I/O ports. However, up to 16 bits are sacrificedwhen the Expanded Bus mode is used ...
USER’S GUIDE 050396 9/173 10 Watchdog Timer When the user’s software is being executed, the Watch-dog Timer can be used to automatically restart the pro-cessor in the event that software control is lost. It is alsoused to generate an oscillator start–up delay to allow theclock frequency to stabilize...
7FH 2FH 2EH 2DH 2CH 2BH 2AH 29H 28H 27H 26H 25H 24H 23H 22H 21H 20H 1FH 18H 17H 10H 0FH 08H 07H 00H BANK 3 BANK 2 BANK 1 BANK 0 MSB LSB 7F 7E 7D 7C 7B 7A 79 78 77 76 75 74 73 72 71 70 6F 6E 6D 6C 6B 6A 69 68 67 66 65 64 63 62 61 60 5F 5E 5D 5C 5B 5A 59 58 57 56 55 54 53 52 51 50 4F 4E 4D 4C 4B 4A 49...
USER’S GUIDE 050396 12/173 13 The 8051 instruction set allows efficient (single cycle)access to variables when using the Working Registers.These are a group of four 8–byte banks of ScratchpadRAM. The active Working Registers are referred to asR0–R7. They reside between location 00h and 1Fh, de-pendi...
USER’S GUIDE 050396 13/173 14 DS5000 Series Memory Organization As mentioned above, the DS5000 series consists of theDS5000FP chip and the DS5000(T) and DS2250T mod-ules. The programming model discussed in this sectionapplies to all of these parts. The DS5000 series Byte–wide bus has 15 address line...
USER’S GUIDE 050396 15/173 16 case is to select a Range of 8K, and to choose a Parti-tion of greater than 8K. This will result in the Range asthe limiting factor. Addresses above the Range will auto-matically be deflected to the Expanded bus. No datamemory will be allocated in NV RAM for this config...
USER’S GUIDE 050396 16/173 17 MCON.3: RA32/8 “Range Address”: Sets the maximum usable address on the Byte–wide bus.RA32/8 = 0 sets Range Address = 1FFFH (8K); RA32/8 = 1 sets Range Ad-dress = 7FFFH (32K) Initialization: Set to a 1 on a No V LI Power On Reset and when the Security Lock bit (SL) is cl...
USER’S GUIDE 050396 17/173 18 a Partitionable mode (PM=0), the DS5001 can use upto 64K x 8 SRAM for program and data on its Byte–widebus. It can partition this area into program and datasegments on 4K boundaries. The 64K memory spacewould consist of two 32K x 8 SRAMs. Each is accessedby a separate c...
USER’S GUIDE 050396 18/173 19 PARTITIONABLE MEMORY MAP FOR DS5001/DS5002 SERIES Figure 4–5 FFFFh 0000 PROGRAM DATA LEGEND: BYTE–WIDE BUS ACCESS BYTE–WIDE BUS ACCESS PARTITION ADDR. ÏÏ ÏÏ = EXPANDED BUS ACCESS ON PORTS 0 AND 2 BYTE–WIDE ACCESS(NONVOLATILE RAM) = PES=0 64K RANGE ADDRESS MEMORY MEMORY ...
USER’S GUIDE 050396 19/173 20 Any address that does not fall into the Byte–wide busarea is routed to the Expanded bus of Ports 0 and 2. Thiscould only occur for the first two settings. Note that asingle 128K device is the least expensive in terms ofcomponent cost and size. In this case, all memory a...
USER’S GUIDE 050396 20/173 21 On occasion, a memory mapped peripheral is neededthat interfaces directly to an 8051 multiplexed bus.When this occurs, MOVX instructions can be forced touse the Expanded bus in any mode with the EXBS bit(RPCTL.5). Setting this bit to a logic one forces all MOVX instruct...
USER’S GUIDE 050396 22/173 23 DS5001/DS5002 SERIES RPCTL REGISTER BITS AFFECTING MEMORY Figure 4–9 RNR ––– EXBS AE IBI DMA RPCON RG0 Bit Description: RPCTL.5: EXBSThe Expanded Bus Select routes data memory access (MOVX) to theExpanded bus formed by ports 0 and 2 when set. Initialization: Cleared aft...
USER’S GUIDE 050396 24/173 25 MOV TA, #0AAh ; TIMED ACCESS MOV TA, #55h ; TIMED ACCESS 2 MOV MCON, #10001010b ; SET PAA BIT . ; USER’S CODE TO LOAD . ; RAM USING MOVX . . MOV TA, #0AAh ; TIMED ACCESS MOV TA, #55h ; TIMED ACCESS 2 MOV MCON, #11001000b ; LOAD NEW PARTITION AND CLEAR PAA BIT RELOADING ...
USER’S GUIDE 050396 25/173 26 SOFT RELOAD OF A DS5001/DS5002When application software decides that it should repro-gram a portion of memory, the software must convertthe target area into data memory. However, a Soft Re-load of a DS5001 series device has minor variationsfrom the DS5000 version. First...
USER’S GUIDE 050396 27/173 28 Special Function Registers The Secure Microcontroller uses Special Function Reg-isters (SFRs) to control most functions. In many cases,an SFR will contain 8 bits, each of which control a func-tion or report status on a function. The SFRs reside inregister locations 80–F...
F7 F6 F5 F4 F3 F2 F1 F0 E7 E6 E5 E4 E3 E2 E1 E0 C AC F0 RS1 RS0 OV P D7 D6 D5 D4 D3 D2 D1 D0 PA3 PA2 PA1 PA0 RA32/8 ECE2 PAA SL RWT PS PT1 PX1 PT0 PX0 BF – – BC BB BA B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 EA ES ET1 EX1 ET0 EX0 AF – – AC AB AA A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 SM0 SM1 SM2 REN TB8 RB8 TI RI 9F 9E...
USER’S GUIDE 050396 30/173 31 POWER CONTROL REGISTER Label: PCON Register Address: 087H D7 D6 D5 D4 D3 D2 D1 D0 SMOD POR PFW WTR EPFW EWT STOP IDL Bit Description: PCON.7 SMOD “Double Baud Rate”: When set to a 1, the baud rate is doubled when the serial port is being usedin modes 1, 2, or 3. Initial...
USER’S GUIDE 050396 31/173 32 PCON.3: EPFW “Enable Power Fail Interrupt”: Used to enable or disable the Power Fail Interrupt. When EPFW is set to a 1, it will be enabled; it will be disabled when EPFW is cleared to a 0. Initialization: Cleared to a 0 on any type of reset. Read Access: Can be read no...
USER’S GUIDE 050396 32/173 33 TIMER CONTROL REGISTER Label: TCON Register Address 088H D7 D6 D5 D4 D3 D2 D1 D0 TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Bit Description: TCON.7: TF1 “Timer 1 Overflow Flag”: Status bit set to 1 when Timer 1 overflows from a previous count value of all1’s. Cleared to 0 when CPU...
USER’S GUIDE 050396 33/173 34 TCON.0: IT0 “Interrupt 0 Type Select”: When set to 1, 1–to–0 transitions on INT0 will be used to generate interruptrequests from this pin. When cleared to 0, INT0 is level–activated. Initialization: Cleared to a 0 on any type of reset. TIMER MODE REGISTER Label: TMOD Re...
USER’S GUIDE 050396 34/173 35 SERIAL CONTROL REGISTER Label:SCON Register Address: 098H D7 D6 D5 D4 D3 D2 D1 D0 SM0 SM1 SM2 REN TB8 RB8 TI RI Bit Description: SCON.7, SCON.6: SM0, SM1 “Mode Select”: Used to select the operational mode of the serial I/O port as follows: SM0 SM1 MODE WORD FUNCTION BAU...
USER’S GUIDE 050396 35/173 36 Initialization: Cleared to a 0 on any type of reset. SCON.0: RI “Receive Interrupt”: Status bit used to signal that a serial data word has been received andloaded into the receive buffer register. In mode 0, it is set at the end of the 8thbit time. It is set at the mid–...
USER’S GUIDE 050396 36/173 37 INTERRUPT PRIORITY REGISTER Label:IP Register Address: 0B8H D7 D6 D5 D4 D3 D2 D1 D0 RWT – – PS PT1 PX1 PT0 PX0 Bit Description: IP.7: RWT “Reset Watchdog Timer”: When set to a 1, the Watchdog Timer count will be reset and counting willbegin again. The RWT bit will then ...
USER’S GUIDE 050396 37/173 38 DS5001 CRC REGISTER Label: CRC Register Address: 0C1H RNGE3 RNGE2 RNGE1 RNGE0 ––– ––– MDM CRC Bit Description: CRC.7–4 RNGE3–0Determines the range over which a power–up CRC will be performed.Addresses are specified on 4K boundaries. Initialization: Reset to 0 on a No V ...
USER’S GUIDE 050396 38/173 39 DS5000 MEMORY CONTROL REGISTER Label:MCON Register Address: 0C6H D7 D6 D5 D4 D3 D2 D1 D0 PA3 PA2 PA1 PA0 RA32/8 ECE2 PAA SL Bit Description: MCON.7–4: PA3–0 “Partition Address”: Used to select the starting address of Data Memory on the Byte–wide bus.Program space lies b...
USER’S GUIDE 050396 39/173 40 Read Access: May be read normally anytime. Write Access: Cannot be modified by the application software; can only be written via theBootstrap Loader. MCON.2: ECE2 “Enable Chip Enable 2”: Used to enable or disable the CE2 signal for the Byte–wide bus datamemory. This bit...
USER’S GUIDE 050396 41/173 42 PROGRAM STATUS WORD REGISTER Label:PSW Register Address: 0D0H D7 D6 D5 D4 D3 D2 D1 D0 C AC F0 RS1 RS0 OV P All of the bits in PSW except parity are read/write and are cleared to 0 on any type of reset. The Parity bit is read onlyand is cleared to 0 on any type of reset....
USER’S GUIDE 050396 42/173 43 DS5001/DS5002 RPC CONTROL REGISTER Label: RPCTL Register Address: 0D8H RNR ––– EXBS AE IBI DMA RPCON RG0 Bit Description: RPCTL.7 RNRWhen internal hardware sets this read–only bit to a 1, a new value may beread from the random number generator register of the DS5001/DS5...
USER’S GUIDE 050396 43/173 44 Read Access: Can be read anytime. Write Access: Can be written when the RPC mode is enabled (RPCON=1). RPCTL.1 RPCONEnable the RPC 8042 I/O protocol. When set, port 0 becomes the data bus,and port 2 becomes the control signals. Initialization: Cleared on all resets. Rea...
USER’S GUIDE 050396 44/173 45 Read Access: Can be read by DS5001/DS5002 and host CPU when in RPC mode. Write Access: Can be written by the DS5001/DS5002 when in RPC mode. RPS.1: IBFInput Buffer Full Flag is set following a write by the external host, and iscleared following a read of the DBBIN by th...
USER’S GUIDE 050396 45/173 46 INSTRUCTION SET Introduction The Secure Microcontroller executes an instruction setwhich is object code compatible with the industry stan-dard 8051 microcontroller. As a result, software toolswritten for the 8051 are compatible with the SecureMicrocontroller, including ...
USER’S GUIDE 050396 46/173 47 The 16–bit DPTR register may be used to access anyData Memory location within the 64K byte space. MOVX @DPTR,A ; Load the Data Memory location ; pointed to by the contents of the ; DPTR register with the contents ; of the Accumulator. Immediate AddressingImmediate Addre...
USER’S GUIDE 050396 47/173 48 Program Status Flags All of the Program Status flags are contained in the PSWregister. Instructions which affect the states of the flagsare summarized below. INSTRUCTIONS THAT AFFECT FLAG SETTINGS INSTRUCTION FLAGS C OV AC INSTRUCTION FLAGS C OV AC ADD CLR C 0 ADDC CPL ...
USER’S GUIDE 050396 48/173 49 SECTION 5: MEMORY INTERCONNECT The Secure Microcontroller family is divided betweenchips and modules. This sections illustrates thememory interconnect for the various chips and showsblock diagrams of selected modules. The Soft Micropro-cessor chips are 80–pin QFP packag...
USER’S GUIDE 050396 52/173 53 MEMORY INTERCONNECT USING THE 128K SRAM Figure 5–5 ÓÓ ÓÓ ÓÓÓÓÓÓÓÓÓ ÔÔ ÔÔ ÔÔÔÔÔÔÔÔÔ Ô Ô Ç Ç Ç ÇÇÇ Ç Ç Ç Ç Ç Ç ÇÇÇ Ç Ç Ç Ç Ç ÇÇÇ Ç Ç Ç Ç ÇÇÇ ÇÇÇ Ç Ç 13 54 +3v +5v 12 10 74 28 27 20 22 16 14 52 DS5001FP/DS5002FP V CC WE CS1 A16 A15 A14–A0 D7–D0 GND CS2 OE 128K x 8 SRAM V C...
USER’S GUIDE 050396 55/173 56 SECTION 6: LITHIUM/BATTERY BACKUP Soft Microcontroller devices are lithium backed for dataretention in the absence of V CC . In the Soft Microcon- troller the state of the microcontroller is also maintained,unlike a conventional processor system using an exter-nal NV RA...
USER’S GUIDE 050396 56/173 57 POWER SUPPLY SLEW RATE Figure 6–1 40 µ s, 130 µ s V CC V CCMIN V LI LITHIUM CURRENT Each time V CC is restored, the lithium backed functions will remain as they were left. A result is that many ofthese values are not altered on a reset condition exceptfor the ‘no batter...
USER’S GUIDE 050396 58/173 59 LITHIUM BATTERY USAGE In the vast majority of applications, lithium batteries pro-vide a reliable means of backing up data and configura-tion. The voltage varies only slightly over its useful life,so it is difficult to measure capacity. A CR chemistry willbegin life at ...
USER’S GUIDE 050396 59/173 60 SECTION 7: POWER MANAGEMENT Introduction All Dallas Semiconductor microcontrollers are imple-mented using fully static CMOS circuitry for low powerconsumption. Power consumption is a linear function ofcrystal frequency. Two software initiated modes areavailable for furt...
USER’S GUIDE 050396 60/173 61 Write Access: Cannot be written. PCON.3: EPFW “Enable Power Fail Interrupt”: Used to enable or disable the Power Fail Interrupt. When EPFW is set to a 1,it will be enabled; it will be disabled when EPFW is cleared to a 0. Initialization: Cleared to a 0 on any type of re...
USER’S GUIDE 050396 61/173 62 The original contents of those Special Function regis-ters that are initialized by a reset are lost. Voltage Monitoring Circuitry The on–chip voltage monitoring circuitry automaticallyplaces the microprocessor in its Data Retention state inthe absence of V CC . It insur...
USER’S GUIDE 050396 62/173 63 Power Fail Interrupt When V CC is stable, program execution proceeds as normal. If V CC should decay from its nominal operating voltage and drop to a level below the V PFW threshold, then the internal PFW status flag (PCON.5) will be set.In addition, a Power Fail Warnin...
USER’S GUIDE 050396 63/173 64 threshold, the Power On Reset cycle will be executed asbefore. As a result, no special processing is required insoftware to accommodate this case. In the case that V CC dips without going below V LI , the PFW flag will be set and a Power Fail Warning interruptwill still...
USER’S GUIDE 050396 65/173 66 This code allows the reset of the Watchdog Timer: MOV 0C7H,#0AAH ; 1st TA Value MOV 0C7H,#055H ; 2nd TA Value 2 Cycles SETB IP.7 ; Reset Watchdog Timer 1 Cycle The Watchdog Timer bit may have been set using ORL IP, #80H whichtakes two cycles. This code allows the reset ...
USER’S GUIDE 050396 66/173 67 Timed Access provides a statistical protection. It isunlikely that randomly generated states will correctlymatch the sequence and timing required to bypass theTimed Access logic. Presented below is a brief justifica-tion for each bit that is protected by Timed Access. T...
USER’S GUIDE 050396 67/173 68 During subsequent program execution, the WatchdogTimer can be reset by a Timed Access write operationwhich sets the RWT bit to a 1. This will cause the Watch-dog Timer to begin counting machine cycles again froman initial count of 0. The RWT bit itself is automaticallyc...
USER’S GUIDE 050396 68/173 69 WATCHDOG TIMER CONTROL BITS Bit Description: PCON.4: WTR “Watchdog Timer Reset” Set to a 1 when a Watchdog Timer timeout occurs. If Watchdog Timer Resetis enabled, this will indicate the cause of the reset. Cleared to 0 immediatelyfollowing a read of the PCON register. ...
USER’S GUIDE 050396 70/173 71 CRC CODE EXAMPLE Figure 8–3 This routine tests the CRC–16 circuit in the DS5001FP crcmsb equ 0C3h crclsb equ 0C2h org 00h ;after reset, CRC regs = 0000 begin: mov p2,crcmsb ;p2=00 read crcmsb register mov p3,crclsb ;p3=00 read crclsb register mov crclsb, #075h ;check cr...
USER’S GUIDE 050396 71/173 72 SECTION 9: FIRMWARE SECURITY One of the most unique features of the Secure Micro-controller is its firmware security. The family far sur-passes the standard offering of ROM based microcon-trollers in keeping system attackers or competitors fromviewing the contents of me...
USER’S GUIDE 050396 72/173 73 SECURITY LOCK Ordinarily, the easiest way to dump (view) the memorycontents of a Secure Microcontroller is using the Boot-strap Loader. On request, the Loader will transfer thecontents of memory to a host PC. This is prevented bythe Security Lock. The lock is the minima...
USER’S GUIDE 050396 73/173 74 DS5000 SOFTWARE ENCRYPTION BLOCK DIAGRAM Figure 9–1 PROGRAM COUNTER DATA POINTER ADDRESS ENCRYPTOR EXTERNAL BYTEWIDE RAM 40–BIT ENCRYPTION KEY DATA ENCRYPTOR SECURITY LOCK BOOTSTRAP LOADER SECURE INTERNAL DATA BUS SECURE INTERNAL ADDRESS BUS ENCRYPTED BYTEWIDE DATA BUS ...
USER’S GUIDE 050396 75/173 76 Encryption Algorithm The Secure Microcontroller family uses a proprietaryalgorithm to encrypt memory. The DS5000FP andDS5002FP use different encryption algorithms. Theyare the result of improvements made over time in theproprietary encryptor circuits. The original DS500...
CE1 ALE BA14–0 BD7–0 XXXXh YYYYh QQQQh RRRRh SINGLE CYCLE INSTRUCTION SINGLE CYCLE INSTRUCTION ENCRYPTED MEMORY ACCESS WITH DUMMY FETCHES Either XXXX or YYYY is real but encrpted, the other is pseudo–random.Either QQQQ or RRRR is real but encrypted, the other is pseudo–random.Either Byte1 or Byte2 i...
USER’S GUIDE 050396 77/173 78 On–chip Vector RAM A 48–byte RAM area is incorporated inside theDS5000FP and DS5002FP. This area maps to the first48 locations of program memory to store reset andinterrupt vectors. Any other data stored in the first 48locations will be contained in this Vector RAM. The...
USER’S GUIDE 050396 78/173 79 Security Summary by Part The preceding information outlined each of the securityfeatures. Their inclusion in various parts is shown in thetable at the beginning of this chapter. For completeness,the following is a summary description of security fea-tures for each part ...
USER’S GUIDE 050396 80/173 81 Change Code Perhaps most importantly, the user should reprogramportions of the Secure Microcontroller that deal with se-curity. For example, if the microprocessor is performingDES, the user can change DES keys. Any security sys-tem can be broken with enough time and res...
USER’S GUIDE 050396 81/173 82 SECTION 10: RESET CONDITIONS Reset Sources The Secure Microcontroller family is designed to pro-vide proper reset operation with a minimum of externalcircuitry. In fact, for may applications, external reset cir-cuitry is not required. The possible sources of reset areas...
USER’S GUIDE 050396 82/173 83 SPECIAL FUNCTION REGISTER RESET STATES Table 10–1 REGISTER LOCATION RESET CONDITION RESET TYPE PC N/A 0000h All ACC E0h 00h All B F0h 00h All PSW D0h 00h All SP 81h 07h All DPTR 83h, 82h 0000h All P0–P3 80h, 90h, A0h, B0h FFh All IP B8h 0XX00000b All IE A8h 0XX00000b Al...
USER’S GUIDE 050396 83/173 84 Power On Reset The Secure Microcontroller family provides an internalPower On Reset capability which requires no externalcomponents. When voltage is applied to the V CC pin from a power off condition, the device automatically per- forms an internal reset sequence to pre...
USER’S GUIDE 050396 84/173 85 No–V LI Power On Reset During a Power On Reset cycle, a test is automaticallyperformed by the internal control circuitry to measurethe voltage of the lithium power source. This test deter-mines whether or not the voltage (V LI ) is above the mini- mum level required (V ...
USER’S GUIDE 050396 85/173 86 APPLICATION: RESET ROUTINE EXAMPLE Like the 8051, Dallas Semiconductor Microcontrollerswill begin execution at address 0000h. This is the ResetVector, followed by other vector locations used for inter-rupts. These are discussed in the section covering inter-rupt operati...
USER’S GUIDE 050396 86/173 87 A code example that initializes the memory map is asfollows. It assumes that the DS5000FP user requires a Partition of 5800h. A DS5001FP using the same codewould use a Partition of B000h. MCON EQU 0C6h Org 00h SJMP Start Org 30hStart : MOV TA, #0AAh ;Timed MOV TA, #55h ...
USER’S GUIDE 050396 87/173 88 Timers The microprocessor disables timer activity (excludingthe Watchdog) and serial port communication on a re-set. Therefore, each timer must be setup and enabledas part of the reset routine. The serial port mode mustalso be initialized if used. This is covered in det...
USER’S GUIDE 050396 88/173 89 SECTION 11: INTERRUPTS The Secure Microcontroller family follows the standard8051 convention for interrupts (with one extra) and isfully compatible. An interrupt stops the normal flow ofprocessing and allows software to react to an event withspecial processing. This eve...
USER’S GUIDE 050396 89/173 90 External Interrupts The two external interrupts are INT0 and INT1. Theycorrespond to P3.2 and P3.3 respectively. These pinsbecome interrupts when the respective interrupt isenabled. Otherwise, they are simply port pins. No otherspecial action is required. Each pin is sa...
USER’S GUIDE 050396 91/173 92 INTERRUPT ENABLE CONTROL BITS Figure 11–2 Bit Description: All bits are read/write at any time and are cleared to 0 following any hardware reset. IE.7: EA “Enable All Interrupts”: When set to 1, each interrupt except for PFW may be individually enabled ordisabled by set...
USER’S GUIDE 050396 92/173 93 INTERRUPT PRIORITIES The Secure Microcontroller provides a three priorityinterrupt scheme. Multiple priority levels allow higherpriority sources to interrupt lower priority ISRs. ThePower–fail Warning Interrupt automatically has thehighest priority if enabled. The remai...
USER’S GUIDE 050396 93/173 94 INTERRUPT ACKNOWLEDGE The various interrupt flags are sampled an latched onceevery machine cycle, specifically during clock phaseS5P2 (see CPU timing section) regardless of other in-terrupt related activity. Likewise, the latched states ofthe flags are polled once every...
EXTERNALADDRESSCONTROL VCC ADDRESS/DATA POWERDOWN PORT 0.n INTERNALDATA BUS WRITEENABLE READENABLE READLATCH/PIN D Q Q USER’S GUIDE 050396 95/173 96 SECTION 12: PARALLEL I/O OVERVIEW The Secure Microcontroller provides four 8–bit bidirec-tional ports for general purpose I/O functions. Each portpin i...
USER’S GUIDE 050396 98/173 99 least significant eight bits of address and data. When 1’sare output on Port 2 for address bits during these cycles,strong current drivers are employed. The information inthe Port 2 SFR latch is unchanged during these cycles. Port 0 also employs strong output drivers fo...
USER’S GUIDE 050396 99/173 100 READ–MODIFY–WRITE INSTRUCTIONS MNEMONIC DESCRIPTION ANL – Logical AND ORL – Logical OR XRL – Logical Exclusive OR JBC – Branch if Bit Set and Clear (bit) CPL – Complement Bit INC – Increment DEC – Decrement DJNZ – Decrement and Branch if not Zero MOV PX.n,C – Move Carr...
USER’S GUIDE 050396 100/173 101 USE OF THE RPC MODE Figure 12–3 P2.3/WR P2.2/RD P2.1/CE PORT 2 P2.0/A0 P2.7/DACK P2.6/DRQ P2.5/IBF P2.4/OBF CONTROL BUS PORT 0 P0.0/D0 DATA BUS P0.1/D1 P0.2/D2 P0.3/D3 P0.4/D4 P0.5/D5 P0.6/D6 P0.7/D7 USE OF THE RPC MODE Figure 12–4 CS RD WR A0 REGISTER 0 0 1 0 DATA OU...
USER’S GUIDE 050396 101/173 102 RPC STATUS REGISTER – STATUS (ADDRESS 0DAH) Figure 12–5 ST7 ST6 ST5 ST4 IAO FO IBF OBF Bit Description: RPS.7–4: General purpose status bits that can be written by the DS5001/2 and can beread by the external host. Initialization: Cleared when RPCON=0. Read Access: Can...
USER’S GUIDE 050396 102/173 103 RPC PROTOCOL Data is written to the microprocessor by the host CPUand is placed in the DBBIN. At this time, the IBF flag isset in the RPC Status Register. If enabled by the IBI bitin the RPCTL register, an IBI interrupt will occur. No fur-ther updates of the DBBIN wil...
USER’S GUIDE 050396 103/173 104 RPC CONTROL REGISTER – RPCTL (ADDRESS 0D8H) Figure 12–6 RNR – EXBS AE IBI DMA RPCON RG0 Bit Description: RPCTL.3: IBIWhen using the RPC mode, an interrupt may be required for the Input BufferFlag. This interrupt is enabled by setting the Input Buffer Interrupt (IBI) b...
USER’S GUIDE 050396 104/173 105 SECTION 13: PROGRAMMABLE TIMERS FUNCTIONAL DESCRIPTION The Secure Microcontroller incorporates two 16–bit tim-ers called Timer 0 and Timer 1. Both can be used to gen-erate precise time intervals, measure external pulsewidths, or count externally applied pulses. Each p...
USER’S GUIDE 050396 105/173 106 TMOD.5, TMOD.4: Timer 1 Mode Control “Mode Select” These bit select the operating mode of the associated timer/counter as fol-lows: M1 M0 0 0 Mode 0: Eight bits with 5–bit prescale 0 1 Mode 1: 16 bits with no prescale 1 0 Mode 2: Eight bits with auto–reload 1 1 Mode 3...
USER’S GUIDE 050396 106/173 107 Mode 0 Figure 13–3 is a block diagram of a timer/counter oper-ating in Mode 0. Mode 0 configures either program-mable timer for operation as a 13–bit timer/counter. ForTimer 0, selection of Mode 0 configures bit 4 – 0 of TL0as bits 4 – 0 respectively of the 13–bit tim...
USER’S GUIDE 050396 107/173 108 Mode 1 Mode 1 for both programmable timers operates in anidentical fashion described for Mode 0, except Mode 1configures a 16–bit timer/counter register. In this case,for Timer 0, TH0 contains the most significant eight bitsof the count value while TL0 holds the least...
USER’S GUIDE 050396 108/173 109 Mode 3 When Timer 0 is selected for operation in Mode 3, bothTH0 and TL0 are configured independently as an 8–bittimer/counter and as an 8–bit timer. Figure 13–5 illus-trates the function of Timer 0 for Mode 3 operation. For Timer 0 in Mode 3, TL0 becomes an 8–bit tim...
USER’S GUIDE 050396 109/173 110 SECTION 14: SERIAL I/O FUNCTION DESCRIPTION The Secure Microcontroller, like the 8051, includes apowerful Serial I/O (UART) port capable of both syn-chronous and asynchronous communication. The baudrate and time–base source is fully programmable. Theserial port uses P...
USER’S GUIDE 050396 110/173 111 value that generates the required time interval at itsoverflow. This is the most common mode of communi-cating with a PC COM port or similar device. When talk-ing to a PC in Mode 1, the PC would be set to 8–N–1( 8 bits, no parity, 1 stop). Common baud rates are 2400,9...
USER’S GUIDE 050396 111/173 112 SCON.2: RB8 “Rcv. Bit 8”: Indicates the state of the 9th data bit received while in Mode 2 or 3 operation.If Mode 1 is selected with SM2=0, RB8 is the state of the stop bit which wasreceived. RB8 is not used in Mode 0. Initialization: Cleared to a 0 on any type of res...
USER’S GUIDE 050396 112/173 113 In most applications, Timer 1 will be configured as a tim-er which uses the internal clock oscillator frequency asits clock source. The baud rate will then be divided downfrom the time base applied to the XTAL1 and XTAL2pins. In order to provide the most flexibility, ...
USER’S GUIDE 050396 114/173 115 MODE 0 BLOCK DIAGRAM AND TIMING Figure 14–2 T1 FLAG OUTPUT SHIFT REGISTER SI S0 LOAD CLK D7 D6 D5 D4 D3 D2 D1 D0 DATA BUS P3.0 LATCH RXD PIN LDSBUF RDSBUF R1 FLAG SERIALINTERRUPT LDSBUF SI0 CONTROL SHIFT RDSBUF RBUFLD RD RCV BUFFER WR SI S0 INPUT SHIFT REGISTER CLK Q7...
USER’S GUIDE 050396 115/173 116 ASYNCHRONOUS OPERATION Mode 1, 2, and 3 provide asynchronous, full-duplexcommunication via the Serial I/O Port. The serial dataword is either 10 or 11 bits long, depending on the modeselected. All three modes include one start bit, eightdata bits, and one stop bit. Mo...
USER’S GUIDE 050396 117/173 118 SERIAL PORT MODE 1 BLOCK DIAGRAM Figure 14–3 MUX TIMER 1 OVERFLOW 1 0 T1 FLAG BIT DETECTOR RXD PIN DIV. BY 16 f CLK /2 TRANSMIT TIMING: WRSBUF SHIFT TXD TI RXD BIT DETECTORSAMPLING SHIFT RI RECEIVE TIMING: D0 D1 D2 D3 D4 D5 D6 D7 STOP D0 D1 D2 D3 D4 D5 D6 D7 STOP XMIT...
USER’S GUIDE 050396 118/173 119 MODE2 AND 3 BLOCK DIAGRAM Figure 14–4 T1 FLAG BIT DETECTOR RXD PIN DIV. BY 16 XMIT SHIFT REGISTER SI S0 LOAD CLK DATA BUS P3.1 LATCH TXD PIN WRSBUF RDSBUF DIVIDE BY 16 R1 FLAG SERIALINTERRUPT WRSBUF SCLK RESET SI0 CONTROL SHIFT RDSBUF LOAD RD RCV DATA BUFFER WR SI S0 ...
USER’S GUIDE 050396 119/173 120 APPLICATION: SERIAL PORTINITIALIZATION The serial port can provide either synchronous orasynchronous serial communication. This note demon-strates how to initialize the serial port and includes anexample showing how to perform asynchronous com-munication with a PC COM...
USER’S GUIDE 050396 120/173 121 SM0 = 0 and SM1 = 1 corresponds to the value SCON.7= 0 and SCON.6 = 1. In addition the since the applica-tion requires receiving data, the serial receiver must be enabled. This is done by setting the REN bit at SCON.4to a logic 1. The remaining bits in SCON can be wri...
XTAL2 XTAL1 GND NC EXT. OSC.SIGNAL USER’S GUIDE 050396 123/173 124 SECTION 15: CPU TIMING OSCILLATOR The Secure Microcontroller provides an on–chip oscilla-tor circuit which may be driven either by using an exter-nal crystal as a time base or from a TTL–compatibleclock signal. The oscillator circuit...
USER’S GUIDE 050396 124/173 125 INSTRUCTION TIMING The internal clocking signals are divided to produce thenecessary clock phases, state times, and machinecycles which define the sequential execution of instruc-tions. Two clock oscillator periods define one state time.The first clock oscillator puls...
USER’S GUIDE 050396 126/173 127 Multiplexed address and data information appear on thePort 0 pins as Program Memory fetches are performedon the Expanded Bus. The falling edge of ALE can beused to signal when the lowest eight bits of valid ad-dress information are being output on Port 0 when sucha fe...
USER’S GUIDE 050396 128/173 129 EXPANDED DATA MEMORY TIMING The timing for the Expanded Data Memory access cycleis illustrated in Figures 15–5 and 6. Accesses to DataMemory on the Expanded Bus will occur any time that aMOVX instruction is executed that references a DataMemory location that is mapped...
USER’S GUIDE 050396 129/173 130 SECTION 16: PROGRAM LOADING INTRODUCTION Program loading is performed to initialize the contentsof NV RAM and to configure the microcontroller. Load-ing is done using a Bootstrap ROM Loader built into allmembers of the Secure Microcontroller family. Whenthis Bootstrap...
USER’S GUIDE 050396 130/173 131 The indeterminate area contains various stacks andbuffers used by the loader, and a given byte in this areamay or may not be modified by the loader. As such theuser should not rely on the bootstrap loader preservingany data in this area. In a like manner, because not ...
USER’S GUIDE 050396 133/173 134 AUTO–BAUD RATE DETECTION The Serial Bootstrap Loader has the capability of deter-mining which of the six supported baud rate frequenciesis being used for communication and initializing its inter-nal hardware for communication at that frequency.When the Program Load mo...
USER’S GUIDE 050396 134/173 135 BOOTSTRAP LOADER INITIALIZATION When loader mode is invoked, the device will await anincoming <CR> character at a valid baud rate througheither the serial port (in Serial Program Load mode) orvia the parallel interface (in Parallel Program Loadmode). At this poi...
USER’S GUIDE 050396 135/173 136 An address will always be the right–most four digits of ahexadecimal number. For example, the following hexa-decimal numbers will result in the following addresses: A → 000AH AB → 00ABH ABC → 0ABCH ABCD → 0ABCDH ABCDE → 0BCDEH The D and F commands allow optional addre...
USER’S GUIDE 050396 136/173 137 F byte [begin–address [end–address]] Fill memory with the value of the specified byte. An op-tional address range may be specified. G Data is read from ports 0, 1, 2 and 3 and is printed as fourpairs of hexadecimal digits. I A CRC–16 is computed from 0 to CRC_RANGE mi...
USER’S GUIDE 050396 138/173 139 compared to the computed value for the record, and ifdifferent, the error message E:BADCKS is printed out.Unfortunately, the data bytes for this record will havebeen put to memory already. End of Data records (01)do not check for valid checksums. After a byte is put t...
USER’S GUIDE 050396 139/173 140 INTEL HEX FILE FORMAT 8051–compatible assemblers produce an absolute out-put file in Intel Hex format. These files are composed of aseries of records. Records in an Intel Hex file have thefollowing format: <Header><Hex Information><Record Terminator>...
USER’S GUIDE 050396 140/173 141 PARALLEL PROGRAM LOAD OPERATION The DS5000 Parallel Program Load mode is compatiblewith the Program mode of the 87C51. The hardwareconfiguration used for this mode of operation is shown in Figure 16–3. Dallas Semiconductor recommends theuse of the serial Program Load ...
USER’S GUIDE 050396 141/173 142 PARALLEL PROGRAM LOAD MODE Table 16–3 summarizes the selection of the availableParallel Program Load cycles. Figure 16–4 illustratesthe timing associated with these cycles. 8751–COMPATIBLE PROGRAM LOAD CYCLES Table 16–3 MODE RST PSEN PROG EA P2.7 P2.6 P2.5 Program 1 0...
USER’S GUIDE 050396 142/173 143 PARALLEL PROGRAMMING CONCERNS Dallas Semiconductor highly recommends using theserial load mode for programming the DS5000. It hasproven highly reliable and easy to use. In the event thatparallel programming is still desirable to some users,several incompatibilities ha...
USER’S GUIDE 050396 143/173 144 SECTION 17: REAL–TIME CLOCK Many user applications require a time–of–day clock.For this reason, all Secure Microcontroller moduleshave real–time clock (RTC) options. These include theDS5000T DIP and the DS2250T, DS2251T, andDS2252T SIMMs. In addition, users of the mon...
USER’S GUIDE 050396 145/173 146 PATTERN COMPARISON REGISTER DESCRIPTION Figure 17–2 7 6 5 4 3 2 1 0 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7 HEX CODE C5 3A A...
USER’S GUIDE 050396 148/173 149 TIME REGISTER EXAMPLES Figure 17–5 7 6 5 4 3 2 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 RANGE (BCD) 00–99 00–59 00–59 01–12 01–07 01–31 01–12 00–99 CLOCK 0 1 2 3 4 5 6 7 REGISTER # 1 0 0 0 1 0 0 1 1 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 ...
USER’S GUIDE 050396 149/173 150 DS1283 WATCHDOG TIMEKEEPER CHIP The DS2251T and DS2252T use the DS1283 Byte–wide RTC. This is also the clock of choice for usersdesigning with the microprocessor chips (DS5000FP,DS5001FP, and DS5002FP). This clock gives perma-nently powered time–of–day monitoring. The...
USER’S GUIDE 050396 150/173 151 DS2251T/DS2252T RTC BLOCK DIAGRAM Figure 17–6 ÇÇÇÇÇÇ ÇÇÇÇÇÇ DS5001 CPU DS1283 RTC DS2251T V CCO V CC PE1 CE R/W WE ÑÑÑÑÑÑ ÑÑÑÑÑÑ BA5–0 A5–0 BD7–0 INTB INTA INTP ÇÇÇÇÇÇ ÇÇÇÇÇÇ DS5002 CPU DS1283 RTC DS2252T V CCO V CC PE1 CE R/W WE ÑÑÑÑÑÑ ÑÑÑÑÑÑ BA5–0 A5–0 BD7–0 INTP P3...
USER’S GUIDE 050396 152/173 153 The time, calendar, and alarms are controlled by theinformation in these 14 registers. In particular, the Com-mand register controls most functions. This is describedin Figure 17–8. There are two additional bits thatdeserve mention. These reside in the register ataddr...
USER’S GUIDE 050396 153/173 154 DS1283 RTC INTERRUPTS The DS1283 provides two interrupt functions. They aretime–of–day alarm and a watchdog alarm. The watch-dog alarm is a user programmed periodic interval time–out. It is programmed using registers 0Ch and 0Dh. Thetime–of–day alarm is controlled by ...
USER’S GUIDE 050396 163/173 164 SECTION 18: TROUBLESHOOTING Dallas Semiconductor’s Secure Microcontroller familyhas proven itself to be a reliable and easy–to–use prod-uct. As with any highly–integrated device, however,questions and or problems can arise during its use anddevelopment. Many of these ...
USER’S GUIDE 050396 164/173 165 lithium batteries have a very long time constant. Puttingthe device on the shelf for one to two weeks may restoreenough voltage to battery back the memory again. Thelifetime of such a battery will be reduced, however. UNABLE TO INVOKE STOP MODE Unlike the 8051, the ST...
USER’S GUIDE 050396 167/173 168 SECTION 19: INSTRUCTION SET DETAILS MNEMONIC INSTRUCTION CODE HEX BYTE CYCLE EXPLANATION MNEMONIC D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 HEX BYTE CYCLE EXPLANATION ADD A, Rn 0 0 1 0 1 n 2 n 1 n 0 28–2F 1 1 (A) = (A) + (Rn) ADD A, direct 0 a 7 0 a 6 1 a 5 0 a 4 0 a 3 1 a 2 0 ...
USER’S GUIDE 050396 168/173 169 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC ARITHMETIC OPER. DA A 1 1 0 1 0 1 0 0 D4 1 1 Contents of Accu-mulator are BCD, IF [[(A 3–0 ) > 9] OR [(AC) = 1]] THEN(A 3–0 ) = (A 3–0 ) + 6 AND...
USER’S GUIDE 050396 169/173 170 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC RL A 0 0 1 0 0 0 1 1 23 1 1 A 1 A 7 A 6 A 5 A 4 A 3 A 2 A 0 The contents of theaccumulator are ro-tated left by one bit. R A TION RLC A 0 0 1 1 0 0...
USER’S GUIDE 050396 170/173 171 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC MOV direct,#data 0 a 7 d 7 1 a 6 d 6 1 a 5 d 5 1 a 4 d 4 0 a 3 d 3 1 a 2 d 2 0 a 1 d 1 1 a 0 d 0 75 Byte 2Byte 3 3 2 (direct) = #data MOV @Ri, A 1 ...
USER’S GUIDE 050396 171/173 172 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC CLR C 1 1 0 0 0 0 1 1 C3 1 1 (C) = 0 CLR bit 1 b 7 1 b 6 0 b 5 0 b 4 0 b 3 0 b 2 1 b 1 0 b 0 C2 Byte 2 2 1 (bit) = 0 SETB C 1 1 0 1 0 0 1 1 D3 1 1 ...
USER’S GUIDE 050396 172/173 173 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC ACALL addr 11 a 10 a 7 a 9 a 6 a 8 a 5 1 a 4 0 a 3 0 a 2 0 a 1 1 a 0 Byte 1Byte 2 2 2 (PC) = (PC) + 2(SP) = (SP) + 1((SP)) = (PC 7–0 ) (SP) = (SP) ...
USER’S GUIDE 050396 173/173 174 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC JNB bit, rel 0 b 7 r 7 0 b 6 r 6 1 b 5 r 5 1 b 4 r 4 0 b 3 r 3 0 b 2 r 2 0 b 1 r 1 0 b 0 r 0 30 Byte 2Byte 3 3 2 (PC) = (PC) + 3IF (bit) = 0 THEN(P...
Manual Mitsubishi DS5000TK
Summary
USER’S GUIDE 050396 1/173 2 SECTION 1: INTRODUCTION The Secure Microcontroller family is a line of8051–compatible devices that utilize nonvolatile RAM(NV RAM) rather than ROM for program storage. Theuse of NV RAM allows the design of a “soft” microcon-troller which provides a number of unique featur...
USER’S GUIDE 050396 2/173 3 LARGE NONVOLATILE MEMORY Soft Microprocessor chips provide nonvolatile memorycontrol for standard CMOS SRAM. Modules combinethe microprocessor chip with memory and lithium back-up. This includes conditionally write protected chip en-ables and a power supply output that sw...
USER’S GUIDE 050396 3/173 4 PRODUCT DESCRIPTION All devices listed below have the standard 8051 familyfeature set listed once here for convenience, but not re-peated for each device. • 8051–compatible instruction set • Addresses 64K program and 64K data memory • Four 8–bit pseudo–bidirectional I/O p...
USER’S GUIDE 050396 4/173 5 DS2251T 128K Soft Microcontroller Module The DS2251T is a SIMM based on the DS5001. It pro-vides up to 128K bytes of on–board NV RAM and hasthe Byte–wide bus available at the connector. This isused with the decoded peripheral enables for memorymapped peripherals such as a...
USER’S GUIDE 050396 5/173 6 SECTION 2: SELECTION GUIDE The following configurations are available. Speeds arerated maximums, but all members of the Secure Micro- controller family are fully static and can be run as slowas desired. CHIP DESCRIPTION MAXIMUM SPEED PART NUMBER DS5000FP–16 Soft Microproc...
USER’S GUIDE 050396 6/173 7 SECTION 3: SECURE MICROCONTROLLERARCHITECTURE Introduction The Secure Microcontroller family is based on an 8051compatible core with a memory interface and I/O logicbuild around it. Many functions are identical to standard8051s and are documented here for completeness. In...
USER’S GUIDE 050396 7/173 8 SECURE MICROCONTROLLER ARCHITECTURAL BLOCK DIAGRAM Figure 3–1 15 8 CE1 CE2 R/W ADDRESS ENCRYPT OR DA T A ENCRYPT OR TIMING AND CONTROL TA MCON SECURITY LOCK LOGIC PCON TIMED ACCESS LOGIC MEMOR Y ALLOCA TIONS CTL. LOGIC NONVOLA TILE CONTROL INTERRUPT CONTROL IP IE INTERNAL...
USER’S GUIDE 050396 8/173 9 Parallel I/O Four SFR’s provide access for the four parallel I/O portlatches. These I/O ports are denoted as P0, P1, P2, andP3. A total of 32 bits of parallel I/O is available throughthese I/O ports. However, up to 16 bits are sacrificedwhen the Expanded Bus mode is used ...
USER’S GUIDE 050396 9/173 10 Watchdog Timer When the user’s software is being executed, the Watch-dog Timer can be used to automatically restart the pro-cessor in the event that software control is lost. It is alsoused to generate an oscillator start–up delay to allow theclock frequency to stabilize...
7FH 2FH 2EH 2DH 2CH 2BH 2AH 29H 28H 27H 26H 25H 24H 23H 22H 21H 20H 1FH 18H 17H 10H 0FH 08H 07H 00H BANK 3 BANK 2 BANK 1 BANK 0 MSB LSB 7F 7E 7D 7C 7B 7A 79 78 77 76 75 74 73 72 71 70 6F 6E 6D 6C 6B 6A 69 68 67 66 65 64 63 62 61 60 5F 5E 5D 5C 5B 5A 59 58 57 56 55 54 53 52 51 50 4F 4E 4D 4C 4B 4A 49...
USER’S GUIDE 050396 12/173 13 The 8051 instruction set allows efficient (single cycle)access to variables when using the Working Registers.These are a group of four 8–byte banks of ScratchpadRAM. The active Working Registers are referred to asR0–R7. They reside between location 00h and 1Fh, de-pendi...
USER’S GUIDE 050396 13/173 14 DS5000 Series Memory Organization As mentioned above, the DS5000 series consists of theDS5000FP chip and the DS5000(T) and DS2250T mod-ules. The programming model discussed in this sectionapplies to all of these parts. The DS5000 series Byte–wide bus has 15 address line...
USER’S GUIDE 050396 15/173 16 case is to select a Range of 8K, and to choose a Parti-tion of greater than 8K. This will result in the Range asthe limiting factor. Addresses above the Range will auto-matically be deflected to the Expanded bus. No datamemory will be allocated in NV RAM for this config...
USER’S GUIDE 050396 16/173 17 MCON.3: RA32/8 “Range Address”: Sets the maximum usable address on the Byte–wide bus.RA32/8 = 0 sets Range Address = 1FFFH (8K); RA32/8 = 1 sets Range Ad-dress = 7FFFH (32K) Initialization: Set to a 1 on a No V LI Power On Reset and when the Security Lock bit (SL) is cl...
USER’S GUIDE 050396 17/173 18 a Partitionable mode (PM=0), the DS5001 can use upto 64K x 8 SRAM for program and data on its Byte–widebus. It can partition this area into program and datasegments on 4K boundaries. The 64K memory spacewould consist of two 32K x 8 SRAMs. Each is accessedby a separate c...
USER’S GUIDE 050396 18/173 19 PARTITIONABLE MEMORY MAP FOR DS5001/DS5002 SERIES Figure 4–5 FFFFh 0000 PROGRAM DATA LEGEND: BYTE–WIDE BUS ACCESS BYTE–WIDE BUS ACCESS PARTITION ADDR. ÏÏ ÏÏ = EXPANDED BUS ACCESS ON PORTS 0 AND 2 BYTE–WIDE ACCESS(NONVOLATILE RAM) = PES=0 64K RANGE ADDRESS MEMORY MEMORY ...
USER’S GUIDE 050396 19/173 20 Any address that does not fall into the Byte–wide busarea is routed to the Expanded bus of Ports 0 and 2. Thiscould only occur for the first two settings. Note that asingle 128K device is the least expensive in terms ofcomponent cost and size. In this case, all memory a...
USER’S GUIDE 050396 20/173 21 On occasion, a memory mapped peripheral is neededthat interfaces directly to an 8051 multiplexed bus.When this occurs, MOVX instructions can be forced touse the Expanded bus in any mode with the EXBS bit(RPCTL.5). Setting this bit to a logic one forces all MOVX instruct...
USER’S GUIDE 050396 22/173 23 DS5001/DS5002 SERIES RPCTL REGISTER BITS AFFECTING MEMORY Figure 4–9 RNR ––– EXBS AE IBI DMA RPCON RG0 Bit Description: RPCTL.5: EXBSThe Expanded Bus Select routes data memory access (MOVX) to theExpanded bus formed by ports 0 and 2 when set. Initialization: Cleared aft...
USER’S GUIDE 050396 24/173 25 MOV TA, #0AAh ; TIMED ACCESS MOV TA, #55h ; TIMED ACCESS 2 MOV MCON, #10001010b ; SET PAA BIT . ; USER’S CODE TO LOAD . ; RAM USING MOVX . . MOV TA, #0AAh ; TIMED ACCESS MOV TA, #55h ; TIMED ACCESS 2 MOV MCON, #11001000b ; LOAD NEW PARTITION AND CLEAR PAA BIT RELOADING ...
USER’S GUIDE 050396 25/173 26 SOFT RELOAD OF A DS5001/DS5002When application software decides that it should repro-gram a portion of memory, the software must convertthe target area into data memory. However, a Soft Re-load of a DS5001 series device has minor variationsfrom the DS5000 version. First...
USER’S GUIDE 050396 27/173 28 Special Function Registers The Secure Microcontroller uses Special Function Reg-isters (SFRs) to control most functions. In many cases,an SFR will contain 8 bits, each of which control a func-tion or report status on a function. The SFRs reside inregister locations 80–F...
F7 F6 F5 F4 F3 F2 F1 F0 E7 E6 E5 E4 E3 E2 E1 E0 C AC F0 RS1 RS0 OV P D7 D6 D5 D4 D3 D2 D1 D0 PA3 PA2 PA1 PA0 RA32/8 ECE2 PAA SL RWT PS PT1 PX1 PT0 PX0 BF – – BC BB BA B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 EA ES ET1 EX1 ET0 EX0 AF – – AC AB AA A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 SM0 SM1 SM2 REN TB8 RB8 TI RI 9F 9E...
USER’S GUIDE 050396 30/173 31 POWER CONTROL REGISTER Label: PCON Register Address: 087H D7 D6 D5 D4 D3 D2 D1 D0 SMOD POR PFW WTR EPFW EWT STOP IDL Bit Description: PCON.7 SMOD “Double Baud Rate”: When set to a 1, the baud rate is doubled when the serial port is being usedin modes 1, 2, or 3. Initial...
USER’S GUIDE 050396 31/173 32 PCON.3: EPFW “Enable Power Fail Interrupt”: Used to enable or disable the Power Fail Interrupt. When EPFW is set to a 1, it will be enabled; it will be disabled when EPFW is cleared to a 0. Initialization: Cleared to a 0 on any type of reset. Read Access: Can be read no...
USER’S GUIDE 050396 32/173 33 TIMER CONTROL REGISTER Label: TCON Register Address 088H D7 D6 D5 D4 D3 D2 D1 D0 TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Bit Description: TCON.7: TF1 “Timer 1 Overflow Flag”: Status bit set to 1 when Timer 1 overflows from a previous count value of all1’s. Cleared to 0 when CPU...
USER’S GUIDE 050396 33/173 34 TCON.0: IT0 “Interrupt 0 Type Select”: When set to 1, 1–to–0 transitions on INT0 will be used to generate interruptrequests from this pin. When cleared to 0, INT0 is level–activated. Initialization: Cleared to a 0 on any type of reset. TIMER MODE REGISTER Label: TMOD Re...
USER’S GUIDE 050396 34/173 35 SERIAL CONTROL REGISTER Label:SCON Register Address: 098H D7 D6 D5 D4 D3 D2 D1 D0 SM0 SM1 SM2 REN TB8 RB8 TI RI Bit Description: SCON.7, SCON.6: SM0, SM1 “Mode Select”: Used to select the operational mode of the serial I/O port as follows: SM0 SM1 MODE WORD FUNCTION BAU...
USER’S GUIDE 050396 35/173 36 Initialization: Cleared to a 0 on any type of reset. SCON.0: RI “Receive Interrupt”: Status bit used to signal that a serial data word has been received andloaded into the receive buffer register. In mode 0, it is set at the end of the 8thbit time. It is set at the mid–...
USER’S GUIDE 050396 36/173 37 INTERRUPT PRIORITY REGISTER Label:IP Register Address: 0B8H D7 D6 D5 D4 D3 D2 D1 D0 RWT – – PS PT1 PX1 PT0 PX0 Bit Description: IP.7: RWT “Reset Watchdog Timer”: When set to a 1, the Watchdog Timer count will be reset and counting willbegin again. The RWT bit will then ...
USER’S GUIDE 050396 37/173 38 DS5001 CRC REGISTER Label: CRC Register Address: 0C1H RNGE3 RNGE2 RNGE1 RNGE0 ––– ––– MDM CRC Bit Description: CRC.7–4 RNGE3–0Determines the range over which a power–up CRC will be performed.Addresses are specified on 4K boundaries. Initialization: Reset to 0 on a No V ...
USER’S GUIDE 050396 38/173 39 DS5000 MEMORY CONTROL REGISTER Label:MCON Register Address: 0C6H D7 D6 D5 D4 D3 D2 D1 D0 PA3 PA2 PA1 PA0 RA32/8 ECE2 PAA SL Bit Description: MCON.7–4: PA3–0 “Partition Address”: Used to select the starting address of Data Memory on the Byte–wide bus.Program space lies b...
USER’S GUIDE 050396 39/173 40 Read Access: May be read normally anytime. Write Access: Cannot be modified by the application software; can only be written via theBootstrap Loader. MCON.2: ECE2 “Enable Chip Enable 2”: Used to enable or disable the CE2 signal for the Byte–wide bus datamemory. This bit...
USER’S GUIDE 050396 41/173 42 PROGRAM STATUS WORD REGISTER Label:PSW Register Address: 0D0H D7 D6 D5 D4 D3 D2 D1 D0 C AC F0 RS1 RS0 OV P All of the bits in PSW except parity are read/write and are cleared to 0 on any type of reset. The Parity bit is read onlyand is cleared to 0 on any type of reset....
USER’S GUIDE 050396 42/173 43 DS5001/DS5002 RPC CONTROL REGISTER Label: RPCTL Register Address: 0D8H RNR ––– EXBS AE IBI DMA RPCON RG0 Bit Description: RPCTL.7 RNRWhen internal hardware sets this read–only bit to a 1, a new value may beread from the random number generator register of the DS5001/DS5...
USER’S GUIDE 050396 43/173 44 Read Access: Can be read anytime. Write Access: Can be written when the RPC mode is enabled (RPCON=1). RPCTL.1 RPCONEnable the RPC 8042 I/O protocol. When set, port 0 becomes the data bus,and port 2 becomes the control signals. Initialization: Cleared on all resets. Rea...
USER’S GUIDE 050396 44/173 45 Read Access: Can be read by DS5001/DS5002 and host CPU when in RPC mode. Write Access: Can be written by the DS5001/DS5002 when in RPC mode. RPS.1: IBFInput Buffer Full Flag is set following a write by the external host, and iscleared following a read of the DBBIN by th...
USER’S GUIDE 050396 45/173 46 INSTRUCTION SET Introduction The Secure Microcontroller executes an instruction setwhich is object code compatible with the industry stan-dard 8051 microcontroller. As a result, software toolswritten for the 8051 are compatible with the SecureMicrocontroller, including ...
USER’S GUIDE 050396 46/173 47 The 16–bit DPTR register may be used to access anyData Memory location within the 64K byte space. MOVX @DPTR,A ; Load the Data Memory location ; pointed to by the contents of the ; DPTR register with the contents ; of the Accumulator. Immediate AddressingImmediate Addre...
USER’S GUIDE 050396 47/173 48 Program Status Flags All of the Program Status flags are contained in the PSWregister. Instructions which affect the states of the flagsare summarized below. INSTRUCTIONS THAT AFFECT FLAG SETTINGS INSTRUCTION FLAGS C OV AC INSTRUCTION FLAGS C OV AC ADD CLR C 0 ADDC CPL ...
USER’S GUIDE 050396 48/173 49 SECTION 5: MEMORY INTERCONNECT The Secure Microcontroller family is divided betweenchips and modules. This sections illustrates thememory interconnect for the various chips and showsblock diagrams of selected modules. The Soft Micropro-cessor chips are 80–pin QFP packag...
USER’S GUIDE 050396 52/173 53 MEMORY INTERCONNECT USING THE 128K SRAM Figure 5–5 ÓÓ ÓÓ ÓÓÓÓÓÓÓÓÓ ÔÔ ÔÔ ÔÔÔÔÔÔÔÔÔ Ô Ô Ç Ç Ç ÇÇÇ Ç Ç Ç Ç Ç Ç ÇÇÇ Ç Ç Ç Ç Ç ÇÇÇ Ç Ç Ç Ç ÇÇÇ ÇÇÇ Ç Ç 13 54 +3v +5v 12 10 74 28 27 20 22 16 14 52 DS5001FP/DS5002FP V CC WE CS1 A16 A15 A14–A0 D7–D0 GND CS2 OE 128K x 8 SRAM V C...
USER’S GUIDE 050396 55/173 56 SECTION 6: LITHIUM/BATTERY BACKUP Soft Microcontroller devices are lithium backed for dataretention in the absence of V CC . In the Soft Microcon- troller the state of the microcontroller is also maintained,unlike a conventional processor system using an exter-nal NV RA...
USER’S GUIDE 050396 56/173 57 POWER SUPPLY SLEW RATE Figure 6–1 40 µ s, 130 µ s V CC V CCMIN V LI LITHIUM CURRENT Each time V CC is restored, the lithium backed functions will remain as they were left. A result is that many ofthese values are not altered on a reset condition exceptfor the ‘no batter...
USER’S GUIDE 050396 58/173 59 LITHIUM BATTERY USAGE In the vast majority of applications, lithium batteries pro-vide a reliable means of backing up data and configura-tion. The voltage varies only slightly over its useful life,so it is difficult to measure capacity. A CR chemistry willbegin life at ...
USER’S GUIDE 050396 59/173 60 SECTION 7: POWER MANAGEMENT Introduction All Dallas Semiconductor microcontrollers are imple-mented using fully static CMOS circuitry for low powerconsumption. Power consumption is a linear function ofcrystal frequency. Two software initiated modes areavailable for furt...
USER’S GUIDE 050396 60/173 61 Write Access: Cannot be written. PCON.3: EPFW “Enable Power Fail Interrupt”: Used to enable or disable the Power Fail Interrupt. When EPFW is set to a 1,it will be enabled; it will be disabled when EPFW is cleared to a 0. Initialization: Cleared to a 0 on any type of re...
USER’S GUIDE 050396 61/173 62 The original contents of those Special Function regis-ters that are initialized by a reset are lost. Voltage Monitoring Circuitry The on–chip voltage monitoring circuitry automaticallyplaces the microprocessor in its Data Retention state inthe absence of V CC . It insur...
USER’S GUIDE 050396 62/173 63 Power Fail Interrupt When V CC is stable, program execution proceeds as normal. If V CC should decay from its nominal operating voltage and drop to a level below the V PFW threshold, then the internal PFW status flag (PCON.5) will be set.In addition, a Power Fail Warnin...
USER’S GUIDE 050396 63/173 64 threshold, the Power On Reset cycle will be executed asbefore. As a result, no special processing is required insoftware to accommodate this case. In the case that V CC dips without going below V LI , the PFW flag will be set and a Power Fail Warning interruptwill still...
USER’S GUIDE 050396 65/173 66 This code allows the reset of the Watchdog Timer: MOV 0C7H,#0AAH ; 1st TA Value MOV 0C7H,#055H ; 2nd TA Value 2 Cycles SETB IP.7 ; Reset Watchdog Timer 1 Cycle The Watchdog Timer bit may have been set using ORL IP, #80H whichtakes two cycles. This code allows the reset ...
USER’S GUIDE 050396 66/173 67 Timed Access provides a statistical protection. It isunlikely that randomly generated states will correctlymatch the sequence and timing required to bypass theTimed Access logic. Presented below is a brief justifica-tion for each bit that is protected by Timed Access. T...
USER’S GUIDE 050396 67/173 68 During subsequent program execution, the WatchdogTimer can be reset by a Timed Access write operationwhich sets the RWT bit to a 1. This will cause the Watch-dog Timer to begin counting machine cycles again froman initial count of 0. The RWT bit itself is automaticallyc...
USER’S GUIDE 050396 68/173 69 WATCHDOG TIMER CONTROL BITS Bit Description: PCON.4: WTR “Watchdog Timer Reset” Set to a 1 when a Watchdog Timer timeout occurs. If Watchdog Timer Resetis enabled, this will indicate the cause of the reset. Cleared to 0 immediatelyfollowing a read of the PCON register. ...
USER’S GUIDE 050396 70/173 71 CRC CODE EXAMPLE Figure 8–3 This routine tests the CRC–16 circuit in the DS5001FP crcmsb equ 0C3h crclsb equ 0C2h org 00h ;after reset, CRC regs = 0000 begin: mov p2,crcmsb ;p2=00 read crcmsb register mov p3,crclsb ;p3=00 read crclsb register mov crclsb, #075h ;check cr...
USER’S GUIDE 050396 71/173 72 SECTION 9: FIRMWARE SECURITY One of the most unique features of the Secure Micro-controller is its firmware security. The family far sur-passes the standard offering of ROM based microcon-trollers in keeping system attackers or competitors fromviewing the contents of me...
USER’S GUIDE 050396 72/173 73 SECURITY LOCK Ordinarily, the easiest way to dump (view) the memorycontents of a Secure Microcontroller is using the Boot-strap Loader. On request, the Loader will transfer thecontents of memory to a host PC. This is prevented bythe Security Lock. The lock is the minima...
USER’S GUIDE 050396 73/173 74 DS5000 SOFTWARE ENCRYPTION BLOCK DIAGRAM Figure 9–1 PROGRAM COUNTER DATA POINTER ADDRESS ENCRYPTOR EXTERNAL BYTEWIDE RAM 40–BIT ENCRYPTION KEY DATA ENCRYPTOR SECURITY LOCK BOOTSTRAP LOADER SECURE INTERNAL DATA BUS SECURE INTERNAL ADDRESS BUS ENCRYPTED BYTEWIDE DATA BUS ...
USER’S GUIDE 050396 75/173 76 Encryption Algorithm The Secure Microcontroller family uses a proprietaryalgorithm to encrypt memory. The DS5000FP andDS5002FP use different encryption algorithms. Theyare the result of improvements made over time in theproprietary encryptor circuits. The original DS500...
CE1 ALE BA14–0 BD7–0 XXXXh YYYYh QQQQh RRRRh SINGLE CYCLE INSTRUCTION SINGLE CYCLE INSTRUCTION ENCRYPTED MEMORY ACCESS WITH DUMMY FETCHES Either XXXX or YYYY is real but encrpted, the other is pseudo–random.Either QQQQ or RRRR is real but encrypted, the other is pseudo–random.Either Byte1 or Byte2 i...
USER’S GUIDE 050396 77/173 78 On–chip Vector RAM A 48–byte RAM area is incorporated inside theDS5000FP and DS5002FP. This area maps to the first48 locations of program memory to store reset andinterrupt vectors. Any other data stored in the first 48locations will be contained in this Vector RAM. The...
USER’S GUIDE 050396 78/173 79 Security Summary by Part The preceding information outlined each of the securityfeatures. Their inclusion in various parts is shown in thetable at the beginning of this chapter. For completeness,the following is a summary description of security fea-tures for each part ...
USER’S GUIDE 050396 80/173 81 Change Code Perhaps most importantly, the user should reprogramportions of the Secure Microcontroller that deal with se-curity. For example, if the microprocessor is performingDES, the user can change DES keys. Any security sys-tem can be broken with enough time and res...
USER’S GUIDE 050396 81/173 82 SECTION 10: RESET CONDITIONS Reset Sources The Secure Microcontroller family is designed to pro-vide proper reset operation with a minimum of externalcircuitry. In fact, for may applications, external reset cir-cuitry is not required. The possible sources of reset areas...
USER’S GUIDE 050396 82/173 83 SPECIAL FUNCTION REGISTER RESET STATES Table 10–1 REGISTER LOCATION RESET CONDITION RESET TYPE PC N/A 0000h All ACC E0h 00h All B F0h 00h All PSW D0h 00h All SP 81h 07h All DPTR 83h, 82h 0000h All P0–P3 80h, 90h, A0h, B0h FFh All IP B8h 0XX00000b All IE A8h 0XX00000b Al...
USER’S GUIDE 050396 83/173 84 Power On Reset The Secure Microcontroller family provides an internalPower On Reset capability which requires no externalcomponents. When voltage is applied to the V CC pin from a power off condition, the device automatically per- forms an internal reset sequence to pre...
USER’S GUIDE 050396 84/173 85 No–V LI Power On Reset During a Power On Reset cycle, a test is automaticallyperformed by the internal control circuitry to measurethe voltage of the lithium power source. This test deter-mines whether or not the voltage (V LI ) is above the mini- mum level required (V ...
USER’S GUIDE 050396 85/173 86 APPLICATION: RESET ROUTINE EXAMPLE Like the 8051, Dallas Semiconductor Microcontrollerswill begin execution at address 0000h. This is the ResetVector, followed by other vector locations used for inter-rupts. These are discussed in the section covering inter-rupt operati...
USER’S GUIDE 050396 86/173 87 A code example that initializes the memory map is asfollows. It assumes that the DS5000FP user requires a Partition of 5800h. A DS5001FP using the same codewould use a Partition of B000h. MCON EQU 0C6h Org 00h SJMP Start Org 30hStart : MOV TA, #0AAh ;Timed MOV TA, #55h ...
USER’S GUIDE 050396 87/173 88 Timers The microprocessor disables timer activity (excludingthe Watchdog) and serial port communication on a re-set. Therefore, each timer must be setup and enabledas part of the reset routine. The serial port mode mustalso be initialized if used. This is covered in det...
USER’S GUIDE 050396 88/173 89 SECTION 11: INTERRUPTS The Secure Microcontroller family follows the standard8051 convention for interrupts (with one extra) and isfully compatible. An interrupt stops the normal flow ofprocessing and allows software to react to an event withspecial processing. This eve...
USER’S GUIDE 050396 89/173 90 External Interrupts The two external interrupts are INT0 and INT1. Theycorrespond to P3.2 and P3.3 respectively. These pinsbecome interrupts when the respective interrupt isenabled. Otherwise, they are simply port pins. No otherspecial action is required. Each pin is sa...
USER’S GUIDE 050396 91/173 92 INTERRUPT ENABLE CONTROL BITS Figure 11–2 Bit Description: All bits are read/write at any time and are cleared to 0 following any hardware reset. IE.7: EA “Enable All Interrupts”: When set to 1, each interrupt except for PFW may be individually enabled ordisabled by set...
USER’S GUIDE 050396 92/173 93 INTERRUPT PRIORITIES The Secure Microcontroller provides a three priorityinterrupt scheme. Multiple priority levels allow higherpriority sources to interrupt lower priority ISRs. ThePower–fail Warning Interrupt automatically has thehighest priority if enabled. The remai...
USER’S GUIDE 050396 93/173 94 INTERRUPT ACKNOWLEDGE The various interrupt flags are sampled an latched onceevery machine cycle, specifically during clock phaseS5P2 (see CPU timing section) regardless of other in-terrupt related activity. Likewise, the latched states ofthe flags are polled once every...
EXTERNALADDRESSCONTROL VCC ADDRESS/DATA POWERDOWN PORT 0.n INTERNALDATA BUS WRITEENABLE READENABLE READLATCH/PIN D Q Q USER’S GUIDE 050396 95/173 96 SECTION 12: PARALLEL I/O OVERVIEW The Secure Microcontroller provides four 8–bit bidirec-tional ports for general purpose I/O functions. Each portpin i...
USER’S GUIDE 050396 98/173 99 least significant eight bits of address and data. When 1’sare output on Port 2 for address bits during these cycles,strong current drivers are employed. The information inthe Port 2 SFR latch is unchanged during these cycles. Port 0 also employs strong output drivers fo...
USER’S GUIDE 050396 99/173 100 READ–MODIFY–WRITE INSTRUCTIONS MNEMONIC DESCRIPTION ANL – Logical AND ORL – Logical OR XRL – Logical Exclusive OR JBC – Branch if Bit Set and Clear (bit) CPL – Complement Bit INC – Increment DEC – Decrement DJNZ – Decrement and Branch if not Zero MOV PX.n,C – Move Carr...
USER’S GUIDE 050396 100/173 101 USE OF THE RPC MODE Figure 12–3 P2.3/WR P2.2/RD P2.1/CE PORT 2 P2.0/A0 P2.7/DACK P2.6/DRQ P2.5/IBF P2.4/OBF CONTROL BUS PORT 0 P0.0/D0 DATA BUS P0.1/D1 P0.2/D2 P0.3/D3 P0.4/D4 P0.5/D5 P0.6/D6 P0.7/D7 USE OF THE RPC MODE Figure 12–4 CS RD WR A0 REGISTER 0 0 1 0 DATA OU...
USER’S GUIDE 050396 101/173 102 RPC STATUS REGISTER – STATUS (ADDRESS 0DAH) Figure 12–5 ST7 ST6 ST5 ST4 IAO FO IBF OBF Bit Description: RPS.7–4: General purpose status bits that can be written by the DS5001/2 and can beread by the external host. Initialization: Cleared when RPCON=0. Read Access: Can...
USER’S GUIDE 050396 102/173 103 RPC PROTOCOL Data is written to the microprocessor by the host CPUand is placed in the DBBIN. At this time, the IBF flag isset in the RPC Status Register. If enabled by the IBI bitin the RPCTL register, an IBI interrupt will occur. No fur-ther updates of the DBBIN wil...
USER’S GUIDE 050396 103/173 104 RPC CONTROL REGISTER – RPCTL (ADDRESS 0D8H) Figure 12–6 RNR – EXBS AE IBI DMA RPCON RG0 Bit Description: RPCTL.3: IBIWhen using the RPC mode, an interrupt may be required for the Input BufferFlag. This interrupt is enabled by setting the Input Buffer Interrupt (IBI) b...
USER’S GUIDE 050396 104/173 105 SECTION 13: PROGRAMMABLE TIMERS FUNCTIONAL DESCRIPTION The Secure Microcontroller incorporates two 16–bit tim-ers called Timer 0 and Timer 1. Both can be used to gen-erate precise time intervals, measure external pulsewidths, or count externally applied pulses. Each p...
USER’S GUIDE 050396 105/173 106 TMOD.5, TMOD.4: Timer 1 Mode Control “Mode Select” These bit select the operating mode of the associated timer/counter as fol-lows: M1 M0 0 0 Mode 0: Eight bits with 5–bit prescale 0 1 Mode 1: 16 bits with no prescale 1 0 Mode 2: Eight bits with auto–reload 1 1 Mode 3...
USER’S GUIDE 050396 106/173 107 Mode 0 Figure 13–3 is a block diagram of a timer/counter oper-ating in Mode 0. Mode 0 configures either program-mable timer for operation as a 13–bit timer/counter. ForTimer 0, selection of Mode 0 configures bit 4 – 0 of TL0as bits 4 – 0 respectively of the 13–bit tim...
USER’S GUIDE 050396 107/173 108 Mode 1 Mode 1 for both programmable timers operates in anidentical fashion described for Mode 0, except Mode 1configures a 16–bit timer/counter register. In this case,for Timer 0, TH0 contains the most significant eight bitsof the count value while TL0 holds the least...
USER’S GUIDE 050396 108/173 109 Mode 3 When Timer 0 is selected for operation in Mode 3, bothTH0 and TL0 are configured independently as an 8–bittimer/counter and as an 8–bit timer. Figure 13–5 illus-trates the function of Timer 0 for Mode 3 operation. For Timer 0 in Mode 3, TL0 becomes an 8–bit tim...
USER’S GUIDE 050396 109/173 110 SECTION 14: SERIAL I/O FUNCTION DESCRIPTION The Secure Microcontroller, like the 8051, includes apowerful Serial I/O (UART) port capable of both syn-chronous and asynchronous communication. The baudrate and time–base source is fully programmable. Theserial port uses P...
USER’S GUIDE 050396 110/173 111 value that generates the required time interval at itsoverflow. This is the most common mode of communi-cating with a PC COM port or similar device. When talk-ing to a PC in Mode 1, the PC would be set to 8–N–1( 8 bits, no parity, 1 stop). Common baud rates are 2400,9...
USER’S GUIDE 050396 111/173 112 SCON.2: RB8 “Rcv. Bit 8”: Indicates the state of the 9th data bit received while in Mode 2 or 3 operation.If Mode 1 is selected with SM2=0, RB8 is the state of the stop bit which wasreceived. RB8 is not used in Mode 0. Initialization: Cleared to a 0 on any type of res...
USER’S GUIDE 050396 112/173 113 In most applications, Timer 1 will be configured as a tim-er which uses the internal clock oscillator frequency asits clock source. The baud rate will then be divided downfrom the time base applied to the XTAL1 and XTAL2pins. In order to provide the most flexibility, ...
USER’S GUIDE 050396 114/173 115 MODE 0 BLOCK DIAGRAM AND TIMING Figure 14–2 T1 FLAG OUTPUT SHIFT REGISTER SI S0 LOAD CLK D7 D6 D5 D4 D3 D2 D1 D0 DATA BUS P3.0 LATCH RXD PIN LDSBUF RDSBUF R1 FLAG SERIALINTERRUPT LDSBUF SI0 CONTROL SHIFT RDSBUF RBUFLD RD RCV BUFFER WR SI S0 INPUT SHIFT REGISTER CLK Q7...
USER’S GUIDE 050396 115/173 116 ASYNCHRONOUS OPERATION Mode 1, 2, and 3 provide asynchronous, full-duplexcommunication via the Serial I/O Port. The serial dataword is either 10 or 11 bits long, depending on the modeselected. All three modes include one start bit, eightdata bits, and one stop bit. Mo...
USER’S GUIDE 050396 117/173 118 SERIAL PORT MODE 1 BLOCK DIAGRAM Figure 14–3 MUX TIMER 1 OVERFLOW 1 0 T1 FLAG BIT DETECTOR RXD PIN DIV. BY 16 f CLK /2 TRANSMIT TIMING: WRSBUF SHIFT TXD TI RXD BIT DETECTORSAMPLING SHIFT RI RECEIVE TIMING: D0 D1 D2 D3 D4 D5 D6 D7 STOP D0 D1 D2 D3 D4 D5 D6 D7 STOP XMIT...
USER’S GUIDE 050396 118/173 119 MODE2 AND 3 BLOCK DIAGRAM Figure 14–4 T1 FLAG BIT DETECTOR RXD PIN DIV. BY 16 XMIT SHIFT REGISTER SI S0 LOAD CLK DATA BUS P3.1 LATCH TXD PIN WRSBUF RDSBUF DIVIDE BY 16 R1 FLAG SERIALINTERRUPT WRSBUF SCLK RESET SI0 CONTROL SHIFT RDSBUF LOAD RD RCV DATA BUFFER WR SI S0 ...
USER’S GUIDE 050396 119/173 120 APPLICATION: SERIAL PORTINITIALIZATION The serial port can provide either synchronous orasynchronous serial communication. This note demon-strates how to initialize the serial port and includes anexample showing how to perform asynchronous com-munication with a PC COM...
USER’S GUIDE 050396 120/173 121 SM0 = 0 and SM1 = 1 corresponds to the value SCON.7= 0 and SCON.6 = 1. In addition the since the applica-tion requires receiving data, the serial receiver must be enabled. This is done by setting the REN bit at SCON.4to a logic 1. The remaining bits in SCON can be wri...
XTAL2 XTAL1 GND NC EXT. OSC.SIGNAL USER’S GUIDE 050396 123/173 124 SECTION 15: CPU TIMING OSCILLATOR The Secure Microcontroller provides an on–chip oscilla-tor circuit which may be driven either by using an exter-nal crystal as a time base or from a TTL–compatibleclock signal. The oscillator circuit...
USER’S GUIDE 050396 124/173 125 INSTRUCTION TIMING The internal clocking signals are divided to produce thenecessary clock phases, state times, and machinecycles which define the sequential execution of instruc-tions. Two clock oscillator periods define one state time.The first clock oscillator puls...
USER’S GUIDE 050396 126/173 127 Multiplexed address and data information appear on thePort 0 pins as Program Memory fetches are performedon the Expanded Bus. The falling edge of ALE can beused to signal when the lowest eight bits of valid ad-dress information are being output on Port 0 when sucha fe...
USER’S GUIDE 050396 128/173 129 EXPANDED DATA MEMORY TIMING The timing for the Expanded Data Memory access cycleis illustrated in Figures 15–5 and 6. Accesses to DataMemory on the Expanded Bus will occur any time that aMOVX instruction is executed that references a DataMemory location that is mapped...
USER’S GUIDE 050396 129/173 130 SECTION 16: PROGRAM LOADING INTRODUCTION Program loading is performed to initialize the contentsof NV RAM and to configure the microcontroller. Load-ing is done using a Bootstrap ROM Loader built into allmembers of the Secure Microcontroller family. Whenthis Bootstrap...
USER’S GUIDE 050396 130/173 131 The indeterminate area contains various stacks andbuffers used by the loader, and a given byte in this areamay or may not be modified by the loader. As such theuser should not rely on the bootstrap loader preservingany data in this area. In a like manner, because not ...
USER’S GUIDE 050396 133/173 134 AUTO–BAUD RATE DETECTION The Serial Bootstrap Loader has the capability of deter-mining which of the six supported baud rate frequenciesis being used for communication and initializing its inter-nal hardware for communication at that frequency.When the Program Load mo...
USER’S GUIDE 050396 134/173 135 BOOTSTRAP LOADER INITIALIZATION When loader mode is invoked, the device will await anincoming <CR> character at a valid baud rate througheither the serial port (in Serial Program Load mode) orvia the parallel interface (in Parallel Program Loadmode). At this poi...
USER’S GUIDE 050396 135/173 136 An address will always be the right–most four digits of ahexadecimal number. For example, the following hexa-decimal numbers will result in the following addresses: A → 000AH AB → 00ABH ABC → 0ABCH ABCD → 0ABCDH ABCDE → 0BCDEH The D and F commands allow optional addre...
USER’S GUIDE 050396 136/173 137 F byte [begin–address [end–address]] Fill memory with the value of the specified byte. An op-tional address range may be specified. G Data is read from ports 0, 1, 2 and 3 and is printed as fourpairs of hexadecimal digits. I A CRC–16 is computed from 0 to CRC_RANGE mi...
USER’S GUIDE 050396 138/173 139 compared to the computed value for the record, and ifdifferent, the error message E:BADCKS is printed out.Unfortunately, the data bytes for this record will havebeen put to memory already. End of Data records (01)do not check for valid checksums. After a byte is put t...
USER’S GUIDE 050396 139/173 140 INTEL HEX FILE FORMAT 8051–compatible assemblers produce an absolute out-put file in Intel Hex format. These files are composed of aseries of records. Records in an Intel Hex file have thefollowing format: <Header><Hex Information><Record Terminator>...
USER’S GUIDE 050396 140/173 141 PARALLEL PROGRAM LOAD OPERATION The DS5000 Parallel Program Load mode is compatiblewith the Program mode of the 87C51. The hardwareconfiguration used for this mode of operation is shown in Figure 16–3. Dallas Semiconductor recommends theuse of the serial Program Load ...
USER’S GUIDE 050396 141/173 142 PARALLEL PROGRAM LOAD MODE Table 16–3 summarizes the selection of the availableParallel Program Load cycles. Figure 16–4 illustratesthe timing associated with these cycles. 8751–COMPATIBLE PROGRAM LOAD CYCLES Table 16–3 MODE RST PSEN PROG EA P2.7 P2.6 P2.5 Program 1 0...
USER’S GUIDE 050396 142/173 143 PARALLEL PROGRAMMING CONCERNS Dallas Semiconductor highly recommends using theserial load mode for programming the DS5000. It hasproven highly reliable and easy to use. In the event thatparallel programming is still desirable to some users,several incompatibilities ha...
USER’S GUIDE 050396 143/173 144 SECTION 17: REAL–TIME CLOCK Many user applications require a time–of–day clock.For this reason, all Secure Microcontroller moduleshave real–time clock (RTC) options. These include theDS5000T DIP and the DS2250T, DS2251T, andDS2252T SIMMs. In addition, users of the mon...
USER’S GUIDE 050396 145/173 146 PATTERN COMPARISON REGISTER DESCRIPTION Figure 17–2 7 6 5 4 3 2 1 0 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7 HEX CODE C5 3A A...
USER’S GUIDE 050396 148/173 149 TIME REGISTER EXAMPLES Figure 17–5 7 6 5 4 3 2 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 RANGE (BCD) 00–99 00–59 00–59 01–12 01–07 01–31 01–12 00–99 CLOCK 0 1 2 3 4 5 6 7 REGISTER # 1 0 0 0 1 0 0 1 1 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 ...
USER’S GUIDE 050396 149/173 150 DS1283 WATCHDOG TIMEKEEPER CHIP The DS2251T and DS2252T use the DS1283 Byte–wide RTC. This is also the clock of choice for usersdesigning with the microprocessor chips (DS5000FP,DS5001FP, and DS5002FP). This clock gives perma-nently powered time–of–day monitoring. The...
USER’S GUIDE 050396 150/173 151 DS2251T/DS2252T RTC BLOCK DIAGRAM Figure 17–6 ÇÇÇÇÇÇ ÇÇÇÇÇÇ DS5001 CPU DS1283 RTC DS2251T V CCO V CC PE1 CE R/W WE ÑÑÑÑÑÑ ÑÑÑÑÑÑ BA5–0 A5–0 BD7–0 INTB INTA INTP ÇÇÇÇÇÇ ÇÇÇÇÇÇ DS5002 CPU DS1283 RTC DS2252T V CCO V CC PE1 CE R/W WE ÑÑÑÑÑÑ ÑÑÑÑÑÑ BA5–0 A5–0 BD7–0 INTP P3...
USER’S GUIDE 050396 152/173 153 The time, calendar, and alarms are controlled by theinformation in these 14 registers. In particular, the Com-mand register controls most functions. This is describedin Figure 17–8. There are two additional bits thatdeserve mention. These reside in the register ataddr...
USER’S GUIDE 050396 153/173 154 DS1283 RTC INTERRUPTS The DS1283 provides two interrupt functions. They aretime–of–day alarm and a watchdog alarm. The watch-dog alarm is a user programmed periodic interval time–out. It is programmed using registers 0Ch and 0Dh. Thetime–of–day alarm is controlled by ...
USER’S GUIDE 050396 163/173 164 SECTION 18: TROUBLESHOOTING Dallas Semiconductor’s Secure Microcontroller familyhas proven itself to be a reliable and easy–to–use prod-uct. As with any highly–integrated device, however,questions and or problems can arise during its use anddevelopment. Many of these ...
USER’S GUIDE 050396 164/173 165 lithium batteries have a very long time constant. Puttingthe device on the shelf for one to two weeks may restoreenough voltage to battery back the memory again. Thelifetime of such a battery will be reduced, however. UNABLE TO INVOKE STOP MODE Unlike the 8051, the ST...
USER’S GUIDE 050396 167/173 168 SECTION 19: INSTRUCTION SET DETAILS MNEMONIC INSTRUCTION CODE HEX BYTE CYCLE EXPLANATION MNEMONIC D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 HEX BYTE CYCLE EXPLANATION ADD A, Rn 0 0 1 0 1 n 2 n 1 n 0 28–2F 1 1 (A) = (A) + (Rn) ADD A, direct 0 a 7 0 a 6 1 a 5 0 a 4 0 a 3 1 a 2 0 ...
USER’S GUIDE 050396 168/173 169 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC ARITHMETIC OPER. DA A 1 1 0 1 0 1 0 0 D4 1 1 Contents of Accu-mulator are BCD, IF [[(A 3–0 ) > 9] OR [(AC) = 1]] THEN(A 3–0 ) = (A 3–0 ) + 6 AND...
USER’S GUIDE 050396 169/173 170 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC RL A 0 0 1 0 0 0 1 1 23 1 1 A 1 A 7 A 6 A 5 A 4 A 3 A 2 A 0 The contents of theaccumulator are ro-tated left by one bit. R A TION RLC A 0 0 1 1 0 0...
USER’S GUIDE 050396 170/173 171 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC MOV direct,#data 0 a 7 d 7 1 a 6 d 6 1 a 5 d 5 1 a 4 d 4 0 a 3 d 3 1 a 2 d 2 0 a 1 d 1 1 a 0 d 0 75 Byte 2Byte 3 3 2 (direct) = #data MOV @Ri, A 1 ...
USER’S GUIDE 050396 171/173 172 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC CLR C 1 1 0 0 0 0 1 1 C3 1 1 (C) = 0 CLR bit 1 b 7 1 b 6 0 b 5 0 b 4 0 b 3 0 b 2 1 b 1 0 b 0 C2 Byte 2 2 1 (bit) = 0 SETB C 1 1 0 1 0 0 1 1 D3 1 1 ...
USER’S GUIDE 050396 172/173 173 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC ACALL addr 11 a 10 a 7 a 9 a 6 a 8 a 5 1 a 4 0 a 3 0 a 2 0 a 1 1 a 0 Byte 1Byte 2 2 2 (PC) = (PC) + 2(SP) = (SP) + 1((SP)) = (PC 7–0 ) (SP) = (SP) ...
USER’S GUIDE 050396 173/173 174 EXPLANATION CYCLE BYTE HEX INSTRUCTION CODE MNEMONIC EXPLANATION CYCLE BYTE HEX D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 MNEMONIC JNB bit, rel 0 b 7 r 7 0 b 6 r 6 1 b 5 r 5 1 b 4 r 4 0 b 3 r 3 0 b 2 r 2 0 b 1 r 1 0 b 0 r 0 30 Byte 2Byte 3 3 2 (PC) = (PC) + 3IF (bit) = 0 THEN(P...
Mitsubishi Manuals
-
Mitsubishi PKA-A18GA
User Manual
-
Mitsubishi PKA-A18GA
Installation Manual
-
Mitsubishi PKA-A18GAL
User Manual
-
Mitsubishi PKA-A18GAL
Installation Manual
-
Mitsubishi PCA-A42GA1
User Manual
-
Mitsubishi PCA-A42GA1
Installation Manual
-
Mitsubishi MSZ-FH18NA
User Manual
-
Mitsubishi MSZ-FH18NA
Installation Manual
-
Mitsubishi MSZ-D36NA
User Manual
-
Mitsubishi MSZ-D36NA
Installation Manual
-
Mitsubishi WD-82742
User Manual
-
Mitsubishi MSZ-FE09NA
User Manual
-
Mitsubishi MSZ-FE09NA
Installation Manual
-
Mitsubishi LT-46164
User Manual
-
Mitsubishi MSY-D36NA-8
User Manual
-
Mitsubishi MSY-D36NA-8
Installation Manual
-
Mitsubishi MSY-A15NA-1
User Manual
-
Mitsubishi MSY-A15NA-1
Installation Manual
-
Mitsubishi WD-73638
User Manual
-
Mitsubishi PKA-A36FA
User Manual