MC9S12C64VFU Freescale Semiconductor, Inc, MC9S12C64VFU Datasheet

no-image

MC9S12C64VFU

Manufacturer Part Number
MC9S12C64VFU
Description
Manufacturer
Freescale Semiconductor, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
MC9S12C64VFU
Manufacturer:
FREESCALE
Quantity:
984
Part Number:
MC9S12C64VFU
Manufacturer:
FREESCALE
Quantity:
984
Part Number:
MC9S12C64VFUE
Manufacturer:
FREESCALE
Quantity:
2 000
Part Number:
MC9S12C64VFUE
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Part Number:
MC9S12C64VFUE
Manufacturer:
FREESCALE
Quantity:
2 000
MC9S12C Family
MC9S12GC Family
Reference Manual
HCS12
Microcontrollers
MC9S12C128
Rev 01.23
05/2007
freescale.com

Related parts for MC9S12C64VFU

MC9S12C64VFU Summary of contents

Page 1

MC9S12C Family MC9S12GC Family Reference Manual HCS12 Microcontrollers MC9S12C128 Rev 01.23 05/2007 freescale.com ...

Page 2

To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://freescale.com/ ...

Page 3

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128 Chapter 2 Port Integration Module (PIM9C32 Chapter 3 ...

Page 4

Appendix E Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690 4 MC9S12C-Family / ...

Page 5

MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 6

Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 7

Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 8

Instruction Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 9

Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 10

Freescale’s Scalable Controller Area Network (S12MSCANV2) 10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 11

Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 12

Serial Peripheral Interface (SPIV3) Block Description 14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 13

IOC0 — Input Capture and Output Compare Channel 0 Pin . . . . . . . . . . . . . . . . . . . . 439 15.3 Memory Map and Register Definition . . ...

Page 14

Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 15

Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 16

Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 17

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.1 Introduction The MC9S12C-Family / MC9S12GC-Family are 48/52/80 pin Flash-based MCU families, which deliver the power and flexibility of the 16-bit core to a whole new range of cost and space sensitive, ...

Page 18

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) • Memory options: — 16K or 32Kbyte Flash EEPROM (erasable in 512-byte sectors) 64K, 96K, or 128Kbyte Flash EEPROM (erasable in 1024-byte sectors) — 1K Byte RAM • Analog-to-digital ...

Page 19

Operating frequency: — 32MHz equivalent to 16MHz bus speed for single chip — 32MHz equivalent to 16MHz bus speed in expanded bus modes — Option of 9S12C Family: 50MHz equivalent to 25MHz bus speed — All 9S12GC Family members ...

Page 20

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.1.3 Block Diagram V SSR V DDR V DDX V Voltage Regulator SSX 16K, 32K, 64K, 96K, 128K Byte Flash V DD2 V SS2 V DD1 1K, 2K, 4K Byte RAM V ...

Page 21

Memory Map and Registers 1.2.1 Device Memory Map Table 1-1 shows the device register map after reset. memory map. Address 0x0000–0x0017 0x0018 0x0019 0x001A–0x001B 0x001C–0x001F 0x0020–0x002F 0x0030–0x0033 0x0034–0x003F 0x0040–0x006F 0x0070–0x007F 0x0080–0x009F 0x00A0–0x00C7 Reserved 0x00C8–0x00CF Serial communications interface (SCI) 0x00D0–0x00D7 ...

Page 22

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0000 0x0400 0x3000 0x4000 0x8000 EXT 0xC000 0xFF00 VECTORS VECTORS 0xFFFF NORMAL EXPANDED SINGLE CHIP The figure shows a useful map, which is not the map out of reset. After reset the ...

Page 23

EXT 0xC000 0xFF00 VECTORS VECTORS 0xFFFF NORMAL EXPANDED SINGLE CHIP The figure shows a useful map, which is not the map out of reset. After reset the map is: 0x0000–0x03FF: Register Space 0x0000–0x0FFF: 4K RAM ...

Page 24

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0000 0x0400 0x3000 0x4000 0x8000 EXT 0xC000 0xFF00 VECTORS VECTORS 0xFFFF NORMAL EXPANDED SINGLE CHIP The figure shows a useful map, which is not the map out of reset. After reset the ...

Page 25

EXT 0xC000 0xFF00 VECTORS VECTORS 0xFFFF NORMAL EXPANDED SINGLE CHIP The figure shows a useful map, which is not the map out of reset. After reset the map is: 0x0000–0x03FF: Register space 0x0800–0x0FFF: 2K RAM ...

Page 26

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0000 0x0400 0x3C00 0x4000 0x8000 EXT 0xC000 0xFF00 VECTORS VECTORS 0xFFFF NORMAL EXPANDED SINGLE CHIP The figure shows a useful map, which is not the map out of reset. After reset the ...

Page 27

Detailed Register Map The detailed register map of the MC9S12C128 is listed in address order below. 0x0000–0x000F MEBI Map (HCS12 Multiplexed External Bus Interface) Address Name Read: 0x0000 PORTA Write: Read: 0x0001 PORTB Write: Read: 0x0002 ...

Page 28

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0010–0x0014 MMC Map (HCS12 Module Mapping Control) Address Name Read: 0x0010 INITRM Write: Read: 0x0011 INITRG Write: Read: 0x0012 INITEE Write: Read: 0x0013 MISC Write: Read: 0x0014 Reserved Write: ...

Page 29

Miscellaneous Peripherals (Device User Guide) Address Name Read: 0x001A PARTIDH Write: Read: 0x001B PARTIDL Write: 0x001C–0x001D MMC Map (HCS12 Module Mapping Control, Device User Guide) Address Name Read: reg_sw0 0x001C MEMSIZ0 Write: Read: rom_sw1 0x001D MEMSIZ1 ...

Page 30

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0020–0x002F DBG (Including BKP) Map (HCS12 Debug) (continued) Address Name Read: 0x0026 DBGCCH Write: Read: 0x0027 DBGCCL Write: DBGC2 Read: 0x0028 BKABEN BKPCT0 Write: DBGC3 Read: 0x0029 BKAMBH BKAMBL ...

Page 31

CRG (Clock and Reset Generator) Address Name Read: 0x0034 SYNR Write: Read: 0x0035 REFDV Write: Read: CTFLG 0x0036 TEST ONLY Write: Read: 0x0037 CRGFLG Write: Read: 0x0038 CRGINT Write: Read: 0x0039 CLKSEL PLLSEL Write: Read: 0x003A PLLCTL Write: Read: ...

