MC68HC908AP8CB Freescale Semiconductor, MC68HC908AP8CB Datasheet

no-image

MC68HC908AP8CB

Manufacturer Part Number
MC68HC908AP8CB
Description
IC MCU 8K FLASH 8MHZ 42SDIP
Manufacturer
Freescale Semiconductor
Series
HC08r
Datasheet

Specifications of MC68HC908AP8CB

Core Processor
HC08
Core Size
8-Bit
Speed
8MHz
Connectivity
I²C, IRSCI, SCI, SPI
Peripherals
LED, LVD, POR, PWM
Number Of I /o
32
Program Memory Size
8KB (8K x 8)
Program Memory Type
FLASH
Ram Size
1K x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
42-DIP (0.600", 15.24mm)
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Eeprom Size
-
MC68HC908AP64
MC68HC908AP32
MC68HC908AP16
MC68HC908AP8
Data Sheet
M68HC08
Microcontrollers
MC68HC908AP64
Rev. 4
01/2007
freescale.com

Related parts for MC68HC908AP8CB

MC68HC908AP8CB Summary of contents

Page 1

MC68HC908AP64 MC68HC908AP32 MC68HC908AP16 MC68HC908AP8 Data Sheet M68HC08 Microcontrollers MC68HC908AP64 Rev. 4 01/2007 freescale.com ...

Page 2

...

Page 3

... The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. This product incorporates SuperFlash® technology licensed from SST. ...

Page 4

... Number(s) — Updated V values. OL and Table 22-10 . Oscillator 301, 305 , and data for DD data. 417, 421 DD . REG 8.7.2 Stop Mode — Updated 168–193 — Corrected register Freescale Semiconductor Page 254 299 — 167 421 — 125 207 415 101 415 ...

Page 5

... Chapter 18 Keyboard Interrupt Module (KBI .277 Chapter 19 Computer Operating Properly (COP .283 Chapter 20 Low-Voltage Inhibit (LVI .287 Chapter 21 Break Module (BRK .291 Chapter 22 Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .297 Chapter 23 Mechanical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .315 Chapter 24 Ordering Information .319 Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev ...

Page 6

... List of Chapters 6 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 7

... Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.3 Configuration Register 1 (CONFIG1 3.4 Configuration Register 2 (CONFIG2 3.5 Mask Option Register (MOR 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4.3 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.3.1 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Freescale Semiconductor Chapter 1 General Description Chapter 2 Memory Chapter 3 Chapter 4 Central Processor Unit (CPU) MC68HC908AP Family Data Sheet, Rev ...

Page 8

... Acquisition and Tracking Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.3.5 Manual and Automatic PLL Bandwidth Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 6.3.6 Programming the PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 6.3.7 Special Programming Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 6.3.8 Base Clock Selector Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 8 Chapter 5 Oscillator (OSC) Chapter 6 Clock Generator Module (CGM) MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 9

... SIM Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.4.1 SIM Counter During Power-On Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.4.2 SIM Counter During Stop Mode Recovery 103 7.4.3 SIM Counter and Reset States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 7.5 Exception Control 104 Freescale Semiconductor ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 DDA ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 SSA Chapter 7 System Integration Module (SIM) MC68HC908AP Family Data Sheet, Rev ...

Page 10

... Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 9.3 Pin Name Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 9.4 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 9.4.1 TIM Counter Prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 9.4.2 Input Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 9.4.3 Output Compare 138 10 Chapter 8 Monitor ROM (MON) Chapter 9 Timer Interface Module (TIM) MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 11

... Character Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 11.4.2.2 Character Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 11.4.2.3 Break Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 11.4.2.4 Idle Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 11.4.2.5 Inversion of Transmitted Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 11.4.2.6 Transmitter Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 11.4.3 Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 11.4.3.1 Character Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Freescale Semiconductor Chapter 10 Timebase Module (TBM) Chapter 11 MC68HC908AP Family Data Sheet, Rev ...

Page 12

... Transmitter Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 12.5.3 Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 12.5.3.1 Character Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 12.5.3.2 Character Reception 190 12.5.3.3 Data Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 12.5.3.4 Framing Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 12.5.3.5 Baud Rate Tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 12.5.3.6 Receiver Wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 12.5.3.7 Receiver Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 12 Chapter 12 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 13

... Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 13.11 SPI During Break Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 13.12 I/O Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 13.12.1 MISO (Master In/Slave Out 222 13.12.2 MOSI (Master Out/Slave In 222 13.12.3 SPSCK (Serial Clock 222 13.12.4 SS (Slave Select 223 Freescale Semiconductor Chapter 13 MC68HC908AP Family Data Sheet, Rev ...

Page 14

... Write Byte/Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 14.8.5 Read Byte/Word 244 14.8.6 Process Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 14.8.7 Block Read/Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 14.9 SMBus Protocol Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 15.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 14 Chapter 14 Multi-Master IIC Interface (MMIIC) Chapter 15 Analog-to-Digital Converter (ADC) MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 15

... Data Direction Register C (DDRC 266 16.5 Port 267 16.5.1 Port D Data Register (PTD 267 16.5.2 Data Direction Register D (DDRD 268 17.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 17.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 Freescale Semiconductor ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 DDA ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 SSA ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 REFH ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 REFL Chapter 16 Input/Output (I/O) Ports ...

Page 16

... Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 19.7.1 Wait Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 19.7.2 Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 19.8 COP Module During Break Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 20.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 16 Chapter 18 Keyboard Interrupt Module (KBI) Chapter 19 Computer Operating Properly (COP) Chapter 20 Low-Voltage Inhibit (LVI) MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 17

... Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 22.7 5V Oscillator Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 22.8 5V ADC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 22 Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 22.10 3V Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 22.11 3V Oscillator Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 22.12 3V ADC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 Freescale Semiconductor Chapter 21 Break Module (BRK) Chapter 22 Electrical Specifications MC68HC908AP Family Data Sheet, Rev ...

Page 18

... Low-Profile Quad Flat Pack (LQFP 316 23.3 44-Pin Quad Flat Pack (QFP 317 23.4 42-Pin Shrink Dual In-Line Package (SDIP 318 24.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 24.2 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 18 Chapter 23 Mechanical Specifications Chapter 24 Ordering Information MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 19

... Two 16-bit, 2-channel timer interface modules (TIM1 and TIM2) with selectable input capture, output compare, and PWM capability on each channel 1. No security feature is absolutely secure. However, Freescale’s strategy is to make reading or copying the FLASH difficult for unauthorized users. Freescale Semiconductor RAM Size (bytes) 2,048 ...

Page 20

... Fast 8 × 8 multiply instruction • • Fast 16/8 divide instruction • Binary-coded decimal (BCD) instructions • Optimization for controller applications • Efficient C language support 1.3 MCU Block Diagram Figure 1-1 shows the structure of the MC68HC908AP64. 20 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 21

... POWER-ON RESET MODULE VDD VDDA VSS POWER VSSA VREG VREFH ADC REFERENCE VREFL Figure 1-1. MC68HC908AP64 Block Diagram Freescale Semiconductor INTERNAL BUS 10-BIT ANALOG-TO-DIGITAL CONVERTER MODULE TIMEBASE MODULE 2-CHANNEL TIMER INTERFACE MODULE 1 2-CHANNEL TIMER INTERFACE MODULE 2 SERIAL COMMUNICATIONS INTERFACE MODULE 1 MULTI-MASTER IIC (SMBUS) ...

Page 22

... Pin Assignment PTB6/T2CH0 1 2 VREG 3 PTB5/T1CH1 VDD 4 5 OSC1 6 OSC2 VSS 7 8 PTB4/T1CH0 IRQ1 9 PTB3/RxD 10 RST 11 PTB2/TxD 12 NC: No connection Figure 1-2. 48-Pin LQFP Pin Assignments 22 MC68HC908AP Family Data Sheet, Rev. 4 VREFH 36 35 VREFL PTA0/ADC0 PTA1/ADC1 29 PTA2/ADC2 28 PTA3/ADC3 27 PTA4/ADC4 26 PTA5/ADC5 PTA6/ADC6 25 Freescale Semiconductor ...

Page 23

... PTB6/T2CH0 1 VREG 2 PTB5/T1CH1 3 VDD 4 OSC1 5 OSC2 6 VSS 7 PTB4/T1CH0 8 IRQ1 9 PTB3/RxD 10 RST 11 Figure 1-3. 44-Pin QFP Pin Assignments Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 Pin Assignment PTD7/KBI7 33 32 VREFH 31 VREFL 30 PTA0/ADC0 29 PTA1/ADC1 28 PTA2/ADC2 PTA3/ADC3 27 PTA4/ADC4 26 25 PTA5/ADC5 PTA6/ADC6 24 PTA7/ADC7 23 23 ...

Page 24

... PTC0/IRQ2 PTC1 Figure 1-4. 42-Pin SDIP Pin Assignment MC68HC908AP Family Data Sheet, Rev. 4 VDDA 42 VSSA 41 PTD3/KBI3 40 PTD4/KBI4 39 PTD5/KBI5 38 PTD6/KBI6 37 PTD7/KBI7 36 VREFH 35 VREFL 34 33 PTA0/ADC0 PTA1/ADC1 32 31 PTA2/ADC2 PTA3/ADC3 30 29 PTA4/ADC4 28 PTA5/ADC5 27 PTA6/ADC6 26 PTA7/ADC7 25 PTC2/MISO 24 PTC3/MOSI 23 PTC4/SS 22 PTC5/SPSCK Unconnected Unconnected Freescale Semiconductor ...

Page 25

... CGM external filter capacitor connection. CGMXFC 8-bit general purpose I/O port. PTA0/ADC0 : Pins as ADC inputs, ADC0–ADC7. PTA7/ADC7 Each pin has high current sink for LED. Freescale Semiconductor Table 1-2. Table 1-2. Pin Functions PIN DESCRIPTION MC68HC908AP Family Data Sheet, Rev. 4 Pin Functions VOLTAGE ...

Page 26

... Table 1-2. Pin Functions PIN DESCRIPTION for V tolerance. REG , C BYPASS BULK MC68HC908AP Family Data Sheet, Rev. 4 VOLTAGE IN/OUT LEVEL V In/Out V In/Out V In/Out V Out In/Out V In/Out V In/Out V In/Out V In/Out Out In/Out V Out In/Out In Figure 1-5 are optional bulk current bypass Freescale Semiconductor ...

Page 27

... All internal logics, except for the I/O pads, are powered by REG V output. V requires an external ceramic bypass capacitor of 100 nF as REG REG the bypass capacitor as close to the V Figure 1-6. Regulator Power Supply Bypassing Freescale Semiconductor DDA C1(a) 0.1 µF + C2(a) ...

Page 28

... General Description 28 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 29

... COP control register, COPCTL 2.3 Monitor ROM The 959 bytes at addresses $FC00–$FDFF and $FE10–$FFCE are reserved ROM addresses that contain the instructions for the monitor functions. (See Freescale Semiconductor Chapter 8 Monitor ROM MC68HC908AP Family Data Sheet, Rev. 4 Figure 2-1, includes: (MON) ...

Page 30

... MC68HC908AP Family Data Sheet, Rev. 4 MC68HC908AP8 RAM $0060 RAM 1,024 Bytes 1,024 Bytes $045F Unimplemented 1,024 Bytes 1,024 Bytes $0860 FLASH Memory 8,192 Bytes ↓ 16,384 Bytes $485F $4860 Unimplemented 54,176 Bytes ↓ 45,984 Bytes $FBFF Freescale Semiconductor $0060 $045F $0860 $285F $2860 ↓ $FBFF ...

Page 31

... Write: Reset: Read: $000B Unimplemented Write: Reset: Read: Port-A LED Control $000C Register Write: (LEDA) Reset Unaffected Figure 2-2. Control, Status, and Data Registers (Sheet Freescale Semiconductor Bit PTA7 PTA6 PTA5 PTA4 Unaffected by reset PTB7 PTB6 PTB5 PTB4 Unaffected by reset PTC7 ...

Page 32

... SCRF IDLE Unaffected by reset 0 0 SCP1 SCP0 Indeterminate = Unimplemented MC68HC908AP Family Data Sheet, Rev Bit 0 CPHA SPWOM SPE SPTIE SPTE MODFEN SPR1 SPR0 WAKE ILTY PEN PTY RWU SBK ORIE NEIE FEIE PEIE BKF RPF SCR2 SCR1 SCR0 Reserved Freescale Semiconductor ...

Page 33

... High Write: (T1MODH) Reset: Read: Timer 1 Counter Modulo $0024 Register Low Write: (T1MODL) Reset: Read: Timer 1 Channel 0 Status and $0025 Write: Control Register (T1SC0) Reset Unaffected Figure 2-2. Control, Status, and Data Registers (Sheet Freescale Semiconductor Bit KBIE7 KBIE6 KBIE5 KBIE4 0 0 ...

Page 34

... Indeterminate after reset Bit Indeterminate after reset X = Indeterminate = Unimplemented MC68HC908AP Family Data Sheet, Rev Bit Bit Bit 0 ELS1B ELS1A TOV1 CH1MAX Bit Bit 0 0 PS2 PS1 PS0 Bit Bit Bit Bit ELS0B ELS0A TOV0 CH0MAX Bit Bit Reserved Freescale Semiconductor ...

Page 35

... Reset: Read: $003C Unimplemented Write: Reset: Read: $003D Unimplemented Write: Reset: Read: $003E Unimplemented Write: Reset: Read: $003F Unimplemented Write: Reset Unaffected Figure 2-2. Control, Status, and Data Registers (Sheet Freescale Semiconductor Bit CH1F 0 CH1IE MS1A Bit Indeterminate after reset Bit ...

Page 36

... WAKE ILTY PEN RWU ORIE NEIE FEIE BKF SCR2 SCR1 TNP1 TNP0 MMAD3 MMAD2 MMAD1 MMCRCBY MMTXAK REPSEN MMRW MMRXAK MMCRCBF MMTXBE MMTD3 MMTD2 MMTD1 Reserved Freescale Semiconductor Bit 0 PTY 0 SBK 0 PEIE RPF SCR0 0 IREN 0 MMEXTAD MMCRCEF Unaffected MMRXBF 0 MMTD0 0 ...

Page 37

... ADC Status and Control $0057 Register Write: (ADSCR) Reset: Read: ADC Clock Control Register $0058 Write: (ADICLK) Reset: Read: ADC Data Register High 0 $0059 Write: (ADRH0) Reset Unaffected Figure 2-2. Control, Status, and Data Registers (Sheet Freescale Semiconductor Bit MMRD7 MMRD6 MMRD5 MMRD4 ...

Page 38

... X = Indeterminate = Unimplemented MC68HC908AP Family Data Sheet, Rev Bit 0 ADx ADx ADx ADx AD5 AD4 AD3 AD2 AD5 AD4 AD3 AD2 AD5 AD4 AD3 AD2 AUTO1 AUTO0 ASCAN SBSW Note 0 ILAD MODRST LVI IF2 IF1 IF10 IF9 IF8 IF7 Reserved Freescale Semiconductor ...

Page 39

... Read: Write: Read: Mask Option Register $FFCF Write: # (MOR) Erased: Reset: Read: COP Control Register $FFFF Write: (COPCTL) Reset: # MOR is a non-volatile FLASH register; write by programming Unaffected Figure 2-2. Control, Status, and Data Registers (Sheet Freescale Semiconductor Bit IF21 IF20 IF19 ...

Page 40

... SCI Error Vector (High) IF11 $FFE7 SCI Error Vector (Low) $FFE8 MMIIC Interrupt Vector (High) IF10 $FFE9 MMIIC Interrupt Vector (Low) $FFEA TIM2 Overflow Vector (High) IF9 $FFEB TIM2 Overflow Vector (Low) MC68HC908AP Family Data Sheet, Rev. 4 Vector Freescale Semiconductor ...

Page 41

... The following table shows the RAM size and address range: Device MC68HC908AP64 MC68HC908AP32 MC68HC908AP16 MC68HC908AP8 The location of the stack RAM is programmable. The 16-bit stack pointer allows the stack to be anywhere in the 64k-byte memory space. Freescale Semiconductor Address $FFEC TIM2 Channel 1 Vector (High) IF8 $FFED TIM2 Channel 1 Vector (Low) $FFEE ...

Page 42

... A security feature prevents viewing of the FLASH contents. 42 NOTE NOTE NOTE FLASH Size (Bytes) 62,368 32,768 16,384 8,192 NOTE MC68HC908AP Family Data Sheet, Rev. 4 Memory Address Range $0860–$FBFF $0860–$885F $0860–$485F $0860–$285F (1) Freescale Semiconductor ...

Page 43

... Write any data to any FLASH location within the page address range desired. (5 µs). 3. Wait for a time, t nvs 4. Set the HVEN bit. 5. Wait for a time t (20 ms). erase 1. No security feature is absolutely secure. However, Freescale’s strategy is to make reading or copying the FLASH difficult for unauthorized users. Freescale Semiconductor HVEN 0 ...

Page 44

... Write data to the FLASH location to be programmed. (20 µ µs). 7. Wait for time, t prog 8. Repeat steps 6 and 7 until all bytes within the row are programmed. 9. Clear the PGM bit. 44 NOTE NOTE shows a flowchart of the programming algorithm.) MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 45

... The mask option register ($FFCF) and the 48 bytes of user interrupt vectors ($FFD0–$FFFF) are always protected, regardless of the value in the FLASH block protect register. A mass erase is required to erase these locations. Freescale Semiconductor NOTE NOTE NOTE MC68HC908AP Family Data Sheet, Rev. 4 ...

Page 46

... Write data to the FLASH address to be programmed 7 Wait for a time, t Completed programming this row? N MC68HC908AP Family Data Sheet, Rev. 4 nvs pgs prog Y 9 Clear PGM bit 10 Wait for a time, t nvh 11 Clear HVEN bit 12 Wait for a time, t rcv End of Programming Freescale Semiconductor ...

Page 47

... Except for the mask option register ($FFCF) and the 48-byte user vectors ($FFD0–$FFFF). These FLASH locations are always protected. Freescale Semiconductor BPR6 BPR5 BPR4 BPR3 0 0 ...

Page 48

... Memory 48 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 49

... Write: † (CONFIG1) Reset: Mask-Option-Register Read: # $FFCF Write: (MOR) Erased: † One-time writable register after each reset. # MOR is a non-volatile FLASH register; write by programming. Figure 3-1. CONFIG and MOR Registers Summary Freescale Semiconductor – – 2 ICLK cycles) DD Bit STOP_ STOP_ STOP_ ...

Page 50

... LVI module resets disabled 0 = LVI module resets enabled 50 NOTE 3- LVISTOP LVIRSTD LVIPWRD LVIREGD – 2 ICLK cycles 18 4 – 2 ICLK cycles Chapter 20 Low-Voltage Inhibit NOTE MC68HC908AP Family Data Sheet, Rev Bit 0 SSREC STOP COPD Chapter 19 Computer Operating (LVI).) Chapter 20 Low-Voltage Inhibit Freescale Semiconductor (LVI).) ...

Page 51

... STOP instruction enabled 0 = STOP instruction treated as illegal opcode COPD — COP Disable Bit COPD disables the COP module. (See 1 = COP module disabled 0 = COP module enabled Freescale Semiconductor LVI circuit. (See Chapter 20 Low-Voltage Inhibit LVI circuit. (See Chapter 20 Low-Voltage Inhibit NOTE NOTE Chapter 19 Computer Operating Properly MC68HC908AP Family Data Sheet, Rev ...

Page 52

... Reset clears these two bits. OSCCLK1 STOP_ STOP_ OSCCLK1 OSCCLK0 RCLKEN XCLKEN Chapter 5 Oscillator OSCCLK0 MC68HC908AP Family Data Sheet, Rev Bit SCIBD- SRC (OSC).) Timebase Clock Source Internal oscillator (ICLK) RC oscillator (RCCLK) X-tal oscillator (XTAL) Not used Freescale Semiconductor ...

Page 53

... These bits are unaffected by reset. (See Bits 5–0 — Should be left as 1’s OSCSEL1 OSCSEL0 The internal oscillator is a free running oscillator and is available after each POR or reset turned-off in stop mode by setting the STOP_ICLKDIS bit in CONFIG2. Freescale Semiconductor , is used as clock source for SCI BUS Unaffected by reset Reserved Table 3-1 ...

Page 54

... Configuration & Mask Option Registers (CONFIG & MOR) 54 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 55

... Fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions • Enhanced binary-coded decimal (BCD) data handling • Modular architecture with expandable internal bus definition for extension of addressing range beyond 64 Kbytes • Low-power stop and wait modes Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev ...

Page 56

... STACK POINTER (SP) 0 PROGRAM COUNTER (PC CONDITION CODE REGISTER (CCR) CARRY/BORROW FLAG ZERO FLAG NEGATIVE FLAG INTERRUPT MASK HALF-CARRY FLAG TWO’S COMPLEMENT OVERFLOW FLAG Figure 4-1. CPU Registers Unaffected by reset Figure 4-2. Accumulator (A) MC68HC908AP Family Data Sheet, Rev Bit 0 Freescale Semiconductor ...

Page 57

... During reset, the program counter is loaded with the reset vector address located at $FFFE and $FFFF. The vector address is the address of the first instruction to be executed after exiting the reset state. Freescale Semiconductor 13 12 ...

Page 58

... If the interrupt service routine modifies H, then the user must stack and unstack H using the PSHH and PULH instructions Loaded with Vector from $FFFE and $FFFF Figure 4-5. Program Counter (PC NOTE MC68HC908AP Family Data Sheet, Rev Bit Bit Freescale Semiconductor ...

Page 59

... I bit remains clear. After exit by reset, the I bit is set. • Disables the CPU clock After exiting stop mode, the CPU clock begins running after the oscillator stabilization delay. Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 Arithmetic/Logic Unit (ALU) 59 ...

Page 60

... B9 dd EXT IX2 – IX1 SP1 9EE9 ff SP2 9ED9 ee ff IMM AB ii DIR BB dd EXT IX2 – IX1 SP1 9EEB ff SP2 9EDB ee ff – – – – – – IMM A7 ii – – – – – – IMM AF ii Freescale Semiconductor ...

Page 61

... BHCS rel Branch if Half Carry Bit Set BHI rel Branch if Higher Branch if Higher or Same BHS rel (Same as BCC) BIH rel Branch if IRQ Pin High BIL rel Branch if IRQ Pin Low Freescale Semiconductor Table 4-1. Instruction Set Summary Description A ← (A) & ( ← (PC rel ? ( ← ...

Page 62

... DIR (b5 DIR (b6 DIR (b7 – – – – – – REL 21 rr DIR (b0 DIR (b1 DIR (b2 DIR (b3 – – – – – o DIR (b4 DIR (b5 DIR (b6 DIR (b7 DIR (b0 DIR (b1 DIR (b2 DIR (b3 – – – – – – DIR (b4 DIR (b5 DIR (b6 DIR (b7 Freescale Semiconductor ...

Page 63

... CPX ,X Compare X with M CPX opr,X CPX opr,X CPX opr,SP CPX opr,SP DAA Decimal Adjust A Freescale Semiconductor Table 4-1. Instruction Set Summary Description PC ← (PC push (PCL) SP ← (SP) – 1; push (PCH) SP ← (SP) – ← (PC) + rel PC ← (PC rel ? (A) – (M) = $00 PC ← (PC rel ? (A) – (M) = $00 PC ← ...

Page 64

... IX2 IX1 DIR BD dd EXT – – – – – – IX2 IX1 IMM A6 ii DIR B6 dd EXT IX2 – – – IX1 SP1 9EE6 ff SP2 9ED6 ee ff IMM – – – DIR 55 dd Freescale Semiconductor ...

Page 65

... ORA opr ORA opr,X Inclusive OR A and M ORA opr,X ORA ,X ORA opr,SP ORA opr,SP PSHA Push A onto Stack PSHH Push H onto Stack PSHX Push X onto Stack PULA Pull A from Stack Freescale Semiconductor Table 4-1. Instruction Set Summary Description X ← ( ← (M) (M) Destination Source H:X ← ...

Page 66

... SP2 9ED2 ee ff – – – – – 1 INH 99 – – 1 – – – INH 9B DIR B7 dd EXT IX2 – – – IX1 SP1 9EE7 ff SP2 9ED7 – – – DIR 35 dd – – 0 – – – INH 8E Freescale Semiconductor ...

Page 67

... TSX Transfer SP to H:X TXA Transfer TXS Transfer H WAIT Enable Interrupts; Wait for Interrupt Freescale Semiconductor Table 4-1. Instruction Set Summary Description M ← (X) A ← (A) – (M) PC ← (PC Push (PCL) SP ← (SP) – 1; Push (PCH) SP ← (SP) – 1; Push (X) SP ← (SP) – 1; Push (A) SP ← ...

Page 68

... Stack pointer 16-bit offset addressing mode Stack pointer Undefined Overflow bit Index register low byte Zero bit Logical AND Logical OR Logical EXCLUSIVE OR Contents of Negation (two’s complement) Immediate value Sign extend Loaded with If Concatenated with Set or cleared Not affected Freescale Semiconductor ...

Page 69

Bit Manipulation Branch Read-Modify-Write DIR DIR REL DIR INH MSB LSB BRSET0 BSET0 BRA NEG NEGA NEGX 3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 5 ...

Page 70

... Central Processor Unit (CPU) 70 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 71

... CGMXCLK and CGMRCLK — Reference clock for clock generator module (CGM) and other MCU sub-systems other than TBM and COP. This is the main reference clock for the MCU. • OSCCLK — Reference clock for timebase module (TBM). Freescale Semiconductor NOTE MC68HC908AP Family Data Sheet, Rev. 4 regulator, ...

Page 72

... Figure 5-2. Mask Option Register (MOR CGM PLL CGMXCLK CGMRCLK MUX XCLK RCCLK RC OSCILLATOR BUS CLOCK OSC2 (MOR Unaffected by reset Reserved MC68HC908AP Family Data Sheet, Rev TBM OSCCLK CONFIG2 OSCCLK1 MUX OSCCLK0 SIM (and COP) ICLK INTERNAL OSCILLATOR From SIM 2 1 Bit Freescale Semiconductor ...

Page 73

... Figure 5-3. Configuration Register 2 (CONFIG2) Table 5-2. Timebase Module Reference Clock Selection OSCCLK1 The RCCLK or XCLK is only available if that clock is selected as the CGM reference clock, whereas the ICLK is always available. Freescale Semiconductor Table 5-1. CGMXCLK Clock Selection CGMXCLK OSC2 Pin — — Not used f ICLK Internal oscillator generates the CGMXCLK ...

Page 74

... CONFIG2 STOP_ICLKDIS MCU free running clock that requires no ICLK From SIM To Clock Selection MUX and COP SIMOSCEN ICLK EN INTERNAL OSCILLATOR Figure 5-4. Internal Oscillator MC68HC908AP Family Data Sheet, Rev. 4 From SIM BUS CLOCK OSC2 Freescale Semiconductor ...

Page 75

... Fixed capacitor • Tuning capacitor, C (can also be a fixed capacitor) 2 • Feedback resistor • Series resistor, R (optional) S Freescale Semiconductor To Clock Selection MUX SIMOSCEN RCCLK EN RC OSCILLATOR OSC1 V REG R C EXT Figure 5-5. RC Oscillator MC68HC908AP Family Data Sheet, Rev Oscillator From SIM ...

Page 76

... Oscillator Enable Signal (SIMOSCEN) The SIMOSCEN signal from the system integration module (SIM) enables/disables the x-tal oscillator, the RC-oscillator, or the internal oscillator circuit. 76 SIMOSCEN OSC1 32.768kHz C 1 Figure 5-6. Crystal Oscillator MC68HC908AP Family Data Sheet, Rev Clock Selection MUX XCLK OSC2 Freescale Semiconductor ...

Page 77

... The internal oscillator clock continues operation in stop mode. It can be disabled by setting the STOP_ICLKDIS bit to logic 1 before entering stop mode. 5.8 Oscillator During Break Mode The oscillator continues to drive CGMXCLK when the device enters the break state. Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 Low Power Modes Chapter 10 Timebase Module ...

Page 78

... Oscillator (OSC) 78 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 79

... VCO clock, CGMPCLK, divided by two as the base clock, CGMOUT. The SIM derives the system clocks from either CGMOUT or CGMXCLK. Figure 6-1 shows the structure of the CGM. Figure 6 summary of the CGM registers. Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev ...

Page 80

... ACQ PLLIE PLLF PRE[1: CGMVCLK FREQUENCY DIVIDER Figure 6-1. CGM Block Diagram MC68HC908AP Family Data Sheet, Rev SIM (and COP) To Timebase Module (TBM) To ADC A CGMOUT CLOCK ÷ SELECT SIM B S* CIRCUIT SIMDIV2 *WHEN CGMOUT = B From SIM CGMPCLK CGMINT To SIM Freescale Semiconductor ...

Page 81

... The PLL can change between acquisition and tracking modes either automatically or manually. 6.3.3 PLL Circuits The PLL consists of these circuits: • Voltage-controlled oscillator (VCO) • Reference divider • Frequency pre-scaler • Modulo VCO frequency divider Freescale Semiconductor Bit PLLF PLLIE PLLON LOCK AUTO ...

Page 82

... Modes. The value of the external capacitor and the 6.5.2 PLL Bandwidth Control 6.3.8 Base Clock Selector MC68HC908AP Family Data Sheet, Rev Modulating the voltage on the is equal to the nominal VRS RCLK , is fed back through a programmable /(N × VDV VCLK Register.) Circuit.) The PLL is automatically in Freescale Semiconductor (See ...

Page 83

... Programming the PLL The following procedure shows how to program the PLL. The round function in the following equations means that the real number should be rounded to the nearest integer number. Freescale Semiconductor Register read-only indicator of the mode of Modes.) 6.8 Acquisition/Lock Time Specifications 6 ...

Page 84

... MC68HC908AP Family Data Sheet, Rev and then VCLKDES × f BUS /R. For stability and lock time reduction, RCLK ) to a value determined RCLK Chapter 22 Electrical to an integer divisor of f RCLK ⎛ ⎞ f ⎫ VCLKDES ⎜ ⎟ ⎬ ------------------------- - f ⎝ ⎠ ⎭ RCLK and f . VCLK BUS ) Freescale Semiconductor , is , BUSDES ...

Page 85

... In the PLL reference divider select register (PMDS), program the binary coded equivalent of R. The values for and R can only be programmed when the PLL is off (PLLON = 0). Table 6-1 provides numeric examples (numbers are in hexadecimal notation): Freescale Semiconductor Frequency Range 0 < f < 9,830,400 VCLK 9,830,400 ≤ f < ...

Page 86

... MHz 4.0 MHz 32.768 kHz 8 MHz 2.0 MHz 32.768 kHz 4 MHz 1.0 MHz 32.768 kHz 6.3.6 Programming the PLL Circuit.) MC68HC908AP Family Data Sheet, Rev 12C 132 1E9 258 263 384 3D1 1E9 does not account for three possible Freescale Semiconductor ...

Page 87

... DDA potential as the V pin. DD Route V carefully for maximum noise immunity and place bypass DDA capacitors as close as possible to the package. Freescale Semiconductor for routing information, filter network and its effects on PLL CGMXFC 1 kΩ 0.22 µF Figure 6-3. CGM External Connections 6-3.) ...

Page 88

... PLL VCO range select register (PMRS) (See 6.5.4 PLL VCO Range Select • PLL reference divider select register (PMDS) (See 6.5.5 PLL Reference Divider Select 88 ) SSA NOTE Register.) Registers.) Register.) Register.) MC68HC908AP Family Data Sheet, Rev. 4 pin to the same voltage SSA Freescale Semiconductor ...

Page 89

... CGMXCLK and three CGMPCLK cycles to complete the transition from one source clock to the other. During the transition, CGMOUT is held in stasis. (See Selector Circuit.) Reset clears the BCS bit CGMPCLK divided by two drives CGMOUT 0 = CGMXCLK divided by two drives CGMOUT Freescale Semiconductor PLLF ...

Page 90

... NOTE: Do not program value NOTE Circuit.) PLL.) PRE1 and PRE0 cannot be written when the 6.3.6 Programming the PLL, and VRS MC68HC908AP Family Data Sheet, Rev. 4 Prescaler Multiplier 6.5.4 PLL VCO Range Select . VPR1:VPR0 cannot be written when VCO Power-of-Two Range Multiplier Freescale Semiconductor ...

Page 91

... When the AUTO bit is clear, ACQ is a read/write bit that controls whether the PLL is in acquisition or tracking mode. In automatic bandwidth control mode (AUTO = 1), the last-written value from manual operation is stored in a temporary location and is recovered when manual operation resumes. Reset clears this bit, enabling acquisition mode Tracking mode 0 = Acquisition mode Freescale Semiconductor LOCK 0 ...

Page 92

... VRS[7:0] cannot be written when the PLLON bit in the VRS Exceptions.) A value of $00 in the VCO range select MC68HC908AP Family Data Sheet, Rev Bit 0 MUL10 MUL9 MUL8 Bit 0 MUL2 MUL1 MUL0 Bit 0 VRS2 VRS1 VRS0 6.5.1 PLL Control Register.), controls the Freescale Semiconductor ...

Page 93

... When the PLL enters lock, the divided VCO clock, CGMPCLK, divided by two can be selected as the CGMOUT source by setting BCS in the PCTL. When the PLL exits lock, the Freescale Semiconductor Exceptions.). Reset initializes the register to NOTE ...

Page 94

... To protect the PLLF bit during the break state, write a logic 0 to the BCFE bit. With BCFE at logic 0 (its default state), software can read and write the PLL control register during the break state without affecting the PLLF bit. 94 NOTE 7.7.3 SIM Break Flag Control MC68HC908AP Family Data Sheet, Rev. 4 Register.) Freescale Semiconductor ...

Page 95

... PLL. A fixed value is best. Variable supplies, such as batteries, are acceptable if they vary within a known range at very slow speeds. Noise on the power supply is not acceptable, because it causes small frequency errors which continually change the acquisition time of the PLL. Freescale Semiconductor 6.3.3 PLL Circuits, Register ...

Page 96

... Time, the external filter network is critical to the is recommended when using a 32.768kHz reference clock CGMXFC 1 kΩ SSA (a) Figure 6-10. PLL Filter MC68HC908AP Family Data Sheet, Rev. 4 Figure 6-10 (b) is used in CGMXFC 0.22 µF V SSA (b) Freescale Semiconductor ...

Page 97

... Internal address bus IDB Internal data bus PORRST Signal from the power-on reset module to the SIM IRST Internal reset signal R/W Read/write signal Freescale Semiconductor Figure 7-1. Table 7-1. Signal Name Conventions Description MC68HC908AP Family Data Sheet, Rev. 4 Figure 7 summary of the SIM 97 ...

Page 98

... SIMOSCEN (TO CGM, OSC) COP CLOCK ICLK (FROM OSC) CGMOUT (FROM CGM) INTERNAL CLOCKS LVI (FROM LVI MODULE) ILLEGAL OPCODE (FROM CPU) ILLEGAL ADDRESS (FROM ADDRESS MAP DECODERS) COP (FROM COP MODULE) INTERRUPT SOURCES CPU INTERFACE SBSW NOTE ILAD MODRST LVI Freescale Semiconductor Bit ...

Page 99

... OSCILLATOR (OSC) MODULE OSC1 STOP MODE CLOCK ENABLE SIGNALS FROM CONFIG2 CGMRCLK PHASE-LOCKED LOOP (PLL) 7.2.1 Bus Timing In user mode, the internal bus frequency is either the oscillator output (CGMXCLK) divided by four or the divided PLL output (CGMPCLK) divided by four. Freescale Semiconductor IF6 IF5 IF4 ...

Page 100

... All others 100 7.6.2 Stop Mode.) 7.4 SIM Counter), but an external reset does not. Each of shows the relative timing. Table 7-2. PIN Bit Set Timing Number of Cycles Required to Set PIN 4163 (4096 + ( MC68HC908AP Family Data Sheet, Rev. 4 7.7 SIM Registers.) Freescale Semiconductor ...

Page 101

... The external reset pin (RST) is held low while the SIM counter counts out 4096 + 32 ICLK cycles. Thirty-two ICLK cycles later, the CPU and memories are released from reset to allow the reset vector sequence to occur. Freescale Semiconductor Figure 7-4. External Reset Timing NOTE ...

Page 102

... SIM reset status register (SRSR) and causes a reset. 102 32 32 CYCLES CYCLES Figure 7-7. POR Recovery on the RST pin disables the COP module. TST MC68HC908AP Family Data Sheet, Rev. 4 $FFFE $FFFF while the MCU is in monitor TST Freescale Semiconductor ...

Page 103

... CGMXCLK cycles down to 32 CGMXCLK cycles. This is ideal for applications using canned oscillators that do not require long start-up times from stop mode. External crystal applications should use the full stop recovery time, that is, with SSREC cleared. Freescale Semiconductor Chapter 8 Monitor ROM MC68HC908AP Family Data Sheet, Rev. 4 ...

Page 104

... SP – 1 CCR – 1[15:8] PC – 1[7:0] Figure 7-9. Interrupt Recovery Timing MC68HC908AP Family Data Sheet, Rev. 4 for details.) The SIM counter is for counter control and Figure 7-8 shows VECT H VECT L START ADDR CCR V DATA H V DATA L OPCODE OPCODE OPERAND Freescale Semiconductor ...

Page 105

... If more than one interrupt is pending at the end of an instruction execution, the highest priority interrupt is serviced first. Figure 7-11 demonstrates what happens when two interrupts are pending interrupt is pending upon exit from the original interrupt service routine, the pending interrupt is serviced before the LDA instruction is executed. Freescale Semiconductor FROM RESET BREAK I BIT SET? YES INTERRUPT? ...

Page 106

... The interrupt status registers can be useful for debugging. 106 CLI LDA #$FF PSHH INT1 INTERRUPT SERVICE ROUTINE PULH RTI PSHH INT2 INTERRUPT SERVICE ROUTINE PULH RTI . Interrupt Recognition Example NOTE NOTE MC68HC908AP Family Data Sheet, Rev. 4 BACKGROUND ROUTINE Table 7-3 summarizes the Freescale Semiconductor ...

Page 107

... Bit 7 Read: 0 Write: R Reset Figure 7-14. Interrupt Status Register 3 (INT3) IF21–IF15 — Interrupt Flags 21–15 These flags indicate the presence of an interrupt request from the source shown Interrupt request present interrupt request present Freescale Semiconductor IF5 IF4 IF3 IF2 ...

Page 108

... TIM1 Overflow $FFF1 $FFF2 IF5 TIM1 Channel 1 $FFF3 $FFF4 IF4 TIM1 Channel 0 $FFF5 $FFF6 IF3 PLL $FFF7 $FFF8 IRQ2 IF2 $FFF9 $FFFA IF1 IRQ1 $FFFB $FFFC — SWI $FFFD $FFFE Reset — $FFFF MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 109

... SBSW, in the SIM break status register (SBSR). If the COP disable bit, COPD, in the mask option register is logic 0, then the computer operating properly module (COP) is enabled and remains active in wait mode. Freescale Semiconductor Chapter 21 Break Module (BRK).) The SIM puts the CPU into the break MC68HC908AP Family Data Sheet, Rev ...

Page 110

... SSREC bit. 110 WAIT ADDR + 1 SAME PREVIOUS DATA NEXT OPCODE Figure 7-15. Wait Mode Entry Timing $6E0B $6E0C $00FF $A6 $A6 $01 $ CYCLES CYCLES $A6 NOTE MC68HC908AP Family Data Sheet, Rev. 4 SAME SAME SAME $00FE $00FD $00FC $6E RST VCT H RST VCT L Freescale Semiconductor ...

Page 111

... SIM Registers The SIM has three memory-mapped registers: • SIM Break Status Register • SIM Reset Status Register • SIM Break Flag Control Register Freescale Semiconductor Figure 7-18 NOTE STOP ADDR + 1 SAME PREVIOUS DATA NEXT OPCODE Figure 7-18. Stop Mode Entry Timing ...

Page 112

... RTI 112 Reserved ; See if wait mode or stop mode was exited by ; break. ;If RETURNLO is not zero, ;then just decrement low byte. ;Else deal with high byte, too. ;Point to WAIT/STOP opcode. ;Restore H register. MC68HC908AP Family Data Sheet, Rev Bit 0 SBSW R R Note 0 Freescale Semiconductor ...

Page 113

... MODRST — Monitor Mode Entry Module Reset Bit 1 = Last reset caused by monitor mode entry when vector locations $FFFE and $FFFF are $FF after POR while IRQ1 = POR or read of SRSR LVI — Low-Voltage Inhibit Reset Bit 1 = Last reset caused by the LVI circuit 0 = POR or read of SRSR Freescale Semiconductor PIN COP ...

Page 114

... This read/write bit enables software to clear status bits by accessing status registers while the MCU break state. To clear status bits during the break state, the BCFE bit must be set Status bits clearable during break 0 = Status bits not clearable during break 114 Reserved MC68HC908AP Family Data Sheet, Rev Bit Freescale Semiconductor ...

Page 115

... PTA0 and the host computer. PTA0 is used in a wired-OR configuration and requires a pullup resistor security feature is absolutely secure. However, Freescale’s strategy is to make reading or copying the FLASH difficult for unauthorized users. Freescale Semiconductor TST ( reset vector is blank ($FFFE and $FFFF contain ...

Page 116

... MC68HC908AP Family Data Sheet, Rev. 4 0.1 µ 0.1 µF OSC1 0.01 µF 10k 0.033 µF 1M 6– SW2 (SEE NOTE 1) 8 10k 10k 10k SW1 Freescale Semiconductor RST HC908AP DDA V REFH V REG V REFL SSA CGMXFC OSC1 OSC2 IRQ1 PTA0 PTA1 PTB0 PTA2 ...

Page 117

... V voltage is applied to the IRQ1 pin. An external oscillator of 9.8304 MHz is required for a baud rate of DD 9600, as the internal bus frequency is automatically set to the external frequency divided by four. Freescale Semiconductor NOTE on IRQ1 (condition set 1), then the COP is disabled as long TST is maintained on the IRQ1 pin after entering monitor TST MC68HC908AP Family Data Sheet, Rev ...

Page 118

Table 8-1. Monitor Mode Signal Requirements and Options Address PTA0 IRQ1 RST $FFFE/ PTA2 PTA1 $FFFF X GND ( TST V TST ...

Page 119

... Pulling RST low will not exit monitor mode in this situation. Table 8-2 summarizes the differences between user mode and monitor mode vectors. Modes User Monitor Freescale Semiconductor Figure 8-1 POR RESET NO NORMAL USER IS VECTOR BLANK? YES ...

Page 120

... Table 8-3. Monitor Baud Rate Selection Internal IRQ1 PTB0 Frequency V 0 2.4576 MHz TST V 1 2.4576 MHz TST V X 2.4576 MHz 2.4576 MHz SS MC68HC908AP Family Data Sheet, Rev. 4 NEXT START STOP BIT 7 BIT BIT Baud Rate (BPS) 9600 9600 9600 9600 Freescale Semiconductor ...

Page 121

... FROM HOST WRITE WRITE 3 1 ECHO Notes Echo delay, 2 bit times 2 = Cancel command delay, 11 bit times 3 = Wait 1 bit time before sending next byte. A brief description of each monitor mode command is given in Freescale Semiconductor NOTE ADDRESS ADDRESS ADDRESS ADDRESS HIGH HIGH LOW LOW 4 ...

Page 122

... Data None Returned Opcode $49 FROM HOST WRITE WRITE ECHO 122 Command Sequence ADDRESS ADDRESS ADDRESS ADDRESS HIGH HIGH LOW LOW Command Sequence ADDRESS ADDRESS ADDRESS ADDRESS HIGH HIGH LOW LOW MC68HC908AP Family Data Sheet, Rev. 4 DATA RETURN DATA DATA Freescale Semiconductor ...

Page 123

... Write to last address accessed + 1 Operand Single data byte Data None Returned Opcode $19 A sequence of IREAD or IWRITE commands can access a block of memory sequentially over the full 64-Kbyte memory map. Freescale Semiconductor Command Sequence FROM HOST IREAD IREAD DATA Command Sequence FROM HOST ...

Page 124

... CPU registers to prepare to run the host program. The READSP command returns the incremented stack pointer value The high and low bytes of the program counter are at addresses and 124 Command Sequence FROM HOST SP READSP READSP HIGH Command Sequence FROM HOST RUN RUN ECHO MC68HC908AP Family Data Sheet, Rev LOW RETURN Freescale Semiconductor ...

Page 125

... PTA0 FROM MCU NOTES Echo delay, 2 bit times Data return delay, 2 bit times Wait 1 bit time before sending next byte. Freescale Semiconductor HIGH BYTE OF INDEX REGISTER CONDITION CODE REGISTER ACCUMULATOR LOW BYTE OF INDEX REGISTER HIGH BYTE OF PROGRAM COUNTER LOW BYTE OF PROGRAM COUNTER ...

Page 126

... Emulated EEPROM write. Data size ranges from bytes at a time. Emulated EEPROM read. Data size ranges from bytes at a time. MC68HC908AP Family Data Sheet, Rev. 4 Stack Used Call Address (bytes) $FC34 15 $FCE4 9 $FC00 7 $FF24 17 $FF28 11 $FF36 30 $FD5B 18 Freescale Semiconductor ...

Page 127

... PRGRNGE PRGRNGE is used to program a range of FLASH locations with data loaded into the data array. Routine Name Routine Description Calling Address Stack Used Data Block Format Freescale Semiconductor $XXXX BUS SPEED (BUS_SPD) DATA SIZE (DATASIZE) START ADDRESS HIGH (ADDRH) ...

Page 128

... ORG FLASH INITIALISATION: MOV #20, BUS_SPD MOV #64, DATASIZE LDHX #FLASH_START STHX START_ADDR RTS MAIN: BSR INITIALISATION : : LDHX #FILE_PTR JSR PRGRNGE 128 ; Indicates 4x bus frequency ; Data size to be programmed ; FLASH start address ; Reserved data array MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 129

... EQU $FCE4 MAIN: BSR INITIALISATION : : LDHX #FILE_PTR JSR ERARNGE : Freescale Semiconductor Table 8-12. ERARNGE Routine ERARNGE Erase a page or the entire array $FCE4 9 bytes Bus speed (BUS_SPD) Data size (DATASIZE) Starting address (ADDRH) Starting address (ADDRL) 8.5.1 PRGRNGE). MC68HC908AP Family Data Sheet, Rev. 4 ...

Page 130

... LDHX #FILE_PTR JSR LDRNGE : 130 Table 8-13. LDRNGE Routine LDRNGE Loads data from a range of locations $FC00 7 bytes Bus speed (BUS_SPD) Data size (DATASIZE) Starting address (ADDRH) Starting address (ADDRL) Data 1 : Data N MC68HC908AP Family Data Sheet, Rev. 4 8.5.1 PRGRNGE). Freescale Semiconductor ...

Page 131

... The MON_ERARNGE routine is designed to be used in monitor mode. It performs the same function as the ERARNGE routine (see 8.5.2 via an SWI instruction. After a MON_ERARNGE call, the SWI instruction will return the control back to the monitor code. Freescale Semiconductor Table 8-14. MON_PRGRNGE Routine MON_PRGRNGE Program a range of locations, in monitor mode $FF24 ...

Page 132

... Table 8-16. EE_WRITE Routine EE_WRITE Emulated EEPROM write. Data size ranges from bytes at a time. $FF36 30 bytes Bus speed (BUS_SPD) (1) Data size (DATASIZE) (2) Starting address (ADDRH) (1) Starting address (ADDRL) Data 1 : Data N MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 133

... FLASH page boundary and the data size 15. If the FLASH page is already programmed with a data array with a different size, the EE_WRITE call will be ignored. Freescale Semiconductor PAGE BOUNDARY CONTROL: 9 BYTES ...

Page 134

... Table 8-17. EE_READ Routine EE_READ Emulated EEPROM read. Data size ranges from bytes at a time. $FD5B 18 bytes Bus speed (BUS_SPD) Data size (DATASIZE) (1) Starting address (ADDRH) (1) Starting address (ADDRL) Data 1 : Data N NOTE MC68HC908AP Family Data Sheet, Rev. 4 8.5.6 8.5.6 EE_WRITE). Freescale Semiconductor ...

Page 135

... Pin Names: References to either timer 1 or timer 2 may be made in the following text by omitting the timer number. For example, TCH0 may refer generically to T1CH0 and T2CH0, and TCH1 may refer to T1CH1 and T2CH1. Freescale Semiconductor Table 9-1. Pin Name Conventions T[1,2]CH0 TIM1 ...

Page 136

... CH0F MS0A MS0B ELS0B ELS0A CH1F MS0A Figure 9-1. TIM Block Diagram NOTE MC68HC908AP Family Data Sheet, Rev. 4 TOF INTERRUPT LOGIC TOIE TOV0 PORT CH0MAX T[1,2]CH0 LOGIC INTERRUPT LOGIC CH0IE TOV1 PORT CH1MAX T[1,2]CH1 LOGIC INTERRUPT CH01IE LOGIC CH1IE Freescale Semiconductor ...

Page 137

... TIM2 Counter Register Read: High Write: $002C (T2CNTH) Reset: TIM2 Counter Register Read: $002D Low Write: (T2CNTL) Reset: TIM2 Counter Modulo Read: Register High Write: $002E (T2MODH) Reset: Figure 9-2. TIM I/O Register Summary (Sheet Freescale Semiconductor Bit TOF 0 TOIE TSTOP 0 TRST Bit ...

Page 138

... Indeterminate after reset Bit Indeterminate after reset CH1F 0 CH1IE MS1A Bit Indeterminate after reset Bit Indeterminate after reset = Unimplemented MC68HC908AP Family Data Sheet, Rev Bit Bit ELS0B ELS0A TOV0 CH0MAX Bit Bit 0 ELS1B ELS1A TOV1 CH1MAX Bit Bit 0 9.4.3 Freescale Semiconductor ...

Page 139

... PWM pulse is logic 0. The value in the TIM counter modulo registers and the selected prescaler output determines the frequency of the PWM output. The frequency of an 8-bit PWM signal is variable in 256 increments. Writing Freescale Semiconductor NOTE MC68HC908AP Family Data Sheet, Rev. 4 ...

Page 140

... PWM signal generation when changing the PWM pulse width to a new, much larger value. 140 9.9.1 TIM Status and Control OVERFLOW PERIOD OUTPUT OUTPUT COMPARE COMPARE NOTE MC68HC908AP Family Data Sheet, Rev. 4 Register. OVERFLOW OUTPUT COMPARE 9.4.4 Pulse Width Freescale Semiconductor ...

Page 141

... Toggling on output compare can also cause incorrect PWM signal generation when changing the PWM pulse width to a new, much larger value the TIM status control register (TSC), clear the TIM stop bit, TSTOP. Freescale Semiconductor NOTE Table 9-3.) NOTE MC68HC908AP Family Data Sheet, Rev ...

Page 142

... The system integration module (SIM) controls whether status bits in other modules can be cleared during the break state. The BCFE bit in the break flag control register (BFCR) enables software to clear status bits during the break state. (See 142 Registers.) 21.5.4 SIM Break Flag Control MC68HC908AP Family Data Sheet, Rev. 4 Register.) Freescale Semiconductor ...

Page 143

... Stops the TIM counter • Resets the TIM counter • Prescales the TIM counter clock Address: T1SC, $0020 and T2SC, $002B Bit 7 Read: TOF Write: 0 Reset: 0 Figure 9-4. TIM Status and Control Register (TSC) Freescale Semiconductor Conventions. NOTE TOIE TSTOP TRST 0 1 ...

Page 144

... PS0 TIM Clock Source Internal bus clock ÷ Internal bus clock ÷ Internal bus clock ÷ Internal bus clock ÷ Internal bus clock ÷ Internal bus clock ÷ Internal bus clock ÷ Not available MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 145

... Figure 9-7. TIM Counter Modulo Register High (TMODH) Address: T1MODL, $0024 and T2MODL, $002F Bit 7 Read: Bit 7 Write: Reset: 1 Figure 9-8. TIM Counter Modulo Register Low (TMODL) Reset the TIM counter before writing to the TIM counter modulo registers. Freescale Semiconductor NOTE ...

Page 146

... This read/write bit selects buffered output compare/PWM operation. MSxB exists only in the TIM1 channel 0 and TIM2 channel 0 status and control registers. 146 CH0IE MS0B MS0A ELS0B CH1IE MS1A ELS1B MC68HC908AP Family Data Sheet, Rev Bit 0 ELS0A TOV0 CH0MAX Bit 0 ELS1A TOV1 CH1MAX Freescale Semiconductor ...

Page 147

... I/O pin. the ELSxB and ELSxA bits. Table 9-3. Mode, Edge, and Level Selection MSxB:MSxA ELSxB:ELSxA Freescale Semiconductor NOTE Table 9-3 shows how ELSxB and ELSxA work. Reset clears Mode 00 Output preset Capture on falling edge only Input capture 11 01 Output compare 10 ...

Page 148

... NOTE NOTE Figure 9-11 shows, the CHxMAX bit takes effect in the cycle OVERFLOW OVERFLOW OUTPUT OUTPUT COMPARE COMPARE Figure 9-11. CHxMAX Latency MC68HC908AP Family Data Sheet, Rev. 4 OVERFLOW OVERFLOW OUTPUT COMPARE Freescale Semiconductor ...

Page 149

... Address: T1CH1H, $0029 and T2CH1H, $0034 Bit 7 Read: Bit 15 Write: Reset: Figure 9-14. TIM Channel 1 Register High (TCH1H) Address: T1CH1L, $002A and T2CH1L, $0035 Bit 7 Read: Bit 7 Write: Reset: Figure 9-15. TIM Channel 1 Register Low (TCH1L) Freescale Semiconductor Indeterminate after reset ...

Page 150

... Timer Interface Module (TIM) 150 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 151

... TACK bit. The first time the TBIF flag is set after enabling the timebase module, the interrupt is generated at approximately half of the overflow period. Subsequent events occur at the exact period. The reference clock OSCCLK is derived from the oscillator module, see Selection. Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 Figure 10-1, starts counting 5 ...

Page 152

... Figure 10-1. Timebase Block Diagram TBR2 TBR1 TBR0 TACK Unimplemented R MC68HC908AP Family Data Sheet, Rev. 4 ÷ 2 ÷ 2 ÷ 2 ÷ 2048 TBMINT TBIF SEL Bit 0 TBIE TBON Reserved Freescale Semiconductor TBON TBIE ...

Page 153

... This read/write bit enables the timebase. Timebase may be turned off to reduce power consumption when its function is not necessary. The counter can be initialized by clearing and then setting this bit. Reset clears the TBON bit Timebase enabled 0 = Timebase disabled and the counter initialized to 0’s Freescale Semiconductor NOTE Timebase Interrupt Rate TBR0 Divider ...

Page 154

... In stop mode the timebase register is not accessible by the CPU. If the timebase functions are not required during stop mode, reduce the power consumption by stopping the timebase before enabling the STOP instruction. 154 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 155

... Noise error – Framing error – Parity error • Receiver framing error detection • Hardware parity checking • 1/16 bit-time noise detection • Configuration register bit, SCIBDSRC, to allow selection of baud rate clock source Freescale Semiconductor NOTE MC68HC908AP Family Data Sheet, Rev. 4 155 ...

Page 156

... Figure 11-1. SCI I/O Register Summary MC68HC908AP Family Data Sheet, Rev. 4 shows the full names and the generic TxD PTB2/TxD WAKE ILTY PEN ILIE TE RE RWU ORIE NEIE FEIE IDLE BKF Unaffected by reset SCP0 R SCR2 SCR1 Unaffected Freescale Semiconductor Bit 0 PTY 0 SBK 0 PEIE RPF SCR0 0 ...

Page 157

... RE RWU SBK WAKEUP CONTROL SCIBDSRC FROM CONFIG SL CGMXCLK A ÷ BUS CLOCK => => CGMXCLK is from CGM module Freescale Semiconductor INTERNAL BUS SCTE TC SCRF IDLE LOOPS RECEIVE CONTROL BKF ENSCI RPF PRE- BAUD SCALER DIVIDER ÷ 16 Figure 11-2. SCI Module Block Diagram MC68HC908AP Family Data Sheet, Rev. 4 ...

Page 158

... MC68HC908AP Family Data Sheet, Rev. 4 Figure 11-3. NEXT BIT START STOP BIT BIT 7 BIT PARITY NEXT BIT START BIT 7 BIT 8 STOP BIT BIT INTERNAL BUS SCI DATA REGISTER 11-BIT TRANSMIT SHIFT REGISTER TRANSMITTER CONTROL LOGIC SCTE SBK LOOPS SCTIE ENSCI TC TE TCIE Freescale Semiconductor TxD ...

Page 159

... Clears the SCI data register (SCDR) • Clears the R8 bit in SCC3 • Sets the break flag bit (BKF) in SCS2 • May set the overrun (OR), noise flag (NF), parity error (PE), or reception in progress flag (RPF) bits Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 Functional Description 159 ...

Page 160

... After a complete character shifts into the receive shift register, the data portion of the character transfers to the SCDR. The SCI receiver full bit, SCRF, in SCI status register 1 (SCS1) becomes set, indicating that 160 NOTE 1.) MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 161

... SCP0 SL CGMXCLK A PRE- ÷ BUS CLOCK SCALER => => BKF RPF WAKE ILTY PEN PTY Figure 11-5. SCI Receiver Block Diagram Freescale Semiconductor INTERNAL BUS SCR1 SCR2 SCR0 BAUD ÷ 16 DIVIDER DATA RxD RECOVERY ALL 0s M WAKEUP LOGIC PARITY CHECKING IDLE ILIE ...

Page 162

... QUALIFICATION VERIFICATION SAMPLING Figure 11-6. Receiver Data Sampling Table 11-2. Start Bit Verification Start Bit Samples Verification 000 Yes 001 Yes 010 Yes 011 No 100 Yes 101 No 110 No 111 No MC68HC908AP Family Data Sheet, Rev. 4 LSB DATA Noise Flag Freescale Semiconductor ...

Page 163

... To verify a stop bit and to detect noise, recovery logic takes samples at RT8, RT9, and RT10. summarizes the results of the stop bit samples. RT8, RT9, and RT10 Freescale Semiconductor Table 11-3. Data Bit Recovery Data Bit Samples ...

Page 164

... DATA SAMPLES Figure 11-7. Slow Data Figure 11-7, the receiver counts 154 RT cycles at the point when 154 147 – × 100 = 4.54% ------------------------- - 154 Figure 11-7, the receiver counts 170 RT cycles at the point when MC68HC908AP Family Data Sheet, Rev. 4 STOP Freescale Semiconductor ...

Page 165

... So that the MCU can ignore transmissions intended only for other receivers in multiple-receiver systems, the receiver can be put into a standby state. Setting the receiver wakeup bit, RWU, in SCC2 puts the receiver into a standby state during which receiver interrupts are disabled. Freescale Semiconductor 170 163 – ...

Page 166

... Parity error (PE) — The PE bit in SCS1 is set when the SCI detects a parity error in incoming data. The parity error interrupt enable bit, PEIE, in SCC3 enables PE to generate SCI error CPU interrupt requests. 166 NOTE MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 167

... When the SCI is enabled (ENSCI=1), the PTB2/TxD pin becomes the serial data output, TxD, from the SCI transmitter regardless of the state of the DDRB2 bit in data direction register B (DDRB). The TxD pin is an open-drain output and requires a pullup resistor to be connected for proper SCI operation. Freescale Semiconductor for information on exiting wait mode. for information on exiting stop mode. ...

Page 168

... SCI control register 2 (SCC2) • SCI control register 3 (SCC3) • SCI status register 1 (SCS1) • SCI status register 2 (SCS2) • SCI data register (SCDR) • SCI baud rate register (SCBR) 168 NOTE NOTE MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 169

... M — Mode (Character Length) Bit This read/write bit determines whether SCI characters are eight or nine bits long. (See The ninth bit can serve as an extra stop bit receiver wakeup signal parity bit. Reset clears the M bit 9-bit SCI characters 0 = 8-bit SCI characters Freescale Semiconductor ENSCI ...

Page 170

... Odd 1 8 Even 1 8 Odd MC68HC908AP Family Data Sheet, Rev. 4 11-5.) When enabled, the parity function 11-3.) Reset clears the PEN bit. Stop Character Bits Length 1 10 bits 1 11 bits 1 10 bits 1 10 bits 1 11 bits 1 11 bits Freescale Semiconductor ...

Page 171

... ILIE — Idle Line Interrupt Enable Bit This read/write bit enables the IDLE bit to generate SCI receiver CPU interrupt requests. Reset clears the ILIE bit IDLE enabled to generate CPU interrupt requests 0 = IDLE not enabled to generate CPU interrupt requests Freescale Semiconductor TCIE ...

Page 172

... No break characters being transmitted Do not toggle the SBK bit immediately after setting the SCTE bit. Toggling SBK before the preamble begins causes the SCI to send a break character instead of a preamble. 172 NOTE NOTE NOTE MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 173

... SCTE DMA service requests disabled; SCTE CPU interrupt requests enabled ORIE — Receiver Overrun Interrupt Enable Bit This read/write bit enables SCI error CPU interrupt requests generated by the receiver overrun bit, OR SCI error CPU interrupt requests from OR bit enabled 0 = SCI error CPU interrupt requests from OR bit disabled Freescale Semiconductor ...

Page 174

... SCS1 with SCTE set and then writing to SCDR. Reset sets the SCTE bit SCDR data transferred to transmit shift register 0 = SCDR data not transferred to transmit shift register 174 11.8.4 SCI Status Register SCRF IDLE Unimplemented MC68HC908AP Family Data Sheet, Rev. 4 1.) Reset clears PEIE Bit Freescale Semiconductor ...

Page 175

... This clearable, read-only bit is set when the SCI detects noise on the RxD pin. NF generates an SCI error CPU interrupt request if the NEIE bit in SCC3 is also set. Clear the NF bit by reading SCS1 and then reading the SCDR. Reset clears the NF bit Noise detected noise detected Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 I/O Registers 175 ...

Page 176

... READ SCDR BYTE 2 DELAYED FLAG CLEARING SEQUENCE BYTE 2 BYTE 3 READ SCS1 SCRF = READ SCDR BYTE 1 Figure 11-13. Flag Clearing Sequence MC68HC908AP Family Data Sheet, Rev. 4 BYTE 4 READ SCS1 SCRF = READ SCDR BYTE 3 BYTE 4 READ SCS1 SCRF = READ SCDR BYTE 3 Freescale Semiconductor ...

Page 177

... Reset: R7/T7–R0/T0 — Receive/Transmit Data Bits Reading the SCDR accesses the read-only received data bits, R7–R0. Writing to the SCDR writes the data to be transmitted, T7–T0. Reset has no effect on the SCDR. Do not use read/modify/write instructions on the SCI data register. Freescale Semiconductor ...

Page 178

... Table 11-7. SCI Baud Rate Selection Baud Rate Divisor (BD) 000 001 010 011 100 101 110 111 SCI clock source baud rate = -------------------------------------------- - × × MC68HC908AP Family Data Sheet, Rev Bit 0 SCR2 SCR1 SCR0 Reserved Table 11-6. Reset clears SCP1 Table 11-7. Reset clears 128 Freescale Semiconductor ...

Page 179

... Freescale Semiconductor SCR2, SCR1, and SCR0 Divisor (BD) 000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111 MC68HC908AP Family Data Sheet, Rev. 4 ...

Page 180

... Serial Communications Interface Module (SCI) 180 MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 181

... Features of the infrared (IR) sub-module include the following: • IR sub-module enable/disable for infrared SCI or conventional SCI on SCTxD and SCRxD pins • Software selectable infrared modulation/demodulation (3/16, 1/16 or 1/32 width pulses) Freescale Semiconductor NOTE MC68HC908AP Family Data Sheet, Rev. 4 181 ...

Page 182

... CKS SCP1 SCP0 Unimplemented R = Reserved MC68HC908AP Family Data Sheet, Rev. 4 shows the full names and the generic TxD PTC6/SCTxD WAKE ILTY PEN RWU ORIE NEIE FEIE BKF SCR2 SCR1 TNP1 TNP0 Unaffected Freescale Semiconductor Bit 0 PTY 0 SBK 0 PEIE RPF SCR0 0 IREN 0 ...

Page 183

... When receiving data, the infrared pulses should be detected using an infrared photo diode for conversion to CMOS voltage levels before connecting to the RxD pin for the infrared decoder. The SCI data stream is reconstructed by stretching the "0" pulses. Freescale Semiconductor INTERNAL BUS SCI_TxD SERIAL ...

Page 184

... IR_RxD remains "1". 184 TNP[1:0] TRANSMIT ENCODER IR_RxD RECEIVE DECODER MUX DATA BIT WIDTH DETERMINED BY BAUD RATE Figure 12-4. Infrared SCI Data Example MC68HC908AP Family Data Sheet, Rev. 4 IREN IR_TxD SCTxD MUX SCRxD Freescale Semiconductor ...

Page 185

... SCTE RE TC RWU SCRF SBK IDLE WAKEUP CONTROL CKS SL CGMXCLK A X BUS CLOCK => => SCI_R32XCLK SCI_R16XCLK Freescale Semiconductor INTERNAL BUS LOOPS RECEIVE FLAG CONTROL CONTROL BKF ENSCI RPF BAUD RATE GENERATOR DATA SELECTION ÷16 CONTROL Figure 12-5. SCI Module Block Diagram MC68HC908AP Family Data Sheet, Rev ...

Page 186

... DATA FORMAT BIT M IN IRSCC1 SET BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 Figure 12-6. SCI Data Formats MC68HC908AP Family Data Sheet, Rev. 4 Figure 12-6. NEXT BIT START STOP BIT 7 BIT BIT PARITY NEXT BIT START BIT 7 BIT 8 STOP BIT BIT Freescale Semiconductor ...

Page 187

... After the preamble shifts out, control logic transfers the IRSCDR data into the transmit shift register. A logic 0 start bit automatically goes into the least significant bit position of the transmit shift register. A logic 1 stop bit goes into the most significant bit position. Freescale Semiconductor BAUD ÷ 16 ...

Page 188

... Toggle the TE bit for a queued idle character when the SCTE bit becomes set and just before writing the next byte to the IRSCDR. 12.5.2.5 Transmitter Interrupts The following conditions can generate CPU interrupt requests from the SCI transmitter: 188 NOTE MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 189

... IRSCDR are empty and that no break or idle character has been generated. The transmission complete interrupt enable bit, TCIE, in IRSCC2 enables the TC bit to generate transmitter CPU interrupt requests. 12.5.3 Receiver Figure 12-8 shows the structure of the SCI receiver. Freescale Semiconductor MC68HC908AP Family Data Sheet, Rev. 4 SCI Functional Description 189 ...

Page 190

... WAKEUP LOGIC PARITY CHECKING IDLE ILIE DMARE SCRF SCRIE DMARE SCRF SCRIE DMARE OR ORIE NF NEIE FE FEIE PE PEIE MC68HC908AP Family Data Sheet, Rev. 4 SCI DATA REGISTER 11-BIT RECEIVE SHIFT REGISTER SCRF IDLE R8 ILIE SCRIE DMARE OR ORIE NF NEIE FE FEIE PE PEIE Freescale Semiconductor RWU ...

Page 191

... When the falling edge of a possible start bit occurs, the RT clock begins to count to 16. To verify the start bit and to detect noise, data recovery logic takes samples at RT3, RT5, and RT7. Table 12-2 summarizes the results of the start bit verification samples. RT3, RT5, and RT7 Freescale Semiconductor START BIT START BIT START BIT QUALIFICATION ...

Page 192

... Determination 000 0 001 0 010 0 011 1 100 0 101 1 110 1 111 1 NOTE Table 12-4. Stop Bit Recovery RT8, RT9, and RT10 Framing Samples Error Flag 000 1 001 1 MC68HC908AP Family Data Sheet, Rev. 4 Noise Flag Noise Flag Table 12-4 Noise Flag 0 1 Freescale Semiconductor ...

Page 193

... For an 8-bit character, data sampling of the stop bit takes the receiver 9 bit times × cycles + 10 RT cycles = 154 RT cycles. With the misaligned character shown in the count of the transmitting device is 9 bit times × cycles + 3 RT cycles = 147 RT cycles. Freescale Semiconductor Table 12-4. Stop Bit Recovery RT8, RT9, and RT10 Framing ...

Page 194

... DATA SAMPLES Figure 12-11. Fast Data Figure 12-11, the receiver counts 154 RT cycles at the point when ˙ 154 160 – × 100 = 3.90% ------------------------- - 154 Figure 12-11, the receiver counts 170 RT cycles at the point when MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 195

... Noise flag (NF) — The NF bit is set when the SCI detects noise on incoming data or break characters, including start, data, and stop bits. The noise error interrupt enable bit, NEIE, in IRSCC3 enables NF to generate SCI error CPU interrupt requests. Freescale Semiconductor 170 176 – ...

Page 196

... I/O Signals The two IRSCI I/O pins are: • PTC6/SCTxD — Transmit data • PTC7/SCRxD — Receive data 196 for information on exiting wait mode. for information on exiting stop mode. MC68HC908AP Family Data Sheet, Rev. 4 Freescale Semiconductor ...

Page 197

... X 1. After completion of transmission in progress. 12.9 I/O Registers The following I/O registers control and monitor SCI operation: • IRSCI control register 1 (IRSCC1) • IRSCI control register 2 (IRSCC2) • IRSCI control register 3 (IRSCC3) Freescale Semiconductor NOTE NOTE IRSCC2 TxD Pin [RE] (1) 0 Hi-Z (1) ...

Page 198

... This read/write bit enables the SCI and the SCI baud rate generator. Clearing ENSCI sets the SCTE and TC bits in SCI status register 1 and disables transmitter interrupts. Reset clears the ENSCI bit SCI enabled 0 = SCI disabled 198 ENSCI M WAKE MC68HC908AP Family Data Sheet, Rev Bit 0 ILTY PEN PTY Freescale Semiconductor ...

Page 199

... Odd parity 0 = Even parity Changing the PTY bit in the middle of a transmission or reception can generate a parity error. Control Bits M PEN:PTY Freescale Semiconductor Table Figure NOTE Table 12-6. Character Format Selection Character Format Start Data Parity Bits Bits 1 8 None 1 9 None 1 7 ...

Page 200

... TxD returns to the idle condition (logic 1). Clearing and then setting TE during a transmission queues an idle character to be sent after the character currently being transmitted. Reset clears the TE bit Transmitter enabled 0 = Transmitter disabled 200 TCIE SCRIE ILIE MC68HC908AP Family Data Sheet, Rev Bit 0 RE RWU SBK Freescale Semiconductor ...

Related keywords