0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
68HC05C5

68HC05C5

  • 厂商:

    FREESCALE(飞思卡尔)

  • 封装:

  • 描述:

    68HC05C5 - SPECIFICATION (General Release) - Freescale Semiconductor, Inc

  • 数据手册
  • 价格&库存
68HC05C5 数据手册
Freescale Semiconductor, Inc. HC05C5GRS/D REV 1.2 68HC05C5 Freescale Semiconductor, Inc... SPECIFICATION (General Release) ©August 29, 1994 CSIC System Design Group Austin, Texas For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC05C5 Specification Release 1.2 TABLE OF CONTENTS SECTION 1 1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.4.10 INTRODUCTION .............................................................. 1 GENERAL...................................................................................1 FEATURES.................................................................................1 MASK OPTIONS ........................................................................2 SIGNAL DESCRIPTION .............................................................3 VDD AND VSS ........................................................................3 PE..........................................................................................3 IRQ ........................................................................................3 OSC1 AND OSC2 .................................................................3 RESET ..................................................................................3 TCAP.....................................................................................3 PA0-PA7................................................................................3 PB0-PB7................................................................................4 PC0-PC7 ...............................................................................4 PD0-PD7 ...............................................................................4 Freescale Semiconductor, Inc... SECTION 2 2.1 2.2 OPERATING MODES ...................................................... 5 SINGLE-CHIP MODE .................................................................5 SELF-CHECK MODE .................................................................6 SECTION 3 3.1 3.2 3.3 3.3.1 3.3.2 MEMORY ......................................................................... 9 ROM .........................................................................................11 RAM..........................................................................................11 EEPROM ..................................................................................11 PROGRAMMING REGISTER $1C .....................................11 PROGRAMMING/ERASING PROCEDURES .....................13 SECTION 4 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.3 4.3.1 4.3.2 CPU CORE..................................................................... 15 REGISTERS .............................................................................15 ACCUMULATOR (A) ...........................................................15 INDEX REGISTER (X) ........................................................16 PROGRAM COUNTER (PC)...............................................16 STACK POINTER (SP) .......................................................16 CONDITION CODE REGISTER (CCR) ..............................16 INSTRUCTION SET .................................................................17 REGISTER/MEMORY INSTRUCTIONS .............................17 READ-MODIFY-WRITE INSTRUCTIONS ..........................18 BRANCH INSTRUCTIONS .................................................19 BIT MANIPULATION INSTRUCTIONS ...............................20 CONTROL INSTRUCTIONS ...............................................20 ADDRESSING MODES............................................................21 IMMEDIATE ........................................................................21 DIRECT ...............................................................................21 For More Information On This Product, Go to: www.freescale.com Page iii Freescale MC68HC05C5 Specification Release 1.2 Semiconductor, Inc. 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.3.10 4.4 4.4.1 4.4.2 4.4.3 4.5 4.5.1 4.5.2 4.5.3 4.5.4 4.6 4.6.1 4.6.2 EXTENDED ........................................................................ 21 RELATIVE........................................................................... 21 INDEXED, NO OFFSET ..................................................... 22 INDEXED, 8-BIT OFFSET .................................................. 22 INDEXED, 16-BIT OFFSET ................................................ 22 BIT SET/CLEAR ................................................................. 22 BIT TEST AND BRANCH ................................................... 22 INHERENT.......................................................................... 23 RESETS ................................................................................... 23 POWER-ON RESET (POR)................................................ 23 RESET PIN ......................................................................... 24 COMPUTER OPERATING PROPERLY (COP) RESET..... 24 INTERRUPTS .......................................................................... 24 HARDWARE CONTROLLED INTERRUPT SEQUENCE... 25 SOFTWARE INTERRUPT (SWI) ........................................ 25 EXTERNAL INTERRUPT ................................................... 25 TIMER INTERRUPT ........................................................... 26 LOW-POWER MODES ............................................................ 28 STOP .................................................................................. 28 WAIT ................................................................................... 29 Freescale Semiconductor, Inc... SECTION 5 5.1 5.2 5.3 5.4 5.5 INPUT/OUTPUT PORTS ................................................31 PORT A .................................................................................... 31 PORT B .................................................................................... 31 PORT C .................................................................................... 31 PORT D .................................................................................... 31 INPUT/OUTPUT PROGRAMMING .......................................... 32 SECTION 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 TIMER.............................................................................33 INTRODUCTION ...................................................................... 33 COUNTER................................................................................ 34 OUTPUT COMPARE REGISTER ............................................ 34 INPUT CAPTURE REGISTER ................................................. 35 TIMER CONTROL REGISTER (TCR) $12............................... 35 TIMER STATUS REGISTER (TSR) $13 .................................. 37 TIMER DURING WAIT MODE ................................................. 38 TIMER DURING STOP MODE................................................. 38 SECTION 7 7.1 7.1.1 7.1.2 7.1.3 7.2 7.2.1 7.2.2 7.2.3 MOTOROLA Page iv SIMPLE SERIAL INPUT/OUTPUT PORT......................39 SIGNAL FORMAT .................................................................... 39 SCK..................................................................................... 39 SDO .................................................................................... 39 SDI ...................................................................................... 40 SIOP REGISTERS ................................................................... 40 SIOP CONTROL REGISTER (SCR)................................... 40 SIOP STATUS REGISTER (SSR) ...................................... 42 SIOP DATA REGISTER (SDR)........................................... 42 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. MC68HC05C5 Specification Release 1.2 SECTION 8 8.1 8.2 8.3 8.4 8.5 COMPUTER OPERATING PROPERLY........................ 43 INTRODUCTION ......................................................................43 RESETTING THE COP ............................................................43 COP TEST FEATURES............................................................43 COP DURING WAIT MODE .....................................................43 COP DURING STOP MODE ....................................................43 SECTION 9 9.1 9.2 9.3 9.4 9.5 ELECTRICAL SPECIFICATIONS.................................. 45 MAXIMUM RATINGS ...............................................................45 THERMAL CHARACTERISTICS..............................................45 DC ELECTRICAL CHARACTERISTICS ..................................46 CONTROL TIMING...................................................................47 SIOP TIMING............................................................................49 Freescale Semiconductor, Inc... SECTION 10 10.1 10.2 MECHANICAL SPECIFICATIONS ............................... 51 40-PIN DUAL INLINE PACKAGE .............................................51 44-PIN PLCC PACKAGE..........................................................52 For More Information On This Product, Go to: www.freescale.com Page v Freescale Semiconductor, Inc. Specification Rev. 1.2 MC68HC05C5 LIST OF FIGURES Figure 1-1: Figure 2-1: Figure 2-2: Figure 3-1: Figure 3-2: Figure 3-3: Figure 4-1: Figure 4-2: Figure 4-3: Figure 4-4: Figure 4-5: Figure 4-6: Figure 5-1: Figure 6-1: Figure 6-2: Figure 6-3: Figure 7-1: Figure 7-2: Figure 7-3: Figure 7-4: Figure 7-5: Figure 7-6: Figure 9-1: Figure 9-2: Figure 9-3: Self-Check Mode Schematic for the MC68HC05C5 .................................2 Single-Chip Mode Pinout of the MC68HC05C5........................................6 Self-Check Mode Schematic for the MC68HC05C5 .................................7 The 8K Memory Map of the MC68HC05C5 ..............................................9 I/O Registers for the MC68HC05C5 .......................................................10 Programming Register ............................................................................11 Programming Model ...............................................................................15 Stacking Order ........................................................................................15 Power-On Reset and RESET .................................................................23 Interrupt Flowchart ..................................................................................27 Stop Recovery Timing Diagram ..............................................................28 STOP/WAIT Flowcharts..........................................................................29 Port I/O Circuitry .....................................................................................32 Timer Block Diagram ..............................................................................33 Timer Control Register............................................................................35 Timer Status Register .............................................................................37 SIOP Block Diagram ...............................................................................39 Serial I/O Port Timing (CPOL=1) ............................................................40 Serial I/O Port Timing (CPOL=0) ............................................................40 SIOP Control Register ............................................................................40 SIOP Status Register..............................................................................42 SIOP Data Register ................................................................................42 Stop Recovery Timing Diagram ..............................................................48 LVPI Timing Diagram..............................................................................48 SIOP Timing Diagram .............................................................................49 Freescale Semiconductor, Inc... For More Information On This Product, Go to: www.freescale.com Page vii Freescale Semiconductor, Inc. Specification Rev. 1.2 MC68HC05C5 LIST OF TABLES Table 2-1: Table 3-1: Table 4-1: Table 5-1: Operating Mode Conditions...................................................................5 Erase Mode Select ..............................................................................12 Vector Address for Interrupts and Reset .............................................25 I/O Pin Functions .................................................................................32 Freescale Semiconductor, Inc... For More Information On This Product, Go to: www.freescale.com Page ix Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 1 1.1 GENERAL INTRODUCTION The MC68HC05C5 is a 40-pin device based on the MC68HC05P7. The memory map includes 5184 bytes of user ROM, 176 bytes of RAM, and 128 bytes of EEPROM. The MCU has four 8-bit I/O ports: A, B, C and D. Port C has high sink current capability. The MC68HC05C5 includes a simple Serial I/O Peripheral (SIOP), 16-bit Timer, and an onchip Computer Operating Properly (COP) watchdog circuit. Freescale Semiconductor, Inc... 1.2 • • • • • • • • • • • • • • • • • FEATURES HC05 Core 40-pin DIP or 44-pin plastic-leaded chip carrier (PLCC) package On-Chip Oscillator with resistor capacitor (RC) or Crystal/Ceramic Resonator Mask Options 5184 Bytes of User ROM 176 Bytes of On-Chip RAM 128 Bytes of EEPROM EEPROM Low Voltage Program Inhibit (LVPI) Hardware EEPROM Program Enable 16-Bit Timer COP Watchdog Timer Mask Option 32 Bidirectional I/O Lines Single-Chip Mode Self-Check Mode Power-Saving STOP and WAIT Modes Edge-Sensitive or Edge and Level-Sensitive Interrupt Trigger Mask Option Simple Serial Input/Output Port 10 mA Sink Capability on One 8-Bit Port Section 1: Introduction For More Information On This Product, Go to: www.freescale.com Page 1 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. OSC1 OSC2 INTERNAL PROCESSOR CLOCK OSCILLATOR AND DIVIDE BY ∏ 2 TCAP TIMER SYSTEM COP SYSTEM RESETRESET PA0 PA1 PORT A I/O LINES PA2 PA3 PA4 PA5 PA6 PA7 CONDITION CODE REGISTER STACK POINTER PORT DATA B REG DIR REG PROGRAM COUNTER HIGH PROGRAM COUNTER LOW SIOP SCK/PB7 ALU INDEX REGISTER PORT DATA A REG DIR REG ACCUMULATOR CPU CONTROL IRQ PC0 PC1 DATA PORT DIR REG C REG PC2 PC3 PC4 PC5 CPU PC6 PC7 PORT C I/O LINES Freescale Semiconductor, Inc... PB0 PB1 PORT B I/O LINES PB2 PB3 PB4 SDO/PB5 SDI/PB6 PD0 PD1 DATA PORT DIR REG D REG PD2 PD3 PD4 PD5 PD6/TCMP PORT D I/O LINES 5184 X 8 USER ROM 368 X 8 SELF-CHECK ROM 176 X 8 RAM PD7 128 X 8 EEPROM PE Figure 1-1: Self-Check Mode Schematic for the MC68HC05C5 1.3 MASK OPTIONS There are five mask options on the MC68HC05C5: CLOCK (RC or Crystal), IRQ (edgesensitive only or edge and level-sensitive), SIOP (MSB or LSB first), COP Watchdog Timer (enable/disable) and LVPI (enable/disable). Section 1: Introduction Page 2 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 NOTE: Negative true signals like RESET and IRQ will be denoted with either an asterisk or an overline. 1.4 1.4.1 SIGNAL DESCRIPTION V DD AND V SS Power is supplied to the microcontroller using these two pins. VDD is the positive supply, and VSS is ground. Freescale Semiconductor, Inc... 1.4.2 PE PE is the Program Enable for the EEPROM. This pin has a very weak internal pullup. If this pin is held at a logic "1" level or left not connected, the EEPROM can be programmed and erased. If this pin is held at a logic "0" level, EEPROM programming and erasing is disabled. The pullup will not be able to pull the pin high if any circuit is connected to PE. 1.4.3 IRQ This pin has a mask option that provides two different choices of interrupt triggering sensitivity. The IRQ pin contains an internal Schmitt trigger as part of its input to improve noise immunity. Refer to 4.5 INTERRUPTS for more detail. 1.4.4 OSC1 AND OSC2 These pins provide control input for an on-chip clock oscillator circuit. A crystal, a ceramic resonator, a resistor/capacitor combination, or an external signal connects to these pins providing a system clock. A mask option selects either a crystal/ceramic resonator or a resistor/capacitor as the frequency determining element. The oscillator frequency is two times the internal bus rate. 1.4.5 RESET This active low pin is used to reset the MCU to a known start-up state by pulling RESET low. The RESET pin contains an internal Schmitt trigger as part of its input to improve noise immunity. 1.4.6 TCAP This pin controls the input capture feature for the on-chip programmable timer. The TCAP pin contains an internal Schmitt trigger as part of its input to improve noise immunity. 1.4.7 PA0-PA7 These eight I/O lines comprise port A. The state of any pin is software programmable and all port A lines are configured as input during power-on or reset. Refer to 5.5 INPUT/ OUTPUT PROGRAMMING for a detailed description of I/O programming. Section 1: Introduction For More Information On This Product, Go to: www.freescale.com Page 3 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 1.4.8 PB0-PB7 These eight I/O lines comprise port B. The state of any pin is software programmable and all port B lines are configured as input during power-on or reset. Refer to 5.5 INPUT/ OUTPUT PROGRAMMING for a detailed description of I/O programming. Three of the port B pins (PB5-PB7) are shared with the SIOP subsystem. Refer to SECTION 7 SIMPLE SERIAL INPUT/OUTPUT PORT for a detailed description of the SIOP. 1.4.9 PC0-PC7 These eight I/O lines comprise port C. The state of any pin is software programmable and all port C lines are configured as input during power-on or reset. Refer to 5.5 INPUT/ OUTPUT PROGRAMMING for a detailed description of I/O programming. Freescale Semiconductor, Inc... 1.4.10 PD0-PD7 These eight I/O lines comprise port D. The state of any pin is software programmable and all port D lines are configured as input during power-on or reset. Refer to 5.5 INPUT/ OUTPUT PROGRAMMING for a detailed description of I/O programming. PD6 is shared with TCMP. Refer to SECTION 6 TIMER for more information on the TCMP pin. Section 1: Introduction Page 4 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 2 OPERATING MODES The MCU has two modes of operation: Single-Chip Mode and Self-Check Mode. Table 2-1 shows the conditions required to go into each mode, where VTST = 2 x VDD. Table 2-1: Operating Mode Conditions RESET IRQ VSS to VDD TCAP VSS to VDD VDD MODE Single-chip Self-Check Freescale Semiconductor, Inc... VTST 2.1 SINGLE-CHIP MODE In Single-Chip Mode, the address and data buses are not available externally, but there are four 8-bit I/O ports. This mode allows the MCU to function as a self-contained microcontroller, with maximum use of the pins for on-chip peripheral functions. All address and data activity occurs within the MCU. Single-Chip Mode is entered on the rising edge of RESET if the IRQ pin is within normal operating range. Section 2: Operating Modes For More Information On This Product, Go to: www.freescale.com Page 5 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. RESET IRQ PE PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 PB0 PB1 PB2 PB3 PB4 SDO/PB5 SDI/PB6 SCK/PB7 VSS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 VDD OSC1 OSC2 TCAP PD7 PD6/TCMP PD5 PD4 PD3 PD2 PD1 PD0 PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 Freescale Semiconductor, Inc... Figure 2-1: Single-Chip Mode Pinout of the MC68HC05C5 2.2 SELF-CHECK MODE The Self-Check program resides at mask ROM location $1E80 to $1FEF. This program is designed to check the part’s functionality with a minimum of support hardware. The Self-Check Mode is entered on the rising edge of RESET if the IRQ pin is at VTST volts and the TCAP pin is at logic one. RESET must be held low for 4064 cycles after Power-on Reset (POR), or for a time tRL for any other reset. After reset, the I/O, RAM, ROM, Timer, SIOP and Interrupts are tested. Section 2: Operating Modes Page 6 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 VTST VDD 10 KΩ 4.7 KΩ 1 µf 2N3904 PA7 PA6 PA5 RESET IRQ PE VDD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 VDD OSC1 OSC2 TCAP PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 VDD 10 MΩ 20 pf 20 pf 4 MHz Freescale Semiconductor, Inc... 10 KΩ PA4 PA3 PA2 PA1 PA0 PB0 PB1 PB2 PB3 PB4 10 KΩ PB5 PB6 PB7 VSS Figure 2-2: Self-Check Mode Schematic for the MC68HC05C5 Section 2: Operating Modes For More Information On This Product, Go to: www.freescale.com Page 7 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. Freescale Semiconductor, Inc... Section 2: Operating Modes Page 8 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 3 MEMORY The MC68HC05C5 has an 8 K-byte memory map, consisting of user ROM, user RAM, Self-Check ROM, EEPROM, and I/O. See Figure 3-1 and Figure 3-2. $0000 I/O 32 Bytes $0020 0032 User ROM 48 Bytes $0050 RAM 176 Bytes $00C0 $0100 EEPROM 128 Bytes $0180 Unused 2304 Bytes 0384 Stack 64 Bytes 0192 0256 0080 0000 Freescale Semiconductor, Inc... $0A80 User ROM 5120 Bytes 2688 $1E80 Self-Check ROM 368 Bytes Self-Check Vectors User Vectors 16 Bytes $1FFF 7808 $1FE0 $1FF0 8160 8176 8191 Figure 3-1: The 8K Memory Map of the MC68HC05C5 Section 3: Memory For More Information On This Product, Go to: www.freescale.com Page 9 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. DATA ADDRESS 0000 TO 001F $00 PORT A DATA $01 PORT B DATA $02 PORT C DATA $03 PORT D DATA $04 PORT A DDR $05 PORT B DDR 7 6 5 4 3 2 1 0 Freescale Semiconductor, Inc... $06 PORT C DDR $07 PORT D DDR $08 UNUSED $09 UNUSED $0A SERIAL CTRL $0B SERIAL STAT $0C SERIAL DATA $0D UNUSED $0E UNUSED $0F UNUSED $10 UNUSED $11 UNUSED $12 TIMER CONTROL $13 TIMER STATUS $14 CAPTURE HIGH $15 CAPTURE LOW $16 COMPARE HIGH $17 COMPARE LOW $18 COUNTER HIGH $19 COUNTER LOW $1A DUAL TM HIGH $1B DUAL TM LOW $1C PROGRAM REG $1D UNUSED $1E UNUSED $1F TEST REGISTER LVPI ---CPEN --MSCAN 0 --ROMON ER1 --IOOFF ER0 ---LATCH --COPON EERC EEPGM --RAMON -----ICIE ICF -----OCIE OCF -----TOIE TOF -----0 0 -----0 0 -----COE 0 -----IEDG 0 -----OLVL 0 --0 SPIF --SPE DCOL --0 0 --MSTR 0 --CPOL 0 --0 0 --0 0 --0 0 --TCNT Figure 3-2: I/O Registers for the MC68HC05C5 Section 3: Memory Page 10 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 3.1 ROM The user ROM consists of 48 bytes of page zero ROM from $0020 to $004F, 5120 bytes of ROM from $0A80 to $1E7F and 16 bytes of user vectors from $1FF0 to $1FFF. The Self-Check ROM and vectors are located from $1E80 to $1FEF. Eight of the user vectors, $1FF8 through $1FFF, are dedicated to reset and interrupt vectors. The remaining eight locations, $1FF0 through $1FF7, are general purpose user ROM locations. 3.2 RAM Freescale Semiconductor, Inc... The user RAM consists of 176 bytes of a shared stack area. The stack begins at address $00FF. The stack pointer can access 64 bytes of RAM in the range $00FF to $00C0. See 4.1.4 STACK POINTER (SP). NOTE: Using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. 3.3 EEPROM The EEPROM on this device is 128 bytes long and is located at address $0100. Programming the EEPROM can be done by the user on a single byte basis by manipulating the Programming Register, located at address $001C. 3.3.1 PROGRAMMING REGISTER $1C The contents and use of the programming register are discussed below. This device includes low-voltage programming inhibit (LVPI) circuitry which inhibits the use of the programming register when the supply voltage (VDD) falls below VLVPI. $1C RESET: LVPI 0 CPEN 0 0 0 ER1 0 ER0 0 LATCH 0 EERC 0 EEPGM 0 Figure 3-3: : Programming Register 3.3.1.1 LVPI - Low-Voltage Programming Inhibit LVPI is automatically set and cleared by the LVPI circuit and is not writable. The bit is set when VDD falls below VLVPI and is cleared when VDD is above VLVPR. Note that the VDD rise and fall slew rates (tVDDR and tVDDF) must be within the specification for proper LVPI operation. If the specification is not met, the circuit will operate properly Section 3: Memory For More Information On This Product, Go to: www.freescale.com Page 11 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. following a delay of VDD/Slew rate. When set, LVPI clears bits 0 through 6 in the programming register to disable the charge pump and prevent programming. CPEN cannot be set when LVPI is set. During reset, LVPI is set until VDD reaches VLVPI, at which time it is cleared. The LVPI circuitry continues to function while the processor is in STOP mode. The LVPI function is a mask option. If this function is disabled, bit 7 will be set to a value of "0". 3.3.1.2 CPEN - Charge Pump Enable Freescale Semiconductor, Inc... When set, CPEN enables the charge pump which produces the internal EEPROM programming voltage. This bit should be set concurrently with the LATCH bit. The programming voltage will not be available until EEPGM is set. The charge pump should be disabled when not in use. This bit is automatically cleared by the LVPI circuit when LVPI is set, and cannot be set until LVPI is cleared. CPEN is readable and writable and is cleared by reset. 3.3.1.3 ER1:ER0 - Erase Select Bits ER1 and ER0 form a 2-bit field which is used to select one of three erase modes: byte, block, or bulk. Table 3-1 shows the modes selected for each bit configuration. These bits are automatically cleared when LVPI is set. These bits are readable and writable and are cleared by reset. In byte erase mode, only the selected byte is erased. In block mode, a 32-byte block of EEPROM is erased. The EEPROM memory space is divided into four 32-byte blocks ($100-$11F, $120-$13F, $140-$15F, $160-$17F), and doing a block erase to any address within a block will erase the entire block. In bulk erase mode, the entire 128-byte EEPROM section is erased. Table 3-1: Erase Mode Select ER1 0 0 1 1 ER0 0 1 0 1 MODE Program (no Erase) Byte Erase Block Erase Bulk Erase 3.3.1.4 LATCH When set, LATCH configures the EEPROM address and data bus for programming. When LATCH is set, writes to the EEPROM array cause the data bus and the address bus to be latched. This bit is readable and writable, but reads from the array are inhibited if the LATCH bit is set and a write to the EEPROM space has taken place. When clear, Section 3: Memory Page 12 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 address and data buses are configured for normal operation. LATCH is automatically cleared when LVPI is set. Reset clears this bit. 3.3.1.5 EERC - EEPROM RC Oscillator Control When this bit is set, the EEPROM section uses the internal RC oscillator instead of the CPU clock. After setting the EERC bit, delay a time tRCON to allow the RC oscillator to stabilize. This bit is readable and writable and should be set by the user when the internal bus frequency falls below 1.5 MHz. EERC is automatically cleared when LVPI is set. Reset clears this bit. 3.3.1.6 EEPGM - EEPROM Programming Power Enable Freescale Semiconductor, Inc... EEPGM must be written to enable (or disable) the EEPGM function. When set, EEPGM turns on the charge pump and enables the programming (or erasing) power to the EEPROM array. When clear, this power is switched off. This will enable pulsing of the programming voltage to be controlled internally. This bit can be read at any time, but can only be written to if LATCH = 1. If LATCH is not set, then EEPGM cannot be set. LATCH and EEPGM can not both be set with one write if LATCH is cleared. EEPGM is automatically cleared when LVPI is set. EEPGM is automatically cleared when LATCH is cleared. Reset clears this bit. 3.3.2 PROGRAMMING/ERASING PROCEDURES To program a byte of EEPROM, set LATCH = CPEN = 1, set ER1 = ER0 = 0, write data to the desired address and then set EEPGM for a time tEPGM. NOTE: Any bit should be erased before it is programmed. However, if write/ erase cycling is a concern, a procedure can be followed to minimize the cycling of each bit in each EEPROM byte. Here is the procedure: • If PB•EB* = 0, then program the new data over the existing data without erasing it first • If PB•EB* ≠ 0, then erase byte before programming • Where PB = Byte data to be programmed and EB = Existing EEPROM byte data. Section 3: Memory For More Information On This Product, Go to: www.freescale.com Page 13 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. To erase a byte of EEPROM, set LATCH = 1, CPEN = 1, ER1 = 0 and ER0 = 1, write to the address to be erased, and set EEPGM for a time tEBYT. To erase a block of EEPROM, set LATCH = 1, CPEN = 1, ER1 = 1 and ER0 = 0, write to any address in the block, and set EEPGM for a time tEBLOCK. For a bulk erase, set LATCH = 1, CPEN = 1, ER1 = 1, and ER0 = 1, write to any address in the array, and set EEPGM for a time tEBULK. To terminate the programming or erase sequence, clear EEPGM, delay for a time tFPV to allow the program voltage to fall, and then clear LATCH and CPEN to free up the buses. Following each erase or programming sequence, clear all programming control bits. Freescale Semiconductor, Inc... Section 3: Memory Page 14 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 4 4.1 REGISTERS CPU CORE The MCU contains five registers as shown in the programming model of Figure 4-1. The interrupt stacking order is shown in Figure 4-2. 7 A 0 Accumulator 0 X 12 PC 12 0 0 0 0 0 7 1 1 SP CCR H I N Z C Condition Code Register 0 Stack Pointer 0 Program Counter Index Register Freescale Semiconductor, Inc... 7 Figure 4-1: Programming Model 7 1 Increasing Memory Addresses R E T U R N 1 1 0 Condition Code Register Accumulator Index Register PCH PCL Stack I N T E R R U P T Decreasing Memory Addresses Unstack NOTE: Since the Stack Pointer decrements during pushes, the PCL is stacked first, followed by PCH, etc. Pulling from the stack is in the reverse order. Figure 4-2: Stacking Order 4.1.1 ACCUMULATOR (A) The accumulator is a general purpose 8-bit register used to hold operands and results of arithmetic calculations or data manipulations. Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 15 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 4.1.2 INDEX REGISTER (X) The index register is an 8-bit register used for the indexed addressing value to create an effective address. The index register may also be used as a temporary storage area. 4.1.3 PROGRAM COUNTER (PC) The program counter is a 13-bit register that contains the address of the next byte to be fetched. 4.1.4 STACK POINTER (SP) Freescale Semiconductor, Inc... The stack pointer contains the address of the next free location on the stack. During an MCU reset or the reset stack pointer (RSP) instruction, the stack pointer is set to location $00FF. The stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled from the stack. When accessing memory, the seven most significant bits are permanently set to 0000011. These 7 bits are appended to the six least significant register bits to produce and address within the range of $00FF to $00C0. Subroutines and interrupts may use up to 64 (decimal) locations. If 64 locations are exceeded, the stack pointer wraps around and loses the previously stored information. A subroutine call occupies two locations on the stack; an interrupt uses five locations. 4.1.5 CONDITION CODE REGISTER (CCR) The CCR is a 5-bit register in which 4 bits are used to indicate the results of the instruction just executed, and the fifth bit indicates whether interrupts are masked. These bits can be individually tested by a program, and specific actions can be taken as a result of their state. Each bit is explained in the following paragraphs. 4.1.5.1 Half Carry (H) This bit is set during ADD and ADC operations to indicate that a carry occurred between bits 3 and 4. 4.1.5.2 Interrupt (I) When this bit is set, the timer and external interrupt is masked (disabled). If an interrupt occurs while this bit is set, the interrupt is latched and processed as soon as the interrupt bit is cleared. 4.1.5.3 Negative (N) When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was negative. 4.1.5.4 Zero (Z) When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was zero. Section 4: CPU Core Page 16 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 4.1.5.5 Carry/Borrow (C) When set, this bit indicates that a carry or borrow out of the arithmetic logical unit (ALU) occurred during the last arithmetic operation. This bit is also affected during bit test and branch instructions and during shifts and rotates. 4.2 INSTRUCTION SET The MCU has a set of 62 basic instructions. They can be divided into five different types: register/memory, read-modify-write, branch, bit manipulation, and control. The following paragraphs briefly explain each type. For more information on the instruction set, refer to the M6805 Family User’s Manual (M6805UM/AD2) or the MC68HC05C4 Technical Data (MC68HC05C4/D). Freescale Semiconductor, Inc... 4.2.1 REGISTER/MEMORY INSTRUCTIONS Most of these instructions use two operands. One operand is either the accumulator or the index register. The other operand is obtained from memory using one of the addressing modes. The jump unconditional (JMP) and jump to subroutine (JSR) instructions have no register operand. Refer to the following instruction list. Function Load A from Memory Load X from Memory Store A in Memory Store X in Memory Add Memory to A Add Memory and Carry to A Subtract Memory Subtract Memory from A with Borrow AND Memory to A OR Memory with A Exclusive OR Memory with A Arithmetic compare A with Memory Arithmetic Compare X with Memory Bit Test Memory with A (Logical Compare) Jump Unconditional Jump to Subroutine Multiply Mnemonic LDA LDX STA STX ADD ADC SUB SBC AND ORA EOR CMP CPX BIT JMP JSR MUL Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 17 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 4.2.2 READ-MODIFY-WRITE INSTRUCTIONS These instructions read a memory location or a register, modify or test its contents, and write the modified value back to memory or to the register. The test for negative or zero (TST) instruction is an exception to the read-modify-write sequence since it does not modify the value. Do not use these read-modify-write instructions on write-only locations. Refer to the following list of instructions. Function Increment Decrement Mnemonic INC DEC CLR COM NEG ROL ROR LSL LSR ASR TST Freescale Semiconductor, Inc... Clear Complement Negate (Twos Complement) Rotate Left Through Carry Rotate Right Through Carry Logical Shift Left Logical Shift Right Arithmetic Shift Right Test for Negative or Zero Section 4: CPU Core Page 18 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 4.2.3 BRANCH INSTRUCTIONS This set of instructions branches if a particular condition is met; otherwise, no operation is performed. Branch instructions are 2-byte instructions. Refer to the following list for branch instructions. Function Branch Always Branch Never Branch if Higher Branch if Lower or Same Mnemonic BRA BRN BHI BLS BCC BHS BCS BLO BNE BEQ BHCC BHCS BPL BMI BMC BMS BIL BIH BSR Freescale Semiconductor, Inc... Branch if Carry Clear Branch if Higher or Same Branch if Carry Set Branch if Lower Branch if Not Equal Branch if Equal Branch if Half Carry Clear Branch if Half Carry Set Branch if Plus Branch if Minus Branch if Interrupt Mask Bit is Clear Branch if Interrupt Mask Bit is Set Branch if Interrupt Line is Low Branch if Interrupt Line is High Branch to Subroutine Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 19 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 4.2.4 BIT MANIPULATION INSTRUCTIONS The MCU is capable of setting or clearing any writable bit which resides in the first 256 bytes of the memory space where all port registers, port DDRs, timer, timer control, and on-chip RAM reside. An additional feature allows the software to test and branch on the state of any bit within these 256 locations. The bit set, bit clear and bit test and branch functions are all implemented with a single instruction. For test and branch instructions, the value of the bit tested is also placed in the carry bit of the condition code register. These instructions are also read-modify-write instructions. Do not bit manipulate writeonly locations. Refer to the following list for bit manipulation instructions. Function Mnemonic BRSET n (n = 0. . .7) BRCLR n (n = 0. . .7) BSET n (n = 0. . .7) BCLR n (n = 0. . .7) Freescale Semiconductor, Inc... Branch if Bit n is Set Branch if Bit n is Clear Set Bit n Clear Bit n 4.2.5 CONTROL INSTRUCTIONS These instructions are register reference instructions and are used to control processor operation during program execution. Refer to the following list for control instructions. Function Transfer A to X Transfer X to A Set Carry Bit Clear Carry Bit Set Interrupt Mask Bit Clear Interrupt Mask Bit Software Interrupt Return from Subroutine Return from Interrupt Reset Stack Pointer No-Operation Stop Wait Mnemonic TAX TXA SEC CLC SEI CLI SWI RTS RTI RSP NOP STOP WAIT Section 4: CPU Core Page 20 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 4.3 ADDRESSING MODES The MCU uses ten different addressing modes to provide the programmer with an opportunity to optimize the code for all situations. The various indexed addressing modes make it possible to locate data tables, code conversion tables, and scaling tables anywhere in the memory space. Short indexed accesses are single-byte instructions; the longest instructions (3 bytes) permit accessing tables throughout memory. Short and long absolute addressing is also included. One or 2-byte direct addressing instructions access all data bytes in most applications. Extended addressing permits jump instructions to reach all memory. The term "effective address" (EA) is used to describe the various addressing modes. Effective address is defined as the address from which the argument for an instruction is fetched or stored. 4.3.1 IMMEDIATE Freescale Semiconductor, Inc... In the immediate addressing mode, the operand is contained in the byte immediately following the opcode. The immediate addressing mode is used to access constants that do not change during program execution (for example, a constant used to initialize a loop counter). 4.3.2 DIRECT In the direct addressing mode, the effective address of the argument is contained in a single byte following the opcode byte. Direct addressing allows the user to directly address the lowest 256 bytes in memory with a single 2-byte instruction. 4.3.3 EXTENDED In the extended addressing mode, the effective address of the argument is contained in the 2 bytes following the opcode byte. Instructions with extended addressing mode are capable of referencing arguments anywhere in memory with a single 3-byte instruction. When using the Motorola assembler, the user need not specify whether an instruction uses direct or extended addressing. The assembler automatically selects the shortest form of the instruction. 4.3.4 RELATIVE The relative addressing mode is only used in branch instructions. In relative addressing, the contents of the 8-bit signed offset byte, which is the last byte of the instruction, is added to the PC if, and only if, the branch conditions are true. Otherwise control proceeds to the next instruction. The span of relative addressing is from -128 to +127 from the address of the next opcode. The programmer need not calculate the offset when using the Motorola assembler, since it calculates the proper offset and checks to see that it is within the span of the branch. Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 21 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 4.3.5 INDEXED, NO OFFSET In the indexed, no offset addressing mode, the effective address of the argument is contained in the 8-bit index register. This addressing mode can access the first 256 memory locations. These instructions are only 1 byte long. This mode is often used to move a pointer through a table or to hold the address of a frequently referenced RAM or I/O location. 4.3.6 INDEXED, 8-BIT OFFSET Freescale Semiconductor, Inc... In the indexed, 8-bit offset addressing mode, the effective address is the sum of the contents of the unsigned 8-bit index register and the unsigned byte following the opcode. th This addressing mode is useful for selecting the K element in an n element table. With this 2-byte instruction, K would typically be in X and the address of the beginning of the table would be in the instruction. As such, tables may begin anywhere within the first 256 addressable locations and could extend as far as location 510 ($01FE). This is the last location which can be accessed in this way. 4.3.7 INDEXED, 16-BIT OFFSET In the indexed, 16-bit offset addressing mode, the effective address is the sum of the contents of the unsigned 8-bit index register and the 2 unsigned bytes following the opcode. This address mode can be used in a manner similar to indexed, 8-bit offset except that this 3-byte instruction allows tables to be anywhere in memory. As with direct and extended addressing, the Motorola assembler determines the shortest form of indexed addressing. 4.3.8 BIT SET/CLEAR In the bit set/clear addressing mode, the bit to be set or cleared is part of the opcode, and the byte following the opcode specifies the direct addressing of the byte in which the specified bit is to be set or cleared. Any read/write bit in the first 256 locations of memory, including I/O, can by selectively set or cleared with a single 2-byte instruction. 4.3.9 BIT TEST AND BRANCH The bit test and branch addressing mode is a combination of direct addressing and relative addressing. The bit that is to be tested and its condition (set or clear), is included in the opcode. The address of the byte to be tested is in the single byte immediately following the opcode byte. The signed relative 8-bit offset in the third byte is added to the PC if the specified bit is set or cleared in the specified memory location. This single 3byte instruction allows the program to branch based on the condition of any readable bit in the first 256 locations of memory. The span of branching is from -128 to +127 from the address of the next opcode. The state of the tested bit is also transferred to the carry bit of the condition code register. Section 4: CPU Core Page 22 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 4.3.10 INHERENT In the inherent addressing mode, all the information necessary to execute the instruction is contained in the opcode. Operations specifying only the index register and/or accumulator as well as the control instructions with no other arguments are included in this mode. These instructions are 1 byte long. 4.4 RESETS The MCU can be reset three ways: by the initial power-on reset function, by an active low input to the RESET pin, and by a COP watchdog-timer reset. 4.4.1 POWER-ON RESET (POR) Freescale Semiconductor, Inc... An internal reset is generated upon power-up to allow the internal clock generator to stabilize. The power-on reset is strictly for power turn-on conditions and should not be used to detect a drop in the power supply voltage. There is a 4064 internal processor clock cycle (tCYC) oscillator stabilization delay after the oscillator becomes active. If the RESET pin is low at the end of this 4064-cycle delay, the MCU will remain in the reset condition until RESET goes high. V DD tVDDR OSC1 2 4064tcyc tcyc Internal 1 Clock Internal Address 1 Bus Internal Data 1 Bus 1FFE 1FFF New PC Dummy New PC Op Code 1FFE 1FFE 1FFE 1FFE 1FFF New PC Dummy New PC Op Code New PCH New PCL PCH PCL t RESET RL 3 NOTES: 1. Internal timing signal and bus information not available externally. 2. OSC1 line is not meant to represent frequency. It is only used to represent time. 3. The next rising edge of the internal processor clock following the rising edge of RESET initiates the reset sequence. Figure 4-3: Power-On Reset and RESET Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 23 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 4.4.2 RESET PIN The MCU is reset when a logic zero is applied to the RESET input for a period of one and one-half machine cycles (tCYC). 4.4.3 COMPUTER OPERATING PROPERLY (COP) RESET The MCU contains a watchdog timer that automatically times out if not reset (cleared) within a specific time by a program reset sequence. If the COP watchdog timer is allowed to time-out, an internal reset is generated to reset the MCU. Because the internal RESET signal is used, the MCU comes out of a COP reset in the same operating mode it was in when the COP time-out was generated. Freescale Semiconductor, Inc... The COP reset function is enabled or disabled by a mask option. Refer to SECTION 8 COMPUTER OPERATING PROPERLY for more information on the COP Watchdog timer. 4.5 INTERRUPTS The MCU can be interrupted three different ways: by the two maskable hardware interrupts (IRQ and timer) and the nonmaskable software interrupt instruction (SWI). Interrupts cause the processor to save register contents on the stack and to set the interrupt mask (I bit) to prevent additional interrupts. The RTI instruction causes the register contents to be recovered from the stack and normal processing to resume. Unlike RESET, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. NOTE: The current instruction is the one already fetched and being operated on. When the current instruction is complete, the processor checks all pending hardware interrupts. If interrupts are not masked (CCR I bit clear) and if the corresponding interrupt enable bit is set, the processor proceeds with interrupt processing; otherwise, the next instruction is fetched and executed. If both an external interrupt and a timer interrupt are pending at the end of an instruction execution, the external interrupt is serviced first. The SWI is executed the same as any other instruction, regardless of the I-bit state. Table 4-1 lists vector addresses for all interrupts including reset. Section 4: CPU Core Page 24 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 Table 4-1: Vector Address for Interrupts and Reset Register N/A N/A N/A TSR TSR TSR Flag Name N/A N/A N/A ICF OCF TOF Interrupts Reset Software External Interrupt Timer Input Capture Timer Output Compare Timer Overflow CPU Interrupt RESET SWI IRQ TIMER TIMER TIMER Vector Address $1FFE-$1FFF $1FFC-$1FFD $1FFA-$1FFB $1FF8-$1FF9 $1FF8-$1FF9 $1FF8-$1FF9 4.5.1 HARDWARE CONTROLLED INTERRUPT SEQUENCE Freescale Semiconductor, Inc... The following three functions (RESET, STOP, and WAIT) are not in the strictest sense interrupts; however, they are acted upon in a similar manner. Flowcharts for hardware interrupts are shown in Figure 4-4, and for STOP and WAIT in Figure 4-6. A discussion is provided below. 1. RESET - A low input on the RESET input pin causes the program to vector to its starting address which is specified by the contents of memory locations $1FFE and $1FFF. The I bit in the condition code register is also set. Much of the MCU is configured to a known state during this type of reset as previously described in 4.4 RESETS. 2. STOP - The STOP instruction causes the oscillator to be turned off and the processor to "sleep" until and external interrupt (IRQ) or reset occurs. 3. WAIT - The WAIT instruction causes all processor clocks to stop, but leaves the timer clock running. This "rest" state of the processor can be cleared by reset, an external interrupt IRQ), or timer interrupt. There are no special wait vectors for these individual interrupts. 4.5.2 SOFTWARE INTERRUPT (SWI) The SWI is an executable instruction and a non-maskable interrupt: It is executed regardless of the state of the I bit in the CCR. If the I bit is zero (interrupts enabled), SWI executes after interrupts which were pending when the SWI was fetched, but before interrupts generated after the SWI was fetched. The interrupt service routine address is specified by the contents of memory locations $1FFC and $1FFD. 4.5.3 EXTERNAL INTERRUPT If the interrupt mask bit (I bit) of the CCR is set, all maskable interrupts (internal and external) are disabled. Clearing the I bit enables interrupts. The interrupt request is latched immediately following the falling edge of IRQ. It is then synchronized internally and serviced as specified by the contents of $1FFA and $1FFB. Either a level-sensitive and edge-sensitive trigger or an edge-sensitive-only trigger is available as a mask option. Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 25 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. NOTE: The internal interrupt latch is cleared in the first part of the interrupt service routine; therefore, one external interrupt pulse could be latched and serviced as soon as the I bit is cleared. TIMER INTERRUPT 4.5.4 There are three different timer interrupt flags that cause a timer interrupt whenever they are set and enabled. The interrupt flags are in the Timer Status Register (TSR), and the enable bits are in the Timer Control Register (TCR). Any of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory locations $1FF8 and $1FF9. Freescale Semiconductor, Inc... Section 4: CPU Core Page 26 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 FROM RESET Y I-BIT IN CCR SET ? N IRQ EXTERNAL INTERRUPT N INTERNAL TIMER INTERRUPT N Y Y CLEAR IRQ REQUEST LATCH Freescale Semiconductor, Inc... STACK PC, X, A, CCR FETCH NEXT INSTRUCTION SET I BIT IN CC REGISTER SWI INSTRUCTION ? N Y RTI INSTRUCTION ? N RESTORE REGISTERS FROM STACK: CCR, A, X, PC EXECUTE INSTRUCTION Y LOAD PC FROM: SWI: $1FFC-$1FFD IRQ: $1FFA-$1FFB Timer: $1FF8-$1FF9 Figure 4-4: Interrupt Flowchart Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 27 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 4.6 4.6.1 LOW-POWER MODES STOP The STOP instruction places the MCU in its lowest power consumption mode. In STOP mode, the internal oscillator is turned off, halting all internal processing, including timer and COP Watchdog operation. The RC oscillator is also turned off during STOP mode, and is not available for use by the EEPROM system. During the STOP mode, the TCR bits are altered to remove any pending timer interrupt request and to disable any further timer interrupts. The timer prescaler is cleared. The I bit in the CCR is cleared to enable external interrupts. All other registers and memory remain unaltered. All input/output lines remain unchanged. The processor can be brought out of the STOP mode only by an external interrupt or reset. 4.6.1.1 STOP RECOVERY Freescale Semiconductor, Inc... The processor can be brought out of the STOP mode only by an external interrupt or RESET. See Figure 4-5. OSC11 tRL RESET IRQ2 tLIH IRQ3 tILCH 4064 tcyc INTERNAL CLOCK INTERNAL ADDRESS BUS 1FFE 1FFE 1FFE 1FFE 1FFF Notes: 1. Represents the internal gating of the OSC1 pin. 2. IRQ pin edge-sensitive mask option. 3. IRQ pin level- and edge-sensitive mask option. RESET OR INTERRUPT VECTOR FETCH Figure 4-5: Stop Recovery Timing Diagram Section 4: CPU Core Page 28 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 4.6.2 WAIT The WAIT instruction places the MCU in a low-power consumption mode, but the WAIT mode consumes more power than the STOP mode. All CPU action is suspended, but the timer and the oscillator remain active. Any interrupt or reset (including a COP reset) will cause the MCU to exit the WAIT mode. During the WAIT mode, the I bit in the CCR is cleared to enable interrupts. All other registers, memory, and input/output lines remain in their previous state. The timer may be enabled to allow a periodic exit from the WAIT mode. STOP WAIT Freescale Semiconductor, Inc... Stop Oscillator And All Clocks Clear I Bit Oscillator Active Timer Clock Active Processor Clocks Stopped Clear I Bit N Reset Reset N N External Interrupt (IRQ) Y Y Y External Interrupt (IRQ) Y Y N Timer Interrupt N Turn On Oscillator Wait for Time Delay to Stabilize Restart Processor Clock 1. Fetch Reset Vector or 2. Service Interrupt a.Stack b.Set I Bit c.Vector to Interrupt Routine 1. Fetch Reset Vector or 2. Service Interrupt a.Stack b.Set I Bit c.Vector to Interrupt Routine Figure 4-6: STOP/WAIT Flowcharts Section 4: CPU Core For More Information On This Product, Go to: www.freescale.com Page 29 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. Freescale Semiconductor, Inc... Section 4: CPU Core Page 30 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 5 INPUT/OUTPUT PORTS In single-chip mode there are 32 lines arranged as four 8-bit I/O ports. These ports are programmable as either inputs or outputs under software control of the data direction registers. NOTE: To avoid a glitch on the output pins, write data to the I/O Port Data Register before writing a 1 to the corresponding Data Direction Register. Freescale Semiconductor, Inc... 5.1 PORT A Port A is an 8-bit bidirectional port which does not share any of its pins with other subsystems. The port A data register is at $0000 and the data direction register (DDR) is at $0004. Reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. Writing a 1 to a DDR bit sets the corresponding port bit to output mode. 5.2 PORT B Port B is an 8-bit bidirectional port. Three of the port B pins (PB5 thourgh PB7) are shared with the SIOP subsystem. Refer to SECTION 7 SIMPLE SERIAL INPUT/OUTPUT PORT for a detailed description of the SIOP. The port B data register is at $0001 and the data direction register (DDR) is at $0005. Reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. Writing a 1 to a DDR bit sets the corresponding port bit to output mode. 5.3 PORT C Port C is an 8-bit bidirectional port which does not share any of its pins with other subsystems. The port C data register is at $0002 and the data direction register (DDR) is at $0006. Reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. Writing a 1 to a DDR bit sets the corresponding port bit to output mode. Port C has a high current sink capability. To minimize current spikes, these pins should be switched one at a time. 5.4 PORT D Port D is an 8-bit bidirectional port. PD6 is shared with TCMP. If the PD6 pin is configured as TCMP by setting the COE bit in the Timer Control Register, this pin will become an output controlled by the Timer subsection. Refer to SECTION 6 TIMER for more information. The port D data register is at $0003 and the data direction register (DDR) is at $0007. Reset does not affect the data registers, but clears the data direction Section 5: Input/Output Ports For More Information On This Product, Go to: www.freescale.com Page 31 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. registers, thereby returning the ports to inputs. corresponding port bit to output mode. Writing a 1 to a DDR bit sets the 5.5 INPUT/OUTPUT PROGRAMMING Port pins may be programmed as inputs or outputs under software control. The direction of the pins is determined by the state of the corresponding bit in the port data direction register (DDR). Each port has an associated DDR. Any port pin is configured as an output if its corresponding DDR bit is set to a logic one. A pin is configured as an input if its corresponding DDR bit is cleared to a logic zero. At power-on or reset, all DDRs are cleared, which configures all pins as inputs. The data direction registers are capable of being written to or read by the processor. During the programmed output state, a read of the data register actually reads the value of the output data latch and not the I/O pin. Refer to Table 5-1 and Figure 5-1. Table 5-1: I/O Pin Functions R/W 0 0 1 1 DDR 0 1 0 1 I/O Pin Function The I/O pin is in input mode. Data is written into the output data latch. Data is written into the output data latch and output of the I/O pin. The state of the I/O pin is read. The I/O pin is in an output mode. The output data latch is read. Freescale Semiconductor, Inc... R/W is an internal signal. Data Direction Register Bit Internal HC05 Connections Latched Output Data Bit Output I/O Pin Input Register Bit Input I/O Figure 5-1: Port I/O Circuitry Section 5: Input/Output Ports Page 32 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 6 6.1 INTRODUCTION TIMER The timer consists of a 16-bit, software-programmable counter driven by a fixed divideby-four prescaler. This timer can be used for many purposes, including input waveform measurements while simultaneously generating an output waveform. Pulse widths can vary from several microseconds to many seconds. Refer to Figure 6-1 for a timer block diagram. Freescale Semiconductor, Inc... Because the timer has a 16-bit architecture, each specific functional segment (capability) is represented by two registers. These registers contain the high and low byte of that functional segment. Generally, accessing the low byte of a specific timer function allows full control of that function; however, an access of the high byte inhibits that specific timer function until the low byte is also accessed. Note: The I bit in the CCR should be set while manipulating both the high and low byte register of a specific timer function to ensure that an interrupt does not occur. Internal Bus Internal Processor Clock ∏∏∏ /4 $16 $17 Output Compare Register High Byte 16-Bit Free Running Counter Counter Alternate Register Low Byte $18 $19 $1A $1B High Byte Low Byte 8-Bit Buffer High Low Byte Byte Input Capture Register $14 $15 Output Compare Circuit Overflow Detect Circuit Edge Detect Circuit Timer Status Reg. ICF OCF TOF $13 Output Level Reg. Timer Control ICIE OCIE TOIE IEDG OLVL Reg. $12 DQ CLK C RESET Interrupt Circuit Output Edge Level Input (TCMP) (TCAP) Figure 6-1: Timer Block Diagram Section 6: Timer For More Information On This Product, Go to: www.freescale.com Page 33 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 6.2 COUNTER The key element in the programmable timer is a 16-bit, free-running counter or counter register, preceded by a prescaler that divides the internal processor clock by four. The prescaler gives the timer a resolution of 2.0 microseconds if the internal bus clock is 2.0 MHz. The counter is incremented during the low portion of the internal bus clock. Software can read the counter at any time without affecting its value. The double-byte, free-running counter can be read from either of two locations, $18-$19 (counter register) or $1A-$1B (counter alternate register). A read from only the least significant byte (LSB) of the free-running counter ($19, $1B) receives the count value at the time of the read. If a read of the free-running counter or counter alternate register first addresses the most significant byte (MSB) ($18, $1A), the LSB ($19, $1B) is transferred to a buffer. This buffer value remains fixed after the first MSB read, even if the user reads the MSB several times. This buffer is accessed when reading the free-running counter or counter alternate register LSB ($19 or $1B) and, thus, completes a read sequence of the total counter value. In reading either the free-running counter or counter alternate register, if the MSB is read, the LSB must also be read to complete the sequence. The counter alternate register differs from the counter register in one respect: A read of the counter register MSB can clear the timer overflow flag (TOF). Therefore, the counter alternate register can be read at any time without the possibility of missing timer overflow interrupts due to clearing of the TOF. The free-running counter is configured to $FFFC during reset and is always a read-only register. During a power-on reset, the counter is also preset to $FFFC and begins running after the oscillator start-up delay. Because the free-running counter is 16 bits preceded by a fixed divided-by-four prescaler, the value in the free-running counter repeats every 262,144 internal bus clock cycles. When the counter rolls over from $FFFF to $0000, the TOF bit is set. An interrupt can also be enabled when counter rollover occurs by setting its interrupt enable bit (TOIE). Freescale Semiconductor, Inc... 6.3 OUTPUT COMPARE REGISTER The 16-bit output compare register is made up of two 8-bit registers at locations $16 (MSB) and $17 (LSB). The output compare register is used for several purposes, such as indicating when a period of time has elapsed. All bits are readable and writable and are not altered by the timer hardware or reset. If the compare function is not needed, the 2 bytes of the output compare register can be used as storage locations. The output compare register contents are compared with the contents of the free-running counter continually, and if a match is found, the corresponding output compare flag (OCF) bit is set and the corresponding output level (OLVL) bit is clocked to an output level register. The output compare register values and the output level bit should be changed after each successful comparison to establish a new elapsed timeout. An interrupt can also accompany a successful output compare provided the corresponding interrupt enable bit (OCIE) is set. Section 6: Timer Page 34 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 After a processor write cycle to the output compare register containing the MSB ($16), the output compare function is inhibited until the LSB ($17) is also written. The user must write both bytes (locations) if the MSB is written first. A write made only to the LSB ($17) will not inhibit the compare function. The free-running counter is updated every four internal bus clock cycles. The minimum time required to update the output compare register is a function of the program rather than the internal hardware. The processor can write to either byte of the output compare register without affecting the other byte. The output level (OLVL) bit is clocked to the output level register regardless of whether the output compare flag (OCF) is set or clear. 6.4 INPUT CAPTURE REGISTER Freescale Semiconductor, Inc... Two 8-bit registers, which make up the 16-bit input capture register, are read-only and are used to latch the value of the free-running counter after the corresponding input capture edge detector senses a defined transition. The level transition which triggers the counter transfer is defined by the corresponding input edge bit (IEDG). Reset does not affect the contents of the input capture register except when exiting stop mode. The result obtained by an input capture will be one more than the value of the free-running counter on the rising edge of the internal bus clock preceding the external transition. This delay is required for internal synchronization. Resolution is one count of the free-running counter, which is four internal bus clock cycles. The free-running counter contents are transferred to the input capture register on each proper signal transition regardless of whether the input capture flag (ICF) is set or clear. The input capture register always contains the free-running counter value that corresponds to the most recent input capture. After a read of the input capture register ($14) MSB, the counter transfer is inhibited until the LSB ($15) is also read. This characteristic causes the time used in the input capture software routine and its interaction with the main program to determine the minimum pulse period. A read of the input capture register LSB ($15) does not inhibit the free-running counter transfer since they occur on opposite edges of the internal bus clock. 6.5 TIMER CONTROL REGISTER (TCR) $12 The TCR is a read/write register containing six control bits. Three bits control interrupts associated with the timer status register flags ICF, OCF and TOF. $12 RESET: ICIE 0 OCIE 0 TOIE 0 0 0 0 0 COE 0 IEDG U OLVL 0 Figure 6-2: Timer Control Register Section 6: Timer For More Information On This Product, Go to: www.freescale.com Page 35 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. ICIE - Input Capture Interrupt Enable 1 = Interrupt enabled 0 = Interrupt disabled OCIE - Output Compare Interrupt Enable 1 = Interrupt enabled 0 = Interrupt disabled TOIE - Timer Overflow Interrupt Enable 1 = Interrupt enabled Freescale Semiconductor, Inc... 0 = Interrupt disabled COE - TCMP Pin Enable 1 = TCMP pin enabled 0 = TCMP pin disabled (pin 35 is PD6) IEDG - Input Edge Value of input edge determines which level transition on TCAP pin will trigger free-running counter transfer to the input capture register 1 = Positive edge 0 = Negative edge Reset does not affect the IEDG bit (U=unaffected). OLVL - Output Level Value of output level is clocked into output level register by the next successful output compare and will appear on the TCMP pin 1 = High output 0 = Low output Bits 3 and 4 - Not used Always read zero Section 6: Timer Page 36 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 6.6 TIMER STATUS REGISTER (TSR) $13 The TSR is a read-only register containing three status flag bits. $13 RESET: ICF U OCF U TOF U 0 0 0 0 0 0 0 0 0 0 Figure 6-3: Timer Status Register ICF - Input Capture Flag 1 = Flag set when selected polarity edge is sensed by input capture edge detector Freescale Semiconductor, Inc... 0 = Flag cleared when TSR and input capture low register ($15) are accessed OCF - Output Compare Flag 1 = Flag set when output compare register contents match the free-running counter contents 0 = Flag cleared when TSR and output compare low register ($17) are accessed TOF - Timer Overflow Flag 1 = Flag set when free-running counter transition from $FFFF to $0000 occurs 0 = Flag cleared when TSR and counter low register ($19) are accessed Bits 0-4 - Not used Always read zero Accessing the timer status register satisfies the first condition required to clear status bits. The remaining step is to access the register corresponding to the status bit. A problem can occur when using the timer overflow function and reading the free-running counter at random times to measure an elapsed time. Without incorporating the proper precautions into software, the timer overflow flag could unintentionally be cleared if: 1) The timer status register is read or written when TOF is set, and 2) The LSB of the free-running counter is read but not for the purpose of servicing the flag. The counter alternate register at address $1A and $1B contains the same value as the free-running counter (at address $18 and $19); therefore, this alternate register can be read at any time without affecting the timer overflow flag in the timer status register. Section 6: Timer For More Information On This Product, Go to: www.freescale.com Page 37 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 6.7 TIMER DURING WAIT MODE The CPU clock halts during the WAIT mode, but the timer remains active. If interrupts are enabled, a timer interrupt will cause the processor to exit the WAIT mode. 6.8 TIMER DURING STOP MODE Freescale Semiconductor, Inc... In the STOP mode, the timer stops counting and holds the last count value if STOP is exited by an interrupt. If RESET is used, the counter is forced to $FFFC. During STOP, if at least one valid input capture edge occurs at the TCAP pin, the input capture detect circuit is armed. This does not set any timer flags nor wake up the MCU, but when the MCU does wake up, there is an active input capture flag and data from the first valid edge that occurred during the STOP mode. If RESET is used to exit STOP mode, then no input capture flag or data remains, even if a valid input capture edge occurred. Section 6: Timer Page 38 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 7 SIMPLE SERIAL INPUT/OUTPUT PORT This device includes a simple synchronous Serial I/O Port (SIOP). The SIOP is a threewire master/slave system including Serial Clock (SCK), Serial Data Input (SDI), and Serial Data Output (SDO). A mask programmable option determines whether the SIOP is MSB or LSB first. RESET RQ D C SDO Freescale Semiconductor, Inc... SCK 8-BIT SHIFT REGISTER SDI MSB/LSB MASK OPTION DATA BUS Figure 7-1: SIOP Block Diagram 7.1 7.1.1 SIGNAL FORMAT SCK The state of SCK between transmissions must be logic ’1’ for CPOL set and logic ’0’ for CPOL clear. The first transition of SCK signals the beginning of a transmission. At this time, the first bit of received data is accepted at the SDI pin and the first bit of transmitted data is presented at the SDO pin. Data is captured at the SDI pin on the rising edge of SCK. Subsequent falling edges shift the data and accept or present the next bit. The transmission is ended upon the eighth rising edge of SCK. The maximum frequency of SCK in slave mode is equal to E (bus clock) divided by 4. That is for a 4 MHz oscillator input E becomes 2 MHz and the maximum SCK frequency is 500 KHz. There is no minimum SCK frequency. In master mode, the format is identical except that the SCK pin is an output and the shift clock now originates internally. The master mode transmission frequency is fixed at E/4. 7.1.2 SDO A mask programmable option will be included to allow data to be transmitted in either MSB first format or LSB first format. In either case, the state of the SDO pin will always reflect the value of the first bit received on the previous transmission if there was one. Upon enabling the SIOP, SDO will always be driven to a logic one by the SIOP subsystem. Section 7: Simple Input/Output Port For More Information On This Product, Go to: www.freescale.com Page 39 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. While the SIOP is enabled, PB5 can not be used as a standard output since that pin is coupled to the last stage of the serial shift register. If CPOL is set, the first falling edge of SCK will shift the first data bit out to the output pin. If CPOL is clear, the first data bit will be on the SDO pin waiting for the transmission. 7.1.3 SDI The SDI pin becomes an input as soon as the SIOP is enabled. New data may be presented to the SDI pin on the falling edge of SCK. Valid data must be present at least tS before the rising edge of the clock and remain valid for tH after the edge. Freescale Semiconductor, Inc... SCK SDO SDI BIT 1 BIT 2 BIT 3 BIT 7 BIT 8 BIT 1 BIT 2 BIT 3 BIT 7 BIT 8 Figure 7-2: Serial I/O Port Timing (CPOL=1) SCK SDO SDI BIT 1 BIT 2 BIT 3 BIT 7 BIT 8 BIT 1 BIT 2 BIT 3 BIT 7 BIT 8 Figure 7-3: Serial I/O Port Timing (CPOL=0) 7.2 7.2.1 SIOP REGISTERS SIOP CONTROL REGISTER (SCR) This register is located at address $000A and contains 3 bits. $0A RESET: 0 0 SPE 0 0 0 MSTR 0 CPOL 1 0 0 0 0 0 0 Figure 7-4: SIOP Control Register Section 7: Simple Input/Output Port Page 40 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 7.2.1.1 SPE - SERIAL PERIPHERAL ENABLE When set, this bit enables the Serial I/O Port and initializes the Port B DDR such that PB5 (SDO) is output, PB6 (SDI) is input and PB7 (SCK) is input (slave mode only). The Port B DDR can be subsequently altered as the application requires and the Port B data register (except for PB5) can be manipulated as usual. However, these actions could affect the transmitted or received data. When SPE is cleared, Port B reverts to standard parallel I/O without affecting the Port B data register or DDR. SPE is readable and writable any time but clearing SPE while a transmission is in progress will abort the transmission, reset the bit counter, and return Port B to its normal I/O function. Reset clears this bit. 7.2.1.2 MSTR - MASTER MODE Freescale Semiconductor, Inc... When set, this bit configures the SIOP for master mode. This means that the transmission is initiated by a write to the data register and the SCK pin becomes an output providing a synchronous data clock at a fixed rate of E (bus clock) divided by 4. While the device is in master mode, the SDO and SDI pins do not change function. These pins behave exactly as they would in slave mode. Reset clears this bit and configures the SIOP for slave operation. MSTR may be set at any time regardless of the state of SPE. Clearing MSTR will abort any transmission in progress. 7.2.1.3 CPOL - CLOCK POLARITY The Clock Polarity bit controls the SCK polarity between transmissions. When this bit is cleared, SCK will be low between transmissions. When this bit is set, SCK will be high between transmissions. In both cases, the data is latched on the rising edge of SCK for serial input and is valid on the rising edge of SCK for serial output. Reset sets this bit. When using the Clock Polarity low mode (CPOL=0), the proper mode should be entered before enabling the serial system. The CPOL bit should be cleared first. Then the SPE bit should be set during a second write to the SCR. The following example shows a proper sequence. * For Master Mode CPOL=0 LDA#$00 STASCRclear CPOL LDA#$50 STASCRset Mstr, set SPE * For Slave Mode CPOL=0 LDA#$00 STASCRclear CPOL LDA#$40 Section 7: Simple Input/Output Port For More Information On This Product, Go to: www.freescale.com Page 41 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. STASCRset SPE 7.2.2 SIOP STATUS REGISTER (SSR) This register is located at address $000B and contains only 2 bits. $0B RESET: SPIF 0 DCOL 0 0 0 0 0 0 0 0 0 0 0 0 0 Figure 7-5: SIOP Status Register Freescale Semiconductor, Inc... 7.2.2.1 SPIF - SERIAL PERIPHERAL INTERFACE FLAG This bit is set upon occurrence of the last rising clock edge if CPOL is set and the last falling clock edge of CPOL is clear to indicates that a data transfer has taken place. It has no effect on any further transmissions and can be ignored without problem. SPIF is cleared by reading the SSR with SPIF set followed by a read or write of the serial data register. If SPIF is cleared before the last edge of the next byte, it will be set again. Reset clears this bit. 7.2.2.2 DCOL - DATA COLLISION This is a read-only status bit which indicates that an invalid access to the data register has been made. This can occur any time after the first falling edge of SCK if CPOL is set and after the first rising edge of SCK if CPOL is clear and before SPIF is set. A read or write of the data register during this time will result in invalid data being transmitted or received. DCOL is cleared by reading the status register with SPIF set followed by a read or write of the data register. If the last part of the clearing sequence is done after another transmission has been started, DCOL will be set again. Reset also clears this bit. 7.2.3 SIOP DATA REGISTER (SDR) This register is located at address $000C and is both the transmit and receive data register. This system is not double buffered and any write to this register will destroy the previous contents. The SDR can be read at any time, but if a transmission is in progress the results may be ambiguous. Writes to the SDR while a transmission is in progress can cause invalid data to be transmitted and/or received. This register can be read and written only when the SIOP is enabled (SPE=1). $0C RESET: U U U U U U U U Figure 7-6: SIOP Data Register Section 7: Simple Input/Output Port Page 42 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 8 8.1 COMPUTER OPERATING PROPERLY INTRODUCTION This device includes a "Watchdog" Computer Operating Properly (COP) feature as a mask option. The COP is implemented with an 18-bit ripple counter. This provides a timeout period of 64 milliseconds at a bus rate of 2 MHz. If the COP should timeout, a system reset will occur and the device will be re-initialized in the same fashion as a POR or external reset. Freescale Semiconductor, Inc... 8.2 RESETTING THE COP Preventing a COP reset is done by writing a "0" to the COPF bit. This action will reset the counter and begin the timeout period again. The COPF bit is bit 0 of address $1FF0. A read of address $1FF0 will result in the user defined ROM data at that location. 8.3 COP TEST FEATURES For speeding up the COP test, a feature was added in the Self-Check mode to split the 18-bit counter into 6-bit and 12-bit counters clocked in parallel where the output of the 6bit counter drives the COP logic. Splitting the counter is accomplished by writing a "1" to bit 7 of $1FF0. Writing a "0" to bit 7 of $1FF0 will reconnect the two halves of the COP counter. 8.4 COP DURING WAIT MODE The COP will continue to operate normally during WAIT mode. The software should pull the device out of WAIT mode periodically and reset the COP by writing to the COPF bit to prevent a COP reset. 8.5 COP DURING STOP MODE STOP mode disables the oscillator circuit and thereby turns the clock off for the entire device. The COP counter will be reset when STOP mode is entered. If a reset is used to exit STOP mode, the COP counter will be reset after the 4064 cycles of delay after STOP mode. If an IRQ is used to exit STOP mode, the COP counter will not be reset after the 4064-cycle delay and will have that many cycles already counted when control is returned to the program. Section 8: Computer Operating Properly For More Information On This Product, Go to: www.freescale.com Page 43 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. Freescale Semiconductor, Inc... Section 8: Computer Operating Properly Page 44 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 9 9.1 MAXIMUM RATINGS Rating Supply Voltage Input Voltage ELECTRICAL SPECIFICATIONS (Voltages referenced to VSS) Symbol VDD VIN VIN I TA Value -0.3 to +7.0 VSS - 0.3 to VDD + 0.3 VSS - 0.3 to 2 Current Drain Per Pin Excluding VDD and VSS Operating Temperature Range MC68HC05C5P (Standard) MC68HC05C5CP (Extended) Storage Temperature Range TSTG 25 TL to TH 0 to +70 -40 to +85 -65 to +150 Unit V V Freescale Semiconductor, Inc... Self-Check Mode (IRQ Pin Only) V × VDD + 0.3 mA °C °C This device contains circuitry to protect the inputs against damage due to high static voltages or electric fields; however, it is advised that normal precautions be taken to avoid application of any voltage higher than maximum-rated voltages to this high-impedance circuit. For proper operation, it is recommended that VIN and VOUT be constrained to the range VSS ≤ (VIN or VOUT) ≤ VDD. Reliability of operation is enhanced if unused inputs are connected to an appropriate logic voltage level (for example, either VSS or VDD). 9.2 THERMAL CHARACTERISTICS Characteristic Symbol Value Unit Thermal Resistance Plastic DIP Plastic Leaded Chip Carrier θJA θJA 60 70 °C/W °C/W Section 9: Electrical Specifications For More Information On This Product, Go to: www.freescale.com Page 45 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 9.3 DC ELECTRICAL CHARACTERISTICS Characteristic Output voltage ILoad = 10.0 µA ILoad = -10.0 µA Output High Voltage (ILoad = -0.8 mA) PA0-7, PB0-7,PC0-7,PD0-7 Output Low Voltage (ILoad = 1.6 mA) PA0-7, PB0-7,PD0-7 ( ILoad = 10 mA) PC0-7 VOL VIH — 0.7 × V — 0.4 V Symbol Min Typ Max Unit (VDD = 5.0 Vdc ±10%, VSS = 0 Vdc, TA = -40°C to +85°C, unless otherwise noted) VOL VOH VOH — VDD-0.1 VDD-0.8 — — 0.1 — V — — V Freescale Semiconductor, Inc... Input High Voltage PA0-7, PB0-7,PC0-7, PD0-7, IRQ,RESET,OSC1, TCAP Input Low Voltage PA0-7, PB0-7,PC0-7, PD0-7, IRQ,RESET,OSC1, TCAP Low Voltage Programming Inhibit Low Voltage Programming Recover Low Voltage Programming Inhibit/Recover Hysteresis Supply Current (see Notes) Run Wait Stop with LVPI Enabled 25°C -40°C to +85°C Stop with LVPI Disabled 25°C -40°C to +85°C I/O Ports Hi-Z Leakage Current PA0-7, PB0-7,PC0-7,PD0-7 Input Current RESET, IRQ, OSC1,TCAP, PE PE Capacitance Ports (as Input or Output) RESET, IRQ, TCAP,PE PE DD — VDD V VIL VLVPI VLVPR HLVPI IDD IDD IDD IDD IDD IDD IOZ IIN IIN COUT CIN CIN VSS 3.5 — 0.1 — — — — 0.2 × V — 4.5 1.0 DD V V V V — — — — — — 3.0 1.0 200 200 2 5 7.0 4.0 300 300 50 140 10 mA mA µA µA µA µA µA µA µA pF pF pF — — — — — — 1 1 — — — — — — 12 8 8 NOTES: 1. All values shown reflect average measurements. 2. Typical values at midpoint of voltage range, 25°C only unless otherwise noted. 3. Wait IDD: Only timer system active. 4. Run (Operating) IDD, Wait IDD: Measured using external square wave clock source (fosc = 4.2 MHz), all inputs 0.2V from rail; no dc loads, less than 50 pF on all outputs, CL = 20 pF on OSC2. 5. Wait, Stop IDD: All ports configured as inputs, VIL = 0.2 V, VIH = VDD-0.2 V. 6. Stop IDD measured with OSC1 = VSS. is affected linearly by the OSC2 capacitance. Section 9: Electrical Specifications Page 46 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 9.4 CONTROL TIMING Characteristic Symbol Min Max Unit (VDD = 5.0 Vdc ±10%, VSS = 0 Vdc, TA = -40°C to +85 °C, unless otherwise noted) Frequency of Operation Crystal Option External Clock Option Internal Operating Frequency Crystal (fosc ÷ 2) External Clock (fosc ÷ 2) Cycle Time fosc fosc fOP fOP tCYC tOXOV tILCH t RL — dc 4.2 4.2 MHz MHz — dc 480 — — 1.5 125 * 90 — — — — 2.1 2.1 — 100 100 — — — — 15.0 15.0 30.0 100.0 MHz MHz ns ms ms t CYC Freescale Semiconductor, Inc... Crystal Oscillator Start-up Time Stop Recovery Start-up Time (Crystal Oscillator) RESET Pulse Width Interrupt Pulse Width Low (Edge-Triggered) Interrupt Pulse Period OSC1 Pulse Width EEPROM Byte Programming Time EEPROM Byte Erase Time EEPROM Block Erase Time EEPROM Bulk Erase Time EEPROM Programming Voltage Fall Time Normal Operation After LVPI set VDD Slew Rate Rising Falling RC Oscillator Stabilization Time (EEPROM) tILIH tILIL tOH,tOL tEPGM tEBYT tEBLOCK tEBULK tFPV tFPVL tVDDR tVDDF tRCON ns tCYC ns ms ms ms ms — — 10.0 10.0 µs µs V/µs V/µs µs — — — 0.05 0.1 5.0 * The minimum period TILIL should not be less than the number of cycle times it takes to execute the interrupt service routine plus 21 tcyc. Section 9: Electrical Specifications For More Information On This Product, Go to: www.freescale.com Page 47 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. CONTROL TIMING OSC11 tRL RESET tILIH IRQ2 tILCH 4064 tcyc Freescale Semiconductor, Inc... IRQ3 Internal Clock Internal Address Bus 1FFE NOTES: 1. Represents the internal gating of the OSC1 pin 2. IRQ pin edge-sensitive mask option. 3. IRQ pin level and edge-sensitive mask option. 4. RESET vector address shown for timing example. 1FFE 1FFE 1FFE 1FFF4 RESET or Interrupt Vector Fetch Figure 9-1: Stop Recovery Timing Diagram tV VDD VLVPI DDF tVDDR VLVPR LVPI (INTERNAL) 20V VPP (INTERNAL) tFPVL CPEN CPEN CANNOT BE WRITTEN TO "1" CPEN CAN NOW BE WRITTEN TO "1" Figure 9-2: LVPI Timing Diagram Section 9: Electrical Specifications Page 48 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 1 2 SCK SDO 3 BIT 0 BIT 1 4 BIT 6 BIT 7 6 BIT 6 5 BIT 7 Freescale Semiconductor, Inc... SDI BIT 0 BIT 1 Figure 9-3: SIOP Timing Diagram NOTE: Clock Polarity (CPOL) = 1 and Data LSB first shown for example only. 9.5 Num. SIOP TIMING Characteristic Operating Frequency Master Slave Symbol Min Max Unit (VDD = 5.0 Vdc ±10%, VSS = 0 Vdc, TA = -40°C to +85°C, unless otherwise noted) fOP(M) fOP(S) tCYC(M) tCYC(S) tCYC tV tHO tS tH dc dc 0.25 0.25 fOP fOP tCYC tCYC ns ns ns ns ns 1 Cycle Time Master Slave Clock (SCK) Low Time SDO Data Valid Time SDO Hold Time SDI Setup Time SDI Hold Time 4.0 — 932 — 0 100 100 4.0 4.0 — 200 — — — 2 3 4 5 6 NOTES: 1. fOP = 2.1 MHz max. Section 9: Electrical Specifications For More Information On This Product, Go to: www.freescale.com Page 49 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. Freescale Semiconductor, Inc... Section 9: Electrical Specifications Page 50 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc.Specification Rev. 1.2 MC68HC05C5 SECTION 10 10.1 MECHANICAL SPECIFICATIONS 40-PIN DUAL INLINE PACKAGE RESET IRQ PE PA7 PA6 PA5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 VDD OSC1 OSC2 TCAP PD7 PD6/TCMP PD5 PD4 PD3 PD2 PD1 PD0 PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 Freescale Semiconductor, Inc... PA4 PA3 PA2 PA1 PA0 PB0 PB1 PB2 PB3 PB4 SDO/PB5 SDI/PB6 SCK/PB7 VSS Section 10: Mechanical Specifications For More Information On This Product, Go to: www.freescale.com Page 51 Freescale MC68HC05C5 Specification Rev. 1.2 Semiconductor, Inc. 10.2 44-PIN PLCC PACKAGE R E S OO I EVSS PNRTDCC ECQ* D12 P A 6 6 PA5 PA4 PA3 PA2 PA1 PA0 12 7 P A 7 T C AN PC 40 1 39 PD7 PD6/TCMP PD5 PD4 PD3 34 PD2 PD1 PD0 PC0 PC1 Freescale Semiconductor, Inc... PB0 PB1 PB2 PB3 PB4 17 18 N C P B 5 / S D O P B 6 / S D I 23 28 29 PC2 PVNPPPPP BSCCCCCC 7S 76543 / S C K Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters which may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals” must be validated for each customer application by customer’s technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. RoHS-compliant and/or Pb- free versions of Freescale products have the functionality and electrical characteristics of their non-RoHS-compliant and/or non-Pb- free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale.s Environmental Products program, go to http://www.freescale.com/epp. Section 10: Mechanical Specifications Page 52 For More Information On This Product, Go to: www.freescale.com
68HC05C5 价格&库存

很抱歉,暂时无法提供与“68HC05C5”相匹配的价格&库存,您可以联系我们找货

免费人工找货