Page 32

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0040–0x006F TIM (Sheet Address Name Read: 0x0047 TTOV Write: Read: 0x0048 TCTL1 Write: Read: 0x0049 TCTL2 Write: Read: 0x004A TCTL3 EDG7B Write: Read: 0x004B TCTL4 EDG3B Write: Read: 0x004C ...

Page 33

TIM (Sheet Address Name Read: 0x005E TC7 (hi) Write: Read: 0x005F TC7 (lo) Write: Read: 0x0060 PACTL Write: Read: 0x0061 PAFLG Write: Read: 0x0062 PACNT (hi) Write: Read: 0x0063 PACNT (lo) Write: Read: 0x0064 Reserved Write: ...

Page 34

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0080–0x009F ATD (Analog-to-Digital Converter 10 Bit 8 Channel) Address Name Read: 0x0080 ATDCTL0 Write: Read: 0x0081 ATDCTL1 Write: Read: 0x0082 ATDCTL2 Write: Read: 0x0083 ATDCTL3 Write: Read: 0x0084 ATDCTL4 Write: Read: 0x0085 ...

Page 35

ATD (Analog-to-Digital Converter 10 Bit 8 Channel) (continued) Address Name Read: 0x0096 ATDDR3H Write: Read: 0x0097 ATDDR3L Write: Read: 0x0098 ATDDR4H Write: Read: 0x0099 ATDDR4L Write: Read: 0x009A ATDDR5H Write: Read: 0x009B ATDDR5L Write: Read: 0x009C ATDDR6H Write: Read: ...

Page 36

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x00C8–0x00CF SCI (Asynchronous Serial Interface) (continued) Address Name Read: 0x00CD SCISR2 Write: Read: 0x00CE SCIDRH Write: Read: 0x00CF SCIDRL Write: 0x00D0–0x00D7 Reserved Address Name Read: 0x00D0– Reserved 0x00D7 Write: 0x00D8–0x00DF SPI (Serial ...

Page 37

PWM (Pulse Width Modulator) Address Name Read: $00E0 PWME Write: Read: $00E1 PWMPOL Write: Read: $00E2 PWMCLK Write: Read: $00E3 PWMPRCLK Write: Read: $00E4 PWMCAE Write: Read: $00E5 PWMCTL Write: Read: PWMTST $00E6 Test Only Write: Read: $00E7 PWMPRSC ...

Page 38

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x00E0–0x00FF PWM (Pulse Width Modulator) (continued) Address Name Read: $00F6 PWMPER4 Write: Read: $00F7 PWMPER5 Write: Read: $00F8 PWMDTY0 Write: Read: $00F9 PWMDTY1 Write: Read: $00FA PWMDTY2 Write: Read: $00FB PWMDTY3 Write: ...

Page 39

Flash Control Register (continued) Address Name Read: Reserved for 0x010A Factory Test Write: Read: Reserved for 0x010B Factory Test Write: Read: 0x010C Reserved Write: Read: 0x010D Reserved Write: Read: 0x010E Reserved Write: Read: 0x010F Reserved Write: 0x0110–0x013F Reserved Address ...

Page 40

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0140–0x017F CAN (Scalable Controller Area Network — MSCAN) Address Name Read: 0x014A CANTBSEL Write: Read: 0x014B CANIDAC Write: Read: 0x014C Reserved Write: Read: 0x014D Reserved Write: Read: RXERR7 RXERR6 RXERR5 RXERR4 RXERR3 ...

Page 41

Table 1-2. Detailed MSCAN Foreground Receive and Transmit Buffer Layout (continued) Address Name Read: 0xXXXD Reserved Write: Read: 0xXXXE CANxRTSRH Write: Read: 0xXXXF CANxRTSRL Write: Extended ID Read: CANxTIDR0 Write: 0xxx10 Read: Standard ID Write: Extended ID Read: CANxTIDR1 Write: ...

Page 42

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0240–0x027F PIM (Port Interface Module) (Sheet Address Name Read: 0x0240 PTT Write: Read: 0x0241 PTIT Write: Read: 0x0242 DDRT Write: Read: 0x0243 RDRT Write: Read: 0x0244 PERT Write: Read: ...

Page 43

PIM (Port Interface Module) (Sheet Address Name Read: 0x0256 WOMM Write: Read: 0x0257 Reserved Write: Read: 0x0258 PTP Write: Read: 0x0259 PTIP Write: Read: 0x025A DDRP DDRP7 Write: Read: 0x025B RDRP RDRP7 Write: Read: 0x025C PERP ...

Page 44

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 0x0240–0x027F PIM (Port Interface Module) (Sheet Address Name Read: 0x026D PPSJ Write: Read: 0x026E PIEJ Write: Read: 0x026F PIFJ Write: Read: 0x0270 PTAD Write: Read: PTIAD7 0x0271 PTIAD Write: ...

Page 45

Part ID Assignments The part ID is located in two 8-bit registers PARTIDH and PARTIDL (addresses 0x001A and ox001B after reset). The read-only value is a unique part ID for each revision of the chip. part ID numbers for ...

Page 46

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.3 Signal Description 1.3.1 Device Pinouts PW3/KWP3/PP3 PW2/KWP2/PP2 PW1/KWP1/PP1 PW0/KWP0/PP0 PW0/IOC0/PT0 PW1/IOC1/PT1 PW2/IOC2/PT2 PW3/IOC3/PT3 V DD1 V SS1 PW4/IOC4/PT4 IOC5/PT5 IOC6/PT6 IOC7/PT7 MODC/TAGHI/BKGD ADDR0/DATA0/PB0 ADDR1/DATA1/PB1 ADDR2/DATA2/PB2 ADDR3/DATA3/PB3 ADDR4/DATA4/PB4 Signals shown in Bold ...

Page 47

PW3/KWP3/PP3 1 PW0/IOC0/PT0 2 PW1/IOC1/PT1 3 PW2/IOC2/PT2 4 PW3/IOC3/PT3 DD1 V 7 SS1 IOC4/PT4 8 IOC5/PT5 9 10 IOC6/PT6 11 IOC7/PT7 12 MODC/BKGD 13 PB4 * Signals shown in Bold italic are not available on the 48-pin ...

Page 48

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) PW0/IOC0/PT0 1 PW1/IOC1/PT1 2 PW2/IOC2/PT2 3 PW3/IOC3/PT3 DD1 V 6 SS1 IOC4/PT4 7 8 IOC5/PT5 9 IOC6/PT6 10 IOC7/PT7 11 MODC/BKGD 12 PB4 Figure 1-9. Pin Assignments in 48-Pin ...

Page 49

Signal Properties Summary Pin Name Pin Name Pin Name Function 1 Function 2 Function 3 EXTAL — — XTAL — — RESET — — XFC — — TEST V — PP BKGD MODC TAGHI PE7 NOACC XCLKS PE6 IPIPE1 ...

Page 50

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) Pin Name Pin Name Pin Name Function 1 Function 2 Function 3 PP[2:0] KWP[2:0] PW[2:0] PJ[7:6] KWJ[7:6] — PM5 SCK — PM4 MOSI — PM3 SS — PM2 MISO — PM1 TXCAN ...

Page 51

Detailed Signal Descriptions 1.3.4.1 EXTAL, XTAL — Oscillator Pins EXTAL and XTAL are the crystal driver and external clock pins. On reset all the device clocks are derived from the EXTAL input frequency. XTAL is the crystal output. 1.3.4.2 ...

Page 52

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.3.4.6 PA[7:0] / ADDR[15:8] / DATA[15:8] — Port A I/O Pins PA7–PA0 are general purpose input or output pins,. In MCU expanded modes of operation, these pins are used for the multiplexed ...

Page 53

Figure 1-13. External Clock Connections (PE7 = 0) 1.3.4.9 PE6 / MODB / IPIPE1 — Port E I/O Pin 6 PE6 is a general purpose input or output pin used as a MCU operating mode select pin during ...

Page 54

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.3.4.13 PE2 / R/W — Port E I/O Pin [2] / Read/Write In all modes this pin can be used as a general-purpose I/O and is an input with an active pull-up ...

Page 55

Flash EEPROM memory in the memory map (ROMCTL). At the rising edge of RESET, the state of this pin is latched to the ROMON bit. • PP6 = 1 in emulation modes equates to ROMON = 0 (ROM space ...

Page 56

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.3.4.27 PS[3:2] — Port S I/O Pins [3:2] PS3 and PS2 are general purpose input or output pins. These pins are not available in the 48- / 52-pin package versions. 1.3.4.28 PS1 ...

Page 57

— Power Supply Pins for ATD and VREG DDA SSA are the power supply and ground input pins for the voltage regulator reference and the analog DDA SSA to digital converter. 1.3.5.5 V ...

Page 58

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.4 System Clock Description The clock and reset generator provides the internal clock signals for the core and all peripheral modules. Figure 1-14 shows the clock connections from the CRG to all ...

Page 59

BKGD = PE6 = PE5 = PP6 = MODC MODB MODA ROMCTL For further explanation on ...

Page 60

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) The security byte resides in a portion of the Flash array. Check the Flash Block User Guide for more details on the security configuration. 1.5.2.2 Operation of the Secured Microcontroller 1.5.2.2.1 Normal ...

Page 61

Wait This mode is entered by executing the CPU WAI instruction. In this mode the CPU will not execute instructions. The internal CPU signals (address and data bus) will be fully static. All peripherals stay active. For further power ...

Page 62

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) Table 1-9. Interrupt Vector Locations (continued) Vector Address Interrupt Source 0xFFDE, 0xFFDF Standard timer overflow 0xFFDC, 0xFFDD Pulse accumulator A overflow 0xFFDA, 0xFFDB Pulse accumulator input edge 0xFFD8, 0xFFD9 0xFFD6, 0xFFD7 0xFFD4, ...

Page 63

Resets Resets are a subset of the interrupts featured in system reset are summarized in changed to known start-up states. Refer to the respective module Block User Guides for register reset states. 1.6.2.1 Reset Summary Table Reset Power-on Reset ...

Page 64

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) Table 1-11. Device Specific Flash PAGE Mapping Device PAGE MC9S12GC16 3F MC9S12C32 3E $00,$02,$04,$06,$08,$0A,$0C,$0E,$10,$12......$2C,$2E,$30,$32,$34,$36,$38,$3A,$3C,$3E MC9S12GC32 3F $01,$03,$05,$07,$09,$0B,$0D,$0F,$11,$13.....$2D,$2F,$31,$33,$35,$37,$39,$3B,$3D,$3F 3C MC9S12C64 3D MC9S12GC64 MC9S12C96 3C MC9S12GC96 ...

Page 65

VREGEN The VREGEN input mentioned in the VREG section is device internal, connected internally to V 1.7 DD1 DD2 SS1 In the 80-pin QFP package versions, both internal V sides of the device as ...

Page 66

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) 1.8 Recommended Printed Circuit Board Layout The PCB must be carefully laid out to ensure proper operation of the voltage regulator as well as of the MCU itself. The following rules must ...

Page 67

Figure 1-15. Recommended PCB Layout (48 LQFP) Colpitts Oscillator Freescale Semiconductor Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) MC9S12C-Family / MC9S12GC-Family Rev 01.23 67 ...

