8XC196MC, 8XC196MD, 8XC196MH Microcontroller User’ Manual
We Value Your Opinion
Page
8XC196MC, 8XC196MD, 8XC196MH Microcontroller User’s Manual
Intel Corporation
Contents
Chapter Memory Partitions
Contents
8XC196MC, MD, MH USER’S Manual
Functional Overview Programming the Frequency Generator
PWM Signals and Registers
Application Example
Programming the Waveform Generator
Chapter Event Processor Array EPA
Chapter Minimum Hardware Considerations
Chapter Programming the Nonvolatile Memory
Appendix C Registers Glossary Index
Figures
10-5
15-9 Ready Timing Diagram One Wait State 8XC196MH
15-21
Tables
11-12
16-7 Pmode Values
Guide to This Manual
Page
Chapter Guide to this Manual
Manual Contents
Special Operating Modes
Assert and deassert
Notational Conventions and Terminology
Numbers
Related Documents
Application Notes, Application Briefs, and Article Reprints
Handbooks and Product Information
Title Order Number
MCS 96 Microcontroller Datasheets Automotive
MCS 96 Microcontroller Datasheets Commercial/Express
This Page Left Intentionally Blank
Guide to this Manual
This Page Left Intentionally Blank
Technical Support
World Wide Web
Product Literature
Page
Architectural Overview
Page
Typical Applications
Microcontroller Features
Functional Overview
Features of the 8XC196Mx Product Family
Otprom
SIO PWM
PTS EPA PWM WDT SIO
ROM
CPU
RAM
Register File
CPU Control
Register Arithmetic-logic Unit Ralu
Instruction Format
Code Execution
Memory Interface Unit
Interrupt Service
Clock Circuitry
Internal Timing
State Times at Various Frequencies
Internal Peripherals
Serial I/O SIO Port
1 I/O Ports
Pulse-width Modulator PWM
Event Processor Array EPA and Timer/Counters
Frequency Generator
Waveform Generator
Reducing Power Consumption
Watchdog Timer
Testing the Printed Circuit Board
Analog-to-digital Converter
Programming the Nonvolatile Memory
Programming Considerations
Page
Operand Type Definitions
Overview of the Instruction SET
Operand Type No. Signed Possible Values Addressing
Restrictions
Byte Operands
BIT Operands
SHORT-INTEGER Operands
Word Operands
DOUBLE-WORD Operands
Integer Operands
Converting Operands
LONG-INTEGER Operands
Conditional Jumps
Floating Point Operations
Addressing Modes
Immediate Addressing
Direct Addressing
Indirect Addressing
Definition of Temporary Registers
Indirect Addressing with Autoincrement
Indexed Addressing
Indirect Addressing with the Stack Pointer
Short-indexed Addressing
Zero-indexed Addressing
Long-indexed Addressing
Using Registers
Assembly Language Addressing Mode Selections
Software Standards and Conventions
Linking Subroutines
Addressing 32-bit Operands
Software Protection Features and Guidelines
8XC196MC, MD, MH USER’S Manual
Memory Partitions
Page
External Devices Memory or I/O
Memory Partitions
Program and Special-purpose Memory
Memory Map
Program Memory
Device
Description Addressing Modes
Special-purpose Memory Addresses
Special-purpose Memory
Reserved Memory Locations
Interrupt and PTS Vectors
Special-function Registers SFRs
Chip Configuration Bytes CCBs
Security Key
Peripheral SFRs
Memory-mapped SFRs
Peripheral SFRs 8XC196MC
EPA and Timer SFRs
Port 2 SFRs
SFRs
Ports 2 and 7 SFRs
Peripheral SFRs 8XC196MD
Port 0 and 2 SFRs
Peripheral SFRs 8XC196MH
Port 1 SFRs
Serial I/O Port SFRs
Address
Register File Memory Map
General-purpose Register RAM
Register File Memory Addresses
Stack Pointer SP
Device and Hex Address Range Description Addressing Modes
CPU SFRs
CPU Special-function Registers SFRs
Address High Odd Byte Low Even Byte
8XC196MC,MD
Windowing
02FFH 01FFH
00FFH
WSR
Selecting a Window
Bit Function Number
WSR Value for Peripherals
10. Selecting a Window of the Upper Register File
Addressing a Location Through a Window
12. Windowed Base Addresses
11. Windows
Base WSR Value WSR Value for
Peripheral SFRs
2.2 64-byte Windowing Example
2.1 32-byte Windowing Example
2.3 128-byte Windowing Example
Unsupported Locations Windowing Example
?WSR
Using the Linker Locator to Set Up a Window
This listing shows the disassembled code
LDB WSR, #12H
Windowing and Addressing Modes
Page
Standard and PTS Interrupts
Page
Overview of Interrupts
Chapter Standard and PTS Interrupts
Flow Diagram for PTS and Standard Interrupts
Interrupt Signals
Interrupt Signals and Registers
Interrupt and PTS Control and Status Registers
Pipend 1FBEH
Interrupt Sources and Priorities
Ptssel
Ptssrv
Interrupt Sources, Vectors, and Priorities
Interrupt Controller PTS Service
Interrupt Source Mnemonic Name Vector Priority
External Interrupt Pin
Special Interrupts
Unimplemented Opcode
Software Trap
Waveform Generator Protection Circuitry
Multiplexed Interrupt Sources
Flow Diagram for the Ovrtm Interrupt
Interrupt Latency
End-of-PTS Interrupts
Situations that Increase Interrupt Latency
Standard Interrupt Latency
Calculating Latency
Standard Interrupt Response Time PTS Interrupt Latency
Programming the Interrupts
PTS Mode Execution Time in State Times
Execution Times for PTS Cycles
Standard and PTS Interrupts
8XC196MC
Ptssel
8XC196MD
Bit Function
COMP2 EPA2 COMP1 EPA1 COMP3 COMP0 EPA0 Ovrtm
Intmask
Bit Mnemonic Interrupt Standard Vector
COMP2 MC, MD
NMI Extint
INTMASK1
NMI Extint EPA5
NMI Extint SPI COMP3 EPA3 COMP4 EPA4 RI1 RI0 TI1 TI0
8XC196MC 8XC196MD
Pimask
Bit Function Number Mnemonic
Pimask
Modifying Interrupt Priorities
OVRTM1
Standard and PTS Interrupts
Determining the Source of an Interrupt
Intpend
10. Interrupt Pending Intpend Register
INTPEND1
11. Interrupt Pending 1 INTPEND1 Register
Pipend
12. Peripheral Interrupt Pending Pipend Register
Pipend
Initializing the PTS Control Blocks
Specifying the PTS Count
Ptssrv
14. PTS Service Ptssrv Register
Single Transfer Mode
Selecting the PTS Mode
Ptscon
Ptsdst H Ptsdst L Ptssrc H Ptssrc L Ptscon Ptscount
PTS Single Transfer Mode Control Block
Register Location Function
Ptsdst Ptscb +
Standard and PTS Interrupts
Single Transfer Mode Ptscb
Block Transfer Mode
Block Transfer Mode Ptscb
Ptsblock Ptscb +
PTS Block Transfer Mode Control Block
5 A/D Scan Mode
PTS A/D Scan Mode Control Block
Address Contents
A/D Scan Mode Command/Data Table
5.2 A/D Scan Mode Example
5.1 A/D Scan Mode Cycles
A/D Scan Mode Ptscb Example
Command/Data Table Example
PTSPTR2 H = 1FH PTSPTR2 L = AAH
Ptscount = 04H
10. Command/Data Table Example
5.3 A/D Scan Mode Example
11. A/D Scan Mode Ptscb Example
Serial I/O Modes
SA1 SA0 MAJ
PTS Serial I/O Mode Control Block 1 8XC196MC, MD
Ptsvec
Epareg
Baud
SA1
SA0 †
8XC196MC, MD, MH USER’S Manual
Port Mask Register
PTS Serial I/O Mode Control Block 2 8XC196MC, MD
Port Address Pointer high byte
PTSCON1
Data
Rpar
8XC196MC, MD Register Location Function
PTS Serial I/O Mode Control Block
Portreg
8XC196MC, MD, MH USER’S Manual
PTSCB1 PTSCB2
13. Ssio Transmit Mode PTSCBs
Txddone =
23. Synchronous SIO Receive Timing
Synchronous SIO Receive Mode Example
Clrb Rxddone
14. Ssio Receive Mode PTSCBs
Standard and PTS Interrupts
Rxddone =
25. Asynchronous SIO Transmit Timing
15. Asio Transmit Mode PTSCBs
Standard and PTS Interrupts
End-Of-PTS Interrupt Save Critical Data Is PTS
27. Asynchronous SIO Receive Timing
Asynchronous SIO Receive Mode Example
Samptime = 01H
16. Asio Receive Mode PTSCBs
Portreg H = 1FH P2PIN
Standard and PTS Interrupts
End-Of-PTS Interrupt
Ports
Page
Device I/O Ports
I/O Ports Overview
Port Bits Type Direction Associated Peripherals
INPUT-ONLY Ports 1 MC, MD only
Standard Input-only Port Pins
Input-only Port Registers
Standard Input-only Port Operation
1FDAH MH
P1PIN MC, MD
Bidirectional Ports 1 MH ONLY, 2, 5, and 7 MD only
Standard Input-only Port Considerations
Port Pin Special-function Associated Signals
Bidirectional Port Pins
Bidirectional Port Control and Status Registers
Bidirectional Port Operation
Ports
Bidirectional Port Structure
Logic Table for Bidirectional Ports in I/O Mode
Bidirectional Port Pin Configurations
Sfdir
8XC196MC, MD, MH USER’S Manual
Control Register Values for Each Configuration
Bidirectional Port Pin Configuration Example
Port Configuration Example
HZ1
Bidirectional Port Considerations
P5.1/INST
Port Pins Special-function
Ports 3 and 4 Pins
Bidirectional Ports 3 and 4 ADDRESS/DATA BUS
12. Ports 3 and 4 Control and Status Registers
Address/Data Bus Ports 3 and 4 Structure
Bidirectional Ports 3 and 4 Address/Data Bus Operation
Design Considerations for Ports 3
Using Ports 3 and 4 as I/O
Standard OUTPUT-ONLY Port
13. Logic Table for Ports 3 and 4 as Open-drain I/O
14. Standard Output-only Port Pins
Configuring Output-only Port Pins
Output-only Port Operation
15. Output-only Port Control Register
Wgoutput Port Address
Reset State 0000H
1FC0H
OP1 OP0
Wgoutput Port
Reset State 0000H
Page
Serial I/O SIO Port
Page
Serial I/O SIO Port Functional Overview
SIO Block Diagram
Serial Port Signals
Serial I/O Port Signals and Registers
Serial Port Control and Status Registers
P1PIN 1F9FH
P1DIR 1F9BH
P1REG 1F9DH
Serial Port Modes
Mode
Synchronous Modes Modes 0
Mode 0 Timing
Asynchronous Modes Modes 1, 2,
Serial Port Frames for Mode
Multiprocessor Communications
Mode 2 and 3 Timings
Programming the Serial Port
Configuring the Serial Port Pins
Programming the Control Register
SP xCON Address 1F83H, 1F8BH = 0-1 8XC196MH
Bit Function
Clksrc
Programming the Baud Rate and Clock Source
BV7
BV9 BV8
Bclk
Baudvalue =
Enabling the Serial Port Interrupts
SPxBAUD Values When Using XTAL1 at 16 MHz
80CFH
E82BH
RPE/RB8 TXE
Determining Serial Port Status
RPE/RB8
8XC196MC, MD, MH USER’S Manual
Frequency Generator
Page
Chapter Frequency Generator
Frequency Generator Control and Status Registers
Frequency Generator Signal
Port Frequency
Programming the Frequency Generator
Configuring the Output
Programming the Frequency
Freqgen
Application Example
Determining the Current Value of the Down-counter
Freqcnt
Frequency Generator
0FAH
Xmitbuf Dsb Bufsize Block of data to send Shiftreg
Stb temp,freqgen0 Into freq gen
Frequency Generator
Page
Waveform Generator
Page
Waveform Generator Functional Overview
Chapter Waveform Generator
Waveform Generator Block Diagram
Waveform Generator Signals
Waveform Generator Signals and Registers
Waveform Generator Control and Status Registers
Timebase Generator
Waveform Generator Operation
Control and Protection Circuitry
Phase Driver Channels
Protection Circuitry
Register Buffering and Synchronization
Operating Modes
Event Mode
Register Updates
Operation in Center-aligned and Edge-aligned Modes
Step Center-aligned Modes Edge-aligned Modes
Center-aligned Modes Counter Operation
Center-aligned Modes
Center-aligned Modes Output Operation Edge-Aligned Modes
Edge-aligned Modes Counter Operation
Output Configuration
Configuring the Outputs
Programming the Waveform Generator
OP1 OP0 Sync PE7
Wgoutput Waveform Generator
PE6
OP1
8XC196MC, MD, MH USER’S Manual
F0H
Wgprotect
E0H
8XC196MC, MD 8XC196MH Bit Function Number Mnemonic
Wgreload
Specifying the Carrier Period and Duty Cycle
Reload
150 Reload
1FC2H,1FC4H,1FC6H
Wgcomp Address
DT7 DT6 DT5 DT4 DT9 DT8 DT3 DT2 DT1 DT0
Wgcontrol
Wgcounter = Wgreload
Enabling the Waveform Generator Interrupts
Determining the Waveform GENERATOR’S Status
Wgcounter
Xxxxh
Dead Time and Duty Cycle
Design Considerations
Wgcount WGCOUNT=
Wgcomp
Programming Example
Ph3 Dsw P6.4,5 config
Waveform Generator
Temp1,WGOUTPUT0 Now store it Ret
Demo board PI interrupt
Page
Pulse-width Modulator
Page
PWM Functional Overview
Chapter PULSE-WIDTH Modulator
PWM Signals
PWM Signals and Registers
PWM Control and Status Registers
PWM Operation
PEx Pin Output
E6H
Programming the Frequency and Period
FFH
Pwmperiod
PWM Output Frequencies Fpwm
Pwmperiod +
Programming the Duty Cycle
Reading the Current Value of the Down-counter
Sample Calculations
PWM xCONTROL Address 10-3
Enabling the PWM Outputs
PWM Output Alternate Port Function PWM Output Enabled When
PWM Output Alternate Functions
Pwmcount
Waveform Generator Output Configuration Wgoutput Register
Generating Analog Outputs
D/A Buffer Block Diagram
Event Processor Array EPA
Page
EPA Channels
EPA Functional Overview
Device Capture/Compare Channels Compare-only Channels
COMP30
EPA and Timer/Counter Signals
EPA and TIMER/COUNTER Signals and Registers
EPA Control and Status Registers
P1PIN 1FA9H
P0PIN 1FA8H
TIMER1 1F7AH
TIMER/COUNTER Functional Overview
TIMER2 1F7EH
T1RELOAD
EPA Timer/Counters
Quadrature Clocking Modes
Cascade Mode Timer 2 Only
T1DIR
State of Xinternal State of Yinternal Count Direction
EPA Channel Functional Overview
Quadrature Mode Timing and Count
A Single EPA Capture/Compare Channel
Operating in Capture Mode
EPA Simplified Input-capture Structure
Overwrite Bit Status Action Taken When a Valid Edge Occurs
Action Taken When a Valid Edge Occurs
EPA Overruns
EPAxCON.0
Preventing EPA Overruns
Operating in Compare Mode
Generating a Low-speed PWM Output
Generating the Highest-speed PWM Output
Configuring the EPA and Timer/Counter Signals
Programming the EPA and TIMER/COUNTERS
Programming the Timers
T1CONTROL
Prescaler Divisor Resolution †
Clock Source Direction Source
T2CONTROL
Prescaler Resolution †
Mode WGR ROT ON/RT
Example EPA Control Register Settings for Channels 1, 3, or
Programming the Capture/Compare Channels
Compare Mode Action
Capture Mode Event
EPAxCON = 0-1 8XC196MH x = 0-3 8XC196MC x = 0-5 8XC196MD
= 0, 2 = 1, 3
= 0, 2
EPA xCON Address
For EPA capture/compare channels 0, 2
For EPA capture/compare channels 1, 3
Compare Mode RT
Capture Mode on
Programming the Compare-only Channels
= 0-3 8XC196MC, MH = 0-5 8XC196MD Reset State 00H
Comp xCON Address
WGR ROT
Enabling the EPA Interrupts
Determining Event Status
Analog-to-digital Converter
PageNum-38
Angnd
12.1 A/D Converter Functional Overview
A/D Converter Pins
12.2 A/D Converter Signals and Registers
Port Pin Signal Description
A/D Control and Status Registers
P1PIN MC,MD
12.3 A/D Converter Operation
Programming the A/D Converter
Adtest
Programming the A/D Test Register
OFF1 OFF0
Adresult Write
Programming the A/D Time Register
Adtime
Programming the A/D Command Register
M1 M0 Mode
Adcommand
Enabling the A/D Interrupt
ACH3 ACH2 ACH1 ACH0
Adresult Read
Determining A/D Status and Conversion Results
ADRLT90
Idealized A/D Sampling Circuitry
Designing External Interface Circuitry
Minimizing the Effect of High Input Source Resistance
Suggested A/D Input Circuit
Using Mixed Analog and Digital Inputs
Understanding A/D Conversion Errors
12-14
Ideal A/D Conversion Characteristic
10. Actual and Ideal A/D Conversion Characteristics
12-17
11. Terminal-based A/D Conversion Characteristic
Minimum Hardware Considerations
Page
RESET#
Minimum Required Signals
Minimum Connections
Port Where to Find Configuration Information
I/O Port Configuration Guide
Unused Inputs
13.1.2 I/O Port Pin Connections
Minimum Hardware Connections
Noise Protection Tips
Applying and Removing Power
On-chip Oscillator Circuit
ON-CHIP Oscillator Circuitry
External Crystal Connections
External Clock Connections
Using AN External Clock Source
Reset Timing Sequence
Resetting the Device
Rsts DR0
Gencon
Rsts
DRO
Internal Reset Circuitry
Generating an External Reset
10. Minimum Reset Circuit
Enabling the Watchdog Timer
Issuing the Reset RST Instruction
Issuing an Illegal Idlpd Key Operand
Generating Wait States
First Byte Second Byte Reset Interval
Selecting the Watchdog Reset Interval 8XC196MH only
1EH E1H
1EH A1H
Page
Special Operating Modes
Page
Operating Mode Control Signals
Special Operating Mode Signals and Registers
Port Pin Signal Type Description
Clkout
Port Pin Signal Type Description Name
Operating Mode Control and Status Registers
ONCE#
CCR0
P1MODEMH
Reducing Power Consumption
P7MODEMD 1FD1H
P1REG MH 1F9DH
Clock Control During Power-saving Modes
Idle Mode
Enabling and Disabling Powerdown Mode
Powerdown Mode
Exiting Powerdown Mode
Entering Powerdown Mode
Generating a Hardware Reset
Driving the VPP Pin Low
Asserting the External Interrupt Signal
Selecting R1 and C1
External RC Circuit
Typical Voltage on the VPP Pin While Exiting Powerdown
Once Mode
Reserved Test Modes
Page
Interfacing with External Memory
Page
External Memory Interface Signals
External Memory Interface Signals and Registers
Signal Port Pin Type Description Name
ADV#
BHE# AD0
Bytes Accessed
CCR0.1
CCR1.2 Buswidth
EA#
Signal Port Pin
WR#
WRH#
External Memory Interface Registers
WRL#
Register Address Description Mnemonic
P5REG = 11XX Xxxxb
Chip Configuration Registers and Chip Configuration Bytes
BHE#/WRH# †
15-6
LOC1 LOC0 IRC1 IRC0 ALE BW0
CCR0
LOC1 LOC0
IRC2 IRC1 IRC0
ALE
CCR0
BW1 BW0
WDE BW1 IRC2
CCR1
WDE
CCR1
BUS Width and Multiplexing
Multiplexing and Bus Width Options
Buswidth Timing Diagram 8XC196MC, MD
Symbol Definition
Buswidth Signal Timing Definitions
Timing Requirements for Buswidth
15.3.2 16-bit Bus Timings
Timings for 16-bit Buses
15.3.3 8-bit Bus Timings
Timings for 8-bit Buses
Wait States Ready Control
15-18
Ready Timing Diagram One Wait State 8XC196MC, MD
Address Valid to Ready Setup
BUS-CONTROL Modes
Bus-control Mode Bus-control Signals CCR0.3 CCR0.2
Bus-control Modes
BHE# WR# AD0
Standard Bus-control Mode
ALE OE# WE# RD# WR#
CS#
Eprom RAM
Buswidth CS#
OE# WE# RD# WR#
14. Write Strobe Mode
Write Strobe Mode
OE# OE# WE# RD# WRH# WRL#
15 -bit System with Writes to Byte-wide RAMs
16. Address Valid Strobe Mode
Address Valid Strobe Mode
18 -bit System with Flash
OE# RD#
Eprom
20. Timings of Address Valid with Write Strobe Mode
Address Valid with Write Strobe Mode
VCC Buswidth
System BUS AC Timing Specifications
WRH# WRL# CS#
WE# CS#
22. System Bus Timing
AC Timing Symbol Definitions Signals
Explanation of AC Symbols
External Memory Systems Must Meet These Specifications
AC Timing Definitions
Address Setup to ALE/ADV# Low
Microcontroller Meets These Specifications
15-35
Page
Programming Nonvolatile Memory
Page
Programming Methods
Programming the Nonvolatile Memory
Otprom Memory MAP
Controlling Access to Internal Memory
Security Features
C196Mx Otprom Memory Map
Address Range Description Hex
Memory Protection for Normal Operating Mode
Controlling Access to the Otprom During Normal Operation
Controlling Access to the Otprom During Programming Modes
Read Protect Write Protect Protection Status
Security Key
Memory Protection Options for Programming Modes
Pccb CCB
Controlling Fetches from External Memory
Usfr
Uprom Programming Values and Locations for Slave Mode
To set this bit Write this value To this location
Ppwvalue
Programming Pulse Width
PPW
BitBitFunction Number Mnemonic
Example Ppwvalue Calculations
Modified QUICK-PULSE Algorithm
8XC196MC, MD 8XC196MH Two 250-µs pulses required
Ppwvalue =
Modified Quick-pulse Algorithm
Special Program Port Pin
Programming Mode Pins
AINC#
PROG#
Cpver
PACT#
Entering Programming Modes
Selecting the Programming Mode
Pmode Values
Power-up Sequence
Power-up and Power-down Sequences
Power-down Sequence
Reading the Signature Word and Programming Voltages
Slave Programming Mode
Device Signature Word and Programming Voltages
Slave Programming Circuit and Memory Map
Device Signature Word Programming VCC
Location Value
Operating Environment
Slave Programming Mode Memory Map
Description Address Comments
LOC1 LOC0 IRC1 IRC0 WDE BW1 IRC2
CCR1, CCR0
Bit Mnemonic Function
Slave Programming Routines
Address/Command Decoding Routine
Program Word Routine
Program Word Waveform
10. Dump Word Routine
10. Timing Mnemonics
Timing Mnemonics
MnemonicDescription
Auto Programming Circuit and Memory Map
Auto Programming Mode
Mnemonic Description
12. Auto Programming Circuit
Address Internal Address Using
Address Internal Address Using Output from
Auto Programming Routine
11 XC196MC/MD Auto Programming Memory Map
13. Auto Programming Routine
Auto Programming Procedure
Pccb and Uprom Programming 8XC196MH only
ROM-dump Mode
14. Pccb and Uprom Programming Circuit
RUN-TIME Programming
Pins Pccb Programming Uprom Programming
13. Pccb and Uprom Programming Values
PMODE30 0DH
15. Run-time Programming Code Example
Page
Instruction Set Reference
Page
Appendix a Instruction SET Reference
Opcode
Table A-1. Opcode Map Left Half
Table A-1. Opcode Map Right Half
Value of Bits Shifted Off
Table A-2. Processor Status Word PSW Flags
Instruction Quotient Stored Flag Set if Quotient is
Symbol Description
Table A-4. PSW Flag Setting Symbols
Instruction Jumps to Destination if Continues if
Variable Description
Table A-5. Operand Variables
Table A-6. Instruction Set
PSW Flag Settings
Mnemonic Operation
C V VT ST
Dest ← Dest and SRC
Instruction Format
Andb
Count
PTRS, Cntreg
Dstptr ← Srcptr Ptrs ← Srcptr +
Count ← Cntreg Loop Srcptr ← Ptrs Dstptr
Count ← Count
Dest
Clear BYTE. Clears the value
Mnemonic Operation Instruction Format
Dest MOD SRC
← Dest MOD SRC
Djnzw Decrement and Jump if not Zero
Djnz Decrement and Jump if not Zero
Epts Enable Peripheral Transaction
Dpts Disable Peripheral Transaction
Epts
EXT SIGN-EXTEND Integer Into Long
Extb SIGN-EXTEND SHORT-INTEGER Into
Increment BYTE. Increments the value Byte operand by
JGE Jump if Signed Greater than or
JLE Jump if Signed Less than or Equal
Negative flag is set, this instruction adds
JNV Jump if Overflow Flag is Clear
Jnvt Jump if OVERFLOW-TRAP Flag is
JVT Jump if OVERFLOW-TRAP Flag is SET
Load Byte SIGN-EXTENDED. Sign
Mulb
MUL
Mulub
Mulu
SRC, Dest
Integer operand
Dest ← Dest or SRC
Dest ← not Dest
PSW/INTMASK ← SP
INTMASK1/WSR ← SP
SP ← INTMASK1/WSR INTMASK1 ←
SP ← PSW/INTMASK PSW/INTMASK ←
Scall
Wreg, #count
SHR
Range of 0 to 31 1FH, inclusive. If
Shral Arithmetic Right Shift Double
Skip
Shrl Logical Right Shift DOUBLE-WORD
SUB
Rightmost operand
Subc Subtract Words with Borrow DEST, SRC
Subb
Subc
Subcb Subtract Bytes with Borrow DEST, SRC
× Offset + Tbase = Dest
Index and #MASK = Offset
Tijmp TBASE, INDEX, #MASK
Dest ← Dest XOR SRC
XOR
Hex Code Instruction Mnemonic
Table A-7. Instruction Opcodes
Clrb Notb Negb
Decb Extb Incb Shrb Shlb Shrab
Hex Code
Hex Code
8XC196MC, MD, MH USER’S Manual
EF Lcall
Dpts Epts
DIV/DIVB/MUL/MULB Note
Arithmetic Group Direct Immediate Indirect Indexed Mnemonic
Table A-8. Instruction Lengths and Hexadecimal Opcodes
Subc Subcb
Logical Direct Immediate Indirect
Opcode Length
Stack Direct Immediate Indirect Indexed Mnemonic
Data Direct
Jump Direct
Length Opcode
Call Direct Immediate Indirect Indexed Mnemonic
Conditional Jump Direct Immediate
Special Mnemonic Direct Immediate Indirect
Shift Mnemonic Direct Immediate Indirect Indexed
PTS
Mnemonic Direct Immediate Indirect
Arithmetic Group Indirect
Table A-9. Instruction Execution Times in State Times
Normal Autoinc Short Long Reg Mem
Mem Reg
DIV Divb Divu Divub
Mnemonic Direct Immed Normal Autoinc Short Long Reg Mem
Logical
Normal Autoinc Short
Stack Register Indirect
Reg Mem
LDB Ldbse Ldbze STB XCH Xchb
Autoinc Short Long Reg
Autoinc Short Long
Ljmp Sjmp Tijmp
Normal Autoinc Short Long
Call Memory Indirect Indexed Mnemonic Direct
Conditional Jump Mnemonic
Indirect Indexed
Shift Mnemonic Direct
Clrc Clrvt Idlpd
NOP RST Setc Skip
Page
Signal Descriptions
Page
Functional Groupings of Signals
Signal Name Changes
Table B-1. Signal Name Changes
New Name
Table B-2 XC196MC Signals Arranged by Functional Categories
U8XC196MC
Figure B-1 XC196MC 64-lead Shrink DIP Sdip Package
X8XC196MC
Figure B-2 XC196MC 84-lead Plcc Package
Figure B-3 XC196MC 80-lead Shrink EIAJ/QFP Package
P7.7/FREQOUT
Table B-3 XC196MD Signals Arranged by Functional Categories
X8XC196MD
Figure B-4 XC196MD 84-lead Plcc Package
Figure B-5 XC196MD 80-lead Shrink EIAJ/QFP Package
EA# Extint NMI ONCE# RESET# XTAL1 XTAL2
Table B-4 XC196MH Signals Arranged by Functional Categories
P2.7/SCLK1#/BCLK1
X8XC196MH
Figure B-6 XC196MH 64-lead Shrink DIP Sdip Package
Figure B-7 XC196MH 84-lead Plcc Package
Figure B-8 XC196MH 80-lead Shrink EIAJ/QFP Package
Signal Descriptions
Table B-5. Description of Columns of Table B-6
Table B-6. Signal Descriptions
Column Heading Description Name
BCLK10
Buswidth
CCR0.1 CCR1.2
COMP1/P2.5/PACT#, COMP2/P2.6/CPVER, COMP3/P2.7MC, MD
Command that invoked the power-saving mode
System using a clip-on emulator
P5.7/BUSWIDTH
Auto programming
Slave programming
PMODE.30
Programming Start
SCLK10# Shift Clock 0 MH only
Default Conditions
Table B-8 XC196MC and MD Default Signal Conditions
Table B-7. Definition of Status Symbols
Port Signals Alternate During Upon RESET#
Functions RESET# Active
WG2 WK1
NMI WK0 RESET#
WG3 WK1
PWM0 WK0
RESET#
Table B-9 XC196MH Default Signal Conditions
Port Signals
Alternate During Upon
Osc output
Registers
Page
CPU
Table C-1. Modules and Related Registers
8XC196MC, MH, x =
Table C-2. Register Name, Address, and Reset Status
Xxxx EPA3TIME MC, MD
Xxxx EPA2TIME MC, MD
Xxxx EPA4TIME MD
Xxxx EPA5TIME MD
Xxxx P1REG MH
P7PIN MD
1FFD
P5REG MC, MD
TIMER2
Xxxx TIMER1
Usfr MC, MD
Usfr MH Xxxx Watchdog
Adcommand
Adresult Read
Adresult Write
Adtest
Adtime
CCR0
ALE
CCR1
IRC2 IRC1 IRC0
Comp xCON Address Table C-3 = 0-3 8XC196MC, MH
COMPxCON
For EPA capture/compare channels 0, 2
Register Address Reset Value
Table C-3. COMPxTIME Addresses and Reset Values
COMPxTIME
Comp xTIME Address
EPAxCON
= 0-3 8XC196MC x = 0-5 8XC196MD
EPAxCON Address Table C-4 = 0-1 8XC196MH
= 0-3 8XC196MC = 0-5 8XC196MD
Table C-4. EPAxCON Addresses and Reset Values
EPA Timer Value
Table C-5. EPAxTIME Addresses and Reset Values
EPAxTIME
EPAxTIME = 0-1 8XC196MH x = 0-3 8XC196MC x = 0-5 8XC196MD
Freqcnt
Freqgen
Gencon
OVRTM†
Intmask
INTMASK1
Intpend
INTPEND1
Onesreg
Onesreg
Ffffh
One
PxDIR
Table C-6. PxDIR Addresses and Reset Values
= 1 MH
= 2, 5 M
PxMODE
Table C-7. PxMODE Addresses and Reset Values
= 1 MH = 2, 5 Mx
PIN7 PIN6 PIN5 PIN4
Pin Special-function Signal
Table C-8. Special-function Signals for Ports 1, 2, 5
Port
8XC196MC, MD
PxPIN
Table C-9. PxPIN Addresses and Reset Values
PxREG
Table C-10. PxREG Addresses and Reset Values
PxREG = 2-5 8XC196MC = 2-5, 7 8XC196MD x = 1-5 8XC196MH
= 2-5 M
Pimask
Pimask
Pipend
Pipend
PPW150 Ppwvalue
PPW
PSW
PSW
PSE
PSW
Ptssel
Ptssrv
Pwmcount
Pwmperiod
PWM xCONTROL Address 1FB0H, 1FB2H
PWMxCONTROL
SBUFxRX Address 1F80H, 1F88H = 0-1 8XC196MH
SBUFxRX
8XC196MH Data Received Bit
Sbuf xTX Address 1F82H, 1F8AH = 0-1 8XC196MH
SBUFxTX
8XC196MH Data to Transmit Bit
150 Stack Pointer
Stack Pointer
SPxBAUD
SPxCON Address 1F83H, 1F8BH = 0-1 8XC196MH
SPxCON
SPxSTATUS
T1CONTROL
T1RELOAD
Timer 1 Reload Value
T1RELOAD
T2CONTROL
Timer Address 1F7AH
TIMERx
1F7EH
Usfr
Watchdog
Watchdog
0AH
WGCOMPx
Wgcontrol
Wgcounter
Wgoutput Port
Wgoutput Waveform Generator
Wgoutput Waveform Generator
Output Values Output Polarities WG x#
Table C-11. Output Configuration
Wgprotect
Wgreload
Byte Windows
WSR
Register Mnemonic
00E0-00FFH 00C0-00FFH
00E0-00FFH 00C0-00FFH 0080-00FFH Location
1EH 00FAH TIMER2 † 1F7EH 7BH 00FEH 3DH WGCOMP1 1FC2H
T2CONTROL 1F7CH 7BH 00FCH 3DH 1EH TIMER1 † 1F7AH 00FAH
PWM0CONTROL 1FB0H 7DH
PWM1CONTROL 1FB2H 7DH
Zeroreg
Zeroreg
Zero
Page
Glossary
Page
Glossary
Characteristic
DOUBLE-WORD
LONG-INTEGER
LSB
Otprom
PTS
PWM
SFR
Special interrupt
WDT
Page
Index
Page
Index
Index-2
Index-3
Index-4
Index-5
Index-6
Index-7
Index-8
Index-9
Index-10
Index-11
Index-12
Index-13
Index-14