Page 68

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) Figure 1-16. Recommended PCB Layout (52 LQFP) Colpitts Oscillator 68 MC9S12C-Family / MC9S12GC-Family Rev 01.23 Freescale Semiconductor ...

Page 69

Figure 1-17. Recommended PCB Layout (80 QFP) Colpitts Oscillator Freescale Semiconductor Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) MC9S12C-Family / MC9S12GC-Family Rev 01.23 69 ...

Page 70

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) Figure 1-18. Recommended PCB Layout for 48 LQFP Pierce Oscillator 70 MC9S12C-Family / MC9S12GC-Family Rev 01.23 Freescale Semiconductor ...

Page 71

Figure 1-19. Recommended PCB Layout for 52 LQFP Pierce Oscillator Freescale Semiconductor Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) MC9S12C-Family / MC9S12GC-Family Rev 01.23 71 ...

Page 72

Chapter 1 MC9S12C and MC9S12GC Device Overview (MC9S12C128) Figure 1-20. Recommended PCB Layout for 80QFP Pierce Oscillator 72 MC9S12C-Family / MC9S12GC-Family Rev 01.23 Freescale Semiconductor ...

Page 73

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.1 Introduction The Port Integration Module establishes the interface between the peripheral modules and the I/O pins for all ports. This chapter covers: • Port A, B, and E related to the ...

Page 74

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.1.2 Block Diagram Figure 2 block diagram of the PIM. PJ6 PJ7 PAD0 AN0 PAD1 AN1 AN2 PAD2 AN3 PAD3 AN4 PAD4 PAD5 AN5 PAD6 AN6 AN7 PAD7 PB0 ADDR0/DATA0 ...

Page 75

PWM channels to Port 80QFP option, the associated PWM channels are then mapped to both Port P and Port T. Freescale Semiconductor Chapter 2 Port Integration Module (PIM9C32) Block Description MC9S12C-Family / MC9S12GC-Family Rev 01.23 ...

Page 76

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.2 Signal Description This section lists and describes the signals that do connect off-chip. Table 2-1 shows all pins and their functions that are controlled by the PIM module. If there is ...

Page 77

Table 2-1. Pin Functions and Priorities (continued) Port Pin Name Pin Function NOACC/ PE7 XCLKS/ GPIO IPIPE1/ PE6 MODB/ GPIO IPIPE0/ PE5 MODA/ GPIO Port E PE4 ECLK/GPIO LSTRB/ PE3 TAGLO/ GPIO R/W/ PE2 GPIO PE1 IRQ/GPI PE0 XIRQ/GPI 2.3 ...

Page 78

Chapter 2 Port Integration Module (PIM9C32) Block Description Address Name Bit 7 R 0x0006 Reserved W R 0x0007 MODRR W R 0x0008 PTS W SCI — R 0x0009 PTIS W R 0x000A DDRS W R 0x000B RDRS W R 0x000C ...

Page 79

Address Name Bit 7 R 0x001A DDRP DDRP7 W R 0x001B RDRP RDRP7 W R 0x001C PERP PERP7 W R 0x001D PPSP PPSP7 W R 0x001E PIEP PIEP7 W R 0x001F PIFP PIFP7 W R 0x0020– Reserved 0x0027 W R ...

Page 80

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2 Register Descriptions Table 2-2 summarizes the effect on the various configuration bits — data direction (DDR), input/output level (I/O), reduced drive (RDR), pull enable (PE), pull select (PS), and interrupt enable ...

Page 81

Port T Registers 2.3.2.1.1 Port T I/O Register (PTT) Module Base + 0x0000 PTT7 PTT6 W TIM IOC7 IOC6 PWM Reset Unimplemented or Reserved Read: Anytime. Write: Anytime. If the data direction bits ...

Page 82

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.1.2 Port T Input Register (PTIT) Module Base + 0x0001 PTIT7 PTIT6 W Reset — — = Unimplemented or Reserved Read: Anytime. Write: Never, writes to this register have ...

Page 83

Port T Reduced Drive Register (RDRT) Module Base + 0x0003 RDRT7 RDRT6 W Reset 0 0 Figure 2-6. Port T Reduced Drive Register (RDRT) Read: Anytime. Write: Anytime. Field 7–0 Reduced Drive Port T — This ...

Page 84

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.1.6 Port T Polarity Select Register (PTTST) Module Base + 0x0005 PPST7 PPST6 W Reset 0 0 Figure 2-8. Port T Polarity Select Register (PPST) Read: Anytime. Write: Anytime. ...

Page 85

Port S Registers 2.3.2.2.1 Port S I/O Register (PTS) Module Base + 0x0008 SCI — — Reset Unimplemented or Reserved Read: Anytime. Write: Anytime. If the data direction bits of ...

Page 86

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.2.3 Port S Data Direction Register (DDRS) Module Base + 0x000A Reset Unimplemented or Reserved Figure 2-12. Port S Data Direction Register (DDRS) ...

Page 87

Port S Reduced Drive Register (RDRS) Module Base + 0x000B Reset Unimplemented or Reserved Figure 2-13. Port S Reduced Drive Register (RDRS) Read: Anytime. Write: Anytime. Field 3–0 Reduced Drive ...

Page 88

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.2.6 Port S Polarity Select Register (PPSS) Module Base + 0x000D Reset Unimplemented or Reserved Figure 2-15. Port S Polarity Select Register (PPSS) ...

Page 89

Port M Registers 2.3.2.3.1 Port M I/O Register (PTM) Module Base + 0x0010 MSCAN/ — — SPI Reset Unimplemented or Reserved Read: Anytime. Write: Anytime. If the data direction bits ...

Page 90

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.3.3 Port M Data Direction Register (DDRM) Module Base + 0x0012 Reset — — = Unimplemented or Reserved Figure 2-19. Port M Data Direction Register (DDRM) ...

Page 91

Port M Reduced Drive Register (RDRM) Module Base + 0x0013 Reset Unimplemented or Reserved Figure 2-20. Port M Reduced Drive Register (RDRM) Read: Anytime. Write: Anytime. Field 5–0 Reduced Drive ...

Page 92

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.3.6 Port M Polarity Select Register (PPSM) Module Base + 0x0015 Reset Unimplemented or Reserved Figure 2-22. Port M Polarity Select Register (PPSM) ...

Page 93

Port P Registers 2.3.2.4.1 Port P I/O Register (PTP) Module Base + 0x0018 PTP7 PTP6 W PWM — — Reset 0 0 Read: Anytime. Write: Anytime. If the data direction bits of the associated I/O pins ...

Page 94

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.4.3 Port P Data Direction Register (DDRP) Module Base + 0x001A DDRP7 DDRP6 W Reset 0 0 Figure 2-26. Port P Data Direction Register (DDRP) Read: Anytime. Write: Anytime. ...

Page 95

Port P Pull Device Enable Register (PERP) Module Base + 0x001C PERP7 PERP6 W Reset 0 0 Figure 2-28. Port P Pull Device Enable Register (PERP) Read: Anytime. Write: Anytime. Field 7–0 Pull Device Enable Port ...

Page 96

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.4.7 Port P Interrupt Enable Register (PIEP) Module Base + 0x001E PIEP7 PIEP6 W Reset 0 0 Figure 2-30. Port P Interrupt Enable Register (PIEP) Read: Anytime. Write: Anytime. ...

Page 97

Port J Registers 2.3.2.5.1 Port J I/O Register (PTJ) Module Base + 0x0028 PTJ7 PTJ6 W Reset Unimplemented or Reserved Read: Anytime. Write: Anytime. If the data direction bits of the associated I/O ...

Page 98

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.5.3 Port J Data Direction Register (DDRJ) Module Base + 0x002A DDRJ7 DDRJ6 W Reset Unimplemented or Reserved Figure 2-34. Port J Data Direction Register (DDRJ) ...

Page 99

Port J Pull Device Enable Register (PERJ) Module Base + 0x002C PERJ7 PERJ6 W Reset Unimplemented or Reserved Figure 2-36. Port J Pull Device Enable Register (PERJ) Read: Anytime. Write: Anytime. Field 7–6 ...

Page 100

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.5.7 Port J Interrupt Enable Register (PIEJ) Module Base + 0x002E PIEJ7 PIEJ6 W Reset Unimplemented or Reserved Figure 2-38. Port J Interrupt Enable Register (PIEJ) ...

Page 101

Port AD Registers 2.3.2.6.1 Port AD I/O Register (PTAD) Module Base + 0x0030 PTAD7 PTAD6 W Reset 0 0 Read: Anytime. Write: Anytime. If the data direction bits of the associated I/O pins are set to ...

Page 102

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.3.2.6.3 Port AD Data Direction Register (DDRAD) Module Base + 0x0032 DDRAD7 DDRAD6 W Reset 0 0 Figure 2-42. Port AD Data Direction Register (DDRAD) Read: Anytime. Write: Anytime. ...

Page 103

Port AD Pull Device Enable Register (PERAD) Module Base + 0x0034 PERAD7 PERAD6 W Reset 0 0 Figure 2-44. Port AD Pull Device Enable Register (PERAD) Read: Anytime. Write: Anytime. Field 7–0 Pull Device Enable Port ...

Page 104

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.4 Functional Description Each pin can act as general purpose I/O. In addition the pin can act as an output from a peripheral module or an input to a peripheral module. A ...

Page 105

Reduced Drive Register If the port is used as an output the register allows the configuration of the drive strength. 2.4.1.5 Pull Device Enable Register This register turns on a pull-up or pull-down device. It becomes only active if ...

Page 106

Chapter 2 Port Integration Module (PIM9C32) Block Description 2.4.2.5 Port P The PWM module is connected to port P. Port P pins can be used as PWM outputs. Further the Keypad Wake-Up function is implemented on pins PP[7:0]. During reset, ...

Page 107

A valid edge on input is detected if 4 consecutive samples of a passive level are followed by 4 consecutive samples of an active level directly or indirectly. The filters are continuously clocked by the bus clock in RUN and ...

Page 108

Chapter 2 Port Integration Module (PIM9C32) Block Description Port Data Direction T Input S Input M Input P Input J Input BKGD pin 2.6 Interrupts Port P and J generate a separate edge sensitive interrupt if enabled. ...

Page 109

Chapter 3 Module Mapping Control (MMCV4) Block Description 3.1 Introduction This section describes the functionality of the module mapping control (MMC) sub-block of the S12 core platform. The block diagram of the MMC is shown in SECURE BDM_UNSECURE STOP, WAIT ...

Page 110

Chapter 3 Module Mapping Control (MMCV4) Block Description 3.1.1 Features • Registers for mapping of address space for on-chip RAM, EEPROM, and FLASH (or ROM) memory blocks and associated registers • Memory mapping control and selection based upon address decode ...

Page 111

Address Offset 0x0017 Reserved . . 0x001C Memory Size Register 0 (MEMSIZ0) 0x001D Memory Size Register 1 (MEMSIZ1 0x0030 Program Page Index Register (PPAGE) 0x0031 Reserved Freescale Semiconductor Chapter 3 Module Mapping Control (MMCV4) Block Description Table 3-1. ...

Page 112

Chapter 3 Module Mapping Control (MMCV4) Block Description 3.3.2 Register Descriptions Name Bit 7 0x0010 R RAM15 INITRM W 0x0011 R 0 INITRG W 0x0012 R EE15 INITEE W 0x0013 R 0 MISC W 0x0014 R Bit 7 MTSTO W ...

Page 113

Initialization of Internal RAM Position Register (INITRM) Module Base + 0x0010 Starting address location affected by INITRG register setting RAM15 RAM14 W Reset Unimplemented or Reserved Figure 3-3. Initialization of Internal RAM Position ...

Page 114

Chapter 3 Module Mapping Control (MMCV4) Block Description 3.3.2.2 Initialization of Internal Registers Position Register (INITRG) Module Base + 0x0011 Starting address location affected by INITRG register setting REG14 W Reset Unimplemented or ...

Page 115

Initialization of Internal EEPROM Position Register (INITEE) Module Base + 0x0012 Starting address location affected by INITRG register setting EE15 EE14 W 1 Reset — — 1. The reset state of this register is controlled at ...

Page 116

Chapter 3 Module Mapping Control (MMCV4) Block Description 3.3.2.4 Miscellaneous System Control Register (MISC) Module Base + 0x0013 Starting address location affected by INITRG register setting Reset: Expanded 0 or Emulation Reset: Peripheral 0 or Single ...

Page 117

Stretch Bit EXSTR1 3.3.2.5 Reserved Test Register 0 (MTST0) Module Base + 0x0014 Starting address location affected by INITRG register setting Reset Unimplemented or Reserved Figure 3-7. ...

Page 118

Chapter 3 Module Mapping Control (MMCV4) Block Description 3.3.2.7 Memory Size Register 0 (MEMSIZ0) Module Base + 0x001C Starting address location affected by INITRG register setting REG_SW0 0 W Reset — — = Unimplemented or Reserved Figure ...

Page 119

Table 3-9. Allocated RAM Memory Space (continued) Allocated ram_sw2:ram_sw0 RAM Space 011 8K bytes 100 10K bytes 101 12K bytes 110 14K bytes 111 16K bytes 1. The RAM Reset BASE Address is based on the reset value of the ...

Page 120

Chapter 3 Module Mapping Control (MMCV4) Block Description Field 7:6 Allocated System FLASH or ROM Physical Memory Space — The allocated system FLASH or ROM ROM_SW[1:0] physical memory space is as given in 1:0 Allocated Off-Chip FLASH or ROM Memory ...

Page 121

Program Page Index Register (PPAGE) Module Base + 0x0030 Starting address location affected by INITRG register setting Reset — — 1. The reset state of this register is controlled at chip integration. ...

Page 122

Chapter 3 Module Mapping Control (MMCV4) Block Description Table 3-14. Program Page Index Register Bits PIX5 PIX4 ...

Page 123

The MMC will make only one select signal active at any given time. This activation is based upon the priority outlined in Table ...

Page 124

Chapter 3 Module Mapping Control (MMCV4) Block Description unimplemented locations within the register space or to locations that are removed from the map (i.e., ports A and B in expanded modes) will not cause this signal to become active. When ...

Page 125

The PPAGE register holds the page select value for the program page window. The value of the PPAGE register can be manipulated by normal read and write (some devices don’t allow writes in some modes) instructions as well as the ...

Page 126

Chapter 3 Module Mapping Control (MMCV4) Block Description During the execution of an RTC instruction, the CPU: • Pulls the old PPAGE value from the stack • Pulls the 16-bit return address from the stack and loads it into the ...

Page 127

Table 3-20. 48K Byte Physical FLASH/ROM Allocated Address Space 0x0000–0x3FFF 0x4000–0x7FFF 0x8000–0xBFFF 0xC000–0xFFFF Table 3-21. 64K Byte Physical FLASH/ROM Allocated Address Space 0x0000–0x3FFF 0x4000–0x7FFF 0x8000–0xBFFF 0xC000–0xFFFF Freescale Semiconductor Chapter 3 Module Mapping Control (MMCV4) Block Description Page Window Access ROMHM ...

Page 128

Chapter 3 Module Mapping Control (MMCV4) Block Description A graphical example of a memory paging for a system configured as 1M byte on-chip FLASH/ROM with 64K allocated physical space is given in 0x0000 61 16K FLASH (UNPAGED) 0x4000 62 16K ...

Page 129

Chapter 4 Multiplexed External Bus Interface (MEBIV3) 4.1 Introduction This section describes the functionality of the multiplexed external bus interface (MEBI) sub-block of the S12 core platform. The functionality of the module is closely coupled with the S12 CPU and ...

Page 130

Chapter 4 Multiplexed External Bus Interface (MEBIV3) REGS Addr[19:0] Data[15:0] (Control) CPU pipe info IRQ interrupt XIRQ interrupt BDM tag info Control signal(s) Data signal (unidirectional) Data signal (bidirectional) Data bus (unidirectional) Data bus (bidirectional) 130 ADDR ADDR EXT BUS ...

Page 131

Modes of Operation • Normal expanded wide mode Ports A and B are configured as a 16-bit multiplexed address and data bus and port E provides bus control and status signals. This mode allows 16-bit external memory and peripheral ...

Page 132

Chapter 4 Multiplexed External Bus Interface (MEBIV3) . Table 4-1. External System Pins Associated With MEBI Pin Name Pin Functions BKGD/MODC/ MODC TAGHI BKGD TAGHI PA7/A15/D15/D7 PA7–PA0 thru A15–A8 PA0/A8/D8/D0 D15–D8 D15/D7 thru D8/D0 PB7/A7/D7 PB7–PB0 thru A7–A0 PB0/A0/D0 D7–D0 ...

Page 133

Table 4-1. External System Pins Associated With MEBI (continued) Pin Name Pin Functions PE4/ECLK PE4 ECLK PE3/LSTRB/ TAGLO PE3 LSTRB SZ8 TAGLO PE2/R/W PE2 R/W PE1/IRQ PE1 IRQ PE0/XIRQ PE0 XIRQ PK7/ECS PK7 ECS PK6/XCS PK6 XCS PK5/X19 PK5–PK0 thru ...

Page 134

Chapter 4 Multiplexed External Bus Interface (MEBIV3) 4.3.1 Module Memory Map Address Offset 0x0000 Port A Data Register (PORTA) 0x0001 Port B Data Register (PORTB) 0x0002 Data Direction Register A (DDRA) 0x0003 Data Direction Register B (DDRB) 0x0004 Reserved 0x0005 ...

Page 135

Read: Anytime when register is in the map Write: Anytime when register is in the map Port A bits 7 through 0 are associated with address lines A15 through A8 respectively and data lines D15/D7 through D8/D0 respectively. When this ...

Page 136

Chapter 4 Multiplexed External Bus Interface (MEBIV3) 4.3.2.3 Data Direction Register A (DDRA) Module Base + 0x0002 Starting address location affected by INITRG register setting Bit Reset 0 0 Figure 4-4. Data Direction Register ...

Page 137

Data Direction Register B (DDRB) Module Base + 0x0003 Starting address location affected by INITRG register setting Bit Reset 0 0 Figure 4-5. Data Direction Register B (DDRB) Read: Anytime when register is ...

Page 138

Chapter 4 Multiplexed External Bus Interface (MEBIV3) 4.3.2.5 Reserved Registers Module Base + 0x0004 Starting address location affected by INITRG register setting Reset Unimplemented or Reserved Module Base + 0x0005 Starting ...

Page 139

These register locations are not used (reserved). All unused registers and bits in this block return logic 0s when read. Writes to these registers have no effect. These registers are not in the on-chip map in special peripheral mode. 4.3.2.6 ...

Page 140

Chapter 4 Multiplexed External Bus Interface (MEBIV3) To ensure that you read the value present on the PORTE pins, always wait at least one cycle after writing to the DDRE register before reading from the PORTE register. 4.3.2.7 Data Direction ...

Page 141

Port E Assignment Register (PEAR) Module Base + 0x000A Starting address location affected by INITRG register setting NOACCE W Reset Special Single Chip 0 Special Test 0 Peripheral 0 Emulation Expanded 1 Narrow Emulation Expanded 1 Wide ...

Page 142

Chapter 4 Multiplexed External Bus Interface (MEBIV3) Field 7 CPU No Access Output Enable NOACCE Normal: write once Emulation: write never Special: write anytime 1 The associated pin (port E, bit 7) is general-purpose I/O. 0 The associated pin (port ...

Page 143

Mode Register (MODE) Module Base + 0x000B Starting address location affected by INITRG register setting MODC W Reset Special Single Chip 0 Emulation Expanded 0 Narrow Special Test 0 Emulation Expanded 0 Wide Normal Single Chip 1 ...

Page 144

Chapter 4 Multiplexed External Bus Interface (MEBIV3) Field 7:5 Mode Select Bits — These bits indicate the current operating mode. MOD[C:A] If MODA = 1, then MODC, MODB, and MODA are write never. If MODC = MODA = 0, then ...

Page 145

Table 4-8. MODC, MODB, and MODA Write Capability MODC MODB MODA writes to the ...

Page 146

Chapter 4 Multiplexed External Bus Interface (MEBIV3) This register is not in the on-chip memory map in expanded and special peripheral modes. Therefore, these accesses will be echoed externally. These bits have no effect when the associated pin(s) are outputs. ...

Page 147

Field 7 Reduced Drive of Port K RDRK 0 All port K output pins have full drive enabled. 1 All port K output pins have reduced drive enabled. 4 Reduced Drive of Port E RDPE 0 All port E output ...

Page 148

Chapter 4 Multiplexed External Bus Interface (MEBIV3) 4.3.2.13 Reserved Register Module Base + 0x000F Starting address location affected by INITRG register setting Reset Unimplemented or Reserved This register location is not ...

Page 149

Port K Data Register (PORTK) Module Base + 0x0032 Starting address location affected by INITRG register setting Bit Reset 0 0 Alternate ECS XCS Pin Function Read: Anytime Write: Anytime This port is ...

Page 150

Chapter 4 Multiplexed External Bus Interface (MEBIV3) 4.3.2.16 Port K Data Direction Register (DDRK) Module Base + 0x0033 Starting address location affected by INITRG register setting Bit Reset 0 0 Figure 4-20. Port K ...

Page 151

Table 4-15. Access Type vs. Bus Control Pins LSTRB 4.4.2 Stretched Bus Cycles In order to allow fast internal bus cycles to coexist in a system with slower external memory resources, the HCS12 supports the concept ...

Page 152

Chapter 4 Multiplexed External Bus Interface (MEBIV3) There are two basic types of operating modes: 1. Normal modes: Some registers and bits are protected against accidental changes. 2. Special modes: Allow greater access to protected control registers and bits for ...

Page 153

Normal Expanded Wide Mode In expanded wide modes, Ports A and B are configured as a 16-bit multiplexed address and data bus and Port E bit 4 is configured as the E clock output signal. These signals allow external ...

Page 154

Chapter 4 Multiplexed External Bus Interface (MEBIV3) The PE4/ECLK pin is initially configured as ECLK output with stretch. The E clock output function depends upon the settings of the NECLK bit in the PEAR register, the IVIS bit in the ...

Page 155

Special Operating Modes There are two special operating modes that correspond to normal operating modes. These operating modes are commonly used in factory testing and system development. 4.4.3.2.1 Special Single-Chip Mode When the MCU is reset in this mode, ...

Page 156

Chapter 4 Multiplexed External Bus Interface (MEBIV3) mode. Background debugging should not be used while the MCU is in special peripheral mode as internal bus conflicts between BDM and the external master can cause improper operation of both functions. 4.4.4 ...

Page 157

Chapter 5 Interrupt (INTV1) Block Description 5.1 Introduction This section describes the functionality of the interrupt (INT) sub-block of the S12 core platform. A block diagram of the interrupt sub-block is shown in WRITE DATA BUS INTERRUPTS XMASK IMASK RESET ...

Page 158

Chapter 5 Interrupt (INTV1) Block Description The interrupt sub-block decodes the priority of all system exception requests and provides the applicable vector for processing the exception. The INT supports I-bit maskable and X-bit maskable interrupts, a non- maskable unimplemented opcode ...

Page 159

External Signal Description Most interfacing with the interrupt sub-block is done within the core. However, the interrupt does receive direct input from the multiplexed external bus interface (MEBI) sub-block of the core for the IRQ and XIRQ pin data. ...

Page 160

Chapter 5 Interrupt (INTV1) Block Description Field 4 Write to the Interrupt Test Registers WRTINT Read: anytime Write: only in special modes and with I-bit mask and X-bit mask set. 0 Disables writes to the test registers; reads of the ...

Page 161

Field 7:0 Interrupt TEST Bits — These registers are used in special modes for testing the interrupt logic and priority INT[E:0] independent of the system configuration. Each bit is used to force a specific interrupt vector by writing it to ...

Page 162

Chapter 5 Interrupt (INTV1) Block Description 5.4.1 Low-Power Modes The INT does not contain any user-controlled options for reducing power consumption. The operation of the INT in low-power modes is discussed in the following subsections. 5.4.1.1 Operation in Run Mode ...

Page 163

Interrupt Priority Decoder The priority decoder evaluates all interrupts pending and determines their validity and priority. When the CPU requests an interrupt vector, the decoder will provide the vector for the highest priority interrupt request. Because the vector is ...

Page 164

Chapter 5 Interrupt (INTV1) Block Description 164 MC9S12C-Family / MC9S12GC-Family Rev 01.23 Freescale Semiconductor ...

Page 165

Chapter 6 Background Debug Module (BDMV4) Block Description 6.1 Introduction This section describes the functionality of the background debug module (BDM) sub-block of the HCS12 core platform. A block diagram of the BDM is shown in HOST SYSTEM BKGD ENTAG ...

Page 166

Chapter 6 Background Debug Module (BDMV4) Block Description • Nine hardware commands using free cycles, if available, for minimal CPU intervention • Hardware commands not requiring active BDM • 15 firmware commands execute from the standard BDM firmware lookup table ...

Page 167

External Signal Description A single-wire interface pin is used to communicate with the BDM system. Two additional pins are used for instruction tagging. These pins are part of the multiplexed external bus interface (MEBI) sub-block and all interfacing between ...

Page 168

Chapter 6 Background Debug Module (BDMV4) Block Description 6.3 Memory Map and Register Definition A summary of the registers associated with the BDM is shown in host-driven communications to the BDM hardware using READ_BD and WRITE_BD commands. Detailed descriptions of ...

Page 169

Register Descriptions Register Bit 7 Name 0xFF00 R X Reserved W 0xFF01 R ENBDM BDMSTS W 0xFF02 R X Reserved W 0xFF03 R X Reserved W 0xFF04 R X Reserved W 0xFF05 R X Reserved W 0xFF06 R CCR7 ...

Page 170

Chapter 6 Background Debug Module (BDMV4) Block Description 6.3.2.1 BDM Status Register (BDMSTS) 0xFF01 7 R ENBDM W Reset: (1) Special single-chip mode: 1 Special peripheral mode: 0 All other modes Note: 1. ENBDM is read as "1" ...

Page 171

Field 7 Enable BDM — This bit controls whether the BDM is enabled or disabled. When enabled, BDM can be made ENBDM active to allow firmware commands to be executed. When disabled, BDM cannot be made active but BDM hardware ...

Page 172

Chapter 6 Background Debug Module (BDMV4) Block Description Table 6-2. BDMSTS Field Descriptions (continued) Field 2 Clock Switch — The CLKSW bit controls which clock the BDM operates with only writable from a hardware CLKSW BDM command. A ...

Page 173

BDM CCR Holding Register (BDMCCR) 0xFF06 CCR7 CCR6 W Reset 0 0 Figure 6-4. BDM CCR Holding Register (BDMCCR) Read: All modes Write: All modes When BDM is made active, the CPU stores the value of ...

Page 174

Chapter 6 Background Debug Module (BDMV4) Block Description 6.4 Functional Description The BDM receives and executes commands from a host via a single wire serial interface. There are two types of BDM commands, namely, hardware commands and firmware commands. Hardware ...

Page 175

BDM becomes active before or after execution of the next instruction attempt is made to activate BDM before being enabled, the CPU resumes normal instruction execution after a brief delay. ...

Page 176

Chapter 6 Background Debug Module (BDMV4) Block Description The BDM hardware commands are listed in Opcode Command (hex) BACKGROUND 90 ACK_ENABLE D5 ACK_DISABLE D6 READ_BD_BYTE E4 READ_BD_WORD EC READ_BYTE E0 READ_WORD E8 WRITE_BD_BYTE C4 WRITE_BD_WORD CC WRITE_BYTE C0 WRITE_WORD C8 ...

Page 177

The standard BDM firmware watches for serial commands and executes them as they are received. The firmware commands are shown in (1) Command Opcode (hex) READ_NEXT 62 16-bit data out READ_PC 63 16-bit data out READ_D 64 16-bit data ...

Page 178

Chapter 6 Background Debug Module (BDMV4) Block Description 16-bit misaligned reads and writes are not allowed. If attempted, the BDM will ignore the least significant bit of the address and will assume an even address from the remaining bits. For ...

Page 179

BITS AT ∼16 TC/BIT HARDWARE COMMAND READ HARDWARE COMMAND WRITE 44-BC DELAY FIRMWARE COMMAND READ FIRMWARE COMMAND WRITE 64-BC DELAY GO, COMMAND TRACE 6.4.6 BDM Serial Interface The BDM communicates with external devices serially via the BKGD pin. During ...

Page 180

Chapter 6 Background Debug Module (BDMV4) Block Description earlier. Synchronization between the host and target is established in this manner at the start of every bit time. Figure 6-7 shows an external host transmitting a logic 1 and transmitting a ...

Page 181

CLOCK TARGET SYSTEM HOST DRIVE TO BKGD PIN TARGET SYSTEM SPEEDUP PULSE HIGH-IMPEDANCE PERCEIVED START OF BIT TIME BKGD PIN Figure 6-8. BDM Target-to-Host Serial Bit Timing (Logic 1) Figure 6-9 shows the host receiving a logic 0 from the ...

Page 182

Chapter 6 Background Debug Module (BDMV4) Block Description 6.4.7 Serial Interface Hardware Handshake Protocol BDM commands that require CPU execution are ultimately treated at the MCU bus rate. Because the BDM clock source can be asynchronously related to the bus ...

Page 183

Figure 6-11 shows the ACK handshake protocol in a command level timing diagram. The READ_BYTE instruction is used as an example. First, the 8-bit instruction opcode is sent by the host, followed by the address of the memory location to ...

Page 184

Chapter 6 Background Debug Module (BDMV4) Block Description 6.4.8 Hardware Handshake Abort Procedure The abort procedure is based on the SYNC command. In order to abort a command, which had not issued the corresponding ACK pulse, the host controller should ...

Page 185

READ_BYTE CMD IS ABORTED BY THE SYNC REQUEST BKGD PIN READ_BYTE MEMORY ADDRESS HOST TARGET AND STARTS TO EXECUTES THE READ_BYTE CMD Figure 6-12. ACK Abort Procedure at the Command Level Figure 6-13 shows a conflict between the ACK pulse ...

Page 186

Chapter 6 Background Debug Module (BDMV4) Block Description The commands are described as follows: • ACK_ENABLE — enables the hardware handshake protocol. The target will issue the ACK pulse when a CPU command is executed by the CPU. The ACK_ENABLE ...

Page 187

SYNC — Request Timed Reference Pulse The SYNC command is unlike other BDM commands because the host does not necessarily know the correct communication speed to use for BDM communications until after it has analyzed the response to the ...

Page 188

Chapter 6 Background Debug Module (BDMV4) Block Description If an interrupt is pending when a TRACE1 command is issued, the interrupt stacking operation occurs but no user instruction is executed. Upon return to standard BDM firmware execution, the program counter ...

Page 189

If a read command is issued but the data is not retrieved within 512 serial clock cycles, a soft-reset will occur causing the command to be disregarded. The data is not available for retrieval after the time-out has occurred. This ...

Page 190

Chapter 6 Background Debug Module (BDMV4) Block Description 190 MC9S12C-Family / MC9S12GC-Family Rev 01.23 Freescale Semiconductor ...

Page 191

Chapter 7 Debug Module (DBGV1) Block Description 7.1 Introduction This section describes the functionality of the debug (DBG) sub-block of the HCS12 core platform. The DBG module is designed to be fully compatible with the existing BKP_HCS12_A module (BKP mode) ...

Page 192

Chapter 7 Debug Module (DBGV1) Block Description The DBG in DBG mode includes these distinctive features: • Three comparators (A, B, and C) — Dual mode, comparators A and B used to compare addresses — Full mode, comparator A compares ...

Page 193

Data associated with event B trigger modes — Detail report mode stores address and data for all cycles except program (P) and free (f) cycles — Current instruction address when in profiling mode — BGND is not considered a ...

Page 194

Chapter 7 Debug Module (DBGV1) Block Description CLOCKS AND CONTROL SIGNALS . . . . . . EXPANSION ADDRESS ADDRESS WRITE DATA READ DATA REGISTER BLOCK BKPCT0 BKPCT1 BKP READ BKP0X DATA BUS WRITE BKP0H DATA BUS BKP0L BKP1X BKP1H ...

Page 195

DBG READ DATA BUS ADDRESS BUS WRITE DATA BUS READ DATA BUS READ/WRITE DBG MODE ENABLE CHANGE-OF-FLOW INDICATORS MCU IN BDM CPU PROGRAM COUNTER INSTRUCTION LAST CYCLE REGISTER BUS CLOCK WRITE DATA BUS M U READ DATA BUS X READ/WRITE ...

Page 196

Chapter 7 Debug Module (DBGV1) Block Description 7.3 Memory Map and Register Definition A summary of the registers associated with the DBG sub-block is shown in descriptions of the registers and bits are given in the subsections that follow. 7.3.1 ...

Page 197

Name Bit 7 R Bit 15 0x0022 DBGTBH W R Bit 7 0x0023 DBGTBL W R TBF 0x0024 DBGCNT W R 0x0025 PAGSEL ((2)) DBGCCX W R 0x0026 Bit 15 (2) DBGCCH W R 0x0027 Bit 7 (2) DBGCCL ...

Page 198

Chapter 7 Debug Module (DBGV1) Block Description 1. The DBG module is designed for backwards compatibility to existing BKP modules. Register and bit names have changed from the BKP module. This column shows the DBG register name, as well as ...

Page 199

Table 7-3. DBGC1 Field Descriptions (continued) Field 3 DBG Breakpoint Enable Bit — The DBGBRK bit controls whether the debugger will request a breakpoint based DBGBRK on comparator A and B to the CPU upon completion of a tracing session. ...

Page 200

Chapter 7 Debug Module (DBGV1) Block Description 7.3.2.2 Debug Status and Control Register (DBGSC) Module Base + 0x0021 Starting address location affected by INITRG register setting Reset Unimplemented or Reserved Figure ...

Related keywords