Post on 02-Jul-2022
ESCUELA POLITÉCNICA NACIONAL
FACULTAD DE INGENIERÍA ELÉCTRICA
Sistema de Desarrollo para el Microcontrolador INTEL de16bits8XC196KC
Tesis previa a la obtención del Título de Ingeniero en:
Jorge Luis Reascos DíazElectrónica y Telecomunicaciones
Hugo Cicerón Zambrano RamosElectrónica y Control
Quito. Marzo, 2000
Jfi
Certifico que el presente trabajo fue realizado en
su totalidad por los señores:
Jorge Luis Reascos Díaz
Hugo Cicerón Zambrano Ramos
Patricio Chico Hidalgo, Msc.
Director de Tesis
ffi
*AGRADECIMIENTO
Un sincero agradecimiento a nuestro director de Tesis
Msc. Patricio Chico por su valioso apoyo y consejo, a
nuestros padres por habernos dado las bases para forjar
nuestra educación, a todos nuestros amigos y
compañeros, en especial a Carmen y Karel.
Los Autores
A mis padres que han sido mi soporte en los momentos
más difíciles de mi vida, a mi hermana por su apoyo
incondicional, a mis abueiitos, tíos y primos por sus
consejos para mi desarrollo personal.
Jorge Luis
DEDICATORIA
A mi padre
esposa p
a mis; héj^aha^y a: mi
fncQmd[di;Qnai"brindadG.
PROLOGO
En el presente trabajo se propone la construcción de un "sistema de desarrollo"
basado en un microcontrolador de 16 bits, muy poco usados en la Facultad de
Ingeniería Eléctrica en la actualidad, que sirva como herramienta para la
elaboración de aplicaciones. La ejecución de estas aplicaciones se las hace en
"tiempo real" de una manera fácil y rápida. Esto se logra con un programa
manejado desde un computador y la tarjeta de evaluación que ejecuta el
programa que el usuario pretende desarrollar.
Cuando la inventiva, la imaginación y la creatividad se juntan se pueden
desarrollar muchas aplicaciones con alcances inimaginables, por lo que el
presente trabajo pretende "brindar facilidades para el desarrollo de las
aplicaciones.
La tesis está dirigida a estudiantes y personas con conocimientos básicos en
microcontroladores y circuitos digitales, que deseen elaborar una aplicación que
demande rapidez, eficiencia, complejidad y seguridad.
En el Capítulo I se presenta las características de arquitectura y distribución de
memoria de los microcontroladores de la familia MCS-96. En particular se
describe el microcontrolador 8XC196KC, que es el miembro con mayores
beneficios de la familia. Además se detallan los periféricos y sus respectivos
registros.
En el Capítulo II se presenta una descripción general de la tarjeta de
evaluación construida con la distribución de memoria para los distintos modos
de funcionamiento. Se ha detallado además la tarjeta de periféricos, que son
herramientas útiles para el desarrollo de una aplicación.
En el Capítulo III se expone las herramientas disponibles para programar el
microcontrolador, como son: los tipos de instrucciones, modos de
dreccionamiento, tipos de operandos; y se detalla el funcionamiento del
programa Micro196, que se ha elaborado en conjunto con la tarjeta de
evaluación para facilitar el desarrollo de aplicaciones.
En el Capítulo IV se especifican algunos ejemplos de programación que han
sido probados y ejecutados en la tarjeta de evaluación.
En los Anexos se pone énfasis en los registros que utiliza el microcontrolador,
así como;en el~set de instrucciones para programarlo. Además la descripción
física del. microcontrolador y de los integrados utilizados en el desarrollo de la
de-evaluación.
ÍNDICE DE CONTENIDO
PROLOGO
INTRODUCCIÓN
CAPÍTULO I
1.1 MICROCONTROLADOR GENÉRICO DE LA FAMILIA MCS- 96
1.1.1 Generalidades 6
1.1.2 Arquitectura 9
1.1.2.1 Buses Internos 10
1.1.2.2 Unidad de Procesamiento Central (CPU), 10
1.1.2.3 Controladorde Memoria 13
1.2 COMPARACIÓN CON LA FAMILIA MCS-51 14
1.2.1 Comparación de Arquitecturas 15
1.2.2 Tabla Comparativa y Memoria Direccionabie 16
1.3 MICROCONTROLADOR 8XC196KC 17
1.3.1 Arquitectura : 19
1.3.2 Mapa de Memoria 21
1.3.3 Memoria Adicional y Registros de Funciones Especiales 23
1.3.3.1 Ventanas Verticales 24
1.3.3.2 Registros de Funciones Especiales 25
1.3,4 Interrupciones 29
1.3.4.1 Registros que utilizan las Interrupciones 30
1.3.4.2 Prioridad de las Interrupciones 32
1.3.5 Periféricos 34
iv
1.3.5.1 Conversón A/D 35
1.3.5.2 Salida por Modulación de Ancho de Pulso (PWM) 38
1.3.5.3 77mers_ 40
1.3.5.4 Entradas y Salidas de Alta Velocidad (HSIO) 44
1.3.5,5 Servidor de Transferencias Periféricas (PTS) 49
1.3.5.6 Comunicación Serial 51
CAPÍTULO II
2.1 DESCRIPCIÓN GENERAL DE LA TARJETA DE EVALUACIÓN
CONSTRUIDA 55
2.2 DESCRIPCIÓN DEL MODULO CENTRAL 60
2.2.1 Unidad de Procesamiento Central (CPU) 61
2.2.2 Memoria Externa 62
2.2.3 Memoria de Programa (Programa Monitor) 64
2.2.4 Memoria RAM de Programa 64
2.2.5 Memoria RAM de Datos 64
DESCRIPCIÓN DE LA TARJETA DE PERIFÉRICOS 65
2.3.1 Banco de LEDs (Diodos Emisores de Luz) 65
2.3.2 Dip - Switches 66
2.3.3 Módulo de Cristal Líquido (LCD) 67
2.3.4 Displays (7 Segmentos) 70
2.3.5 Teclado 72
2.3.6 Visualización de Puerto 1 73
2.4 HARDWARE PARA COMUNICACIONES 73
2.5 FUENTE DE ALIMENTACIÓN 75
CAPÍTULO III
3.1 MODELO DE PROGRAMACIÓN 78
3.1.1 Tipos de Operandos 79
3.1.2 Tipos de Instrucciones 80
3.1.2.1 Instrucciones de Transferencia de Datos 82
3.1.2.2 Instrucciones Aritméticas 82
3.1.2.3 Instrucciones Lógicas 82
3.1.2.4 instrucciones de Tratamiento de Bloques 83
3.1.2.5 Instrucciones de Salto 83
3.1.2.6 Instrucciones de Control de la Interrupciones 84
3.1.2.7 Instrucciones de Control del Microcontrolador 84
3.1.3 Modos de Direccionamiento 84
3.1.3.1 Direccionamiento Directo . 85
3.1.3.2 Dirección amiento Inmediato 85
3.1.3.3 Direccionamiento Indirecto 85
3.1.3.4 Direccionamiento Indirecto con Autoincremento 86
3.1.3.5 Direccionamiento Indexado Corto 86
3.1.3.6 Direccionamiento Indexado Largo 87
3.1.3.7 Direccionamiento de Registro Cero 87
3.1.3.8 Direccionamiento de Registro Puntero de Pila 87
3.2 Micro196 88
3.2.1 Descripción del Programa 88
3.2.2 Ensamblador ASM-196 90
3.2.2.1 Programa Fuente 91
vi
3.2.2.2 Directivas 93
3.2.2.2.1 Directivas de Módulo , , 94
3.2.2.2.2Directivas de Selección de Segmentos 96
3.2.2.2.3 Directivas de Definición de Símbolos 96
3.2.2.2.4Directivas de Definición de Constantes 97
3.2.2.2.5Directivas de Reserva del Espacio de Almacenamiento 97
3.2.2.2.6 Directivas de Ensamblado Condicional 98
3.2.3 Enlazador RL196_ 98
3.2.4 Convertidor OH 196 99
3.2.5 Programación Modular 100
3.3 EJEMPLO DE PROGRAMACIÓN 102
3.3.1 Inicio dei Programa. 103
3.3.2 Ingreso de los Archivos Fuente. 104
3.3.3 Ensamblado y Enlazado. 106
3.3.4 Transferencia hacia la Tarjeta de Evaluación.
CAPÍTULO IV
PRUEBAS Y RESULTADOS 118
4.1 BANCO DE LEDS 118
4.2 DIP-SWITCHES 119
4.3 DISPLAY 121
4.4 TECLADO 123
4.5 LCD (2 FILAS , 16 CARACTERES) 125
vii
4.6 PRUEBA DEL PUERTO P1 128
4.7 PRUEBA DEL PUERTO SERIAL 130
CAPÍTULO V
CONCLUSIONES Y RECOMENDACIONES 134
ANEXOS
V1I1
ÍNDICE BE VIGUR&S
Figura 1.1 Arquitectura de! Microcontrolador de la Familia MCS -96 ..............9
Figura 1.2 La RALI) ....12
Figura 1.3 Comparación de Arquitecturas....... 16
Figura 1.4 Diagrama en Bloques del Microcontrolador 8XC196KC....... ..20
Figura 1.5 La RALU con el Controlador de Memoria...... .....21
Figura 1.6 Mapa de Dispositivos 22
Figura 1.7 Ventanas Verticales .25
Figura 1.8 Ventanas Horizontales del 8XC196KC ......29
Figura 1.9 Tratamiento de Interrupciones 31
Figura 1.10 Diagrama de Bloques del Conversor A/D ....36
Figura 1.11 Diagrama de Bloques de un PWM.... ..38
Figura 1.12 Diagrama de Bloques de losTimers 40
Figura 1.13 El Timer2 42
Figura 1.14 Diagrama de Bloques de la HSI.... 44
Figura 1.15 Diagrama de Bloque de la HSO ...47
Figura 2.1 Comunicación entre el computador y la tarjeta de evaluación .55
Figura 2.2 Distribución de headers yjumpers de la tarjeta principal 57
Figura 2.3 Diagrama de Bloques del Módulo Central....... 61
Figura 2.4 Diagrama de Bloques de Periféricos.... ......65
Figura 2.5 Banco de LEDs .....66
Figura 2.6 Dip-Switches ...............67
Figura 2.7 LCD... . . . . .69ix
Figura 2.8 Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - .——-— - - - - - - 71
Figura 2.9 Teclado 72
Figura 2.10 Barra de LEOS al Puerto P1 73
Figura 2.11 Puerto de Comunicación Serial....... .......75
Figura 2.12 Fuente de Alimentación 76
Figura 3.1 Tipos de Instrucciones ...81
Figura 3.2 Pasos para ejecución de un programa de usuario 102
Figura 3.3 Nuevo Proyecto................ 105
Figura 3.4 Ingresar el nombre del proyecto......... 106
Figura 3.5 Crear Fichero Fuente....... ...108
Figura 3.6 Crear otro Fichero. 109
Figura 3.7 Ensamblar Ficheros 110
Figura 3.8 Abrir archivos .LST y editar errores 111
Figura 3.9 Enlazar Ficheros. 112
Figura 3.10 Edición del Enlazado 113
Figura 3.11 Opciones del Programa 114
Figura 3.12 Transmisión hacia la Tarjeta... ..115
ÍNDICE &E TABLAS
Tabla 14. Microcontroladores que conforman la Familia MCS-96.......... 8
Tabla 1,2 Comparación entre la familia MCS-51 y la familia MCS-96...... 17
Tabla 1,3 Características de Zonas Mapeadas ..22
Tabla 1,4 Descripción de Registros de la Familia MCS- 96 y el 8X196KC 26
Tabla 1,5 Prioridades y fuentes de interrupción 33
da 1,6 Funciones dei Puerto 2...... ....35
D,ta 1,7 Frecuencias de Salida en el PWM según el Xtal. .........39
Tabla 1,8 Tipos de eventos que se pueden obtener en la HSI .................45
Tabla 2,1 Distribución de memoria en cargar y ejecutar.......... 62
Tabla 2,2 RAM Datos ....63
Tabla 2,3 Periféricos Externos ......63
Tabla 3,1 Tipos de datos del 8XC196KC .79
Tabla 3,2 Extensión de los ficheros utilizados .....91
Tabla3,3 Constantes Numéricas...., 92
Tabla 3,4 Delimitadores ...93
Tabla 3,5 Tipos de Segmentos... ..94
Tabla 3,,6 Directivas.de Selección de Segmento .......96
Tabla 3;7 Directivas de Definición de Constantes .97
XI
INTRODUCCIÓN
Iniciaimente los sistemas de control se construían exclusivamente con
componentes discretos lógicos, eran cajas grandes y pesadas, incluso eran
diseños analógicos mucho más grandes y complejos, con una limitada
capacidad para el desarrollo de aplicaciones.
Con el avance de la tecnología se utilizaron microprocesadores y el sistema de
control completo podía encajar en una tarjeta de circuito impreso, esto es
común actualmente. Se puede encontrar muchos sistemas que incluyen entre
sus componentes microprocesadores tradicionales (como Zilog Z80, Intel 8088,
Motorola 6809, entre otros).
A medida que el proceso de miniaturización se ha ido desarrollando, todos los
componentes que se requieren para un sistema de control se pueden encontrar
dentro de un chip, lo que dio lugar al origen del microcontrolador.
Un microcontrolador es un circuito integrado que incluye todos o casi todos los
componentes necesarios para tener un sistema de control completo.
Los microcontroladores frecuentemente se encuentran en:
- Aparatos electrodomésticos:
- Microondas, Hornos, Frigoríficos
1
- Televisión, Videos, Equipos de sonido
- Equipos informáticos
- Impresoras, Copiadoras láser, Módems, Unidades de disco..
- Automóviles
- Mando de sistemas del automóvil (ABS, Inyección, Encendido,
Diagnósticos, Climatizador,.)
- Mando medioambiental
- Invernadero, Fábrica, Casa
- Instrumentación, Sistemas aerospaciales
Para el año 2000, se espera que el número de microcontroladores en cada casa
de los países desarrollados sea de 240, generando ventas mundiales de miles
de millones de dólares desde los años 90 de1:
4bits
8-b¡t
16-b¡t
'93
1,6
3,7
0,4
'94
1,7
4,6
0,8
'95
1,8
5,6
1,1
•96
1,8
6,5
1,6
'97
1,8
7,5
2,1
'98
1,8
8,4
2,9
'99
1,8
9,2
3,6
'00
1,7
9,7
4,4
Con ello podemos darnos cuenta de la importancia que están tomando los
microcontroladores de 16 bits en el mercado mundial, por las bondades y
facilidades que presentan.
Dentro de la ingeniería electrónica se desarrollan aplicaciones para los
microcontroladores de 8 bits, en base a éste conocimiento, se pretende
continuar con un desarrollo más avanzado y con mejores facilidades dentro de
los microcontroladores de 16 bits y particularmente los de la familia MCS-96 de
Intel.
Intel es una empresa que presta un soporte muy bueno con herramientas de
apoyo que pueden ser emuladores, ensambladores, depuradores, simuladores,
etc.; que se distribuyen en diferentes empresas en todo del mundo. Se puede
obtener fácilmente documentación sobre la familia MSC-96.
La familia MCS-96 presenta además un conjunto muy completo de periféricos,
lo que hace de este trabajo una herramienta muy poderosa para depurar
programas así como para el fácil manejo de periféricos.
Vivimos en un mundo donde la información que vemos, oímos, procesamos
casi siempre es analógica y sobre esta base deben trabajar los sistemas
mecánicos y electrónicos (presión, temperatura, corriente, flujos de aire y de
líquidos son magnitudes analógicas). Estas señales pueden ser digitalizadas,
almacenadas, procesadas y transmitidas en forma digital, pero la interface de
entrada y de salida casi siempre es analógica.
1 Martínez (1998), diapositivas: 6-9
Los microcontroladores con electrónica analógica incorporada como son los de
la familia MSC - 96, se están demandando más cada día en aplicaciones como:
• Telecomunicaciones de alta velocidad
• Procesamiento de señal en tiempo real
• Sistemas de control Industrial
• Sistemas para automóviles
CAPÍTULO I
1.1 MICROCONTROLADOR GENÉRICO DE LA FAMILIA MCS- 96
Con el avance de la tecnología los microcontroladores brindan la posibilidad de
desarrollar nuevos y más grandes proyectos electrónicos.
El libro "Introducción a los microcontroladores de 16 bits" cuyo autor es José
Adolfo González, brinda información detallada de las características de la
familia MCS-96 y en especial del microcontrolador 8XC196KC, por lo que es la
herramienta principal sobre la que se ha desarrollado este capitulo.
1.1.1 Generalidades
El conocimiento de los microcontroladores de 8 bits, como son los de la familia
MCS-51 de Intel han determinado el desarrollo de aplicaciones cada vez más
complejas, con lo que se impulsó el desarrollo de microcontroladores de 16 bits,
con muchas más bondades y facilidades para el manejo de aplicaciones tanto
de control de estado como de control de lazo cerrado.
Los microcontroladores de la familia MCS-96 poseen alto desempeño por su
arquitectura registro a registro, brindando soluciones para aplicaciones
complejas de control en tiempo real tales como discos duros, modems,
impresoras, control de motores, entre otras.
Los cuellos de botella originados por el clásico acumulador son eliminados por
la arquitectura dirigida al proceso registro a registro. Además tienen un bus
dinámico externo de 8 o 16 bits con estados de espera programable.
Intel clasifica a la familia MCS-96 en tres distintas líneas que son;
• Familia EPA (Event Processor Array): cuenta con periféricos avanzados los
que incluyen un sistema flexible de entrada/salida y una matriz del
procesador de eventos.
• Familia HSIO (Hi Speed Input/Output)'. cuenta con un subsistema de
entrada/salida de alta velocidad.
• Familia Motion Control: facilita las aplicaciones para el control de motores.
Los periféricos integrados en cada uno de los chips hacen que las aplicaciones
sean más fáciles de manejar, simplificando la cantidad de instrucciones
necesarias para el desarrollo de una aplicación.
Estas características y funcionalidades, hacen de estos mícrocontroladores la
herramienta ideal para la implementación de un sistema de desarrollo que
permita ser didáctico y al mismo tiempo tienda a abarcar todas las aplicaciones
posibles dentro de la electrónica, el control y las telecomunicaciones.
La tabla 1.1 presenta los microcontroladores intel MCS-96 que forman parte de
la familia.
Tab
laM
icro
cont
rola
dore
s qu
e co
nfo
rman
la F
am
ilia
MC
S-9
61
Baj
o co
sto,
Bus
8/1
6, A
rqui
tect
ura R
egis
tro
a R
egis
tro
16 K
OT
PR
OM
, RA
M I
nter
na d
e có
digo
sX
196K
B/
X19
6KB
16B
ajo
cost
o, A
lto P
erf
orm
an
ce C
HM
OS
Baj
o C
osto
, Bus
8-b
iís,
4-ca
nale
s A
/D16
K O
TP
RO
M,4
88-b
ytes
RA
M, 3
-PW
M,P
TS
X19
60*K
D/
X19
6KD
2032
K O
TP
RO
M,
1000
~byt
e R
AM
PTS,
PW
M, G
ener
ador
de
fonn
as d
e O
nda
de 3
fase
sN
-84,
S
-80,
U-6
4M
C c
on G
ener
ador
de
Fre
cuen
cia
N-8
4,
S-8
0,U
-64
N-8
4,
S-8
0,U
-64
Gen
erad
or d
e fo
rmas
de
Ond
a de
3 f
ases
co
n3
2K
EP
RO
M
3XC
196J
R16
16K
256
561
0E
PA
si64
KC
MO
SN
-52
C.E
.A6
EF
A,
6 A
/D,
más
mem
oria
que
el J
Q3X
C19
6KQ
1612
K36
012
841
6E
PA
s¡64
KC
MO
SC
.E.A
10 E
PA
, 8A
/D, 5
6 lí
neas
I/O
, 12
K O
TP
RO
M3X
C19
6KR
1616
K25
656
10 E
PA
Si
64K
CM
OS
N-e
C,E
.AV
ersi
ón d
el K
Q8X
C19
6KT
1632
K10
0051
256
10 E
PA
Si
64K
CM
OS
N-6
8C
,AV
ersi
ón d
el K
R c
on C
ontr
oJad
or d
e B
us I
nclu
ido,
3XC
196N
P25
4K10
0033
,32
4 E
PA
Si
1MC
MO
SS-
100,
100
SB
-R
ango
de
dire
ccío
nani
ient
o de
IM
byte
, B
aja
pote
ncia
, S
elec
ción
de 6
dii
ps, 3
-PW
M»
Bus
Dem
ux3X
C19
6NT
2032
K10
0051
256
10 E
PA
S¡
1MC
MO
SN-
eR
ango
de
Dir
eccJ
onam
íent
o de
1 M
byte
3XC
196N
U4
0,5
010
0033
,32
4 E
PA
Si
1MS
-100
,10
0S
B-
Ran
go d
e di
recc
iona
mie
nto
de I
Mby
te,
Sel
ecci
ón d
e 6
chip
s, 3
PWM
, B
us D
emux
Op
cio
nes
de
Em
paq
uet
amie
nto
N -
68L
(P
LC
C: P
lást
ic L
cade
d C
hip
Can
ier)
N-5
2-52
L (P
LCC)
N-6
S =
ÓB
L (P
LC
C)
N-W
-B4
L
(PL
CC
)S
- BO
L (QF
P : Q
uad
Flatp
ack
Pack
age)
S-I
OO
-100
L (
QFP
)
C -
48
L (C
eram
ic D
ual
In-L
íiie
Pac
kage
)R
. =
68L
(C
eram
íc L
eadi
ess
Chí
p C
arri
er)
P =
48
L (
Plá
stic
Dip
)U
=6
4L
(Sh
rin
kD
ip)
SB
-10
0»
10
0L
(S
QF
P)
Ran
gos
de
Tem
per
atu
raC
= C
omer
cial
(O
-7
0)E -
Ext
endi
da (
-40 -
85)
A =
Aut
omot
riz
(-4
0-
125)
M-
Mil
itar
(-5
5 -125)
Drf
ínlc
lon
et:
O T
P;
One
Tim
e P
rogr
amab
le E
PR
OM
PW
M:
Pul
se W
rth
Mod
ulat
orHS
IO: H
igh-
Spod
Inpu
l/Out
put
EP
A:
Ev
ait
Pro
sess
or A
iray
SÍO;
Sen
a! In
put/O
utpu
tSS
IO: S
ynch
rono
us S
erial
Jnpu
t/Out
put
PTS:
Per
iphe
ral T
raisa
ctio
n Se
rver
O p
e ton
ei d
e T
emp
erat
ura
S •=
Versi
ón S
tanda
rdA
™ D
ispo
nibl
e en
tem
pera
tura
ext
endi
da* -
Tem
pera
tura
ext
endi
da li
mit
ada
para
cie
rtos
em
paqu
etam
ient
os
Inte
l. C
artil
la:
196
Míc
roco
ntro
ller
Fam
ily
1.1.2 Arquitectura
La figura 1.1 muestra la arquitectura para el microcontrolador genérico de la
familia MCS-96.
VREFPOWEROOVVN
TRECUENCYREFERENCE
6KBYTEON-CHIP
EPROM 879 K 8H
PORTO PORT PORT'2ALT.FUNCTIONS
HSI HSO
Figura 1.1 Arquitectura del Microcontrolador de la FamiJia MCS -96
En el diagrama se pueden destacar algunas partes constitutivas que se detallan
a continuación:
1.1.2.1 Buses Internos
El microcontrolador genérico de la familia MCS-96 está constituido por 2 buses
el A-bus de 8 bits y el D-bus de 16 bits, existiendo además la interconexión
entre bloques, y sus interfaces para interconexión con periféricos.
• El D-bus transfiere datos entre la RALI) (unidad aritmética lógica de
registros) y el fichero de registros o el registro de funciones especiales.
• El A-bus se lo utiliza como bus de direcciones entre el fichero de registros y
la RALU o para conectar la CPU (unidad de procesamiento central) con el
controlador de memoria como bus de direcciones/datos.
El acceso a la memoria interna o externa se lo realiza a través del controlador
de memoria, el cual, se comunica con el mundo exteriora través de los buses
de direcciones y datos.
1.1.2.2 Unidad de Procesamiento Central (CPU)
La unidad de procesamiento central está constituida por el fichero de registros,
la RALU y la unidad de control. Estos permiten un acceso más eficiente y rápido
tanto a la memoria interna como externa. La CPU es de 16 bits permitiendo un
acceso más rápido, con ciclos de máquina de la mitad de la frecuencia del
oscilador.
Fichero de Registros
Constituye la RAM interna de datos. La RALU puede operar sobre cualquiera de
los 256 registros internos que posee y cada uno puede actuar como
10
acumulador. En estas zonas de memoria RAM se encuentran los registros de
funciones especíales (SFR), el puntero de pila (SP) y el fichero de registros
propiamente dicho. Las zonas de memoria utilizada por cada uno de éstos se
explicará más adelante.
Unidad Aritmética Lógica de Registros (RALU)
Las operaciones lógicas y aritméticas se realizan en la unidad aritmética lógica
(ALU), Para la familia MCS-96 se define una RALU que contiene una ALU de 17
bits, el registro de estado del programa (PSW), el contador del programa (PC),
un registro de constantes, un contador de bucles y tres registros temporales;
todos los registros son de 16 o 17 bits (16 bits + la extensión de signo).
El PC contiene la dirección de la siguiente instrucción y utiliza un incrementador
separado que carga esta dirección. Si un salto, una llamada, retornos de otras
funciones e interrupciones son solicitados por el programa, la ALU se encarga
de poner el valor adecuado en el PC.
Para acelerar la velocidad de la ALU se cuenta con un registro de constantes
que es útil cuando se incrementa, complementa o decrementa bytes (8 bits) o
worcfs(16 bits).
El contador de bucles se lo. utiliza cuando hay desplazamientos repetitivos. Para
realizar operaciones que requieren desplazamientos lógicos como multiplicar,
dividir, normalizar se utilizan los registros temporales upper word register y
11
lower word register, el primero se utiliza siempre que exista un desplazamiento,
mientras el segundo únicamente cuando se desplacen palabras de 32 bits
(double word).
Cuando se realizan instrucciones de dos operandos se utiliza el tercer registro
temporal (temporary register), donde se almacena el segundo operando y
deposita éste en la entrada B de la ALU, como se observa en la figura 1.2.
- UPPER-.WORD REGISTER.'SHIFTER
* -OWER.WORD.REGISTER/SHIFTER-- -
Figura 1.2 La RALU.
12
Unidad de Control (Microcode Engine)
Controla la CPU para poder realizar operaciones de 8, 16 o 32 bits dentro del
espacio de 256 bytes del fichero de registros.
Esta unidad, decodifica las instrucciones dadas por el registro de instrucciones
que está en el controlador de memoria y genera las señales adecuadas para
que la RALI) realice la operación deseada sobre esa instrucción,
1.1.2.3 Controlador de Memoria
Unidad que se encarga de transferir hacia la CPU las instrucciones desde la
memoria interna y/o externa, y además ios datos desde la memoria externa.
Está constituido por un controlador de bus, un contador de programa esclavo
(SJave Program Counter) y una cola de instrucciones de 4 bytes.
El controlador del bus es el que se encarga de traer una instrucción de la
memoria externa o interna de programa o la lectura y/o escritura en ia memoria
de datos. Este proceso lo realiza con un bus externo de 8 o 16 bits según la
configuración dada por el usuario.
E! contador de programa esclavo es utilizado para substituir al contador del
programa y hacer más rápido el traslado de las instrucciones desde la memoria
de programa hacia la RALU. Cuando existe un salto, una interrupción, la
llamado o retorno de una subrutina, el PC esclavo se carga con la nueva
dirección, la cola se vaciará y se repite el proceso. Cuando se desea realizar la
13
• Protección de la memoria integrada
• Conversores A/D y D/A integrados
• Comunicaciones serial estándar
• Control y gestión de las interrupciones
Pero además presentan:
• Eficiente acceso a la memoria RAM interna
• CPU original
• Mapa de registros de 1/0 (entrada/salida)
• Herramientas de programación
• Servidor de transferencias periféricas
• Matriz del procesador de eventos
• Protocolo de cesión de bus2
1.2.1 Comparación de Arquitecturas
Uno de los principales beneficios de la RALU es poder cambiar rápidamente de
operación, debido a la eliminación de los cuellos de botella generados por el
acumulador, la RALU de la familia MCS-96 puede utilizar 232 acumuladores
dentro de! fichero de registros. Además, la introducción de instrucciones de 3
operandos ayuda a mejorar la velocidad de procesamiento.
González (1994), introducción, pág. xviíi
15
COMPARACIÓN DE ARQUITECTURAS .ALUFÁPHLIÁ-5Í ./ 'FÁMÍLÍÁ-'96
CONTROLADOR.De-8.BITS TÍPICO
..REFERIDO.AL AOJMULADOR--•NECESITA INSTRUCCIONES.
.ADICIONALES PARA MOVER-WTOS"AL/DESDE, EL;ACUHÜ"LÁpOR
;..ÍNTRUCCIONES"De 2/OPERANDOS--.'SOBREESCRBe-UNA FVJENTE,-• HACEN FALTA;MAS INSTRUCCIONES
PARA. 'rtd'VÉR LOS .'DATOS.. Á U;-
PÓSMEM D'ESEÁÜ'A
REGISTER- FILE-
COÑTROLADOR'DEJó .BÍTS:oe- LA FÁH'ÍLÍÁ;.96
^ARQUITECTURA REGISTRO; A; REGISTRO
— -".SE.ELIMINA LOS.-CUELLOS' oe BOTELLA.•EN EL 'ACtJrtULADÓR
- DISPOÑE;DE zi
DE 3 OPERANDOS
- .SE 'CONSERVA LA-FUCNTE ORIGINAL
- RÉDÚCÉ-ÜA |NSTRUCC'»ON DE'iMOVER'
Figura 1.3 Comparación de Arquitecturas
1.2.2 Tabla Comparativa y Memoria Direccionable
La memoria direccionable para la familia MCS-51 es segregada, es decir
64Kbytes para programas y 64Kbytes para datos. La memoria direccionable
para la familia MCS-96 puede también ser segregada pero admite una
configuración de memoria combinada, en la que coexisten la memoria de
programa y datos sobre un espacio de 64Kbytes.
16
Tabla 1,2 Comparación genérica entre la familia MCS~51yIa familia MCS-96
Unidad de ejecución secuencial deInstrucciones
Unidad de ejecución Pipeüned
Mínimo 12 ciclos de reloj por instrucción Mínimo 2 ciclos de reloj por instrucción
CPU basado en el acumulador PU basado en los registros
Direccionamíento de 16 bits Direccionamiento de 16 bits
Direccionamiento de 64 KB para programasDireccionamiento de 64 KB para programas,en algunos modelos se puede tener hasta1 MB
Direccionamiento de 64 KB para datos Direccionamienío de 64 KB para datos
Pila de stack máxima de 256 bytes Pila de stack máxima de 256 bytes
Set de instrucciones MCS 51 Set de instrucciones MCS 96
Instrucciones solo de 8-bitInstrucciones con operandos de 8, 16 y hastade 32 bits.
Bus interno de código de 8-bit Buses internos de 8 y de 16-bit
No provee la capacidad de estados deespera.
Puede generar 1, 2 y 3 estados de espera enla búsqueda de instrucciones.
Bus externo de datos de 8-bit y paradirecciones de 16-bits
Bus dinámico de datos de 8 o 16-bit y paradirecciones de 16-bits
Permite direccionamiento de bits Solo se puede direccionar bits comocomponentes de un byte o un word.
1.3 MICROCONTROLADOR 8XC196KC
El modelo 8XC196KC es el microcontrolador utilizado para la implementación
del sistema de desarrollo, ya que es el microcontrolador con mayor número de
prestaciones de la familia MCS-96.
17
Con relación al microcontrolador genérico, enunciado anteriormente, éste
modelo tiene algunas características adicionales entre las que se encuentran:
• 16 Kbytes de memoria de programas ROM/EPROM
• Memoria RAM interna de 512 bytes (incluyendo registros de funciones
especiales).
• Utiliza varios tipos de operandos fí/T, BYTE, WORD, DOUBLE-WORD con y
sin signo. El conjunto de instrucciones que maneja, trabaja sobre operandos
de 8 y 16 bits e incluso algunas operaciones están previstas para operandos
de 32 bits.
• Es capaz de realizar multiplicaciones de 16 x 16 bits en 1,75 microsegundos
y divisiones de 32/16 en 3 microsegundos cuando opera a 16 MHz.
• Ofrece ocho canales de conversión A/D con resolución de 8 o 10 bits,
• Se comercializan según 3 versiones: el 80C196KC, que presenta un bus de
datos reconfigurable dinámicamente para 8 o 16 bits: el 83C196KC, con 16
Kbytes de ROM, y el 87C196KC con 16 Kbytes de EPROM/OTP (One Time
Programable o programable una sola vez).
• Las prestaciones del servicio de transferencias periféricas (PTS), se
encuentran mejoradas por la calidad de los consoladores de periféricos que
presenta.
• Cuatro entradas de alta velocidad se encargan de la captura de eventos, así
como de los instantes en que estos se producen. Las seis salidas de alta
velocidad permiten generar temporizaciones de precisión, iniciar una
18
conversión A/D y obtener pulsos u ondas cuadradas. Estas salidas de
eventos pueden basarse en los íemporizadores o en los contadores.
• Tiene 3 salidas con modulación por ancho de pulso (PWM).
• Presenta 48 iíneas de E/S paralelas
« Incorpora un controlador rápido y flexible de interrupciones. Las
interrupciones pueden ser generadas por 28 fuentes, utiliza 16 vectores con
16 prioridades.
• Timersde 16 bits
• Un timer "vigilante" de 16 bits (watchdog timer)3.
1.3.1 Arquitectura
En la figura 1.4 se observa la arquitectura del microcontroiador 8XC196KC, éste
presenta algunas diferencias con el microcontrolador genérico.
Puede observarse los 256 bytes en RAM adicional, dentro del controlador de
interrupciones se encuentra el PTS, además de un mayor número de periféricos
con la posibilidad de tener una arquitectura multiprocesador con las señales
HOLD, HLDA y BREQ. Este microcontrolador tienen también una mayor
velocidad de ejecución, un juego de instrucciones más completo y una unidad
de control más evolucionada.
ibid., pág. 3
19
¿NGND FREOÜENCYREFERENCE. *
CONTROLSIGNÁIS
OPTIONAL16 KSYTES
ROhi/OTPROW
ALTÉRNATEFUNCTIONS HSO
Figura 1.4 Diagrama en Bloques del Microcontrolador 8XC196KC
Posee dos buses internos uno de 8 bits para búsqueda de instrucciones y otro
de 16 bits para transferencia de datos, además, un bus 16/8 para la
comunicación con e! exterior.
Se puede añadir que el contador de bucles para este microcontrolador es de 6
bits sin la máscara de 1 bit, empleada en las instrucciones de comprobación de
bits, se genera en el registro de constantes, en función del contenido del
registro de selección de bit que consta de 3 bits.
La figura 1.5 muestra la arquitectura de la RALU con el controlador de memoria.
20
Figura 1.5 La RALU con el Controlador de Memoria
1.3.2 Mapa de Memoria
La familia MCS-96 utiliza un espacio direccionable de memoria de 64Kbytes,
teniendo gran parte de este espacio para programas y datos, como se muestra
en la figura 1.6. Esta configuración de memoria es utilizada para manejar
periféricos, ya que a los registros de entrada/salida se ios considera como
posiciones de memoria (posmem).
21
205E-207FH
2040-206DH
2030-203FH
2020-202FH
2019-201FH
2018 H
2014-2017 H
2000 - 2013 H
1FFE-1FFFH
RESERVADA
VECTORES DE PTS
VECTORES DE INTERRUPC.
LLAVE DE SEGURIDAD
RESERVADA
CONFIGURACIÓN DE CHIP
RESERVADA
VECTORES DE INTERRUPC.
PUERTOS3Y4
(CCR)
MEMORIA EXTERNA
0
E/S
ROM/EPROM INTERNA0
MEMORIA EXTERNA
REG. FUNCIONES ESPECIFICAS
MEMORIA EXTERNA
RAM ADICIONAL
FICHERO DE REGISTROS
PUNTERO DE PILA
REG. FUNCIONES ESPECIALES
FFFFH
4000 H3FFFH
18 -19 H
OOH
Figura 1.6 Mapa de Dispositivos
Tabla 1,3 Características de Zonas Mapeadas4
mnaamnm0000-0017H
001 8-001 9H
001A-OOFFH
01 00-01 FFH
200H - 1 FFDH
1FFEH-1FFFH
••••• ^ ^ •••••iRegistros mapeados de entrada/salida. Registros de funcionesespeciales
Apunta al comienzo de la pila LIFO. Stack Pointer (SP)
Fichero de registros. RAM interna de datos. Pueden ser todosacumuladores
RAM adiciona!
Memoria externa
Se reserva estas posiciones para la reconstrucción de los puertos3 y 4 en caso de utilizar memoria externa
Estas características son para el 8XC196KC.
22
2000-201 3H
201 4-201 7H
201 8H
201 9H
201A-201FH
2020-202FH
2030-203FH
2040-205DH
205E-207FH
2080-3FFFH
4000-FFFFH
Se almacenan los vectores más bajos de interrupción
Zona RESERVADA. Estas posmem las reserva Intel para posiblesampliaciones de miembros posteriores de la familia. Con el fin deasegurar la compatibilidad con dispositivos de futura aparición, entodas las posmem hay que escribir OFFH, a excepción de laposmem 201 9H, que debe contener 20H.
Se trata del Byte de configuración del chip (Chip ConfígurationByfe, CCB).
Posmem RESERVADA
Posmem RESERVADA
Se encuentra la ílave de seguridad (segurity key) para el bloque dela ROM o ia EPROM.
Se almacenan los vectores más altos de interrupción
Vectores de PTS
Posmem RESERVADA
En la operación de reinicialización, la búsqueda de instruccionescomienza en la posmem 2080H. Es a partir de esta posmemdonde generalmente se encuentra el programa del usuario.
Memoria externa y entradas/salidas mapeadas.
1.3.3 Memoria Adicional y Registros de Funciones Especiales
Las posmem desde OOOOH hasta 01FFH contienen el fichero de registros, los
registros de funciones especiales (SFR), el puntero de pila y 256 bytes de RAM
adicional (01OOH a 01FFH).
Las posmem desde 001AH hasta OOFFH constituyen el fichero de registros.
Como se enunció anteriormente la comunicación entre la RALU y el fichero de
registros se lo realiza con un bus de 8 bits, con ello se accede hasta 256 bytes
del fichero de registros. Para utilizar ios 256 bytes de RAM adicional (512 bytes
del 8XC196KC) deben ser accedidos como registros por la RALU en
23
combinación con el registro de cambio de ventana vertical (vertical reglster
Windows) el cual es controlado por el registro de selección de ventana
(windows select register, WSR), o accesar a estos 256 bytes de RAM adicional
con un direccionamiento indirecto o indexado.
1.3.3.1 Ventanas Verticales
Las ventanas verticales son utilizadas para colocar secciones (porciones de
memoria) de 512 bytes de RAM en la parte alta del fichero de registros, y por
tanto acceder con un direccionamiento directo a ios 256 bytes adicionales de
RAM interna únicamente conmutando éstas ventanas. Las secciones pueden
ser de: 32, 64 o 128 bytes, por [o que se pueden tener 16 bloques de 32 bytes,
8 bloques de 64 bytes o 4 bloques de 128 bytes. Para seleccionar la ventana
que se desea utilizar es necesario recurrir al registro de selección de ventana
(WSR) escogiendo el tipo de ventana que se desee y ei bloque
correspondiente.
24
01EOH01COH01ÁDH0180H0160E0140H012QH
Windows 0100HOOEOHOOCOHOOADH0080H0060H0040H0020HOOOOH
OOFFHOOEOH
Register
OOOOH
32-ByteWindow
15141312111009080706050403020100
01COH
0180H
0140H
0100H
OOCOH
0080H
0040H
OOOOH
.*— OOFTH
OOCOH
OOOOH
64-ByteWindow
07
06
05
04
03
02
01
00
0180H
01COH
080H
OOOOH
OOFFH
0080H
OOOOH
128-ByteWindow
03
02
01
00
Figura 1.7 Ventanas Verticales
1.3.3.2 Registros de Funciones Especiales
En ei mapa de memoria las posiciones localizadas entre OOH y 17H
corresponden a los registros de funciones especiales, estos registros son
utilizados por la RALI) para e! control de los periféricos.
No se puede utilizar los SFR como operandos en operaciones aritméticas y
lógicas ni tampoco como registros base o índice en instrucciones con
dtreccíonamiento directo o indirecto. Los únicos periféricos que no son
manejados con los SFR son los puertos 3 y 4.
25
En la tabla 1.4 se describen los registros y en el anexo B.3 se analiza su
estructura.
Tabla 1A Descripción de Registros de la Familia MCS- 96 y el 8X196KC5
BHBHÍZEROWord: r/w
AD RESULTWord: r
AD_COMMANDByte: w
HSIJVIODEByte: w
HSIJTIMEWord: r
HSO_TIMEWord: r
HSO_COMMANDByte: w
HSI_STATUSByte: r
SBUFfTX)Byte: w
SBUF(RX)Byte:rINT_MASKbyte: r/w
ÍNT_PENDbyte: r/w
WATCHDOGbyte: r/w
TIMER1word: r
TIMER2word: r
BBBB SffiHHHHHIRegistro cero.Se lee siempre como cero, utilizado como base para direccionamientoindexado y como constante. Para cálculos y comparaciones.
Resultado A/D Hi/Low.Parte baja y alta del resultado del conversorA/D.
Registro comando A/D.Controla el A/D.
Registro modo HSI.Establece el modo de la unidad de entrada de alta velocidad.
Tiempo HSl Hi/Lo.Contiene el instante en que se produce el disparo develocidad.
entrada de alta
Tiempo HSO Hi/Lo.Establece ei tiempo o contador de salida de alta velocidad para ejecutarel comando en el registro de comandos.
Registro comando HSO.Determina io que sucederá en el tiempo de carga entiempo HSO.
Registro de estado HSl.Indica que pines HSl han sido detectados en un instantetiempo HSl y el estado actual de aquellos.
los registros de
en el registro de
Transmite un byte al puerto serial.
Recibe un byte por el puerto serial.
Registro de máscaras de interrupción.Habilita o inhabilita las interrupciones individuales.
Registro de interrupciones pendientes,índica que se ha producido una señal de interrupciónfuentes que aún no ha sido tratada.
Registro temporizador "vigilante".Se escribe periódicamente, para desactivar laautomática, cada 64 K-estados.
en una de las
reinicíalizacíón
Timen Hi/Lo. Alto y bajo del Timerl.
Timer2 Hi/Lo. Alto y bajo del Timer2.
González (1994), pág, 19-20
26
1OPORTObyte: r
BAUDJ*ATEbyte: w
IOPORT1byte: r/w
IOPORT2byte: r/w
SP_STATbyte: r
SP_CONbyte: w
IOSObyte: r
IOS1byte: 1
IOCObyte: w
IOC1byte: w
PWM_CONTROLbyte: w
Registro PuertoO.Niveles de los pines del PuertoO.
Registro que determina la velocidad de comunicación: este registrocarga secuencialmente.
se
Registro Puertol.Utilizado para leer y escribir en este puerto.
Registro Puerto2.Utilizado para leer o escribir en el puerto2.
Estado del Puerto Serial.Indica el estado del puerto serial.
Control del Puerto Serial.Utilizado para establecer el modo dei puerto serial.
Registro de EstadoO de E/S.Contiene información sobre e! estado de HSO.
Registro de Estado"! de E/S.Contiene información sobre el estado de los Timers y HSI.
Registro de Controlo de E/S.Controla las funciones alternas de los pines HSI, fuentesreinicialización del Timer2 y fuentes de reloj del Tímer2.
de
Registro de Control 1 de E/S.Controla las funciones alternas de los pines del Puerto2, interrupcionestimere interrupciones HSI.
Registro de control de modulación de ancho del pulso.Establece la duración del pulso del PWM.
^^^^^^^^aí^^^BpSí^S^B^^^ftSí^sj^^^i^^^mmINT_PEND1byte: r/w
INT_MASK1byte: r/w
IOC2byte: w
IOS2byte: r
WSRbyte: r/w
AD_TIMEbyte: r/w
IOC3byte: r/wPTSSELword: r/w
PTSSRVword: r/w
Registro de Interrupciones Pendientes, para los ocho nuevos vectoresde interrupción.
Registro de Máscaras de Interrupción, para los ocho nuevos vectoresinterrupción.
de
Registro de Contro!2 de E/S.
Registro de Estado2 de E/S.Contiene información de los eventos sucedidos en HSO.
Registro de Selección de Ventana.
Determina el tiempo de conversión A/D.
Nuevas características del 8XC196KC (cronograma interno delPWM)(J2CONTROL previo o T2CNTC).
T2,
Habilitación individual de los canales PTS.
Indicador de Interrupción End_of_PTS pendiente.
27
Para aumentar el espacio de ios SFR se utilizan 3 ventanas horizontales, las
cuales se acceden mediante el registro de selección de ventana (WSR) que
conmuta mapas de ventanas horizontales de 24 bytes con los 24 bytes
correspondientes de ios SFR. Se dispone de 3 ventanas horizontales: O, 1 y 15
que tienen las siguientes características:
La Ventana Horizontal O (HventanaO) contiene todos los registros del
microcontrolador genérico y completa algunas posiciones de memoria de este
microcontroiador para mantener la compatibilidad con ia familia MCS-96. Esta
ventana es de lectura o de escritura y se activa el SFR correspondiente según
se lea o escriba en la posmem correspondiente.
La Ventana Horizontal 1 (Hventanal) posee los SFR que son adicionales del
microcontrolador 8XC196KC. Los SFR adicionales controlan e! servidor de
transferencias periféricas (PTS), el PWM, el Timer2 y las nuevas funciones del
conversor A/D, Similar a la ventana anterior puede ser de lectura o de escritura.
La Ventana Horizontal 15 (Hventanal 5) tiene ios mismos SFR que los de
ventana O pero aquellos que en la HventanaO eran de escritura ahora en la
Hventanal 5 son de lectura y viceversa. La única excepción es el Timer2 que en
la HventanaO era de lectura/escritura, ahora estas posiciones de memoria son
utilizadas por el T2CAPTURE que será de lectura/escritura en la Hventanal 5.
28
1.3.4.1 Registros que utilizan las Interrupciones
INT_MASK (Registro de Máscaras de Interrupción): registro que se utiliza
para habilitar o inhabilitar individualmente las interrupciones. Se lo puede leer o
escribir en la HventanaO. Las instrucciones PUSH y PUSHA almacenan este
registro en el sfac/c, por lo que se puede acceder a él desde la pila. Las
instrucciones POP y POPA lo reponen.
INTJVIASK1: es un registro similar al anterior, que puede habilitar o inhablitar
individualmente e! resto de interrupciones.
IOC1 (Registro de Control de Entrada/Salida): permite seleccionar algunas
funciones alternativas entre algunos pines y habilita las fuentes de interrupción.
Este registro se lo puede escribir en la HventanaO y se lo lee en la Hventana15.
INT_PEND (Registro de interrupciones pendientes): cuando el hardware
detecta una interrupción pone a "1" el bit correspondiente. Luego que se ha
accedido a la interrupción repone a "O" el bit. A este registro se lo puede leer o
escribir en la HventanaO. Lo práctico de escribir sobre este registro es que se
pueden "borrar" las interrupciones (cancelar interrupciones pendientes) o se las
puede generar mediante software. Este registro se corresponde bit a bit con el
registro INT_MASK enunciado anteriormente.
30
Tab
la 1
.5
Prio
ridad
es y
fue
ntes
de
inte
rrup
ción
^•
^^
^^
^^
^^
•IIH
l«
. í ..
-r,.,r-r^«
A F
ntrarla
F
IFO
,
.
-n-,,,,-.
Inst
rucc
ión
TRAP
EX
TIN
T(r
ull2
.2)
PortO
.7
MM
I
_
_.,
_._
„C
aptU
ia T
l!vlc
::.K
2
W^l
FIF
O á
1 1
1-
1
a_
Inst
r. T
rap
de s
ottw
aie
T ¡~
cA
TIN
TI (lili.
Exl
ei.)
"^
EXT1
NT
(1 nt.
Ext
er.)
Tin
ÚP
•"-'
A~
\1 ]|
kJ-V
V?
y P
uerto
Ser
ie
riir?l
A r~
-
^ VA
/Ti m
r rí
0
T ..,
-...
Res
etT
lME
R2
Con
vers
ión
A/D
P-itilh
Hl 0
FIFO
HS
I Lle
na
Reg
istro
Ret
enci
ón
—
_.
, .
, _.
-
Des
bord
amie
nto
del T
imer
1 -¿
.
,.,,.
_.
FIF
O H
SI llr
nn
10C
1.7
*V
Dat
os H
SI
disp
onib
les
10C
1.3
¿ —
J_
D
esbo
rdam
ient
o del "T
imer
1
INT1
5
INT1
1
INT1
0
espe
dal
espe
cial
INT1
3
INT7
INT8
INTB
IMT9
IL!l
g|'©
Vj|lB
F?j'©
Rlp
VB
l
203E
H
15
2036
H
11
2034
H
10
201
2H
201 O
H
203A
H
13
200E
H
7
2030
H
8
200C
H
6
2032
H
9
INTT
5 20
0AH
5
IKT4
INT3
IMT1
4
INT2
INT1
IÍSTT
12
INTO
2008
H
4
2006
H
3
203C
H
14
2004
H
2
2002
H
1
2038
H
12
2000
H
0
33
1.3.5 Periféricos
Para la comunicación con el mundo exterior los periféricos comparten sus
funciones con los puertos de entrada y salida. El conocimiento de cada uno de
estos puertos facilita el entendimiento de las características de los periféricos.
Existen 5 puertos de 8 bits que pueden ser de entrada, salida o bidireccionales
y algunos pines de éstos asumen otras características.
Los registros específicos que se utilizan para el control de estos puertos son;
• PORTO: puerto de entrada. Se lee en la HventanaO. Puede ser utilizado para
leer señales digitales o analógicas que se utilizan con el conversor A/D.
Además la entrada P0.7 puede ser entrada de la interrupción externa
EXTINT.
• PORT1: puerto cuasi-bidireccional. Se lee o escribe en ia HventanaO. Los
pines P1.5, P1.6, P1.7 comparten funciones con las señales BREQ, HLDA)
HOLD respectivamente. Mientras que los pines P1.3 y P1.4 comparten
funciones con PWM1 y PWM2. Para utilizar una función se debe habilitar ios
registros correspondientes.
• PORT2: contiene tres tipos de funciones: de entrada, de salida o cuasi-
bidireccional. La tabla 1.6 describe las funciones de este puerto.
34
Tabla 1,6 Funciones del Puerto 2.
fuP2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RgHH^ RBBBRnBlflHillH
«HHaHBBSalida
Entrada
Entrada
Entrada
Entrada
Salida
Cuasi-bidireccional
Cuasi-bidireccional
:í::lilliiillffliiillillWP 1
TXD (transmisión puerto serial)
RXD (recepción puerto serial)
EXTINT
T2CLK (reloj y baudios timer 2)
T2RST (reiniciaiización timer 2)
Salida PWMO
Selección ascendente (UP)/descendente (dowrí)timer 2
Captura timer 2
IOC1.5
SPCON.3
IOC1.1
IOC0.7
IOC0.5
IOC1.0
IOC2.1
Nodisponible
• PORT3 y PORT4; puertos cuasi-bidireccionales que comparten sus pines
con eí bus de direcciones/datos. El control lo realiza el pin EA, cuando está
en nivel bajo los puertos son de direcciones/datos y en caso contrario será
un puerto de E/S mapeada en las direcciones 1FFFH (puerto 4) y 1FFEH
(puerto 3).
1.3.5.1 Conversor A/D
El conversor analógico/digital realiza conversiones de 8 o 10 bits, cuenta con 8
entradas donde se puede programar el tiempo de conversión y además si la
aplicación lo requiere sermultiplexadas para realizar un muestreo secuencial en
cada una de ellas.
35
VREF
(2Z3Q_
Uo
8TO 1ANALQG
MULTIPLICO?
AKCND
SUCCESSIVEAPPROXIUATION
A/DCONVERTER
I ICONTROL LOGIC
BUSY
CHANNEL
5TÁRTCONVERSIÓN
7 o
GO
HSO COMMAND
Figura 1.1O Diagrama de Bloques del Conversor A/D
El conversor cuenta con un subsistema multiplexor de 8 a 1 canales, una
unidad de muestreo y retención (Sample and Hold) y la unidad conversora A/D
del tipo de aproximaciones sucesivas de 8 o 10 bits de resolución.
Registros de Control del Conversor A/D
Los registros utilizados son: AD_COMMAND y AD_RESULT.
En el registro AD_COMMAND se carga el número del canal de entrada, se
Índica la resolución de la conversión y se pone el bit GO (AD_COMMAND.3) a
nivel alto.
36
El resultado de la conversión se lo lee en los registros AD_RESULTH (parte
alta) y AD_RESULTL (parte baja), por lo que AD_RESULT puede ser accedido
como byte o como word, AD_RESULT actualiza los datos cada vez que existe
el inicio de una conversión, por lo que es necesario leerlo y almacenarlo antes
de que se inicie una nueva conversión para que no se sobreescriban los datos.
Registros de programación de tiempos en el conversor A/D
El registro AD_TIME de la Hventanal se utiliza para que el usuario programe
directamente los tiempos de muestreo (SAM) y conversión (COIMV), en
unidades decimales según la frecuencia de trabajo del microcontroiador,
Utilizando las fórmulas:
(T *F -Ticomr osc }
donde:
TSAM : tiempo de muestreo
TCONV :tiempo de conversión
Fose frecuencia del cristal en MHz
B :número de bits para la conversión (8 o 10)
El usuario puede determinar los tiempos de estado de SAM y CONV que sean
necesarios y con ello el tiempo total de conversión.
37
Otro registro utilizado para la programación de tiempos es el IOC2 que utiliza el
bit IOC2.4 cuando se selecciona una velocidad rápida (bit=1) o una velocidad
lenta (bit =0) y además el bit 1OC2.3 que si está en nivel alto habilita el registro
AD_TIME para un modo controlado, es decir, permite la conversión con los
tiempos SAM y CONV determinados por el usuario.
1.3.5.2 Salida por Modulación de Ancho de Pulso (PWM)
El microcontrolador 8XC196KC presenta 3 canales digitales/analógicos (D/A)
del tipo de Modulación de Ancho de Pulso (PWM).
BUS
PWMDl/PUT
STATE TIME CLOCKF(XTALf)/2
1OZ2.2
Figura 1.11 Diagrama de Bloques de un PWM
38
En la figura 1.11 se observa un diagrama de bloques del funcionamiento del
PWM, El cual tiene un contador de 8 bits que se incrementa con cada tiempo de
estado de la señal de reloj. El contador inicia en cero y en este caso la salida
PWM es "1", generándose en este instante el ciclo de trabajo. Cuando el
contador alcanza el valor del registro PWM donde se encuentra el dato que se
va a convertir, el contador actúa sobre el reset del biestable y hace que la salida
cambie a "O". Cuando se desborda el contador, es decir cuando empieza un
nuevo período, la salida cambia nuevamente a "1", generándose otro período.
Se observa además un bloque que permite dividir el tiempo de reloj por 2, esta
opción se habilita con el bit IOC2.2 conocido como preescalar. La forma de
onda es un pulso de ciclo de trabajo variable cada 250 "estados" (32¡is a 16
MHz) cuando ei bit preescalar está inhabilitado.
Según el oscilador que se utilice se pueden obtener las siguientes frecuencias
en ia salida PWM.
Tabla 1,7 Frecuencias de Salida en el PWM según el Xtal
XTAL1 -
IOC2.2 - 0IOC2.2 - 1
8 MHz
15.6 KHz7.8 KHz
10 MHz
19, 6 KHz9.8 KHz
12 MHZ
23.6 KHz11. 8 KHz
Para el control de esta unidad utiliza los siguientes registros:
39
• PWMO_CONTROL: registro de escritura; siendo el último ciclo de trabajo
escrito puede ser leido en la Hventana15. Establece el ciclo de trabajo (duty
cycíe] en la salida PWMO, toma valores entre OOH y FFH generando 256
pasos entre O y 100%.
• PWM1_CONTROL: similar al anterior, generando el control de PWM1. Está
en la Hventanal permitiendo la lectura y escritura.
• PWM2_CONTROL: similar a los anteriores, generando el control de PWM2.
Está en la Hventanal permitiendo la lectura y escritura.
• IOC2: utiliza un bit para el manejo del PWM, el IOC2.2 que estando en "1"
(preescalar en 0/V) habilita el divisor por 2 del contador para la salida PWM
y estando en "O" (preescalar en OFF) inhabilita esta opción.
• IOC3: habüta las salidas PWM1 y PMW2 cuyos pines comparten funciones
con los bits P1.3 y P1.4 respectivamente. Se encuentra en la Hventanal y
habilita las salidas con nivel alto.
1.3.5.3 Timen
El 8XC196KC presenta 2 timers (temporizadores-contadores) de 16 bits, se
basan en un registro contador que se incrementa con la señal de reloj interna
del microcontrolador o con los pulsos procedentes de una señal externa.
40
P2.7
T2RST
Figura 1.12 Diagrama de Bloques de ¡os Timers
Timerl
Es fundamentalmente un contador de 16 bits free-running (funcionamiento
libre), que se incrementa cada ocho estados de tiempo. Puede generar una
interrupción al momento de su desbordamiento. Se lee en la HventanaO y se
escribe en las mismas posiciones de memoria en la Hventana15. Utiliza los
registros:
• IOC1: Se utiliza el segundo bit de este registro para habilitar ("1") o
inhabilitar ("O") la interrupción de desbordamiento de este timer.
• IOS1: (Registro de estado de entrada/salida), si se produce una interrupción
en cualquiera de los timers, este registro se lo utiliza para saber cual la ha
causado. Para el timen utiliza el quinto bit.
• 77ME/?1: contador ascendente free-running de 16 bits. Su valor puede ser
leído en la HventanaO y escrito en la Hventana15, por tanto inicializado con
un valor distinto a cero, que es el valor que toma después del reset.
41
Timer2
El Timer2 se utiliza como: base de tiempo de referencia para la unidad HSO,
contador ascendente o descendente, dispositivo de captura de eventos
externos o contador extra.
Ei contador del timer, puede ser incrementado o decrementado por la señal de
reloj interna o por dos fuentes de señal de reloj externa, aplicada a los pines
T2CLKoHSI1.
Se pueden setear modos de velocidad para la operación del timer, en el modo
rápido el incremento es de "uno" cada estado del reloj, mientras que en los
otros modos el incremento es de "ocho". El timer puede ser reinicializado por
hardware, soñware o por la unidad /-/SO. Por hardware el pin T2RST o HSIO
pueden reinicializarlo externamente, dependiendo del bit IOC0.5 como se
observa en la figura 1.13.
HSO#14>
ÍOC0.3
T2 RST
10CO,5
Figura 1.13 El Timer2
42
*' Los registros que utiliza el timer2 son:
• IOC1: el bit IOC1.3 habilita "1" o inhabilita "O" la interrupción a través del
desbordamiento del timer2.
• IOC2: el bit IOC2.0 habilta "1" o inhabilta "O" el incremento rápido del timer2.
El bit IOC2.1 cuando es "1" configura el timer2 como contador ascendente y
en caso contrario como descendente.
• IOS1: el bit IOS1.4 indica el desbordamiento del tímete.
• IOCO: contiene los bits para reinicializar el timer2. El bit IOC0.1 ("1") permite
realizar un reset en cada escritura del timar. El bit IOC0.3 ("1") habilta el
reset externo. El bit IOC0.5 ("1") permite que HSIO sea la fuente externa del$
reset o si es "O" la fuente externa será el pin T2RST. El bit IOC0.7 ("1")
permite que la fuente de reloj sea HSI1 y si es "O" la fuente externa ingresará
por el pin T2CLK.
• TIMER2: corresponde al contador de ia unidad timer2. Este contador se
puede leer o escribir en la HventanaO. De esta forma puede inicializarse con
í:P un valor distinto de cero.
• T2CAPTURE: (Registro de Captura del Timer2) permite cargar el valor que
tiene el registro TIMER2 en el momento en que se produzca un flanco
ascendente en el pin P2.7.
43
El timer2 posee características superiores al timen, ei que generalmente se lo
utiliza con el control de las unidades de alta velocidad. El timer2 puede poseer
distintos modos de operación que pueden ser;
• Reloj interno/extemo: posibilita que la señal de reloj del timersea interna o
externa, según el estado del bit IOC3.0.
• Velocidad rápida/lenta: puede tener un modo de 8 estados (velocidad
lenta) similar al timerl o un modo de un solo estado (velocidad rápida) con el
reloj interno o externo en el timer2.
• Contador ascendente/descendente: e! contador puede incrementar su
valor o decrementar con los pulsos que ingresan por el pin P2.6/T2UP_DN
teniendo en cuanta el valor de 10C2.1.
• En modo Captura: el valor del registro TIMER2 se puede capturar en el
registro T2CAPTURE, cuando se produce un flanco ascendente en el pin
P2.7/T2CAPTURE es necesario mantener el nivel lóigico en éste al menos
durante un estado.
1.3.5.4 Entradas y Salidas de Alta Velocidad (HSIO)
Unidad HSI
La unidad HSI permite registrar los eventos (señales eléctricas) e instantes en
que se producen ayudados por el timerl. Estos eventos pueden ser 4:
• Transición ascendente
• Transición descendente
44
• Transición ascendente o descendente.
• Ocho transiciones ascendentes consecutivas.
Ei HSI posee cuatro entradas (HSIO a HSI3) que registran los distintos tipos de
eventos (total 8 eventos) consecutivamente.
HSI Triggcr Qptions
juuuuuuuirEVERT EIGHTH POSlHVE
TRAN5IT10N
HSIENA.BLELOGIC
<*1 PORP BUFFERS
_L _I_
*
DIVIDEffi 8
CQUNTER-*•
HSI PIWS
270651-18 HSI-UODC
270&51-19
Figura 1.14 Diagrama de Bloques de ía HSI
Cuando se produce un evento en ei pin HSI, en la pila HS¡_FIFO} de capacidad
7X20 bits, se almacena los 16 bits del timerl y ios 4 bits que indican qué pines
están registrando eventos asociados con la misma marca de tiempo.
Los registros utilizados por esta unidad según la figura 1.14 son:
• HSLMODE: configura cada una de los pines para que detecte uno de los
cuatro diferentes tipos de eventos.
45
Tabla l.,8 Tipos de eventos que se pueden obtener en la HSI
Transición positiva o flanco ascendente
Transición negativa o flanco descendente
Por ambas transiciones
Por cada 8 flancos ascendentes
HSI_STATUS: contiene 4 bits de estado, que indican las entradas que han
recibido eventos, así como el estado actúa! de las mismas. Cuando se
trabaja con este registro el orden de lectura debe ser: primero el registro
HSi__STATUS y después el HSI_TIME.
HSI_TIME: ei valor del timerl se carga sobre este registro cuando se
produce un evento. Este valor de 16 bits, junto con los 4 bits pares que
indican la presencia de evento del registro HSI_STATUS, se almacenan en
la memoria HS!_FIFO. Cada vez que se lea el registro HSí_TÍME} se
descarga un nivel en la memoria HSI_F!FO y si se lee antes de
HSI_STATUS éste se perderá.
IOCO: permite habilitar o inhabiltar las cuatro entradas HSI. El bit IOCO.O
habilita ia entrada HSIO, el bit IOC0.2 habilta la entrada HSI1, el bit IOCO.4
habiita ia entrada HS12, el bit IOC0.6 habilta la entrada HSI3.
IOC1: permite habilitar o inhabiltar la salidas HSO4 y HS05 que comparten
los pines con las entradas HSI2 y HSI3 respectivamente.
46
• IOS1: el bit IOS1.6 (FIFO_FULL) efectúa un preaviso cuando la memoria
HSI_FIFO tiene 6 entradas utilizadas, aunque puede todavía aceptar2 datos
más adicionando el registro de retención. El bit IOS1.7 (HSI_RDY) indica
que tiene un dato disponible en el registro de retención.
El HS¡ puede generar interrupciones en ios sigueintes casos:
• Cada vez que se mueve un valor de la pila HSI_FIFO al registro de
retención.
• Cuando HS¡_FIFO alcance seis entradas independientemente del registro
de retención.
• Cuando HSI_FIFO alcanza el cuarto evento, independientemente dei
presente en el registro de retención. Este es un aviso anticipado de la
HSI_FIFO_FULL
Unidad HSO
Esta unidad actúa externamente con 6 pines de salida, que generan formas de
onda cuadrada y señales de control PWM. Puede funcionar además como
unidad interna, para puesta en marcha o reinicialización en las conversiones
A/D o en los timers por software.
47
En esta unidad el dispositivo CAM (Content Addressabie Memory) es una
memoria direccionabie por contenido, es decir, cada registro o posmem de la
CAM es comparada en cada estado con los valores del timer seleccionado,
tardando 8 estados en comparar todas las posmem de la CAM.
is-arr 16-etr
HK3H SPEED OUTPUT COMTROLS6P1NS4 SOFTWARE TIMERS2 INTERRUPTS1NITIATE A/D CONVERSIÓNRESETT1MER2
270651-24
Figura 1.15 Diagrama de Bloque de la HSO
En la figura 1.15 se observa que la CAM tiene 24 bits; el instante en que se
desencadena el evento, la CAM que continene el HSO_TÍME de 16 bits
compara con la base de tiempo seleccionada, generándose la acción
especificada en el HSO_COMMAND que está en los 8 bits siguientes de la
CAM. Esto produce el evento hasta la llegada de uno nuevo.
Los registros que utiliza esta unidad son:
48
• IOSO: presenta dos indicadores, el de estado de la CAM y el del Registro de
Retención de la CAM. Y tienen el estado actual de los pines HSOO hasta
HS05.
• IOS1: los cuatro primeros bits, SWTFO a SWTF3, son los indicadores de los
timers por software. Estos timers se programan desde el registro
HSO_COMMAND. Cuando se produce una interrupción, en ei caso de que
esté programada, estos indicadores informan qué timar, es ei que la ha
producido.
• IOS2: permite conocer qué pin o dispisitivo ha sido el causante del evento.
Después de una lectura a este registro, se pone a "O" por ello conviene
realizar una copia del registro.
1.3.5.5 Servidor de Transferencias Periféricas (PTS)
Es una unidad incorporada a los miembros más evolucionados de la familia
MCS-96.
Esta unidad es dedicada a la toma y movimiento de los datos a través del
microcontrolador especializado en e! control de eventos. Los eventos son
tratados con una ligera intervención de la CPU y solo se debe configurar la
unidad correspondiente al inicio del programa. Esto permite procesar una mayor
información en el mismo tiempo.
Las operaciones que permiten la utilización del PTS son:
50
• Transferencias simples de datos
• Transferencias de bloques de datos
• Transferencias específicas de datos con el conversor A/D
• Transferencias específicas de datos con las unidades HSI y HSO
La unidad PTS entra en funcionamiento cuando recibe una interrupción y si el'"'•*Vjft 1
canal PTS esta habilitado (PTBSEIi) y además la unidad está habilitada
globalmente (EPTS), la interrupción se vectoriza a través de la tabla de vectores
PTS a una zona de memoria interna donde se encuentra una serie de datos que
alimentan a los registros de control de la unidad. Con el PTS se eíimína el
software para forzar ia llamada a la interrupción. El programa de atención al
PTS es mínimo y contiene el bloque PTSCB y algunos registros de control.
El PTS únicamente tiene cinco modos de operación comparada con una
interrupción que es muy general.
Los registros utilizados por esta unidad son:
• PTSSEL: situado en ia Hventanal, habilita individualmente cada canal PTS
sobre la respuesta normal de interrupción. Si el PTS se habilita globalmente
con el bit EPTS y el bit correspondiente a la interrupción generada en el
registro, al generarse la interrrupción se ejecutará un ciclo PTS.
• PTSSRV: este registro se localiza en la Hventanal, actúa como el registro
de interrupciones pendientes. Cuando el registro PTSCOUNT termina, el
51
PTSSRV genera la interrupción "FIN DE PTS", que llamará a todos los
procesos necesarios y reinicializará el canal PTS.
• PTSCOUNT: define el número de ciclos PTS que deben ejecutarse de forma
consecutiva, sin la intervención del software. El número máximo es de 256
ciclos. Al final de cada ciclo PTS, eí PTSCOUNT se decrementa.
• PTSCON: registro de control del PTS. Define el tipo y modo de transferencia
de los datos.
1.3.5.6 Comunicación Serial
El microcontrolador cuenta con un puerto serial que puede ser configurado con
un modo sicrónico y tres diferentes modos asincrónicos fuli-duplex.
Los registros que utiliza esta unidad son;
• SP_CON: contiene los bits del modo de selección del puerto serial, los bits
de habilitación de recepción, paridad y el bit de transmisión de datos en
formato de 9 bits. Escribiendo en este registro se accede a SP__CON y
leyendo se accede ai SP_STAT.
• SP_STAT: muestra el estado correspondiente al proceso de comunicación e
indica posibles situaciones de error.
• BAUD_RATE: se carga secuencialmente con dos bytes; los 15 bits de
menor peso determinan el número de baudios. Se debe cargar primero el
byte menos significativo.
52
• SBUF: permite la transmisión desde o hacia el puerto serial, SBUF(TX)
mantiene los datos listos para la transmisión y SBUF(RX) contiene los datos
recibidos por e! puerto serial.
La velocidad de comunicación de todos los modos viene dada por el valor del
registro BAUD_RATE. Para el valor de la velocidad seleccionada, se utilizan los
primeros 15 bits (0-14) y para la sincronización con el reloj se utiliza el bit 15, si
este bit es "1" selecciona el pin XTAL1 y si es "O" utiliza el pin T2CLK que puede
tener una frecuencia máxima de 4MHz. El valor máximo que puede tener el
registro es de 32 767. Y se calcula según las siguientes ecuaciones:
MODO 1,2,3 ASINCRÓNICO:
BAUD RATE-.XTALl
mimbaudios * 16T2CLK
MODO O SINCRÓNICO:
BAUD RATE = -XTALl
num .bandios 2— 1 o T2CLK
numbaud * 8
La velocidad máxima de comunicación es de 4 Mbaud en modo sincrónico y 1
Mbaud en modo asincrónico
53
CAPÍTULO n
2.1 DESCRIPCIÓN GENERAL DE LA TARJETA DE EVALUACIÓN
CONSTRUIDA
No se puede realizar ningún trabajo riguroso para el desarrollo de aplicaciones
si no se utiliza una herramienta que proyecte a ia realidad algunos de los
conceptos descritos del microcontrolador 8XC196KC, lo que hace necesario
una herramienta en la cual podamos "cargar y ejecutar" programas en tiempo
real. Los programas son escritos en lenguaje ensamblador desarrollado para la
familia MCS-96, luego de ser ensamblados dichos programas son transmitidos
desde un computador IBM o compatible a la tarjeta de evaluación a través del
respectivo interfaz.
Figura 2.1 Comunicación entre el computador y la tarjeta de evaluación
Se ha construido una tarjeta de evaluación, la cual consta de un
microcontrolador 80C196KC20, memorias EPROM en donde se encuentra el
programa residente, memorias RAM tanto de programas como de datos, una
lógica circuital para tener un "bus dinámico" a través de compuertas lógicas
TTL (Transistor Transistor Logic). Además la tarjeta cuenta con jumpers que
55
sirven para habilitar o inhabilitar funciones útiles para ei usuario, cuenta con
headers y un conectar DB - 9 para comunicación serial.
El bus dinámico puede ser de 8 o de 16 bits según la lógica implementada y la
dirección que establezca el microcontrolador. En la tarjeta disponemos del
jumper JP7 el cual conecta el buswidth del microcontrolador con el circuito que
proporciona las señales digitales para habilitar dichos pines, es decir e! usuario
puede hacer su propio sistema de buswidth de acuerdo a sus necesidades.
Los 64 Kbytes de memoria que direcciona el microcontrolador, se ios dividió en
bloques mediante la utilización de un decodificador 3 a 8 (74LS138), con lo cual
obtenemos 8 bloques de 8 Kbytes tanto para la lectura o escritura de datos, de
los cuales, los últimos 16 Kbytes fueron subdivididos en 8 bloques de 2 Kbytes.
Los primeros 4 bloques de 2 Kbytes son utilizados para manejar periféricos
externos como LEDs (Light-Emitting Diode), switches, teclado, LCD (Liquid
Crystal Display), displays 7 segmentos, y los últimos 4 bloques de 2 Kbytes se
dejan disponibles al usuario.
Se han dispuesto de headers tanto para la conexión con la otra tarjeta de
periféricos como para los requerimientos propios del usuario, es decir se ha
dejado disponibles los pines del microcontrolador en un banco de headers. A
continuación se detalla cada uno de los headers y jumpers disponibles en la
tarjeta.
56
H10
JP1: <l-2 HJt-GND)(2-3 EA-VCC)
JP2: <l-2 NMT-GND)JP3: <l-2 VPP-VCCH2-3 VPP JfflB
<2-3 P2.1-KX)lTP$; íl-2 PZ.O-TXuC)ül II (m m . 'Wj V utj^-, t
<2-3 P2.0-TX)JP7: (1-2 BVSW.tiC BWSW.Tarj.JP9: (1-2 BNCNB-CND)
(2-3 BNCNB-CNDBEE)JP10: (1-2 VItEE-VCC)
(2-3 VREE-VCCKEE)
Figura 2.2 Distribución de headers y jumpers de la tarjeta principal
Como se puede observar los headers y.jümpers permite un manejo adecuado y
personalizado para el usuario.
57
Tabla 2,2 RAM Datos
AOOO-AFFF (R/W) BANCO DE DATOS DE 16 BITS
BOOO-BFFF (RAA/) BANCO DE DATOS DE 8 BITS
Tabla 2,3 Periféricos Externos
IBHIIII ^ HiHBICOOO-C7FF
C800-CFFF
DOOO-D7FF
D800-DFFF
EOOO-E7FF
E800-EFFF
FOOO-F7FF
F800-FFFF
(W) 16 LEDS (R) 16 DIP-SWTICHES
(W) LCD (2 FILAS / 16 CARACTERES)
(R) TECLADO (16 TECLAS)
(W) 4 DISPLAYS ( 7 SEGMENTOS)
(W/R) DISPONIBLE AL USUARIO
(W/R) DISPONIBLE AL USUARIO
(W/R) DISPONIBLE AL USUARIO
(W/R) DISPONIBLE AL USUARIO
••I(16 BITS)
(16 BITS)
(8 BITS)
(16 BITS)
(16 BITS)
(16 BITS)
(16 BITS)
(16 BITS)
63
2.2.3 Memoria de Programa (Programa Monitor)
Es un banco de memoria de 16 bits que. está ubicada en la dirección 2000 a
3FFFH. Consta de dos memorias EEPROM 2732, en las que se encuentra
grabado el programa monitor el cuai permite cargar y ejecutar los programas
requeridos por el usuario. Cuando la tarjeta trabaja en el modo de EJECUCIÓN,
este banco queda desactivado y no existe para el microcontrolador.
2.2.4 Memoria RAM de Programa
Es un banco de memoria de 16 bits, está ubicada en la dirección 6000H a
9FFFH. Consta de dos memorias RAM 6264 de SKbytes cada una, es aquí
donde se descarga el programa transmitido desde el computador y que luego
en el modo de ejecución, son vistas como "EPROMs" donde se ejecutan las
instrucciones o códigos de programa.
2.2.5 Memoria RAM de Datos
Este espacio de memoria de SKbytes se ha subdividido en 2 bloques de
4Kbytes. En los primeros 4Kbytes es decir desde AOOOH a AFFFH se encuentra
un banco de memoria de 16 bits que contiene 2 RAMs 6116 de 2Kbytes cada
una y en los segundos 4Kbytes se encuentra un banco de memoria de 8 bits
que contiene 1 RAM 6116 de 2Kbytes. En ambos bancos es posible guardar o
leer datos de acuerdo a las aplicaciones o necesidades del usuario. El acceso a
estas memorias es similar en todos los microcontroladores y el 8XC196KC no
es la excepción.
64
Figura 2.6 Dip-Switches
2.3.3 Módulo de Cristal Líquido (LCD)
El módulo de cristal líquido o LCD, solucionan inconvenientes como un bajo
consumo de corriente, no es necesario procesos especiales, no requiere tablas
especiales con los caracteres que se desea indicar, se puede conectar
fácilmente con microcontroladores y despliega una óptima presentación.
Los módulos LCD se encuentran en diferentes presentaciones, por ejemplo
(2x16) (2líneas,16 caracteres), 2x20, 4x20, 4x40, etc. La forma de utilización y
los interfaces que presentan son similares para cada módulo. El módulo67
utilizado en la tarjeta de periféricos es de 2x16, este módulo es de bajo costo,
se consigue fácilmente y tiene un tamaño suficiente para la mayoría de
aplicaciones.
Los pines de conexión de estos módulos incluyen un bus de datos de 8 bits, un
pin de habilitación (E), un pin de selección que indica si el dato es una
instrucción o un carácter del mensaje (RS), y un pin que establece si se va a
escribir o leer en el módulo (R/W)
Pines:
1
4
6
GND
VCC
VO (ajusta el contraste)
RS (Selección control-dato)
R/W (Lectura, escritura en LCD)
E (Habilitación)
7 .,..14 : DO....07 (bus de datos)
Según la operación que se desee realizar sobre el módulo de cristal líquido, los
pines de control E, RS y R/W deben tener un estado determinado. Además, en
e! bus de datos se incorpora un código, que indique si el dato es un carácter
para mostrar en la pantalla o una instrucción de control. El módulo LCD
responde a un conjunto especial de instrucciones, éstas deben ser enviadas por
eí microcontrolador o sistema de control al display. La interconexión entre el
microcontrolador y el display de cristal líquido, se puede hacer con un bus de
datos trabajando a 4 u 8 bits. Las señales de control trabajan de la misma forma
en cualquiera de los dos casos, la diferencia se establece el momento de iniciar68
el sistema, ya que existe una instrucción que permite establecer dicha
configuración. Los caracteres que se envían al dispiay se almacenan en ia
memoria RAM del módulo. Existen posiciones de memoria RAM, cuyos datos
son visibles en la pantalla, éstas últimas se pueden utilizar para guardar
caracteres que luego se desplazan hacia la parte visible. Es importante anotar
que solamente se pueden mostrar caracteres ASCII de 7 bits, por lo tanto
algunos caracteres especiales no se pueden ver (se debe tener a la mano una
tabla de los caracteres ASCII para conocer los datos que no se pueden utilizar).
US
LCDJ.
GNDvccvoRSR/WED0DID2D3
DSDED7
_i-— §•
— g-
— =p-
— 5"T0"11121 'sJ"J14
<
D0 Q0DI QlD2 Q2D3 Q3D4 Q4DS Q5DG QED7 Q7
OCG
741-S373
LTN111
D0 Q0DI QlDH Q2D3 Q3D4 Q4DS QSDS OSD7 GT?
7-4LS3V3
Figura 2.7 LCD
En la tarjeta de evaluación el LCD es manejado como memoria externa y está
en la dirección C800H y se entiende que en esta dirección el usuario podrá
escribir mensajes, datos alfanuméricos. El usuario tendrá acceso a las
subrutinas pertinentes para el manejo adecuado del LCD.
69
2.3.4 Displays (7 Segmentos)
Esta parte del hardware consta de 4 displays de 7 segmentos, en los cuales se
podrá mostrar datos numéricos, de cualquier proceso. El bus de manejo de esta
parte de memoria extema es de 16 bits ya que el propósito es manejar datos en
BCD (Binary Code Decimal). La utilización de latches para retener los datos
evita la realización de un barrido sobre los 4 displays, facilitando desplegar los
datos mediante una sola instrucción.
Para la decodificacíón de los datos del microcontrolador a este periférico se
utiliza decodificadores BCD-7 segmentos (74LS47). La dirección de memoria de
este periférico es D800H.
70
U12
74LS47
Figura 2.8 Display
71
2.3.5 Teclado
Esta parte de memoria externa se encuentra en la dirección DOOOH y consiste
de un teclado de 16 caracteres, manejado a través de un 74C922 que provee la
posición de la tecla presionada y la decodifica a través de 4 bits, ios cuales
ingresan a un 74LS244 y dan el control de la lectura de datos en esa posición
de memoria externa. El decodíficador puede generar la señal de DATO
DISPONIBLE para que el .teclado funcione a través de una interrupción.
74C92S
JFl
JUMPER
U10 c c c c1 2 3 4
Fl
F2
F3
F4
TECLPDO1TECURD04X4
74LS244
Figura 2.9 Teclado
72
2.3.6 Visualización de Puerto 1
El estado del puerto 1 del microcontrolador se observa en la barra de LEDs de 8
bits, indicando el estado (1 o 0) de cada pin de este puerto. El 74LS373 se lo
utiliza como un buffer de corriente.
LT7
D0DiD2D3D4D5DGD7
OCG
Q0QlQ2Q3Q4QSQSQ7
R1.0 LB1Rl . 1
^RI . 2 A A
1S
D H=>*f t« A «.i. . ;=>
D HaV ^^-jtt A rí J- . /V v v rp« A
R
4S6789
10
2019IB17161514131211
BftR-MULT74LS373
Figura 2.1O Barra de LEDS al Puerto P1
2.4 HARDWARE PARA COMUNICACIONES
E! microcontrolador 8XC196KC es capaz de comunicarse con dispositivos
externos (computadores, autómatas, microconíroladores, etc.). Es importante la
comunicación en cualquier proceso que deba ser controlado o monitorizado,
principalmente cuando la tendencia general es interconectar los sistemas para
compartir ios datos, que por ejemplo, son muestreados por uno de ellos y
probablemente analizados por otro. El 8XC196KC consta de un circuito de
comunicación de datos serie, que puede ser configurado para trabajar en cuatro
modos diferentes:
• El modo O o modo síncrono
73
- Los modos 1,2,3 asincrónico, es decir full-duplex. Estos modos pueden
recibir y transmitir a la vez.
En la tarjeta de evaluación se emplea el modo 1, debido a la mayor facilidad y
simplicidad en su utilización, mediante el circuito integrado MAX232 que utiliza
la norma de comunicación serial RS-232C. Básicamente consiste en cambiar
los niveles lógicos de la salida o envío de 5V a dos niveles de voltaje de
magnitud mayor: uno positivo (+V) para representar el cero lógico y uno
negativo (-V) para representar el uno lógico. En el equipo receptor de la
información se realiza ei proceso contrario, los niveles positivos y negativos que
lleguen se convierten a los niveles lógicos tradicionales de OV y 5V. Los niveles
de voltaje son simétricos con respecto a tierra y son al menos de +3V para el O
binario y -3V para el 1 binario.
Como la mayoría de aplicaciones de RS232 necesitan de un receptor y un
emisor, el MAX232 incluye en un solo empaque 2 parejas completas de drivery
rece/Ver. Tiene un doblador de voltaje de +5V a +10V y un inversor de voltaje
para obtener la polaridad de -10V. Actualmente, uno de los mayores problemas
que tienen los técnicos en relación con las comunicaciones es la
incompatibilidad de funcionamiento de los sistemas, que en principio deberían
ser perfectamente interconectables.
74
t
CAPITULO m
»
9
3.1 MODELO DE PROGRAMACIÓN
El 8XC196KC utiliza tanto un lenguaje ensamblador de bajo nivel como de alto
nivel como es el lenguaje C, no se implementa este lenguaje en el desarrollo de
la tesis, ya que el objetivo de la misma es la programación únicamente en
lenguaje ensamblador.
El lenguaje de máquina, es la representación del programa tal como lo entiende
el microcontrolador. El lenguaje ensamblador, es una representación
alfanumérica del lenguaje de máquina, lo que facilita su lectura. Cada
instrucción en lenguaje ensamblador corresponde a una instrucción en código
de máquina. Un programa en lenguaje ensamblador es rápido y corto.
La familia MCS - 96 utiliza un juego de instrucciones reducido (RISC: Reduced
Instruction Set Computers). Si es menor el número de instrucciones disponibles,
el chip es más pequeño, más sencillo, más rápido (al ser más simples las
conexiones internas dentro del circuito, existen menos inductancias y
capacitancias parásitas con lo que se puede aumentar la frecuencia de reloj),
además el consumo es menor. Además las instrucciones pueden utilizar
cualquier registro con cualquier modo de direccionamiento
78
3.1.1 Tipos deOperandos
Los operandos pueden ser de los registros internos o de las direcciones
específicas de memoria, sin olvidar a valores inmediatos (constantes) que son
como operandos de una instrucción.
La tabla 3.1 presenta el conjunto de operandos que utiliza el microcontrolador
8XC196KC.
Tabla 3,1 Tipos de datos del 8XC196KC1
mKí\v3mmmm$m\\m^f?™g5wmmBYTE
WORD
SHORT-INTEGER
INTEGER
BIT
DOUBLE-WORD
LONG-INTEGER
8
16
8
16
1
32
32
0-256
0-65535
(-1283+127)
(-32768 a 32767)
Valores Boléanos
(0 a 4294967295)
(-2147483648a2147483647)
BiJ i.iu.i. 'i mi" Pl
Arit./Lógica
Arit./Lógica
Aritméticas
Aritméticas
Chequeos
Normalización.Multiplicación,
División,Comparaciones..
Normalización.Multiplicación,
División,Comparaciones..
•••reprn rTfari BBBil
El resultado se interpreta enaritmética de módulo 256.
El resultado se interpreta enaritmética de módulo 65536.Octeto menos significativosituado en una dirección par.
Los resultados fuera delrango, activan el indicador dedesbordamiento.
Octeto menos significativosituado en una dirección par.
El sistema no admite eldirección a miento directo debits. Estos deben serdíreccíonados como parte deun BYTE o WORD.
Deben formar parte delFichero de Registros, y estaralineados a una direccióndivisible por 4
Deben formar parte delFichero de Registros, y estaralineados a una direccióndivisible por 4
1 González (1994), pág. 89
79
3.1.2 Tipos de Instrucciones
Las instrucciones se clasifican2 según la función que realizan en:
• Aritméticas
• Lógicas
• De Salto
• De Transferencia de Datos
• De Tratamiento de Bloques
• De Control de Interrupciones
• De Control de! Microcontrolador
En la figura 3.1 se presenta la clasificación y la subclasificación con sus
correspondientes instrucciones.
Esta clasificación la realiza González en el Libro "Introducción a los Microcontroladores de 16
bits".
80
+
Fig
ura
3.1
Tip
os d
e In
stru
ccio
nes
- E
XT
Bw
ag.
EX
TIn
g"L
DB
SE
wag
. boc
p.
LD B
ZE v
^eg,
bac
p
-RJE
Hw
aop
. P
OP
Wnc
p-P
JShF
- PO
PF-F
UE
W-P
OP
A
_O
RB
tr»
g b
ocp
— X
OR
ViT
Bg,
woo
p—
XO
RB
bre
g, tn
op—
NO
T'*™
g—
NO
TB
trag
SH
LWag
(fc
ort
SH
L \v
reg.
tr«
gS
KB
brs
g «
axrt
SH
LBbr
eflb
mg
St-L
LIre
g
fccu
i
SH
Rw
«s S
tort
SH
Rw
eg.
brog
SHR
B b
reg,
«m
uí
SHR
B b
rng.
b-sg
SH
RLIte
g,#
carí
SH
RLI
resi
bro
gSH
RA w
eg, »
car
i.9-
RA
WT
og. b
r»g
SHR
AB b
r»g.
Oco
u*S
t-RA
BIra
g, b
i»g
— N
OR
MLI
reg.
tra
g
L-c
t-R
SbrB
g
breg
-
Reo
sÜro
típo
BY
TE d
el F
iche
ro d
e R
eg
lítro
sw
eg
« R
egis
tro
Upo
WO
RD
del
Fic
hero
de
Reg
istr
osVe
o •
Reg
istr
o de
32
bis
del
Fic
hero
de
Reg
istr
osfa
aop •
Ope
rand
o Up
o B
yte
refe
rend
ario
por
uno
de
lo»
mo
do
s de
dire
cció
n a
mie
nto
svao
p «O
pera
ndo
tipo
VTO
RD
ref
eren
dario
por
uno
de
k)s
mo
do
s de
dlre
cclo
na m
ient
oci
dd
•
Dire
cció
n d
e có
digo
del p
rogr
ama
bitn
o
- C
ampo
de
tres
bíts
den
tro d
el c
ódig
o de
ope
raci
ón q
ut s
elec
cion
a un
o de
los
B b
us d
e un
byl
eco
un
t-
Rep
rese
nta
cual
quie
r va
lor
entre
O o
15.
*La
Inst
rucc
lin e
s es
peci
fica
para
e[8
XC
l96
KC
«eg2
. woc
p-
SUBB
Cto
g. b
ocp
SUBS
bra
gl,
tr»g3, b
ecp
-DG
Cw
wg
-DE
C8b
r«g
-NE
Gebra
g
MU
L k
-ag,
wr«
g, w
aop
• M
ULU
IrS
Vrti
opM
LJLU
tr*o w
«g
w»c
p
MU
LB w
eg. b
reg.
bec
p-M
UU
JBV
pToa
bocp
MÜ
LUB
weg, t
xvg.
bao
p-a
V^B
g W
oop
- D
IVU
B w
»g.
bx>p
- C
MP
vd»f
l wac
p-
CM
PB
br «
a. b
aqj
-CM
PLIrealre
g
tjBC
treg. M
no. c
add (s
i bin
a =
D)
JBS
bn
y. b
ino,
cod
d (j
( bt
na =
1)
81
BB
Sea
ddB
Cco
ddB
M3ca
ttl-B
E c
odd
B^E
cac
tiB
GE
cac
tiB
CJT
oiO
lB
Hca
tóB
Wco
ttí
BLE
cattl
BLT
cadd
BS
Tcac
tóB
hSTco
ddB
Vco
dcf
BfvW
cac
tiB
VT
cact
íB
N/T
codc
l
3.1.2.1 Instrucciones de Transferencia de Datos
Son las instrucciones de movimiento de datos entre los registros y posiciones
de memoria. Se agrupa en: instrucciones de datos propiamente dicha, de
manejo de la pila y de conversión de datos.
3.1.2.2 Instrucciones Aritméticas
Estas instrucciones contemplan operaciones de suma, resta, multiplicación,
división, comparación, incremento, decremento y negación.
Las instrucciones de suma, resta y comparación no distinguen entre valores con
o sin signo, el programador debe establecer si el resultado es con o sin signo.
Lo que puede ser analizado con el estado de los indicadores que cambian con
las operaciones aritméticas.
3.1.2.3 Instrucciones Lógicas
Son útiles cuando se quiere modificar el estado de uno o todos los bits que
forman un byte o word.
En las instrucciones de desplazamiento el operando destino (sobre el cual se
realiza el desplazamiento) es un registro de 8 o 16 bits, mientras que el
operando fuente admite un rango de valores de O a 15 si es inmediato, o con el
valor contenido en un registro. Si se utiliza un registro como operando destino
éste debe estar entre las direcciones 24 a 255, ya que no está permitido,
direccionamiento indirecto sobre los registros de funciones especiales. Cuando
82
Una instrucción debe contener sólo una referencia indirecta y si existen más
operandos se utilizará un direccionamiento directo. Los operandos con este
direccionamiento deberán estar entre corchetes [ ].
Ejemplo:LD AX, [AX] ;(AX)«- ((AX))ADDB AL, BL, [CX] ;(AL}<- (BLH)+((CX))
3.1.3.4 Direccionamiento Indirecto con Autoincremento
Direccionamiento similar ai anterior solo que el registro tipo WORD que
contiene la dirección indirecta se incrementa después de utilizada; si la
instrucción opera con BYTE o SHORT-INTEGER el registro se incrementa en
uno, y si opera con WORD o ¡NTEGER se incrementará en dos.
Ejemplo:LD AX, [BX]+ ;(AX)-e ((BX))
¡(BX)^-(BX) + 2ADDB AL,BL,[CX] ;(AL)<r(BL)+((CX))
3.1.3.5 Direccionamiento Indexado Corto
Este tipo de direccionamiento utiliza 2 campos: la dirección base (registro
definido en el fichero de registros entre corchetes) y una expresión de 8 bits
conocida como un desplazamiento. La dirección efectiva se la obtiene como la
suma de estos dos campos. Además el campo de 8 bits tiene signo.
Una instrucción sólo puede contener una referencia con direccionamiento
indexado corto; el resto de operandos, si existen, deben tener referencias
directas.
86
Ejemplo:LD AX,12[BX]MULB AL, BL, 3[CX] ;(AX)«-(BL)*((CX+3))
3.1.3.6 Direccionamiento Indexado Largo
Es similar al direccionamiento indexado corto, a excepción que en este caso el
campo tomado como desplazamiento es de 16 bits y no es necesaria ia
extensión del signo. Una instrucción sólo puede contener una referencia con
direccionamiento indexado largo; el resto de operandos, si existen, deben tener
referencias con direccionamiento directo.
Ejemplo:AND AX, BX, TABLEfCX] ;(AX}^- (BX) AND ((TABLE+CX))ST AX, TABLE[BX] ;(AX)-> ((BX+TABLE))
;TABLE tiene un valor asignado de 16 bits.
3.1.3.7 Direccionamiento de Registro Cero
Direccionamiento que utiliza el registro cero como una variable (tiene el valor
OOOOH) del tipo WORD dentro de una referencia indexada del tipo LONG. Esto
permite acceder directamente a cualquier posición de memoria.
Ejemplo:ADD AX, 1234[0] ¡(AX)^ (AX)+(1234)POP 5678[0] ;(5678)^ ((SP))
;(SP) -e (SP) + 2
3.1.3.8 Direccionamiento de Registro Puntero de Pila
Tipo de direccionamiento útil para localizar la "cima" de la pila, utilizando el
puntero de la pila como una variable tipo WORD en una referencia indirecta. O
bien puede ser utilizado en modo ¡ndexado corto para acceder a los datos de la
pila.
87
Ei programa brinda la facilidad de controlar los errores de ensamblado y
enlazado desde la barra de estado, así como la generación de los distintos
módulos en el proceso de programación en el árbol de ficheros, lo que facilita la
clasificación de los distintos tipos de ficheros generados.
La capacidad de desplegar ventanas de texto en cascada facilita la creación de
varios ficheros fuente al mismo tiempo, así como el despliegue de ios ficheros
listado, permite manejar los errores de programación de una manera fácil y
eficiente.
El programa tiene un menú útil para el control del ensamblador y el eniazador
que genera las directivas de control que el usuario desee.
Estas y otras características hacen de este programa una herramienta
adecuada para el manejo de la tarjeta de evaluación y la generación de los
programas de usuario.
Cada programa que se desee generar va a ser considerado como un nuevo
proyecto, el cual puede contener varios ficheros fuente (programa en
ensamblador), los cuales deben ser ensamblados y enlazados antes de
descargarlos en ia tarjeta para su depuración.
Micro196 está listo para descargar ei programa en la tarjeta cuando se ha
creado el fichero hexadecimal (.HEX) correspondiente al proyecto generado,
89
esto se puede observar en el árbol de ficheros al enlazar o ensamblar el
proyecto. Es posible además crear el archivo hexadecimal de un fichero fuente
el cual se crea con la extensión .HE y puede ser descargado en la tarjeta.
Una mayor descripción del programa se detalla en el manual de usuario adjunto
a la tesis.
3.2.2 Ensamblador ASM-196
Es un software de desarrollo que traduce el código fuente de un programa hacia
su correspondiente código objeto. Esto se realiza en dos pasos:
• Busca en el programa los valores de los símbolos definidos por el usuario,
• Genera el archivo con el código objeto y un listado presentando los
resultados del ensamblador.
El archivo objeto, está constituido por un lenguaje de máquina e información
para cargar éste archivo en una memoria. Este fichero, como resultado del
ensamblaje tiene un formato absoluto o recolocable. Se puede cargar este
fichero sin necesidad del RL196 (enlazador de ficheros), aunque se podría
utilizar este enlazador para resolver segmentos recoiocabies y referencias
externas.
90
El ensamblador genera además un fichero listado, que contiene el programa
fuente, mensajes de diagnóstico para revisar la sintaxis del programa u otros
errores de código y una tabla de símbolos.
Tabla 3*2 Extensión de los ficheros utilizados
.a96 .asm .src || Fichero fuente para lenguaje ensamblador
.inc || Fichero Include para lenguaje ensamblador. |
.obj || Fichero objeto OMF96 generado por el asml 96. |
.Ist || Fichero listado generado por el asm196.
.abs Fichero objeto absoluto sin referencias externasno resueltas.
.m96 | Fichero MAP.
.he || Fichero hexadecímal de un fichero fuente
.hex Fichero hexadecimal de todo el proyecto.Necesario cuando existan varios ficheros fuente
•pyt || Fichero que contienen información del programa |
3.2.2.1 Programa Fuente
El ensamblador emplea un programa fuente que debe ser elaborado como
texto, ya que el ASM196 utiliza el juego completo de caracteres ASCII. Las
combinaciones de estos caracteres generan las instrucciones, los operandos,
símbolos que serán entendidos por el ensamblador. Los elementos constitutivos
que deben formar parte del programa fuente como texto son:
Símbolos; etiquetas definidas por el usuario que representan direcciones de
memoria, constantes, variables, etc. Contiene un máximo de 31 caracteres. Los
símbolos nunca deben comenzar con dígitos ni coincidir con ninguna palabra
reservada del ensamblador.
91
Palabras Reservadas; son nombres que tienen un significado especial en
lenguaje ensamblador. Las palabras reservadas pueden ser: mnemónicos de
instrucciones, directivas del ensamblador, y símbolos predefinidos como
STACK, STACKSIZE, etc.
Constantes Numéricas; pueden representarse como números enteros o
constantes en coma flotante (números reales). Cuando son enteros están
formados por una serie de dígitos acompañados por la base del número
generado y si no se especifica la base se toma por defecto base decimal. En
cambio para la parte fraccional se debe especificar ei signo, la parte entera, la
parte fraccional y e! exponente.
Tabla 3^3 Constantes Numéricas
Ote. Numérica
BINARIO
OCTAL
DECIMAL
HEXADECIMAL
|L Base||(0-1) seguidos por B-b
|| (0-7) seguidos por O/Q o o/q
|| (0-9) seguidos por D-d
||(0-9)(A-F) seguidos por H-h
I
I
I
Cadenas de caracteres; secuencias de caracteres ASCII imprimibles, que son
tratados por el ensamblador de una forma literal.
Delimítadores; separan y terminan los operandos en una sentencia en el
ensamblador. Los deíímitadores se presentan en la tabla 3.4.
92
Tabla 3,4 Delimitadores
Delimrtador Descripción
Espacio Se utiliza como separadores de campos odelimitadores de símbolos
II Permiten separar operando!?
|| Delimitan cadenas de caracteres
|[ Delimitan expresiones
Encierran registros índice o base comooperandos de instrucciones
LF ¡[Carácter ASCli (OAH)terminadorde línea
CR j|Carácter ASCII(QDH) retomo de carro
HT || Tabulador horizontal• «• ^ • • •«• • •••••••• • ^ •¡ • ^ H
"|| Delimita el comienzo de un comentario"
[¡Precede a un dato inmediato
H Separa un nombre del resto de la sentencia |
3.2.2.2 Directivas
Las directivas dan información al ensamblador para que determine la forma en
la que debe generar el código objeto a partir del código fuente. Al hablar de
directivas es necesario conocer también el concepto de segmento.
Un segmento es una porción de memoria que puede contener datos o
programas y la unión de todos los segmentos genera la aplicación que el
usuario quiere desarrollar. Antes de definir cualquier espacio de memoria, es
necesario definir una directiva de selección de segmento, debido a que no
existe ningún segmento por defecto.
Los tipos de segmentos y sus características se detallan en la tabla 3.5.
93
TobÍQ 3,5 T/pos de Segmentos
Registro nosuperpuesto
RegistroSuperpuesto
Datos
Pila
Código
Fichero deRegistros
Fichero deRegistros
RAM
RAM
ROM
Registros
Registros
Datos
Datos
Código yconstantes
No permite solapar con otros segmentos
Se podrá solapar con otros segmentossuperpuestos que no estén activos enforma simultánea.
El usuario puede acceder a direcciones deRAM que se definan en estos segmentos.
Se colocan en forma contigua en unasección de RAM
Las instrucciones de máquina deben estarubicadas en estos segmentos.
Las directivas pueden ser:
Directivas de Módulo
MODULE: nom_modulo MODULE [ atributos, (atributos)]
"nom_modulo" determina el nombre que se le asignará al fichero objeto. Si se
omite este parámetro el fichero objeto recibirá el nombre del fichero fuente. Este
módulo debe aparecer al menos una vez en el programa. Cuando utilizamos
Micro 196 es necesario omitir el parámetro nom_modulo.
Los atributos pueden ser MAIN y STACKSfZE.
• MAIN especifica el módulo como principal y
• STACKSIZE determinan en bytes la cantidad de espacio que requiere el
módulo para la pila.
94
PUBLIC: PUBLIC nom__símbolo[,...]
Declara uno o más símbolos como públicos, los símbolos deben definirse en
alguna parte del programa bien como etiquetas o utilizando una directiva de
definición de símbolos. Los nombres de módulos o palabras reservadas no se
pueden declarar como símbolos.
EXTRN: EXTRN {nom_símbo!o[:tipo_dato]} [,...]
Declara uno o más símbolos como externos, es decir estos símbolos deben
estar definidos en otros módulos, los cuales deben ser declarados como
públicos.
Si por ejemplo se desea definir un símbolo externo de tipo código, la directiva
EXTRN debe situarse dentro de un segmento de tipo código en el fichero donde
se realiza la definición.
tipo_dato hace referencia al tipo de segmento que se va a definir. Esos pueden
ser: WORD, LOA/G, REAL y NULL que pueden definirse en cualquier parte del
fichero, mientras que el tipo ENTRY debe definirse siempre dentro de un
segmento de código.
END: END
Delimita el final del fichero, cualquier otra sentencia localizada después de esta
directiva será ignorada. Esta sentencia debe estar presente siempre en el
95
Directivas de Selección de Segmentos
Estas directivas determinan el tipo de segmento que se va a utilizar en las
siguientes líneas dentro del programa. Las directivas de selección de segmento
se indican en la tabla 3.6.
Tabla 3,6 Directivas de Selección de Segmento
\l DSEGl RSEGl OSEG} [REL ATdirecc base]
CSEG Designa el segmento de código
[ DSEG Designa el segmento de datos
RSEG Designa un segmento de registro no "superpuesto"
OSEG Designa un segmento de registros "superpuesto"
11111
Los atributos [REL|AT direcciónjDase] definen los segmentos como
recolocables (REL) o absolutos (AT dirección_base). Si es absoluto se crea el
nuevo segmento en la dirección base señalada y si es recolocable continuará
activo el último segmento seleccionado de este tipo, si existe.
Un segmento se extiende hasta encontrar una nueva directiva de selección de
segmento o la directiva END.
ORG: ORG expresión
La directiva ORG asigna al contador de posiciones el valor de la dirección de
memoria dada en "expresión".
Directivas de Definición de Símbolos
Estas directivas son EQU y SET.
96
nomjsímbolo {EQU SET} expresión [:íipo_dato]
Ambas definen las características del símbolo (nomjsímbolo) que correspondan
con el atributo expresión, este atributo puede ser: tipo de segmentos,
recoíocabilidad, valor y tipo de dato. El atributo opcional (tipo_dato) puede ser
BYTE, WORD, LONG, REAL y NULL en cualquier segmento mientras que
ENTRY sólo en segmentos de código. Los símbolos definidos por EQU no
pueden ser redefinidos, lo contrario ocurre con los símbolos definidos con SE7.
Una utilidad de EQU es facilitar la definición de los registros de funciones
especiales en sus posiciones de memoria correspondientes.
Directivas de Definición de Constantes
Especifican constantes del tipo: BYTE, WORD, LONG y REAL Estas directivas
sólo pueden aparecer en el segmento de código.
Tabla 3,7 Directivas de Definición de Constantes
\a
DCB
DCW
DCL
| DCR
U Características
|| Especifica constantes del tipo BYTE
[Especifica constantes del tipo WORD
H Específica constantes del tipo LONG WORD
|| Especifica constantes del tipo REAL
\s de Reserva del Espacio de Almacenamiento
Se utilizan para poner etiquetas a posiciones de memoria que actúan como
variables dentro del programa. El contador de posiciones se va incrementando
de acuerdo a la directiva utilizada y con el resultado de la operación
expresión*N} donde N puede ser:
97
N=1 para DSB
N=2 para DSW
N=3paraDSRyDSL
Y expresión proviene de:
[etiqueta:] {DSB DSW DSL DSR} expresión
expresión corresponde a 8, 16 o 32 bits que empiea ia variable según
corresponda.
Directivas de Ensamblado Condicional
Estas son IF, ELSEy ENDIF. Permiten controlar el flujo en el ensamblado y la
ejecución, dependiendo de una condición de las sentencias que corresponden
al programa. Si en una parte del programa se ignora una o un grupo de
sentencias, éstas no formarán parte efectiva del programa y el usuario debe
tener en cuenta de "no utilizar símbolos" definidos dentro de estas sentencias
ignoradas.
3.2.3 Enlazador RL196
Luego de obtener los distintos módulos objeto del ensamblado, para unirlos o
compactarlos se utiliza el RL196. Este trata a cada segmento recolocable como
una unidad independiente, para ubicarlo en una localidad de memoria
determinada. El enlazador conoce a que localidad pertenece cada segmento, si
es ROM, RAM, o está en el área de registros.
98
Cuando se realiza el proceso de enlazado, se genera un fichero objeto (.abs)
con todos los ficheros objeto correspondientes y un fichero con los resultados
del proceso (.m96).
Este programa permite la implementacion del modelo de programación modular
facilitando la unión de ficheros objeto.
3.2.4 Convertidor OH196
Es un programa que permite convertir un fichero objeto a un fichero
hexadecimal. Este fichero hexadecimal contiene la información de las
localidades de memoria que tiene el programa, así como el programa mismo en
un formato numérico en base hexadecimal.
El archivo de salida (.HEX) posee los siguientes campos:
: Longitud offset separador contenido checksum
Donde:
: es la cabecera.
Longitud; cantidad de bytes que contiene la fila con un valor máximo de 16
bytes.
Offset; dirección absoluta, en donde los datos van a estar localizados. Este
campo es de 2 bytes.
99
debe obtener el fichero objeto de cada módulo. Cada módulo en este caso
puede ser recoiocabie, si uno de sus segmentos es recoiocabie; en caso
I contrario si ninguno de los segmentos es recoiocabie, el fichero es absoluto y
puede ser cargado en la tarjeta sin necesidad de la ayuda de RL196, RL196
trata cada segmento recoiocable como una unidad independiente, asignándole
una posición de memoria absoluta.
.* El fichero archivo absoluto total (.abs, formado de segmentos recolocables) se
debe convertir en un fichero numérico con base hexadecimal, mediante el
OH196. Este paso es necesario para descargar el programa en la tarjeta de
evaluación. Todo el proceso se simplifica con el uso del programa Micro196,
que permite realizar cada paso en forma secuencial e interactiva con el usuario.
101
í MODULO06JETOABSOLUTO
«***»— ¿ "
CONVERTIDOR
OH196
......--."i1
gftü-tóep.-cVJ f* tóírVü Yrt'tN ,U1KULÍI f.U
Figura 3.2 Pasos para ejecución de un programa de usuario
102
Es importante tener en cuenta las referencias que existen entre cada módulo,
es decir si existen variables o etiquetas que un módulo las utilice y estén en otro
módulo. Las directivas que se utilizan para este proceso son PUBLIC y EXTRN.
Cuando se define una variable (dentro del segmento de registros), ésta solo
tiene un carácter local en su definición, si se desea utilizar esta variable en otro
módulo es necesario:
• Declarar la variable como pública (PUBLIC) en el módulo que esta definida.
• Declarar la variable como externa (EXTRN) en los módulos que la hagan
referencia.
Cuando se accede a una rutina simplemente se procede igual al caso anterior
solo que con la etiqueta de la rutina, dentro del segmento de código.
3.3 EJEMPLO DE USO DEL SISTEMA
En este apartado se expone un ejemplo de programación para una aplicación
determinada y se explica el funcionamiento del programa Micro196 y la manera
de descargar el programa en la tarjeta de evaluación.
El programa presenta tres bloques principales:
• El programa principal simula una luz deslizante en el Puerto P1. Utiliza la
rutina RETARDO.
103
• La rutina RETARDO produce una temporización para visualizar e!
desplazamiento de la luminosidad.
• Se utiliza una rutina asociada a la interrupción externa (INT7), que se activa
por flanco ascendente en el pin P0.7. Produce 5 ciclos de parpadeo en todos
los LEDs del puerto!
El programa principal se llama "EJEMPL01", el módulo principal se llama
"DESPLAZAMIENTO", el módulo de temporización se llama "RETARDO",
3.3.1 Inicio del Programa.
Micro196 se instala dentro del directorio raíz del disco duro. Se crea el directorio
"C:\Micro196", en el que está e! programa Micro196.exe que permite su
ejecución. Haciendo doble clic sobre este archivo, se observa una pantalla
inicial de presentación del programa. Se puede también inicializar el programa
desde la "barra de inicio" de Windows dentro de "Programas".
En la pantalla inicial, se despliega dentro del menú "Archivo" la opción de "Abrir
proyecto" o de realizar un "Nuevo proyecto", en este caso se debe escoger la
opción "Nuevo proyecto".
104
Figura 3.3 Nuevo Proyecto
En el casillero correspondiente, se escribe el nombre del proyecto que en este
caso es "EJEMPL01", nótese que no es necesario escribir ninguna extensión
en el nombre del proyecto. Esta acción hace que se cree un directorio con el
nombre EJEMPL01 dentro de "C:\Micro196\Proyecto", este constituirá el
directorio de trabajo del proyecto.
105
Figura 3.4 Ingresar el nombre del proyecto.
3.3.2 Ingreso de los Archivos Fuente
El programa fuente principal para la elaboración del proyecto, se detalla a
continuación:
$TITLE ("Programa Principal.SDEBUG
DESPLAZAMIENTO.A96'"
DESPLAZAMIENTO MODULE
SP EQUINT7 EQUP1 EQUIOC1 EQUINT_MASK EQUINT_PEND EQU
RSEG AT 1AHALM1: DSW 1ACUM: DSB 1
MAIN
18H:BYTE ¡Inicializa Punt Pila.200EH ;Posición de la tabla vectorización.OFH:BYTE ¡Puertol16H:BYTE ¡Registro de Control08H:BYTE ¡Registro de Máscaras09H;BYTE ¡Registro de Interrupciones Pendientes
¡Reserva la posición 1AH para ALM1¡Reserva [a posición 1BAH para ACUM
106
PUBLIC ALM1PUBLIC ACUM
¡Permite la utilización de esta Variable para otros¡módulos
CSEG AT INT7DCW 3040H
CSEGINICIO;
AT
EXTRNLDLDBElLDBLDB
2080H
RETARD:ENTRYSP,#010ÜHINT_PEND,#OOH
IOC1,#02HINT_MASK,#80H
VUELVE;
IZQ:
DER:
LDBLDBLCALLSHLBJNELDBLDBLCALLSHRBJEJNE
ACUM,#01HP1.ACUMRETARDACUM,#Q1HIZQACUM,#40HP1.ACUMRETARDACUM,#01HVUELVEDER
NOP
¡Rutina de [a Interrupción ExternaRSEG AT 1AHREG: DSB 1CSEG AT 3040H
PUSHAPUSH REG
EXTRN RETARD:ENTRY
LAZO;LDBLDBLCALLLDBLCALLDJNZPOPPOPARET
END
REG,#05HP1,#OOHRETARDP1,#OFFHRETARDREG,LAZOREG
¡Vectoriza INT7
¡inicio de los códigos de programa en la dirección 2080H
¡Determina que RETARD es una rutina Externa¡Inicia Puntero de Pila¡Borra interrupciones pendientes¡Habilita interrupciones globalmente¡Selecciona INT7 por P0.7¡Habilita INT7.
¡Inicia la Secuencia de Desplazamiento¡Pone el valor de ACUM en el puerto 1¡Llama a la subrutina RETARDO¡Desplaza en una posición el valor de ACUM¡Sigue si el desplazamiento es de izquierda a derecha¡Inicia el desplazamiento de derecha a izquierda¡Pone ef valor de ACUM en el Puertol¡Llama a retardo¡Realiza un desplazamiento a la derecha;S¡ el desplazamiento termina hacia la derecha¡Si el desplazamiento continúa hacia la derecha
¡Guarda en la pila PSW^NT_MASK,INT_MASK1 y WSR
¡Determina que RETARD es una rutina externa¡5 ciclos de parpadeo de las luces¡Presenta en el banco de LEDs OOH¡Llama a un retardo¡Presenta en el banco de LEDs FFH¡Llama a un retardo¡Decrementa Lazo y repite, si es el caso¡Repone Reg¡Repone los registros
El fichero debe almacenarse, escogiendo en el menú archivo la opción guardar.
Este se archivará como DESPLAZAMIENTO.A96. Note que no se debe poner la
extensión.
107
(TTTLt ("Pcograiia Idncipol.ÍDEBUC
DE3H.iz*Hinrro.A9 e")
;Inicialica PurtC. Pila, ¡.->:Aposición de la tabla veC;;í
;RegÍ3tra de Control;Reglscco de Bascaras;Reg. ínter. Pendientes
IfiHíHTIZ08H:BTITD9H:BTrE
IOC1nrr_HisKUiT PEHD
í Reserv» la posición 1AH pera IJ-; Reservo la posición ,1BÍH para ¿
Figura 3.5 Crear Fichero Fuente
Si el usuario io desea puede en este momento ensamblar el fichero, en caso
contrario debe ingresar el otro módulo escogiendo en el menú archivo la opción
"nuevo fichero". Se desplegará en cascada al fichero anterior otra ventana de
texto que le servirá para introducir el nuevo módulo:
$TITLE ("Rutina de retardo.SDEBUG
RETARDO.A96")
RSEG ATEXTERNEXTERNMEMO: DSWMEM1: DSWMEM2: DSW
1AHALM1:BYTEACUMrByTE
CSEGPUBLIC RETARDRETARD;
PUSH ALM1PUSH ACUMLD MEMO,#0030H
SALO: LD MEM1,#0040HSAL1: LD MEM2t#0050HSAL2: DJNZW MEM2,SAl_2
DJNZW MEM1,SAL1DJNZW MEMO.SALO
¡Segmento Recolocable
¡Guarda en [a pila el contenido de ALM1;Guarda en la pila el contenido de ACUM;ínicializa la secuencia de tiempo;Para generar el retardo
108
POP ACUMPOP ALM1RET
;ReponeACUM;Repone ALM1
END
Este módulo debe almacenarse con el nombre RETARDO.A96, y debe tratarse
de forma similar al anterior.
•í::\HlCri0106SPflpyHtrO'.EJCMPl-Q.I>>nETAFtDO.A36
fTITLE ("Rutinn de retardo. RETASDO.A96")
-O Uilodo
-C) hcxodoclmal
HCttll D3¥ 1ITO12; D5ff 1
118ALÜÜffíTEACÜH:BjTÍ
;3egnento Recolocablc
•s i£S&%W{iy££1W^(TTTLEÍDEBUG
PR1H SOCOLE
PlIOC1DITHJL5K
. PdUClpeJL. MSPLAZJlJJIEirrO.ASG-)
EQD ZOGEHZCfU OrHíHTTE100 16S;BTTE
;Iníciai±i» tuax.. Pila,;FoslcÍón de la tabla vecCOtitación,jfuercol;Rcglscro de Concrol;Reo±3CEO de Itaacaraa
Figura 3,6 Crear otro Fichero,
3.3.3 Ensamblado y Enlazado.
Con los dos módulos fuente guardados en el disco, se procede a ensamblarlos.
Para ejecutar este proceso, es necesario seleccionar la ventana
correspondiente al fichero fuente que se desea ensamblar, inicialmente se
selecciona el fichero DESPLAZAMIENTO.A96 y dentro del menú herramientas
se escoge la opción ensamblar.
109
DE3PI.AZAJtIEBTO.Jl96"(Tcograaa Principal.
EOÜ L8H:BTn:EW 200EHEQÜ OrHsHTTE
dt ConteníiReglscia de Bascaras;Reff. In«r, Pendientes-O Uitoto
DESDLAZAMI
R.ETARDOJ.ST RSTG AT 1AHUBI: DÍW 11CBH: B3B 1
la posición 1AH poro JU.
C:\NICR019G\PROYECTD\EJEMPL01\RETAROO-AMASSEMBLY CDMPLETED. HO EHHORfSJ FOUND
Figura 3.7 Ensamblar Ficheros
Una vez completo este proceso, el programa presenta en la parte inferior de la
pantalla si ha existido o no errores. Se puede además observar que en lugar del
árbol de ficheros se ha creado el fichero objeto y el fichero listado. Si el usuario
lo desea puede ver el fichero listado para comprobar los posibles errores y la
forma en que se ha realizado el ensamblado. Este procedimiento se puede
repetir las veces que sean necesarias hasta que el programa este depurado
completamente y no tenga errores.
110
aaoase ñora ASSEHBLCR
30C196 do» «sera MSembler V6.0 rl SSOOOOOOOO-194 (c) 1333 TA3KDIG, 1$.
SODRCE mí: C:\HICR0196\fSOIECTCI\EJEaiLOUPrTlPHO.A96 $OBJECT FILE: C;\HICR0196\I1ROYE(rn]\EJZHPL01\rJirrAED().obn
COHKAKD; errorprint(c:\BÍcciii96\ce»p\ctcci';
P^
CQHTRD13 JPZCITIED BT
jnrr souwx STMEBEBT1 ÍTTIIE ("Butiaa de retando,2 ÍDEHUG
C:\MICnOlSG\PBOYECTO\EJEMPLD1VRETARDGJV3eftSSEHBLY COUPLETED. HO EHRORfS) FOUND
Figura 3.8 Abrir archivos .LSTy editar errores.
Este procedimiento se repite para el fichero RETARDO.A96, obteniéndose
también el fichero objeto de este archivo fuente.
Con los dos ficheros objeto se procede a unirlos mediante el enlazado. Para ello
en el menú herramientas se selecciona "enlazar", se despliega otra ventana, en
la cual se debe escoger los ficheros objeto que se desee inciuir, en este caso se
escogerán los ficheros: DESPLAZAMIENTO.obj y RETARDO.obj.
111
l£:MCMl?Í^Jíffi022001:0040306010208000ilOO0118BlDOa9ÍBB1021SB19E308B1012D
i j~í5 tETAHDaX)Bj| (TITLE ("Rutina de retarda. RCTÍBDQ.A96")j L© ÜESCWZAMIEjA-CD Uslata
i ...j-Ü RETAH.Daj.5T |
ÍDtfftIG
RSEG AT
EXIWI
DcnuíHEHO: P?g
-CD HexadscimalLQ i
y*1
PRTIí HDDÜLE HAOT
EOU 18K:BTrE ;IniciíO±sa. PunC. Pila.
¡qi 983.1930,1333 Intel Ct»p««ationIHPITT RLES; CWiira19e\Pioyeclo\EJEMPU)1\DESPLA2AUIEHTQJ)BJ, C:\Mtoo19G\Piopccto'iEJEyPL01 WETARDO.DBJ
Figura 3.10 Edición del Enlazado
3.3.4 Transferencia hacia la Tarjeta de Evaluación.
Antes de iniciar el proceso de transferencia hacia la tarjeta es necesario
determinar el valor del CCR (Registro de Configuración del Chip). Para io cual
se debe escoger en el menú opciones todas las características que el usuario
necesite para la aplicación. Como se observa en la figura 3.11.
113
&fc¿n, V« JJpdbrw HerwwH.it.- Vertana
$S;tePi8 ^ 3 Ü2200E00403D60. -i •^---U-^.-fc^.E-.^--^..naoannniinnnl
DESDLAZAMI
RETARDO./9Í
3-Cl Objeto ( * ^ í
*^^4
3_P EQÜ Iffitr.BTn:: ^^ajciajd» PunC. Pila.
(C)1983,1930,1933 Intd CcwpwMionIHPUTRLES C.\W«o19KVfofect(AEJEMPLD1\OESPLAZAMIEHTDOBJ C-UfioniasViofectoVEJEMPUnmETARDO OBJ
Figura 3.12 Transmisión hacia la Tarjeta.
El programa despliega cuando se finaliza la transmisión si ha existido o no
errores en este proceso.
Para ejecutar ei programa, por seguridad se debe tener presionado el reset en
la tarjeta y cambiar los interruptores de "cargar" hacia "ejecutar", con esto el
programa se ejecuta en ia tarjeta en tiempo real.
En la tarjeta de periféricos se observará que en ei banco de LEDs se desplaza
el punto luminoso de izquierda a derecha y viceversa, el momento que se
genera una interrupción en el pin P0.7, se producen cinco "parpadeos" de los
115
LEDs y luego se sigue desplazando el punto luminoso en la posición que se
quedó antes de la interrupción.
Al salir del programa Micro196, se recomienda "guardar" el proyecto con los dos
ficheros fuente abiertos, para facilitar la edición de estos en futuras ocasiones.
116
CAPITULO IVJt
PRUEBAS Y RESULTADOS
Este capitulo consta de ejemplos desarrollados con la tesis, en donde
tratamos de usar todos los periféricos externos construidos para el efecto,
con una explicación introductoria de que hace el programa cargado en la
tarjeta de desarrollo.
4.1 LEOS
El programa enciende en un determinado tiempo un LED "secuenciaimente"
del banco de 16 LEDs, ubicado en ia dirección COOOH. El objetivo es
observar el buen funcionamiento del periférico en mención, además
demostrar que no es posible en el microcontroiador direccionar bit a bit.
DRIVER DE SALIDA
$TITLE("LEDS16.A96")
$DEBUG
LEDS16 MODULEMAIN
P1
SP
RAMBASE1
EQU OFH:BYTE
EQU 18H:BYTE
EQU OCOOOH;WORD
;LAS VARIABLES LAS SITUÓ A PARTIR DE LA 1AH
RSEG AT 1AH
ROMBASE1:
DAT6:
DAT5:
DAT4:
DAT3:
DSW 1
DSW 1h
DSB 1
DSB 1
DSB 1
CSEG AT 2080H
INICIO:
LD SP,#0100H
LDB P1,#11100111B
LD ROMBASE1 ,#RAMBASE1
LD DAT6,#0001 H
118
LDB DAT3,#16
LAZO:
ST DAT6,[ROMBASE1]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
SHL DATG,#01H
DJNZ DAT3.LAZO
LD DAT6,#0001 H
LDB DAT3,#16
SJMP LAZO
RETARDO:
LDB DAT5,#OFFH
LDB DAT4,#09H
HOLA:
DJNZ DAT4.HOLA
DJNZ DAT5.HOLA
RET
END
La instrucción SHL permite desplazar un bit del registro DAT6 de derecha a
izquierda el numero de veces dado por el registro DAT3, el cual sé
decrementa mediante DJNZ y según la condición del registro permanece o
sale del bucle de desplazamiento del LED. El registro DAT6 se presenta en
la dirección de RAMBASE1 la cual es visible en el banco de LEDs.
4.2 DIP-SWITCHES
Este ejemplo muestra ia entrada de datos digitales a través del bus dei
microcontrolador y la visualización de los mismos en el banco de 16 leds.
Cabe indicar que tanto los dip-switches como los LEDs están en la dirección
COOOH
119
DRIVER DE SALIDA
DRIVER DE ENTRADA
¡II DIPSWITCHES
DSW 1
DSW 1
DSB
DSB
2080H
$TITLE("SWITCHES.A96")
SDEBUG
SWITCHES MODULEMAÍN
P1 EQU OFHrBYTE
SP EQU 18H:BYTE
RAMBASE1 EQU OCOOOH:WORD
;LAS VARIABLES US SITUÓ A PARTIR DE LA 1AH
RSEG AT 1AH
ROMBASEl:
DAT6:DAT5:DAT4:
CSEG AT
INICIO:
LD SP,#0100H
LDB P1,#11100111B
LD ROMBASE1,#RAMBASE1
BORRAR:
LD DAT6,[ROMBASE1]
ST DAT6,[ROM8ASE1]
SJMP BORRAR
END
En este ejemplo se observa la diferencia de las instrucciones ST y LD
(Correspondiente a MOV en la familia MCS-51),
La instrucción LD transfiere datos desde el operando fuente ubicado a la
derecha hacía el operando destino ubicado a la izquierdo , mientras que ST
transfiere datos en forma inversa.
120
Se observa además que cuando se leen los datos se trae la información
desde los dip-switch mientras que si se escribe en la dirección compartida se
observa el dato en ios LEDs.
4.3 DISPLAY
En la tarjeta de periféricos existe 4 displays de 7 segmentos ubicados en la
dirección D800H. Ei ejemplo implementado consiste en poner en cada uno
de los displays valores de O a 9 repetitivamente con un retardo en la
visuaiización para cada número.
n iDECODIFICADORES BCD-7 SEG
$TITLE("D|SPLAY.A96")
$DEBUG
DISPLAY MODULE MAIN
P1 EQU OFH;BYTE
SP EQU 18H:BYTE
DlSPLAYl EQU OD800H:WORD
;LAS VARIABLES LAS SITUÓ A PARTIR DE LA 1AH
RSEG AT 1AH
DISPLAY2:
DAT6:
DAT5:
DAT4;
CSEG AT
INICIO:
LD SP,#0100H
LDB P1,#11100111B
LD DISPLAY2,#D!SPLAY1
DSW 1
DSW 1
DSB 1
DSB 1
2080H
121
BORRAR;
LD DAT6,#OOOOH
ST DAT6,[D|SPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#1111H
ST DAT61[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#2222H
BORRAR:
LD DAT6,#OOQOH
ST DAT6,[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#1111H
ST DAT6,[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#2222H
ST DAT6,[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LGALL RETARDO
LCALL RETARDO
LD DAT6,#3333H
ST DAT6,[DÍSPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#4444H
ST DAT6,[DlSPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DATS,#5555H
ST DAT6,(DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#6666H
ST DAT6,[D!SPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#7777H
122
ST DAT6,[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#8888H
ST DAT6,[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LD DAT6,#9999H
ST DAT6,[DISPLAY2]
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
SJMP BORRAR
RETARDO:
LDB DAT5,#OFFH
LDB DAT4,#10H
HOLA:
DJNZ DAT4.HOLA
DJNZ DAT5.HOLA
RET
END
En la tarjeta de evaluación se observa secuencialmente los valores puestos
en la instrucción ST que carga este dato a la dirección destinada al display.
"Retardo" es una subruíina que crea una temporizacíón que permite al
usuario observar el cambio de numero sobre el display.
4,4 TECLADO
Consiste en un dispositivo de entrada de datos de 16 teclas, las cuales
pueden ser leídas en la dirección DOOOH ya sea por barrido o por
interrupción. De igual manera e! valor leído puede ser mostrado en cualquier
123
periférico de visualización. En este ejemplo e! valor leído del teclado es
mostrado en los displays.
i n n iiDECODIFICADORES BCD-7 SEG
INT7
$TITLE("TECLADO.A96")
SDEBUG
TECLADO MODULEMAIN
Pl EQU OFH:BYTE
WSR EQU 14H:BYTE
SP EQU 18H:BYTE
INT7 EQU 200EH:WORD
TECLAD01 EQU ODOOOH'.WORD
DISPLAY1 EQU OD800H;WORD
INT_PEND EQU 09H:BYTE
INT_MASK EQU 08H:BYTE
10C1 EQU 16H:BYTE
;LAS VARIABLES LAS SITUÓ A PARTIR DE LA 1 AH
RSEG AT 1AH
DISPLAY2:
TECLADO2:
DAT4:
DAT6:
DAT6 L:
DSW
DSW
DSW
DSW
EQU DAT6;BYTE
124
DAT6JH: EQU OAT6+1 :BYTE
ALM1: DSW 1
DAT5: DSW 1
CSEG AT INT7 ¡Vectoriza INT7
DCW 3040H
CSEG AT 2080H
INICIO:
LD SP,#0100H
LDB INT_P£ND,#OOH
El
LDB IOC1,#02H
LDB INT_MASK,#80H
LDB P1,#11100111B
LD DISPLAY2,#DISPLAY1
LD TECLADO2,#TECLADO1
LD DAT6,#8888H
LAZO:
LD DAT4.DAT6
ST DAT4,[DISPLAY2]
SJMP LAZO
CSEG AT 3040H
PUSHA
LDB P1,#0000111 IB
LDB DAT6_L,[TECLAD02]
AND DAT6,#OOOFH
POPA
RET
END
La utilización del teclado se la hace mediante interrupción utilizando ios
registros necesarios para habilitar la interrupción INT7. Mediante El se
habilitan todas las interrupciones, 10C1 permite que el pin pO.7 trabaje como
interrupción externa. La vectorización de esta interrupción se la realiza
mediante la señal "data available" del manejador de teclado 74C922N.
4.5 LCD (2 FILAS, 16 CARACTERES)
En este ejemplo se utiliza las subrutinas desarrolladas para el LCD como
son las de inicialización, clear, movcursdor, printchar, printdig, promlcd, las
cuales permiten el manejo y la presentación de datos adecuadamente, en
125
este caso sacamos mensajes ai LCD para indicar el buen funcionamiento de
este periférico
STITLE("LCDX.A96")
$DEBUG
LCDX MODULEMAIN
P1 EQU OFH:BYTE
SP EQU 18H:BYTE
LCD EQU OC800H:WORD
LEDs EQU OCOOOH;WORD
;LAS VARIABLES LAS SITUÓ A PARTIR DE LA 1AH
RSEG AT 1AH
LCD1:
LCD2:
ROM:
AUX:
AUXJ_:
AUX_H:
LEDSl:
LEDS2:
DAT4:
DAT5:
DAT6:
DAT7:
DAT8:
DAT9:
DAT10:
DAT11:
DAT12:
LCD_L:
CURSOR:
CARÁCTER:
DÍGITO:
CONTLCD:
CONTLCD1;
CSEG AT
INICIO:
DSW
DSW
DSW
DSW
EQU
EQU
DSW
DSW
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
DSB
2080H
1
1
1
1
AUXtBYTE
AUX+UBYTE
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
126
LD SP,#010QH
LDB P1,#000000116
LD LCD1,#LCD
LD LCD2,#LCD+1
LD LEDS1,#LEDS
LAZO:
LDB P1,#11111001B
LCALL RESETDISP
LCALL CLEARDISP
LDB CURSOR,#1
LCALL MOVCURSOR
LD ROM,#3000H
LCALL PROMLCD
LDB CURSOR,#16
LCALL MOVCURSOR
LD ROM,#3010H
LCALL PROMLCD
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL CLEARDISP
LCALL RETARDÓTE
LD LEDS2,#OFOFH
ST LEDS2,[LEDS1]
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LD LEDS2,#OFOFOH
ST LEDS2,[LEDS1]
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
127
LCALL RETARDÓTE
LCALL RETARDÓTE
LCALL RETARDÓTE
LD LEDS2,#OOOOH
ST LEDS2,[LEDS1]
SJMP LAZO
END
En las subrutinas dadas en Micro196 se encuentran todos las funciones
LD LEDS2,#OOOGH
ST LEDS2,[LEDS1]
SJMP
END
En las subrutinas dadas en M¡cro196 se encuentran todos las funciones
tanto de iniciaüzación ,clear, display on-off, set, etc. Las cuales de acuerdo al
fabricante del LCD son las necesarias para su correcto uso. En este ejemplo
se muestra mensajes que ocurren en el momento que se direcciona a
PROMLCD, que es la subrutina de visuaiización de mensajes.
4.6 PUERTO P1
El puerto P1 puede ser visualizado a través de una barra de LEDs, en el
cual se presenta en los ejemplos anteriores valores de 8 bits. Se presenta un
ejemplo en el cual se desplaza un punto luminoso a través de este puerto
(es decir un bit) y en el caso de existir una interrupción externa parpadea 5
veces, luego continua con el movimiento del punto luminoso.
128
^^Kfi Éb P0.7
PÍO
P1.1
P1.2
P1.3
P1.4
P1 5
P1.6
P1.7
l
i
i
i
i
V
I^
I
I
STITLE ("'Rutina de interrupción. 1NTE7.A96")
$DEBUG
INTE7 MODULEMAIN
RSEG
SP EQU
INT7 EQU
MC RETAR
P1 EQU
IOC1 EQU
INT_MASK
INT_PEND
AT
ALM1:
ACUM; DSB
DAT1:
DAT2:
18H:BYTE
200EH:WC
EQU 2
OFH:BYTE
16H:BYTE
EQU C
EQU C
1AH
DSW 1
1
DSB 1
DSB 1
3000H:WORD
08H:BYTE
09H:BYTE
CSEG AT INT7
DCW 3040H
CSEG AT 2080H
;Vectoriza INT7
INICIO;
'LD SP,#0100H
LDB INT_PEND,#OOH
El
LDB IOC1,#02H
LDB INT_MASK,#80H
129
LAZO:
LDB !NT_MASK,#80H
LD8 P1 ,#001100116
NOP
SJMP LAZO
RETARDO:
LDB DAT1,#OFFH
LDB DAT2,#125
HOLA:
DJNZ DAT2.HOLA
DJNZ DAT1,HOLA
RET
CSEG AT 3040H
PUSHA
DI
LDB INT_PEND,#OOH
LDB INT_MASK,#OOH
LDB P1 ,#111100006
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
LDB P1 ,#00001111B
LCALL RETARDO
LCALL RETARDO
LCALL RETARDO
POPA
RET
END
Este programa permite , gracias a la secuencia de ios estados de salida
visualizados por la barra de LEDs, hacer un seguimiento de la interrupción,
observando el estado de la salida en [a ejecución del programa principal
antes de la interrupción, en la ejecución de la rutina asociada a la
interrupción y después de la misma cuando el control del sistema regresa al
programa principal.
4.7 PUERTO SERIAL
130
Este ejemplo consiste en transmitir un carácter desde el computador a la
velocidad de 1200 baudios, el cual es presentado en la barra de LEDs a
través del puerto P1 y luego es retransmitido a través del mismo puerto serie
hacia ei computador. En el computador se utilizó el programa Hyperterminal
que permite la fácil utilización deí programa antes mencionado
RX
TX
P1.0
P1.1
P1.2
P1.4
P1.5
P1.6
P1.7
$TITLE ("SERIALA96")
SDEBUG
PRIN MODULE MAIN
SP
P1
INT9
INT_MASK1
tNT_PEND1
SP__CON
BAU DÓRATE
SBUF
IOC1
RSEG AT
DATO: DSB
EQU 18H:BYTE
EQU OFH:BYTE
EQU 2032H:WORD
EQU 13H:BYTE
EQU 12H:BYTE
EQU 11H:BYTE
EQU OEH:BYTE
EQU OTHlBYTE
EQU 16H:BYTE
1AH
1
131
CSEG
CSEG
INICIO:
LAZO;
AT INT9
DCW 4000H
AT 2080H
LD SP,#Q100H
LDB INT_PEND1,#OOH
LDB IOC1,#20H
El
LDB INTIMAS K1,#02H
LDB BAUDJWE,#40H
LDB BAUD_RATE,#83H
LDB SP_CON,#09H
LDB P1 ,#111100008
SJMP LAZO
CSEG AT
RUT:
LDB
LDB
STB
RET
END
4000H
DATO.SBUF
P1.DATO
DATO.SBUF
En este ejercicio, el puerto serie del microcontroíador, está configurado en
Modol y también se utiliza la interrupción de recepción, lo que permite en
una subrutina (4QOOH), mostrar en el P1 y luego retransmitir el dato recibido.
132
CAPÍTULO V
La construcción de la tarjeta principal, la de periféricos y el programa
Micro196, con información muy detallada acerca del microcontroíador
utilizado en este proceso, fundamentan el objetivo principal de esta tesis
de grado.
El sistema de desarrollo es una herramienta muy poderosa para la
ejecución de aplicaciones y "abre las puertas" hacia un nuevo
conocimiento como son los microc'ontroladores de 16 bits muy poco
utilizados en la Facultad de Ingeniería Eléctrica en la actualidad.
En la tarjeta de evaluación, los ejemplos ejecutados permiten utilizar
todo el juego de instrucciones disponibles y con periféricos externos
construidos de acuerdo a las necesidades del programados
Una de las ventajas del microcontroíador es poder tener un bus de datos
manejable de 8 o de 16 bits en cualquier parte de la ejecución del
programa, permitiéndose acoplar a cualquier necesidad. Esto se observa
al trabajar con el teclado y el display de 7 segmentos disponibles en la
tarjeta de periféricos. Además el direccionamiento a memoria externa es
sumamente simple sin la necesidad de usar registros auxiliares.
De acuerdo a nuestra experiencia, se ha previsto en la tarjeta de
evaluación 16 Kbytes de memoria que simula EPROM Con la finalidad
que se ejecute programas suficientemente extensos.
Al trabajar con microcontroladores de 16 bits el manejo de "dos
memorias" introducen nuevos conceptos, como son memorias altas y
memorias bajas, debido a que las aplicaciones con el microcontrolador
manejan memorias de 8 bits y el bus de datos es de 16 bits.
La compatibilidad que permite el microcontrolador tanto en protocolos de
cesión del bus como en la comunicación serial, permiten un eficiente
desempeño al trabajar en sistemas muitiprocesador y en especia! al
trabajar con la familia MCS-51.
El procesamiento en un microcontrolador de 16 bits es mucho más
avanzado que en uno de 8 bits, lo que permite desarrollar aplicaciones
más complejas en tiempos bajos de procesamiento.
La utilización de 230 registros, a los que se puede acceder como bytes,
palabras o dobles palabras que son básicamente "acumuladores" en
combinación con 256 bytes adicionales de memoria RAM, permite la
simplificación de instrucciones al liberarnos del cuello de botella que
genera el acumulador en la familia MCS-51.
La persona que utilice este sistema, debe tener conocimientos básicos de
microcontroladores, para que de esta manera se familiarice rápidamente"V
'1_ con el equipo.
Se debe seguir investigando más acerca de este microcontrolador y
otros de 16 bits de Intel, ya que por sus versatilidades permite realizar
innumerables1 funciones.
El usuario podrá implementar otros periféricos, como por ejemplo PPI,
grabador de sonidos, zócaios para grabar EEPROMs, matriz de LEDs,
diferentes tipos de sensores.
Pue.de mejorarse el desempeño del sistema de desarrollo, previo la
utilización de un software de simulación, esto permitirá depurar errores,
del programa y facilitar su ejecución en la tarjeta.
ANEXOS
Av
.ANEXO A
HOJA DE DATOS DEL
MICROCONTROLADOR
8XC196KC/8XC196KC20COMMERCiAL/EXPRESS CHMOS
MICROCONTROLLER87C196KC—16 Kbytes of On-Chlp OTPROM83C196KC—16 Kbytes ROM80C196KC—ROMIess
16 and 20 MHz Available
488 Byte Register RAM
Register-to-Register Architecture
28 Interrupt Sources/16 Vectors
Peripheral Transaction Server
1.4 JLLS 16 X 16 Multiply (20 MHz)
2.4 fis 32/16 Divide (20 MHz)
Powerdown and Idle Modes
Five 8-BÍt I/O Ports
16-Bit Watchdog Timer
Dynamically Configurable 8-Bít or16-Bit Buswidth
Ful! Dúplex Seriai Port
High Speed I/O Subsystem
16-Bit Timer
16-Bit Up/Down Counter with Capture
3 Pulse-Width-Modulated Outputs
Four 16-Bit Software Timers
8- or 10-Bít A/D Converter withSample/Hold
Extended Temperature AvailableHOLD/HLDA Bus Protocol
OTPROM One-Time ProgrammableVersión
The 80C196KC 16-bit micro controller ís a hígh performance member of the MCS® 96 microcontrolíer family.The 80C196KC is an enhanced 80C196KB device with 488 bytes RAM, 16 and 20 MHz operation and anoptional 16 Kbytes of ROM/OTPROM. Intel's CHMOS III process provides a high performance processoralong with low powerconsumption.
The 87C196KC is an 80C196KC wíth 16 Kbytes on-chip OTPROM. The 83C196KC is an 80C196KC with 16Kbytes factory prograrnmed ROM. In this document, the 80G196KC will refer to all producís unless otherwisesíated.
Four high-speed capture inputs are provided to record times when events occur. Six high-speed outputs areavailable for pulse or waveform generation. The high-speed output can aiso genérate four software timers orstart an A/D conversión. Events can be based on the tímer or up/down counter.
With the commerciaí (standard) temperature option, operational characteristics are guaranteed over the tem-perature range of 0°C to +70°C, With the extended (Express) temperature range option, operaíional charac-terisíics are guaranteed over the temperature range of —40°C to -I- 85"C. Unless otherwise noted, the specífi-catíons are the same for both options.
See the Packaging Information for extended temperature designators.
'Olher brands and ñames ate the property of tnelr respective owners.Infotmatton In th!s documanl Is prended ín connectlon vHth Intel producís. Intel asaumes no lloblllty whatsoover, Includlng Inlringement of any paient orcopyright, Cor sale and use of Intel producís except as provHod In Intsl's Terms and Condltlona of Sale for such producís. Intel retalns ttie right to makechanges to thase specillcatlons at any tune, without notfce. Mlcrocomputer Products may havs mbof variadons ío thls specrflcatton known as errata.COPYRIGHT © INTEL CORPORATION, 1995 Novemtwr 1994 Qrder Numben 270942-005
8XC196KC/8XC196KC20
270942-1
Figure 1. 8XC196KC Block Diagram
IOC3 (OCH HW1N1 READ/WRITE)
NOTE:*RSV— Reserved bits musí be - 0
0
1
2
3
4
5
6
7
-----
CL.KOUT-DIS
PWW.1\2 \
RSV
RSVf
RSV*
RSV"
0 = T2 EXTERNAL CLOCK1 =T2 INTERHAL CLOCK
0 = ENABLE CLKOUT1=DISABLE CLKOUT
0 = DISA9LE1 = ENABLE
270942-45
Figure 2. 8XC196KC New SFR Bit (CLKOUT Disable}
inte! BXC196KC/8XC19GKC20
PROCESS INFORMATION
TNs device is manufacturad on PX29.5 or PX29.9, aCHMOS III process. Additional process and reliabili-ty Information is available in [ntel's ComponentsQuality and He/íabiffty Handbook, Order Number210997,
Table 2. 8XC196KC Memory Map
X X X B X C Í 9 6 K C X X
I— D.ÍÍC. Sp»dt
- KC Producl remití
- Progrcm UímD - CttJ on\j
- Paelog» T>p* Oplion.;H = ta-lwd PLCCS = aO-f«d OFPsífabo-i»* son1
- Ttrotwaluf. and Burn~Ín Qpllwy.:Ha U(xk=í00C-7a0C>mb;«nl vllhInltl Standard Burn-InT"=E>1«n<Í«d rwnjwrotuí» -<D°Clo +85°C -Ith Intel StandardBuin-ln
270942-43
EXAMPLE: NB7C196KC te 68-Lead PLCC OTPROM,16MHZ.For complele package dimensional data, refer lo thaIntel Packaging Handbook (Order Number 240800).
NOTE:1. EPROMs are available as One Time Programmable(OTPROM) only.
Figure 3. The 8XC196KC Family Nomenclature
Table 1. Thermal Characteristics
PackageType
PLCC
QFP
SQFP
0la
35nC/W
55°C/W
T8D
*JC
13°C/W
16°C/W
TBD
AH thermal impedance data is approximate for static aírconditíons at 1W of power dlssipation. Valúes will changedepending on operation conditlons and application, Seethe Intel Packaging Handbook (order number 240800) for adescription of Intel's thermal impedance test methodology.
Description
External Memory or I/O
Internal ROM/OTPRQM or ExternalMemory (Determíned by EA)
Reserved. Must contain FFH.(Note 5)
PTS Vectors
Upper Interrupt Vectors
ROM/OTPROM Security Key
Reserved. Must contain FFH.(Note 5)
Reserved. Must Contain 20H(Note 5)
CCB
Reserved. Must contain FFH.(Note 5)
Lower Interrupt Vectors
Port 3 and Port 4
External Memory
488 Bytes Register RAM (Note 1)
CPUSFR's(Notes1,3,4)
Address
OFFFFH06000H
5FFFH2080H
207FH205EH
205DH2040H
203FH2030H
202FH2020H
201 FH201 AH
201 9H
201 8H
2017H201 4H
201 3H2000H
1FFFH1FFEH
1FFDH0200H
01 FFH0018H
0017HOOOOH
NOTES:1. Code execuled in locations OOOOH to 01FFH will beforced exlerna!.2. Reserved memory locations musí contain OFFH unlessnoted.3. Reserved SFR bit locations musí contain 0.4- Refer to 8XC196KC User's manual for SFR descriptíons.5. WARNING: Reserved memory locations must not bewritten or read, The contents and/or function of these lo-cations may change v/ith future revisions of the device.Therefore, a program that relies on one or more of theselocations may not function properiy.
8XC196KC/8XC196KC20 inte]
ACH5/PMODE.1/P0.5II
ACH4/PMODE.O/P0.4C
ÁHGHDC
vssdEXTIMT/PROG/P2.2 C
RESCTC
RXD/PALE/P2.1C
Pi.oC
P1.1C
P1.2C
PWM1/P1.3C
PWM2/P1.4C
HSt.O C
HSI.1 C
HSI.2/HSO-4 El
r-Xo
^~3 t>
UJ -<
•^ ^.ro NLJ UJQ Q Í-J O f Klo o r c i x n : n : ^3 3 E O U O U H - í0 - 0 - < < < - < c M ^ S <
O O O O O O ^ E [ - < O I / 1 I — [— — J I 3 ™ - J ] QQ , D _ Q , n . a . a . Z l U J > l > - X > < : o r a ± : « í j a :
n n n n n n n n n n n n n n n n n/ 9 8 7 6 5 4 3 2 1 68 57 66 65 64 53 62 61 /
10 \ 1 / 60I 1
11 5fl
12 58
13 57
U 56
15 68-PIN Pí 00 5S1 a 54
17 Kl V IX 53
13 51
20 SOTOP VIEW
22 Looldng Down on ^fl
23 Component Side 47oí PC Board
24 46
25 45
26 44
27 23 29 30 31 32 33 34 35 36 37 38 39 40 41 4.2 43U U U L J U U U U U U U U L I U U U U
i ^ x ^ x . ' x ^ . x . ^ r n X . X Í Í ' \"X o < Q O : ^ S m l t - 1
~ü\ y: a: o- ^ l<1 "X 1-
o *o. l~cM
3P3.D/ADO
3P3.1/AD1
3 P3.2/AD2
3 P3.3/A03
H P3.4/AD4
3 P3.5/AD5
UP3.G/AD6
U P3.7/AD7
U P4.0/AD8
3P4.2/AD10
3P4.4/A012
3P4.5/AD13
3P4.6/ÁD14
3P4.7/AD15
D P2.3/T2CLK
270942-2
Figure 4, 68-Lead PLCC Package
inte! BXC196KC/8XC196KC20
AD1/P3.1C
ADD/P3.0C
RDC
ALE/AOVC
INSTC
BUSW10TH C
CLKOUT C
XTAL2 C
XTAUC
vssCVssCVCCCVCCC
ÉAC
NMlC
ACH3/P0.3 U
ACHI/PO.lC
ACHO/PO.OC
ACH2/P0.2 C
ACH6/PMODE.2/P0.6 C
ACH7/EXTINT/PMODE.3/P0.7 C
N.C.C
ACH5/PMODE.1/P0.5II
ACH4/PMODE.O/P0.4 C
0 „ N „ ^ ^
n n n n n n n n n n n n n n n n/ 80 79 78 77 76 75 74 73 72 71 70 69 68 67 56 65
1 64
* O3 62
4 61
5 60
6 59
7 58
6 80-PIN QFP 57
9 56
10 S8XC196KC 5511 54
12 53
13 TOP VIEW 52
14 51Lookíng Down on
15 Componont Sido 50
16 oí PC Board 49
17 48
18 47
19 46
20 45
21 44
22 : 43
23 42
24 41
25 26 27 28 29 30 31 32 33 34 35 36 37 39 39 40
U U U U U U L J U U U U U U U U U
** IS? liíí P5 — ts« < > i =|h^ a o
w
3 P2.3/Í2CLK
3 READY
D P2.4/T2RSTAÍÑC
3SHÉ/WRH
DW/m3 P2.5/PWMO
D P2.7/T2CAPTURE/PACT
UVpp
DVsS
3vss
3 HS0.3
UVcc
3 HS0.2
3 P2.6/T2UP-DN/CPVER
DP1.7/HOLD
3P1.6/HLDA
DP1.5/BREQ
DHSO.l
3 HSO.O
U HS0.5/HSI.3
3vss
H HS0.4/HSI.2
270942-40
Figure 5. S8XC196KC 80-PÍn QFP Package
8XG.196KC/8XC196KC20 Intel
„
RDC
INSPE
BUSVflDTB C
CLKOUfC
XTAL2C
XTAÚJÍI
VS5E
VSS-C
vccn
EÁE
N.C.C
ACH3/POí3 C
ACH1/PO.ÍC
ACHO/PQ.QC
ACH2/POÍ2É:
ACH6/PMODE.2/PO-6 C
ACH7/PMODE.3/PO,7£
-í •
O i— N
Q Q Q O o a Q d a o o o o
' ^ •'"« í¡ "•* ' «" "í ¿ ^ **" -T «" ^? n"
rrn n n n n n n n n n n n n n^-&0'-79 78*77 76 75 74 73 72r71'-70 69 68 67 66
i:o4
5 80 PIN SQFP'6
7 - SB87C196KC8
.9-
¡° TOP VI EW
•u
13 , LOOKING DOWN ON¡j. - COMPONEN! SIDEI B . OF PC BOA.R'D17 " "" •
ÍB -
"19- "
,2Q "
.21 .22 23^2.4 25 26 27 28 29 30 31 32 33 34 35
U- LJ-LJ U U U L J U U U L J U U L I Um •"»,' a u... u iw o t — " ~ o : t / ) O - - o j i o
'-;i!-i " ? > § ^ « ' i § l > s : s : 5 : ?• "S 2; ' - ^ (£ £ Ü
re x C *~S- rf "
•* « ^^< -< < t~"í M. ^ ". M
n n-n n n65 64 63-62 61
60
59
5fl
57
56
55
54
53
52
51
50
49
47
46
45
44
43
42
41
36 37 38 39 40U U U U UT O - T- IS W
í~ i: ¿c ref5" "v.
: -'•-.
U READY - L -* - -
nP2.4/T2R_ST/AÍÑC
3WR/WRL
— I P2 S/PWM-O'1'**^ •'''••"'
3 P2.7/T2CAPTURE/
HVpP
DVSS
^vss - . .nnso.3
HVSS ' -. • ' - - . t . •:
PJkCT
DHS0.2 ';- ' -'
nP2.6/T2Up-DN/CPVER
3P1.7/HO.LD
DPI.S/HL'DA^-* -
DPJ-5/HREO' ^.
D HSO. 1
3HSO.O ;":"f '
HHSI.3/HS0..5'' 1'
. . •• ,
^ ú
•
''
'' ' - ' ' 270942-44
Figure 6. 80-rPin SQFP Package
8XC196KC/8XC196KC20 inte!PIN DESCRIPTlONS(Continued)
Symbol
Ports 3 and 4
HOLD
HLDA
BREO
PMODE
PACT
CPVER
PALÉ
PROG
PVER
AINC
Ñame and Functíon
B-bit bídirectional i/O ports with open drain outputs. These pins are shared with themultiplexed address/data bus which has strong ¡nternal pullups.
Bus Hold input requesting control of the bus.
Bus Hold acknowledge output índicating reléase of the bus.
Bus Request output activated when the bus controller has a pending externa! memorycycle.
Determines the EPROM programming mode.
A low signa! ¡n Auto Programming mode indicates that programming is ¡n process. A highsigna! índicates programming is complete.
Cummulative Program Output Veriftcation. Pin is high if all locations nave programmedcorrectiy since entering a programming mode.
A falling edge in Slave Programming Mode and Auto Configuration Byte Programming Modeindicates that ports 3 and 4 contaín vaíid programming address/command information(input to slave).
A falling edge in Slave Programming Mode indícales that ports 3 and 4 contaín validprogramming data (input to siave).
A high signal in Slave Programmig Mode and Auto Configuration Byte Programming Modeindicates the byte programmed correctiy.
Auto Increment. Active low input signal indtcates that the auto Encrement mode is enabled.Auto Increment will allow reading or writing of sequential EPROM locations without addresstransactions across the PBUS for each read or write.
inte!ELECTRICAL CHARACTERISTICSABSOLUTE MÁXIMUM RATINGS*
Ambient TemperaturaUnderBias . ................ -55°Cto +125°C
Storage Temperatura , ---- . ---- — 65DCto + 150"C
Voltage On Any Pin to Vss ...... -0.5V to -I- 7.0VCO
Voltage from EA orVpP to Vss or ANGND ..... . .......... 4- 13.00V
Power Dissipatíon ..,,., ---- . ............ 1 .5WÍ2)
NOTE: _1. This includes Vpp and EA on ROM or CPU only devices,2. Power dissipation Js based on package neat transfer lim-¡tations, not devíce power consumptíon.
8XC196KC/8XC196KC20
NOTICE: Thís ¡s a productíon data sheet. It is valid forihe devices indícated ¡n the revisión history. Thespecifícaíions are subject to change without notíce.
'WARNING; Stressíng the devíce beyondthe "AbsoluteMáximum Ratíngs" may cause permanent damage.These are stress ratíngs only. Operation beyond the"Operating Condftions" is not recommended and ex-tended exposure beyond the "Operating Conditions"may affect devíce reliability.
OPERATING CONDITIONSSymbol
TA
TA
Vcc
VREFANGND
Fose
Fose
Descríptíon
Ambient Temperature Under Bias Commercial Temp.
Ambient Temperatura UnderBias Extended Temp.
Digital Supply Voltage
Analog Supply Voltage
Analog Ground Voltage
Oscillaíor Frequency (8XC1 96KC)
Oscillator Frequency (8XC196KC20)
Min
0
-40
4.50
4.00
vss - 0-4
8
8
Max
+70
+ 85
5.50
5.50
Vss + 0.4
16
20
Units
°C
°C
V
V
Vd)
MHz
MHz
NOTE:1, ANGND and Vss should be nominally al the same potential.
DC CHARACTERISTICS (OverSpecified Operating Condítions)
Symbol
VIL
VIHV|H1
VIH2
VHYS
VOL
VOLI
VOH
Oescriptíon
Input Low Voitage
Input High Voltage (Note 1)
Inpui High Voltage on XTAL 1
Input High Voltage on RESET
Hysteresis on RESET
Output Low Voltage
Output Low Voltagein RESET on P2.5 (Note 2)
Output High Voltage(Standard Outputs)
Min
-0.5
0.2 VCG + 1.00.7 vcc
2.2
300
Vcc - 0.3VGC - 0-7VCG -1-5
Typ Max
0.8
Vcc + 0.5
VCC + 0.5
vcc + 0.5
0.30.451.5
0.8
Units
V
V
V
V
mV
VVV
V
VVV
Test Conditions
Vcc = 5.0V
IOL = 200 p.AIQL — 2.8 mAIOL = 7 mA
IOL = +0.4mA
IOH^ -200p.AIOH — "3-2 mAIOH - -7mA
8XC196KC/8XC196KC20
DC CHARACTERISTICS (Over Specrfied Operating Conditions) (Continued)
Symbol
VOHI
IOHI
I|L2
I]H1
ILIluíÍTLIILI|L1
Ice
'ce
IIDLE
IÍDLE
IPDIREF
RRST
cs
Descriplion
Output High Voltage(Quasí-bidirectiona! Outputs)
Lógica! 1 Output Current in Reset.on P2.0. Do not exceed thísor devíce may enter test modes.
Logícal 0 Input Current in Reseton P2.0. Máximum current thatmust be sunk by externaldevice to ensure test mode entry.
Logícal 1 Input Current.Máximum current that externaldevice must source to initiate NMI.
Input Leakage Current (Std. Inputs)
Input Leakage Current (Port 0)
1 to 0 Transition Current (QBD Pins)
Lógica! 0 Input Current (QBD Pins)
Ports 3 and 4 in Reset
Active Mode Current in Reset(8XC196KC)
Active Mode Current in Reset(8XC196KC20)
Idle Mode Current (8XC196KC)
Idle Mode Current (8XC196KC20)
Powerdown Mode Current
A/D Converter Reference Current
Reset Pullup Resistor
Pin Capacítance (Any Pín to Vss)
Wlin
VCG - 0-3VCG - o.7Voc-1.5
-0.8
6K
Typ
65
80
17
21
8
2
Max
TBD
+ 200
±10
±3
-650
-70
-70
75
92
25
30
15
5
65K
10
Units
VVV
mA
mA
/¿A
fiA
M
jj,A
u,A
/¿A
mA
mA
mA
mA
MA
mA
nPF
Test Conditions
¡OH = -10 ¿¿AIOH = -30 /*AJOH = -60 JJ.AV|H = VCC-1-5V
V|N - 0.45V
VIN = Vcc = 2.4V
o < v[N < VCG - o.sv
0 < VIN < VREF
V,N = 2.0V
VIM = 0.45V
V!N = 0.45V
XTAL1 = 16 MHzVcc = Vpp « VREF = 5.5V
XTAL1 = 20 MHzVCG = VpP-VREF=5.5V
XTAL1 = 16 MHzVCG = VPP = VREF = 5.5V
XTAL1 = 20 MHzVCG = Vpp = VREF = 5.5VVCG - vPp - VREF - 5.5VVCG — Vpp — VREF — 5-5V
VGC = 5.5V, v¡N = 4.ov
NOTES:1. AH pins except RESET and XTAL1.2. Víolating these specificatíons in Reset may cause the part to enter test modes.3. Commercial specifications appiy to expresa parís except where noted.4. QBD ÍQuasi-bidirectional) pins incIude_Po_rM_, P2.6 and P2.7.5. Standard Outputs include ADO-15, RD, WR, ALE, BHE, INST, HSO pins, PWM/P2.5, CLKOUT, RESET, Ports 3 and 4,TXD/P2.0 and RXD (¡n serial mode 0). The VQH specifícation is not valid for RESET. Ports 3 and 4 are open-draín oulputs.6. Standard Inputs include HSI pins, READY, BUSWIDTH, RXD/P2.1, EXTINT/P2.2, T2CLK/P2.3 and T2RST/P2.4.7. Máximum current per pin must be externally limited to the following valúes if VOL_ is held above 0.45V or VQH is heldbelow VCG - 0.7V:
IOL on Output pins: 10 mA¡OH on quasi-bidirectional pins: self llmitingIOH on Standard Output pins: 10 mA
8. Máximum current per bus p!n (data and control) during normal operation ís ±3.2 mA.9. During normal (non-transient) condillons the following total current límits apply:
Port 1, P2.6 IQL: 29 mA ¡OH fe self ümitingHSO, P2.0,_RXD, RESET IOL: 29 mA IOH' 26 mAPZ5, P2.7, WR, IRÉ IOL: 13 mA IQH'- 11 mAADQ-AD15 IOL: 52 mA IQH: 52 ni ARD, ALE, INST-CLKOUT IOL= 13 mA IQH-' 13 mA
10
inte! 8XC196KC/8XC19GKC20
mA
HQX
Ice Max = 4.13 X Frequency -i- 9 mAIce Typ = 3.50 X Frequency -f- 9 mA[IDLE Max = 1.25 X Frequency 4- 5 mAIIDLE Typ = 0.88 x Frequency + 3 mA
NOTE:Frequencies below 8 MHz are shown for reference only; no testing is performed.
Figure?. lccana" 'IDLEVS Frequency
AC CHARACTERISTICSFor use over speciffed operatíng conditions.
Test Conditions: Capacitive load on al] pins = 100 pF, Rise and falí times = 10 ns, FQSC — 1S MHz
The system must meet these specifications to work with the 80C196KC:
Symbol
TAVYV
TYLYH
TGLYX
TLLYX
TAVGV
TCLGX
TAVDV
TRLDV
TCLDV
TRHDZ
TRXDX
Deacription
Address Vaiid to READY Setup
Non READY Time
READY Hold añer CLKOUT Low
READY Hold after ALE Low
Address Valld to Buswidth Setup
Buswidth Hold after CLKOUT Low
Address Valid to Input Data Vaiid
RT5 Active to Input Data Valid
CLKOUT Low to Inpuí Data Valid
End oí RD to Input Data Floaí
Data Hold after RD Inactive
Mín Max
2 Tose -68
No upper limit
0
TOSO - 15
0
0
Tose - 30
2 Tose -40
2TOSC-68
3 TOSO - 55
TOSO - 22
TOSO - 45
Tose
Units
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
Notes
(Note 1)
(Note 1)
(Note 2)
(Note 2)
NOTES:1. If max ís exceeded, additionaí wait states wíll occur.2. If wait states are used, add 2 TQSC * N< wbere N = number of wait states.
11
8XC196KC/8XC196KC20 ¡nielAC CHARACTERISTICS (Continued)For User over specífied operating conditions.Test Condítions: Capacitive load on all pins — 100 pF, Rise and fall times = 10 ns, FQSC = 16
The 80C196KC will meet these specifications:
Symbol
FXTAL
EXTAL
TOSC
TOSO
TXHCH
TCLCL
TCHCL
TCLLH
TLLCH
TLHLH
TLHLL
TAVLL
TLLAX
TLLRL
TRLCL
TRLRH
TRHLH
TRLAZ
TLLWL
TCLWL
TQVWH
TGHWH
TWLWH
TWHQX
TWHLH
TWHBX
TWHAX
TRHBX
TRHAX
Description
Frequency on XTAL1 (8XC196KC)
Frequency on XTAL1 (8XC196KC20)
I/FXTAL (8XC196KC)
I/FXTAL (8XC196KC20)
XTAL1 High to CLKOUT High or Low
CLKOUT Cycle Time
CLKOUT High Period
CLKOUT Falling Edgs to ALE Rising
ALE Falling Edge to CLKOUT Rising
ALE Cycle Time
ALE High Period
Address Setup to ALE Failíng Edge
Address Hold afíer ALE Falling Edge
ALE Falling Edge ío RD Falling Edge
RD Low to CLKOUT Faüíng Edge
RD Low Period
"RD Rising Edge to ALE Rising Edge
^D Low to Address Float
ALE Falling Edge to WR Falling Edge
CLKOUT Low to WR Falling Edge
Data Stable to WR Rising Edge
CLKOUT High to WR Rising Edge
WR Low Period
Data Hold after WR Rising Edge
WR Rising Edge io ALE Rising Edge
BHE, INST after WR Rising Edge
AD8-15 HOLD after WR Rising
BHE, ÍNST afíer RD Rising Edge
AD8-1 5 HOLD aíierRD Rising
Min
8
8
62.5
50
+ 20
Max
16
20
125
125
+ 110
2 Tose
Tose -10-5
-20
4 Tose
Tose -10
Tose ~ 15
TOSC - 35
Tose - 30
+ 4
TOSC - 5
Tose
TOSC -10
0
Tose - 23o
TOSC - 20
TOSC - 25
TOSC -1°
TOSC -10
TOSC - 30
Tose -10
TOSC - 25
ToSC+15
+ 15
+ 15
TOSC +10
+ 30
TOSC "i- 25
+ 5
+ 25
+ 15
TOSC + 15
Units
MHz
MHz
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
Notes
(Note 1)
(Motel)
(Note 4)
(Note 4)
(Note 2)
(Note 4)
(Note 4)
(Note 2)
(Note 3)
(Note 3)
NOTES:1. Testing performed at 8 MHz. However, the devíce is static by desígn and wil! typically opérate below 1 Hz.2. Assuming back-to-back bus cycles.3. 8-Bit bus only.4. If wait states are usad, add 2 TOSC * N, where N = number of wait States.
12
inte! 8XC196KC/8XC196KC20
System Bus Timings
XTAL1
CLKOUT
ALE
-c ADDRESS OUT DATA OUT
BHE, IHST
1TWHBX
VALID ]
TWHAX
ADDRESS OUT ,I
f
V
fi
270942-18
i13
f
8XC196KC/8XC196KC20
READY Timings (One Wait State)
XTAL1
ALE
READY
ADDRESS OUT DATA OUT
inte!
ADDRESS
270942-20
Buswidth Timings
XTAL1
CLKOUT
ALE
BUSWIDTH
BUS
~\j v
-c
J \ V
TCLGX (MIN)
>—
V
270942-35
14
¡niel 8XC196KC/8XC196KC20
HOLD/HLDATimings
Symbol
THVCH
TCLHAL
TCLBRL
THAUXZ
THALBZ
TCLHAH
TCLBRH
THAHAX
THAHBV
TCLLH
Descriptíon
HOLD Setup
CLKOUT Low to HLDA Low
CLKOUT Low to BREO Low
HLDA Low to Address Float
HLDA Low to BHE, INST, RD, WR Weakly Driven
CLKOUT Low to HLDA High
CLKOUT Low to BREO Hígh
HLDA High to Address No Longer Float
HLDA Hígh to BHE, INST, RD, WR Valid
CLKOUT Low to ALE High
Min
+ 55
-15
-15
-15
-15
-15
-10
-5
Max
+ 15
+ 15
+ 15
+ 20
+ 15
+ 15
+ 15
+ 15
Units
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
Notes
(Motel)
NOTE:1. To guarantee recognition at next clock.
DC SPECIFICATIONS IN HOLD
Description
Weak Pullups on ADV, RD,WR, WRL, BHE
Weak Pulidowns onALE, INST
Min
50K
10K
Max
250K
50K
Units
VCG = 5.5V, V|N = 0.45V
VCG = 5.5V, V|N = 2.4
15
8XC196KC/8XC196KC20
tN (L
—\DLATPICY
r~
^HAHHY
Y Weukly Drívan Inactívi
flakl/ Drlv«iInactiva
rTh nADV «eakly driv Star I oí sírongly drtv«n ADV and ALE
270942-36
Máximum Hold Latency
Bus CycleType
Internal Execulíon
16-Bit Externa! Executíon
8-Bií External Execuííon
1.5 States
2.5 States
4.5 States
EXTERNAL CLOCK ORIVE (8XC196KC)Symbol
i /TXLXLTXLXL
TXHXX
TXLXX
TXLXH
TXHXL
Parameter
Oscillator Frequency
Oscillator Period
High Time
Low Time
Rise Time
Fall Time
Min
8
62.5
20
20
Max
16.0
125
10
10
Units
MHz
ns
ns
ns
ns
ns
16
int0l 8XC196KC/8XC196KC20
EXTERNAL CLOCK DRIVE (8XC196KC20)
Symbol
I/TXLXL
TXLXL
TXHXX
TXLXX
TXLXH
TXHXL
Para meter
Oscillator Frequency
Osctllator Period
Hígh Time
Low Time
Rise Time
Fall Time
Min
8
50
17
17
Max
20.0
125
8
8
Units
MHz
ns
ns
ns
ns
ns
EXTERNAL CLOCK DRIVE WAVEFORMS
0.7Vcy
- — TXHXX — "I
r o.yvcA•*•" TXLXX,0.8
1 i T , K|r XH n°r8/
T
'XLXL '
EXTERNAL CRYSTAL CONNECT1ONS
Vssl|[-<
NOTE:Keep oseshort, diréusing crystresonatorscuitry.
C1
r-ll— f, Lu i^u * \2 \l
8XC196KC
XTALZ
Quaríz Crystol
270942-41
Uator componenís cióse to chip and use;t traces to XTALI, XTAL2 and Vss. Whenais, C1 = G2 ~ 20 pF. When using ceramicconsult manufaclurer for recommended cir-
AC TESTING INPUT, OUTPUT WAVEFORMS
2.4 >
0.45 '
AC Testíng ua Logic "0""1" and 0,8\
2'°^>TESTP0.8
OINTS <^ " V
270942-22iputs are dfíven at 2.4V lor a Logic "1 " and 0.45V forTíming measurements are made at 2.0V (or a Log c/ for a Logic "0".
*-TXHXL
270942-21
EXTERNAL CLOCK CONNECTIONS
vcc
TEXTERHAL fXn 1CLOCK INPUT \S^
clock drívor
no con
NOTE:•Requíred íf TTL driver uNot needed if CMOS dr
BXC 196KC
270942-42
sed.ver is used.
FLOAT WAVEFORMS
TLuÁL)ru-'^v / - ' ' ' "" VVr^.n /---^ TÍMING REFERCNCC __^N
v TTIvK TO(NTS /2
Por Trmíng purposes a Fort Pin is no Longer Floí150 mV change from Load Voltage Occurs and Bewhen a 150 mV change from the Loaded VQH/VOLIQL/'OH "" ±15mA.
YOH-0.|5V
>V+0.15V70942-23ting when agins to Floal,evel occurs;
17
8XC196KC/8XC196KC20
EXPLANATION OF AC SYMBOLS
Each symbol is íwo pairs of íetters prefíxed by "T" for time. The characters ín a pair indícate a signal and itscondiíion, respectively. Symbols represent the time between the two signal/condition poínts.
Conditions:H— HighL— Low
V— Valid
X— No Longer ValidZ— Floating
Signáis:A— Address
L— ALE/ADV
B— BHE
C— GLKOUT
D— DATAG— Buswidth
BR— BREO
R— RD
H— HOLD
W— WR/WRH/WRL
X— XTAL1
Y— READYQ— DataOut
HA— HLDA
AC CHARACTERISTICS—SERIAL PORT—SHIFT REGISTER MODE
SERIAL PORT TIMING—SHIFT REGISTER MODE (MODE 0)
Symbol
TXLXL
TXLXH
TXLXL
TXLXH
TQVXH
TXHQX
TXHQV
TDVXH
TXHDX
TXHQZ
Parameter
Serial Port Clock Period (BRR 8002H)
Serial Port Clock Falling Edgeto Rising Edge (BRR £ 8002H)
Serial Port Clock Period (BRR = 8001 H)
Serial Porf Clock Falling Edgeto Rising Edge (BRR - 8001 H)
Ouíput Data Setup to Clock Rising Edge
Output Daía Hold af ter Clock Rising Edge
Nexl Output Data Valid after Clock Rising Edge
Input Data Setup to Clock Rising Edge
Input Data Hold after Cfock Rising Edge
Last Clock Rising to Output Float
Min
6 TOSO
4 Tose -50
4Tosc
2 Tose -50
2ToSC~50.
2 Tose -50
Tose +50
0
Max
4 Tose +50
2T0SC+50
2 TOSO +50
1 TOSC
Unils
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
WAVEFORM—SERIAL PORT—SHIFT REGISTER MODE
SERIAL PORT WAVEFORM—SHIFT REGISTER MODE (MODE 0)
18
9
inte! 8XC196KC/8XC196KC20
A to D CHARACTERISTICSThe A/D converter ¡s raíiometric, so absolute accuracy is dependen! on the accuracy and stability of VREF.
10-BIT MODE A/D OPERATING CONDITIONSSymbol
TA
TA
VCGVREF
TSAM
TCONV
FOSO
Fose
Description
Ambíent Temperature Commercial Temp.
AmbientTemperature Extended Temp.
Digital Supply Voltage
Analog Supply Voltage
Sample Time
Conversión Time
Oscillator Frequency (8XC196KC)
Oscillator Frequency (8XC196KC20)
Min
0
-40
4.50
4.00
1.0
10
8.0
8.0
Max
+ 70
+ 85
5.50
5.50
20
16.0
20.0
Units
"G
°C
V
V
flSÍD
jisd)MHz
MHz
NOTE:ANGND and Vss should nominaily be al the same potentíal, O.OOV.1. The valué of AD_TlM£ is selected to meet these specifícatíons.
10-BIT MODE A/D CHARACTERISTICS (OverSpecifiedOperatingConditions)Parameter
Resoiution
Absolute Error
Full Scale Error
Zero Offset Error
Non-Lineariíy
Differential Non-Linearity Error
Channel-ío-Channel Matching
Repeatabiüty
Tamperature Coeffícients:OffsetFull ScaleDifferenííal Non-Linearity
Off Iso latió n
Feedthrough
VCG Power Supply Rejection
Input Series Resistance
Voltage on Analog Input Pin
DC Input Leakage
Sampling Capacitor
TyplcalO)
0.25 ± 0.5
0.25 ± 0.5
1.0 ± 2.0
±0.1
±0.25
0.0090.0090.009
-60
-60
3
Mínimum
102410
0
0
>-10
-60
750
ANGND - 0.5
0
Máximum
102410
±3
±3
+ 2
±1
1.2K
VREF + 0.5±3.0
Units*
LevéisBits
LSBs
LSBs
LSBs
LSBs
LSBs
LSBs
LSBs
LSB/°CLSB/°CLSB/°C
dB
dB
dB
nV
jiA
PF
Notes
1,2
1
1
4
5,6
NOTES:*An "LSB" as used here has a valué of approxlimately 5 mV. {See Embedded Mícrocontrollers and Processors Handbookfor A/D glossary of terms}.1. These valúes are expected for most parts at 25°C but are not tested or guaranteed.2. DCtolOOKHz.3. Multiplexer Break-Before-Make is guaranteed.4. Rasistance from device pin, through intemal MUX, to sample capacitor.5. These valúes may be exceeded if the pin current ís limited to ±2 mA.6. Appiying vottages beyond these specifications will degrade Ihe accuracy of all channels being converted.7. All conversions performed with processor ¡n ¡OLE mode.
19
8XC196KC/8XC196KC20
8-BIT MODE A/D OPERATING CONDITIONSSymbol
TA
TA
VCGVREF
TSAM
TCONV
Fosc
FOSC
, , . ,Descriptfon
Ambfent Temperatura Commercial Temp.
AmbientTemperature Extended Temp.
Digital Supply Voltage
Analog Supply Voltage
Sample Time
Conversión Time
Oscillator Frequency (8XC196KC)
Oscillator Frequency (8XC196KC20)
Min
0
-40
4.50
4.00
1.0
7
8.0
8.0
Max
+ 70
+ 85
5.50
5.50
20
16.0
20.0
Units
"C
QC
V
V
fisCO
/isd)
MHz
MHz
NOTE:ANGND and \/ss should nominally be at the same potential, O.OOV.1. The valué of AD_TIME ¡s selected to meel these specífications.
8-BIT MODE A/D CHARACTERISTICS (OverSpecified Operatíng Conditions)
Parameter
Resolution
Absoluta Error
FuII Scale Error
Zero Offset Error
Non-LJnearity
Differenííal Non-Lineariíy Error
Channel-to-Channe! Maíching
Repeaíability
Temperature Coefficients;OffsetFuII ScaleDifferential Non-Unearity
Off Isolation
Feedthrough
Vcc Power Suppiy Rejection
Input Series Resístanos
Voltage on Analog (npuí Pin
DG Input Leakage
Sampling Capacitor
Ty pical
±0.5
±0.5
±0.25
0.0030.0030.003
-60
-60
3
Mínimum
2568
0
0
>-1
-60
750
Vss - 0.5
0
Máximum
2568
±1
±1
+ 1
±1
1.2K
VREF + 0-5±3.0
Units*
LevéisBits
LSBs
LSBs
LSBs
LSBs
LSBs
LSBs
LSBs
LSB/°CLSB/'CLSB/°C
dB
dB
d8
íls
V
JLlA
PF
Notes
2,3
2
2
4
5,6
NOTES:*An "LSB" as used here has a valué of approximateíy 20 mV, {See Embedded Microcontrotters and Processors Handbookfor A/D glossary of terms).1. These valúes are expected for most parts at 25DC but are not tested or guaranteed.2. DCtolOOKHz.3. Multiplexer Break-Before-Make ¡s guaranteed.4. Resistance from devíce pin, through Jnternal MUX, to sample capacitor.5. These valúes may be exceeded íf pin current is límited to ±2 mA.6. Applying voítages beyond these specifícatíons will degrade the accuracy of all channels being converted-7. All conversíons performed with processor in IDLE mode.
20
8XC196KC/8XC196KC20
EPROM SPECIFICATIONS
OPERATING CONDITIONS DURING PROGRAMMÍNGSymbol
TA
VCG
VREFVpp
VEAFOSC
FOSO
FOSG
DescriptíonAmbient Temperatura During Programming
Supply Voltage During Programming
Reference Supply Voltage During Programming
Programming Voltage
EA Pin Volíage
Oscillator Frequency During Auto and SlavaMode Programming
Oscillator Frequency DuringRun-Time Programming (8XC196KC)
Oscillator Frequency DuringRun-Time Programming (8XC196KC20)
Min
20
4.5
4.5
12.25
12.25
6.0
6.0
6.0
Max
30
5.5
5,5
12.75
12.75
8.0
16.0
20.0
Uníts
C
vd>VÍD
V(2)
VÍ2)
MHz
MHz
MHz
NOTES:1. VGC and VREF should nomlnally be al the same voltage during programmíng.2. Vpp and VEA must never exceed the máximum specifi catión, or the device may be damaged.3. Vss and ANGND should nomlnalfy be at the same potential (OV).A. Load capachance during Auto and Slave Mode programming = 150 pR
AC EPROM PROGRAMMING CHARACTERISTICSSymbol
TSHLLTLLLH
TAVLLTLLAXTpLDV
TpHDX
TDVPLTPLDXTp|_PHí1>
TpHLL
TLHPLTPHPLTpHIL
TILIH
TILVHTILPLTpHVL
Description
Reset High to Rrst PALÉ Low
PALÉ Pulse Width
Address Setup Time
Address Hold Timo
PROG Low to Word Dump Valid
Word Dump Data Hold
Data Setup Time
Data Hold Time
PROG Pulse Width
PROG High to Next PALÉ Low
PALÉ High to PROG Low
PROG High to Next PROG Low
PROG High to AINC Low
AINC Pulse Width
PVER Hold after AÍÑCLow
AINC Low to PROG Low
PROG High to PVER Valid
Mín
1100
50
0
100
0
400
50
220
220
220
0
240
50
170
Max
50
50
220
Units
TOSCTOSG
ToseTOSCTOSOTOSCTOSG
ToscTOSC
TOSCTOSCTOSCTOSC
TOSCTOSC
ToscTOSC
NOTE:1. Thls speclficatlon ís for the Word Dump Mode. For programming pulses, use the Modifled Quíck Pulseuser's manual for furthar Information.
Algorithm. See
21
8XC196KC/8XC196KC20
DC EPROM PROGRAMMING CHARACTERISTICSSymbol
IPP
Description
Vpp Supply Current (When Prograrnming)
Mín Max
100
Units
mA
NOTE:Do not apply Vpp until VCQ Is stable and within specifications and the oscillator/clock has stabüized or the device may bedamaged.
EPROM PROGRAMMING WAVEFORMS
SLAVE PROGRAMMING MODE DATA PROGRAM MODE WITH SINGLE PROGRAM PULSE
RESET
PORTS3/4
i-»- TAVLL •*•!
ADDR/CGMMAND
TDVPL
ADDR/COMMAND
PVER
NOTE:P3.0 must be high ("1")
270942-27
SLAVE PROGRAMMING MODE IN WORD DUMP WITH AUTO INCREMENT
RESET
PORTSV4
f
f Lnnr 'rnmiiurn "Sc A aj;/ CDM j
TSHLL . .
PALÉ \PLDV — *•/
PROG
A1ÑC
NOTE:P3.0 must be low {"0"}
\^ »>
| ADOR
~\ H DUMP
TPHDX
/ \* TPHPL *•
| ADOR + 2.
_/vro aiTt;/w/" l
*J-TPLDV -t.
DUUP
TPHDX •*-
/
270942-28
22
8XC196KC/8XC196KC20
SUAVE PROGRAMMING MODE TIMING IN DATA PROGRAMWITH REPEATED PROG PULSE AND AUTO INCREMENT
1. Memory Map. The 8XC196KC has 51 a bytes ofRAM/SFRs and an optional 16K ofROM/OTPROM. The extra 256 bytes of RAM willraside tn locations 100H-1FFH and the extra 8Kof ROM/OTPROM will reside in iocations4000H-5FFFH. These Iocations are externa!memory on the 8XC196KB.
2. The CDE pin on the KB has become a Vgs pin onthe KC to support 16/20 MHz operation.
3. EPROM programming. The BXC196KC has a dif-ferent programmtng algorithm to support 16K ofon-board memory. When performing Run-TímeProgramming, use the secííon of code in the8XC196KC User's Guide.
4. ONCE Mode Entry. The ONCE mode ¡s enteredon the 8XC196KC by driving the TXD pin low onthe rising edge of RESET. The TXD pin is heldhigh by a pullup that is specified by IOHI- ThisPullup musí not be overridden or the 8XC196KCwilí enteríhe ONCE mode.
5. During the bus_HOLD state. the 8XC196KCweakly holds RD, WR, ALE, BHE and INST intheir inactive staíes. The 8XC196KB only holdsALE in its inactivs state.
6. A RESET pulse from the 8XC196KC is 16 statesrather than 4 states as on the 8XC196KB (i.e., awatchdog timer overflow). This provides a longerRESET pulse for other devices in the system.
8XC196KC ERRATA
1. Missed EXTINT on P0.7.
The 80C196KC20 could possibiy missEXTINT on P0.7. See techbit MC0893.
2. HSI_MODE divide-by-eight
See Faxback #2192.
3. IPDhump.
See Faxback #2311.
an
23
8XC196KC/8XC196KC20
DATA SHEET REVISIÓN HISTORY
inte]
Thís data sheet is valid for devices with a "H", "U" or "M" at the end of the topside tracking number. Thetopside tracking number consists of níne characters and is the second une on the top side of the device. Datasheots are changad as new device ¡nformation becomes available. Verify with your local Intel sales office thatyou have the latest versión before finalizing a desígn or ordering devices.
The following are differences between the 270942-004 and 270942-005 datasheets:
1. Removed "Word Addressable On!y" from Port 3 and 4 ín Table 2.
2. Renamed PVAL to CPVER.
3. Removed TLLYV and TLLGV fr°m the waveform diagrams.4. Added HSl_MODE divide-by-eight and IPD hump to 8XC196KC errata.
The following are important differences between the 270942-002 and 270942-004 data sheats:
1. NMI during PTS, QBD port glitch and Divide HOLD/READY erratas were fíxed and have been removedfrom the data sheeí. The HSI errata is also removed as this is now considered normal operation.
2. Combined 16 and 20 MHz data sheets. Data sheet 270924-001 (20 MHz) is now obsolete.
3. Added BO-Iead SQFP package pinout.
4. Added documentation for CLKOUT dísabie bit
5. 0jA for QFP package was changed to 55°C/W from 42°C/W.
6. 0jC for QFP package was changed to 16°C/W from T8DnC/W.
7. TSAM (MIN)inlO-bitmode was changedlo 1.0 p-sfrom 3.0 jus.
8. TSAM (MIN) in 8-bit mode was changed to 1.0 /¿s from 2.0 j¿s.
9. l|[_i specification for port 2.0 was renamed \\\^.
10. [|t_2 (MAX) is changed to TBD from - 6 mA.
11. IIHI (MAX) is changed to + 200/xA from +100jitA.
12. l|m test condition changes to V¡N = 2.4V from ViN = 5.5V.
13. VHYS ¡s changed ío 300 mV from 150 mV.
14. Ice (TYP) at 16 MHz Ís changed to 65 mA from 50 mA.15. |cc (MAX) ai 16 MHz is changed ío 75 mA from 70 mA.
16. Ice (TYP) at 20 MHz is changed to 80 mA from 60 mA.
17. Ice (MAX) at 20 MHz is changed to 92 mA from 86 mA.
18- IlDLE (TYP) at 16 MHz is changed to 17 mA from 15 mA.
19- IIDLE (MAX) at 16 MHz is changed to 25 mA from 30 mA.
20- [IDLE (TYP) at 20 MHz is changed to 21 mA from 15 mA.21 • 'iDLE (MAX) at 20 MHz ís changed to 30 mA from 35 mA.
22. Ipo (TYP) at 16 MHz ¡s changed to 8 ¿iA from 15 /¿A.
23. IPD (MAX) at 16 MHz is changed to 15 ,uA from TBD.
24. IRQ (TYP) at 20 MHz ís changed to 8 jiA from 18 p.A.
25. IPD (MAX) at 20 MHz is changed to 15 juA from TBD.
26. TCLDV (MAX) is changed to TQSG ~45 ns from TQSC ~ 50 ns.
27. TLLAX (MIN)is changed to TQSC "35 ns from TQSC ~ 40 ns.28. TCHWH (MIN) is changed to —5 ns from —10 ns.
29- TRHAX (M'N) ¡s changed to TQSG "~ 25 ns from TQSC ~ 30 ns.30- THAU\ (MAX) is changed to +15 ns from +10 ns.
31. THALBZ (MAX) ¡s changed to + 20 ns from +15 ns.
.- N
-ft-'
-.*f
inte! 8XC196KC/8XC196KC2Q
32. THAHBV (MAX) is now specified at -M 5 ns, was formerly unspecified.
33. The TLLYV and TQ.GV specifications were removed. These specifications are noí required ¡n high-speedsystems designs.
34. Aridecí EXTINT, P0.7 errata to Errata section.
The following are the important differences between the -001 and -002 vsrsions of data sheet 270942,
1. Express and Commerciaí devices are combined into one data sheet. The Express only data sheet270794-001 is obsoleta.
2. Removed KB/KC feature set differences, pin definition tabla, and SFR locaíions and bitmaps.
3. Added programming pin function to package drawings and pin descriptions.4. Changedabsolute máximum temperatureunderbiasfrom 0°Cto Hh70°Cto —55°Gto + 125°C.
5. Replaced VOH2 specification with IQHI and !¡LI specifications,6. Added \\^-\n for NMI pulldown resistors.
7. Added maximurn ho!d latency table,
8. Added externa! oscillator and external clock circuit drawings.
9. Changed Clock Orive TXHXX an^ "Octxx 'n sPec to 20 ns-10. Rxed Serial Port TXLXH specification.
11. Added 8- and 10-bit moda A/p operating conditions tabies.
12. Specified operating range for sample and convert times.13. Added specification for voltage on analog input pin.. ' . ;
14. Put operating conditions for EPROM programming into tabular formal.
25
ANEXO BJ.
JUEGO DE INSTRUCCIONES
f
-8X
C19
6KC
/KD
VIR
ST
RU
CT
10N
SE
T R
EF
ER
EN
CE
Table
A-1
. O
pera
nrl
Va
ria
ble
s
Va
ria
ble
aa baop
bbb
bltn
o
breg
cadd
'
•
Dbr
eg '
disp Dw
reg
'
Ireg
Sbr
eg '
Sw
reg
'
wao
p
wre
g
XX
X
Des
crlp
tlon
A tw
o-bi
t líe
ld w
íthin
an
opco
de th
al s
elec
ts 'h
e ba
sic
addr
essí
ng m
ode
used
. Th
isfie
ld is
pre
sent
onl
y in
tho
se o
pcod
es th
at a
l ow
add
ress
mod
e op
tions
. Th
e Ü
eld
¡sen
code
d as
lollo
ws:
0 0
Reg
iste
r dire
ct0
1 im
med
iate
1 0
Indi
rect
1 1
Inde
xed
A by
te o
pera
nd th
al is
add
ress
ed b
y an
y ad
dres
s m
ode.
A th
ree-
bit
lield
with
in a
n op
code
tha
l sel
ecU
a s
peci
tíc b
it w
ithin
a re
glsl
er.
A th
ree-
bit l
ield
wíth
m a
n op
code
Iha
t sel
ects
one
of t
he e
ight
bits
In a
byt
e.
A by
te re
gist
er in
the
inte
rnal
Reg
iste
r File
. ' V
hen
it co
uld
be u
ncle
ar w
heth
er th
isva
riabl
e re
fers
lo a
sou
rce
or a
des
ünat
ion
rjgis
ter,
it is
pre
fixed
wíth
an
S o
r a
D.
An a
ddre
ss ¡n
the
prog
ram
cod
e.
A by
te re
gist
er in
the
inte
rnal
Reg
iste
r Fi
le t
lat s
erve
s as
the
desü
natio
n of
the
Inst
ruct
ion
oper
alio
n.
Dis
plac
emen
t. Th
e di
stan
ce b
etw
een
the
er d
oí a
n In
slru
cÜon
and
the
targ
et la
bel.
A w
ord
regi
ster
in th
e in
tern
al R
egis
ler
File
hat
ser
ves
as th
e de
süna
tion
oí Ih
ein
stm
cüon
ope
ratio
n. M
ust b
e al
igne
d on
ar
addr
ess
that
¡s e
venl
y di
visi
ble
by 2
.
A 32
-bit
regi
ster
ín th
e In
lern
al R
egis
ter F
ile! M
ust b
e al
igne
d on
an
addr
ess
that
isev
enly
div
isib
le b
y 4.
A by
te r
egis
ter i
n th
e in
tern
al R
egis
ter F
ile I
lat s
erve
s as
the
sour
ce o
f the
Ins
truct
ion
oper
atio
n.
A by
te re
gist
er In
the
inte
rnal
Reg
iste
r File
hat
ser
ves
as th
e so
urce
of t
he ¡n
slru
ctlo
nop
erat
ion.
Mus
t be
alig
ned
on a
n ad
dres
s tj-
at is
eve
nly
divi
sibl
e b
y 2.
A w
ord
oper
and
thal
ís a
ddre
ssed
by
any
addr
ess
mod
e.
A w
ord
regi
ster
in th
e in
tern
al R
egis
ter F
ile. W
hen
it co
uíd
be u
ncle
ar w
heth
er th
isva
riabl
e re
fers
to a
sou
rce
or a
des
ünat
ion
legl
ster
, it I
s pr
elix
ed w
ith a
n S
or a
D.
Mus
t be
alig
ned
on a
n ad
dres
s th
at Is
eve
n'y
divi
sibl
e by
2.
The
thre
e hi
gh-o
rder
bits
oí d
lspl
acem
enl.
' The
D o
r S
pre
lix is
use
d on
ly w
hen
it co
uld
be u
ncle
ar w
l ieth
er a
var
iabl
e re
fers
to a
des
tinat
ion
or a
sour
ce re
gist
er.
A-2
8XC
196K
C/K
D'IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tabl
e A
-2. I
nstr
uctl
on S
el
Mne
mon
icA
DD
(2 o
pera
nds)
AD
D(3
ope
rand
s}
AD
DB
(2 o
pera
nds)
AD
DB
(3 o
pera
nds)
AD
DC
AD
DC
B
AN
D(2
ope
rand
s)
AN
D(3
ope
rand
s)
AN
DB
(2 o
pera
nds)
Ope
ratio
nA
DD
WO
RD
S.
Add
s th
e so
urce
and
dest
inaü
on w
ord
oper
ands
and
sto
res
the
sum
into
the
dest
inaü
on o
pera
nd.
(DE
ST)
4-
(DE
ST)
-f (
SR
C)
AD
D W
OR
DS
. Add
s th
e tw
o so
urce
wor
d op
eran
ds a
nd s
tore
s th
e su
m in
toth
e de
stin
atlo
n op
eran
d.
(DE
ST
)^(S
RC
1)
+ {S
RC
2)
AD
D B
YTE
S. A
dds
the
sour
ce a
ndde
stin
atlo
n by
te o
pera
nds
and
stor
es t
hesu
m in
to th
e de
stin
aüon
(le
ftmos
t)op
eran
d.
(DE
ST)
f-
(DE
ST)
+ (S
RC
)
AD
D B
YTE
S.
Add
s th
e tw
o so
urce
byt
eop
eran
ds a
nd s
tore
s th
e su
m In
to th
ede
stin
aüon
ope
rand
.
(DE
ST
)<-(
SR
C1)
+ (
SR
C2)
AD
D W
OR
DS
WIT
H C
AR
RY
. Add
s th
eso
urce
and
des
ünat
ion
wor
d op
eran
dsan
d st
ores
the
sum
and
the
carr
y fla
g (0
or 1
) Int
o th
e de
stin
atlo
n op
eran
d.
(DE
ST)
<-
(DE
ST)
+ (S
RC
) +
C
AD
D B
YTE
S W
ITH
CA
RR
Y. A
dds
the
sour
ce a
nd d
estin
atlo
n b
yte
oper
ands
and
stor
es th
e su
m a
nd tn
e ca
rry (
lag
(0o
rí)
into
the
dest
inaü
on o
pera
nd.
(DE
ST)
«-
(DE
ST)
+ (S
RC
) +
C
LOG
ICA
L A
ND
WO
RD
S. A
ND
s th
eso
urce
and
des
tlnat
lon
wor
d op
eran
dsan
d st
ores
the
resu
lt in
to th
e de
süna
tion
oper
and.
The
res
ult h
as o
nes
In th
e bi
tpo
sltio
ns In
whi
ch b
oth
oper
ands
had
aT
an
d ze
ros
In a
ll ot
her
bit p
oslti
ons.
(DE
ST)
«-
(DE
ST)
AN
D (S
RC
)
LOG
ICA
L A
ND
WO
RD
S.
AN
Ds
the
two
sour
ce w
ord
oper
ands
and
sto
res t
here
sult
into
the
desü
natio
n op
eran
d. T
here
sult
has
ones
in o
nly
the
bit p
osiü
ons
Inw
hich
bot
h op
eran
ds h
ad a
"1 "
and
zero
sIn
all
othe
r bit
posí
tions
.
(DE
ST)
f-
(SR
C1)
AN
D (S
RC
2)
LOG
ICA
L A
ND
BY
TES
. A
ND
s th
eso
urce
and
des
tinat
lon
byte
ope
rand
san
d st
ores
the
resu
lt in
to th
e de
stin
aüon
oper
and.
The
res
ult h
as o
nes
In o
nly
the
bft p
osiü
ons
In w
hich
bot
h op
eran
ds h
ada
'1 "
and
zero
s In
all
othe
r bit
posi
üons
.
(DE
ST)
«-
(DE
ST)
AN
D (
SR
C)
Inst
ruct
ion
Form
alD
ES
T, S
RC
AD
D
wre
g, w
aop
(OH
001a
a) (
wao
p) (w
reg)
DE
ST
.SR
C1.
SR
C2
AD
D
Dw
reg,
Sw
reg,
wao
p
(OlO
OO
laa)
(w
aop)
(Sw
reg)
(D
wre
g)
DES
T, S
RC
AD
DB
br
eg, b
aop
(011
101a
a)(b
aop)
(bre
g)
DE
ST
.SR
C1.
SR
C2
AD
DB
D
breg
, Sbr
eg,
baop
(010
101a
a) (b
aop)
(br
eg)
DE
ST,
SR
C
AD
DC
w
reg,
wao
p
(101
001a
a) (
wao
p) (w
reg)
DE
ST,
SR
C
AD
DC
B b
reg,
bao
p
(101
101a
a) (
baop
) (b
reg)
DE
ST,
SR
C
AN
D
wre
g, w
aop
(OllO
OÓ
aa)
(wao
p) (
wre
g)
DE
ST
,SR
C1,
SR
C2
AN
D
Dw
reg,
Sw
reg,
wao
p
(OlO
OO
Oaa
) (w
aop)
(S
wre
g) (
Dw
reg)
DE
ST,
SR
C
AN
DB
br
eg,
baop
(Otl
100a
a) (
baop
) (b
reg)
A-3
Ta
ble
A-2
. In
stru
ctlo
n S
3t (
Co
ntl
nu
ed)'
Mnem
onic
AN
DB
(3 o
pera
nds)
BMO
V
BM
OV
I
BR
CLR
Op
era
tlo
n
LOG
ICA
L AN
D B
YTE
S. A
ND
s th
e Ew
oso
urce
byt
e op
eran
ds a
nd s
tore
s the
resu
lt ¡n
lo th
e de
stin
alio
n op
eran
d. T
here
sult
has
ones
in o
nly
[he
bit p
osltí
ons
¡nw
hich
bot
h op
eran
ds h
ad a
"1"
and
zer
osin
all
olhe
r bi
t pos
ition
s.
(OES
T) «
- (S
RC
1) A
ND
(SR
C2)
BLO
CK
MO
VE
. Moy
es a
blo
ck o
f wor
dda
ta (
rom
one
loca
tíon
in m
emor
y to
anot
her.T
he s
ourc
e an
d de
stin
atio
nad
dres
ses
are
calc
ulat
ed u
sing
the
indí
rect
with
aut
o-in
crem
ent
addr
essi
ngm
ode.
A lo
na r
egis
ter a
ddre
sses
the
sour
ce a
nd d
estin
atio
n po
ínte
rs, w
hich
are
stor
ed in
ad¡
acen
t wor
d re
gist
ers.
Aw
ord
regi
ster
(CN
TRE
G) s
peci
fies
the
num
ber
of tr
ansf
ers.
The
blo
cks
o[ d
ata
can
resi
de a
nyw
here
¡n m
emor
y, b
utsh
ould
noí
ove
rlap.
INTE
RR
UP
TAB
LE B
LOC
K M
OV
E.
Mov
es a
blo
ck o
f wor
d da
ta fr
om o
nelo
ca tío
n ¡n
mem
ory
to a
noth
er.T
hein
stru
ctio
n is
iden
lical
to B
MO
V, e
xcep
tIh
at B
MO
VI I
s In
terr
upta
ble.
The
sou
rce
and
dest
inat
ion
addr
esse
s ar
e ca
lcul
aled
usin
g th
e in
dire
ct w
ilh a
uto-
íncr
emen
tad
dres
sing
mod
e. A
long
regi
ster
addr
esse
s th
e so
urce
and
des
tinat
ion
poin
ters
, wht
ch a
re s
tore
d ih
adj
'ace
ntw
ord
regi
ster
s. A
wor
d re
gist
er(C
NTR
EG
) sp
eciíí
es th
e nu
rnbe
r oí
trans
lers
. The
blo
cks
oí d
ata
can
resi
dean
ywhe
re in
mem
ory,
but
sho
uld
not
over
lap.
CO
UN
T <
- (C
NTR
EG)
LOO
P: S
RC
PTR
*-
(PTR
S)
DS
TPTR
t-
(PTR
S +
2)
(DS
TPTR
) t-
(SR
CP
TR)
(PT
RS
)«-
SR
CP
TR +
2(P
TRS +
2) <
-DS
TP
TR
-f 2
CO
UN
T«-
CO
UN
T 1
IIC
OU
NT
*Oth
engo
to L
OO
P
BR
AN
CH
INO
IRE
CT.
Con
tinúe
sex
ecut
ion
al th
e ad
dres
s sp
ecifi
ed ¡
n th
eop
eran
d w
ord
regi
ster
.
PC «
- (D
ESTJ
CLE
AR
WO
RD
. Cle
ars
the
valu
é of
the
oper
and.
(DE
ST)
t-
O
Inst
ruct
lon
Form
alD
ES
T,S
RC
1,S
RC
2
AN
DB
D
breg
, Sbr
eg, b
aop
,010
100a
a) (
baop
) (S
breg
) (D
breg
)
DE
ST,
SR
C
f3M
OV
Ire
g, w
reg
1100
0001
} (w
reg)
(Ire
g)
MO
TE: C
NTR
EG
ts n
ot d
ecre
men
ted
durin
ghl
s in
slru
ctlo
n. It
ís e
asy
to u
nlnt
entio
nally
¡rea
te a
long
, uni
ntem
ipta
ble
oper
atio
n w
íth;h
e B
MO
V in
stru
ctio
n. U
se th
e B
MO
VI
nstru
ctio
n fo
r an
inte
rrupt
able
op
erat
ion.
DE
ST,
SR
C
3MO
VI
Ireg,
wre
g
[110
0110
1) (
wre
g) (
Ireg)
NO
TE: C
NTR
EG
¡s n
ot d
ecre
men
ted
unle
ssih
e In
stru
ctio
n is
inte
rrup
ted.
Whe
n B
MO
VI i
sín
terr
upte
d, C
NTR
EG
ís u
pdat
ed to
sto
re th
eín
terir
n w
ord
coun
l al t
he ti
me
oí th
e in
terr
upt.
ror
this
rea
son,
you
sho
uld
alw
ays
relo
ad,C
NTR
EG
bef
ore
star
ting
a B
MO
VI.
DE
ST
BR
[wre
g)
(111
0001
1) {
wre
g)
- D
ES
T
CLR
w
reg
(000
0000
1)(w
reg)
A-4
8XC
196K
C/K
D I
NS
TR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Tab
le A
-2. I
nst
ruct
lon
Set
(C
on
tln
ue
d)
Mne
mon
icC
LRB
CLR
C
CLR
VT
CM
P
CM
PB
CM
PL
DE
C
DE
CB
DI
Ope
ratio
nC
LEA
R B
YTE
. C
lear
s th
e va
lué
of th
eop
eran
d.
(DE
ST)
«- 0
CLE
AR
CA
RR
Y FL
AG
. Cle
ars
the
carr
yíla
g.
C<
-0
CLE
AR
OV
ER
FLO
W-T
RA
P F
LAG
.C
lear
s th
e ov
erflo
w-tr
ap fl
ag,
VT
t-0
CO
MP
AR
E W
OR
DS
. Sub
trac
ts th
eso
urce
wor
d op
eran
d fr
om th
ede
stin
atio
n w
ord
oper
and.
The
flag
s ar
eal
tere
d, b
ut th
e op
eran
ds r
emai
nun
afte
cted
. |f a
bor
row
occ
urs,
the
carry
flag
is c
lear
ed; o
ther
wis
e ¡t
Ís s
el.
{DE
ST)
- (
SR
C)
CO
MP
AR
E B
YTE
S. S
ubtra
cts
the
sour
ce b
yle
oper
and
from
the
dest
inat
ion
byte
ope
rand
. The
fla
gs a
re a
ltere
d, b
utth
e op
eran
ds r
emai
n un
atíe
cted
. If
abo
rrow
occ
urs,
the
carr
y fla
g !s
cle
ared
;ot
herw
ise
It is
sel
.
(DE
ST)
-(S
RC
)
CO
MP
AR
E L
ON
G.
Com
pare
s th
em
agni
tude
s of
two
doub
le-w
ord
(long
)op
eran
ds. T
he o
pera
nds
are
spec
ified
usin
g th
e di
rect
add
ress
ing
mod
e. T
hefla
gs a
re a
ltere
d, b
ut th
e op
eran
dsre
mai
n un
affe
ded.
If a
bor
row
occ
urs,
the
carr
y fla
g is
cle
ared
; ot
herw
ise,
it Ís
set.
(DE
ST)
-(S
RC
)
DE
CR
EM
EN
TW
OR
D. D
ecre
men
ts th
eva
lué
of th
e op
eran
d by
one
.
(DE
ST)
<-
(DE
ST
)-l
DE
CR
EM
EN
T B
YTE
. Dec
rem
ents
the
valu
é of
the
oper
and
by o
ne.
(DE
ST)
i-
(DE
ST
)-l
DIS
AB
LE I
NTE
RR
UP
TS.
Dis
able
sin
terr
upts
. In
terr
úpl-c
alls
can
not o
ccur
afte
r th
is in
stru
ctio
n.
Inte
rrup
l Ena
ble
(PS
W.1
) «-
0
Inst
ruct
lon
For
mat
DE
ST
CLR
B
breg
(000
1000
1) (b
reg)
CLR
C
(111
1100
0)
CLR
VT
(111
1110
0) DE
ST,
SR
C
CM
P
wre
g, w
aop
(100
010a
a) (
wao
p) (
wre
g)
DE
ST,
SR
C
CM
PB
br
eg,
baop
(100
110a
a) (
baop
) (b
reg)
DE
ST,
SR
C
CM
PL
Ireg,
Ire
g
(110
0010
1) (
srcl
reg)
(de
sttfl
reg)
DE
ST
DE
C
wre
g
(000
0010
1) (
wre
g)
DE
ST
DE
CB
br
eg
(000
1010
1) (
breg
)
DI
.
(111
1101
0)
A-5
8XC
196K
C/K
D I
NS
TR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Tab
le A
-2. I
nst
ruct
lor
Set
(C
ontln
ued)
8XC
196K
C/K
D IN
STR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Mne
mon
lcD
IV Diva
DIV
U
DIV
UB
Ope
ratl
onD
IVID
E I
NT
EG
ER
S.
Div
ides
the
conl
ents
oí
the
dest
inal
ion
long
-Int
eger
oper
and
by th
e co
nten
ls o
f th
e so
urce
Inte
ger
wor
d op
eran
d, u
sing
sig
ned
arith
met
ic. I
t slo
res
Ihe
qupt
ient
inlo
the
low
-ord
er w
ord
of th
e de
stin
atio
n (¡.
e.,
th¡)
wor
d w
ith t
he lo
wer
add
ress
) an
d th
ere
mai
nder
¡nto
the
hig
h-or
der
wor
d.
(low
wor
d D
ES
T)f
(híg
h w
ord
DE
ST
).(D
ES
T)/
(SR
C)
- (D
ES
T)
MO
D(S
RO
)
DIV
IDE
SH
OR
T-I
NT
EG
ER
S.
Div
ides
th'
Jco
nten
ts o
f th
e de
stin
atio
n In
teger
oper
and
by t
he c
onte
nts
of t
he s
ourc
esh
ort
-ln
teg
er
oper
and,
usi
ng s
igne
dar
ithm
etic
.lt s
tore
s th
e qu
otie
nt in
to th
elo
w-o
rder
wor
d of
the
des
tinat
ion
(i.e.
, th'
jw
ord
with
the
low
er a
ddre
ss}
and
Ihe
rem
aind
er in
to t
he h
igh-
orde
r w
ord.
•
(low
byt
e D
ES
T)«
- (D
ES
T)
/ (S
RC
) '.
(hig
h by
te D
ES
T}
«- (
DE
ST
) M
OD
{S
RC
)
DIV
IDE
WO
RD
S, U
NS
IGN
ED
. D
ivid
esth
e co
nten
í oí
the
dest
inat
ion
double
- -
wo
rd o
pera
nd b
y th
e co
nten
ts o
f the
sour
ce w
ord
ope
rand
, us
ing
uns
igne
d .
arith
met
ic,
II sl
ores
the
quo
tíent
Inlo
the
low
-ord
er w
ord
(i.e,
, th
e w
ord
with
the
low
er a
ddre
ss)
oí t
he d
estin
atio
n op
erar
'dan
d th
e re
mai
nder
int
o Ih
e hi
gh-o
rder
wor
d. T
he lo
llow
ing
tw
o st
atem
ents
are
perf
orm
ed c
oncu
rren
tly.
{low
wor
d D
ES
T}
<-(h
igh
wor
d D
ES
T)
<(S
RC
}
(DE
ST
)/(S
RC
)-
(DE
ST
) M
OD
DIV
IDE
BY
TE
S,
UN
SIG
NE
D. T
his
insl
ruct
ipn
divi
des
the
cont
ents
of t
hede
stin
atio
n w
ord
ope
rand
by
the
cont
ents
of
the
sour
ce b
yte
oper
and,
usin
g un
sign
ed a
rithm
etic
. it s
tore
s th
equ
otíe
nt in
lo t
he lo
w-o
rder
wor
d (i.
e.,
thu
wor
d w
ith th
e lo
wer
add
ress
} oí
the
dest
inal
ion
oper
and
and
the
rem
aind
erin
to t
ho h
igh-
orde
r w
ord.
The
lol
low
ing
two
stal
emen
ts a
re p
erfo
rmed
conc
urre
ntly
.
(low
byt
e D
ES
T}
t-(h
Ígh
byt
eD
ES
T)f
(DE
ST
)/(S
RC
)- (
DE
ST
) M
OD
(S
RC
)
Inst
ruct
ion
Fo
rmal
DE
ST
, S
RC
DIV
Ire
g, w
aop
(111
1111
0) (
1000
11 a
a) (
wao
p) (
Ireg)
DE
ST
, S
RC
DIV
B
wre
g, b
aop
(111
1111
0) (
1001
11aa
) (b
aop)
(w
reg}
DE
ST
, SR
C
DIV
U
Ireg,
wao
p
(IQ
OO
Haa
) (w
aop)
(Ire
g)
DE
ST
, SR
C
DIV
UB
w
reg,
bao
p
(100
111
aa)
{bao
p) (
wre
g)
DJN
2
DJN
ZW
DP
TS
EP
TS
EX
T
A6
1
Tabl
e A
-2. I
nst
ruct
lon
Set
(C
on
tin
uad
)
Op
erat
ion
I In
stru
ctlo
n F
orm
alD
EC
RE
ME
NT
A
ND
JU
MP
IF N
OT
ZE
RO
. D
ecre
men
ts t
he v
alué
of
the
byte
oper
and
by 1
. If
the
resu
lt is
O, c
ontr
olpa
sses
lo
the
next
seq
uent
ial i
nslru
ctío
n.If
the
resu
lt is
not
equ
al to
O, t
heIn
stru
ctio
n ad
ds t
o th
e pr
ogra
m c
ount
erth
e of
fset
bet
wee
n th
e e
nd
of
this
inst
rudio
n a
nd th
e ta
rget
taba
l, ef
fect
ing
the
ium
p. T
he o
ffset
mus
t be
ín th
e ra
ngo
of-
12
8to
+1
27
.
(CO
UN
T)
<-
(CO
UN
TJ-
1[f
(CO
UN
T)
* O
the
nP
C í
-PC
-f-d
isp
(N
ote
1)endjf
DE
CR
EM
EN
T A
ND
JU
MP
IF
NO
TZ
ER
O W
OR
D.
Dec
rem
ents
the
val
ué o
fth
e w
ord
oper
and
by
1. If
the
resu
lt Is
O,
cont
rol p
asse
s to
the
next
seq
uent
ial
inst
ruct
ion.
If t
he r
esul
t is
not
equ
al to
O,
the
Inst
ruct
ion
add
s to
the
pro
gram
coun
ter
the
offs
et b
etw
een
the
end
of th
isin
stru
ctfo
n an
d th
e ta
rget
labe
!, ef
fect
ing
the
jum
p. T
he o
ffset
mus
t be
In th
e ra
nge
of-
12
8to
+1
27
(CO
UN
T) f-
(C
OU
NT
H¡f
(CO
UN
T) *
O t
hen
PC
f-P
C +
dls
p (
Not
e 1)
endjf
breg
,cad
d
(111
0000
0) (
bre
g)(
dis
p)
DJN
ZW
wre
g,ca
dd
(111
0000
1) (
wre
g)(
dis
p)
DIS
AB
LE
PE
RIP
HE
RA
LT
RA
NS
AC
TIO
N S
ER
VE
R
(PT
S).
Dis
able
s th
e P
eríp
hera
l Tra
nsac
tion
Ser
ver
(PT
S).
PTS
Dis
able
(P
SW
.2)
«-
O
EN
AB
LE I
NT
ER
RU
PT
S.
Ena
bles
Inte
rrup
ts f
ollo
win
g th
e ex
ecut
ion
of th
ene
xt s
tate
men
t. In
terr
upt-
calls
can
not
occ
urim
media
tely
fol
low
ing
this
inst
rucl
lon.
Inte
rru
ptE
na
ble
(PS
W.f
).
EN
AB
LE P
ER
ÍPH
ER
AL
TR
AN
SA
CT
ION
SE
RV
ER
(P
TS
). E
nabl
es t
he P
erip
hera
lT
rans
actfo
n S
erve
r (P
TS
J.
| P
TS
Ena
ble
(P
SW
.2)
<- 1
DP
TS
(111
0110
0)
SIG
N-E
XT
EN
D I
NT
EG
ER
IN
TO
LO
NG
-IN
TE
GE
R.
Síg
n-ex
tend
s th
e lo
w-o
rder
wor
d of
the
oper
and
thr
ough
out
the
high
-or
der
wor
d ot
the
ope
rand
.
If (lo
w w
ord
DE
ST
) < 8
000H
the
n(h
igh
wor
d D
ES
T)
<- O
else (h
igh
wor
d D
ES
T)
«- O
FF
FF
Hen
d ir
A-7
El
(111
1101
1)
EP
TS
(111
0110
1)
EX
T
Ireg
(000
0011
0) (
Ireg)
¡ni
8X
C1
96
KC
/KD
IN
ST
RU
CT
iON
SE
T R
EF
ER
EN
CE
Table
A-2
. In
str
uctlo
n S
et (C
on
tln
ue
d)
Mnem
oníc
EX
TB
IOLP
D
INC
INC
B
JBC
Opera
tion
SIG
N-E
XT
EN
D S
HO
RT
-INT
EG
ER
IN
TOIN
TE
GE
R. S
ign-
exte
nds
the
low
-ord
erby
te o
f th
e o
pera
nd th
roug
houl
the h
igh-
orde
r by
te o
í Ih
e op
eran
d.
if (lo
w b
yte
DE
ST
)<8
0H
then
(hig
h b
yte
DE
ST
) *-
Oel
se (hig
h b
yte
DE
ST
) (-
OF
FH
end
ií
IDLE
/PO
WE
RD
OW
N.
Dep
endi
ng o
n th
e8-
bit
valu
é o
f the
KE
Y o
pera
nd, t
his
inst
ruct
ion
caus
es t
he p
art
. ío
en
terl
dle
mo
de
(KE
Y=
1),
• to
ent
er P
ower
dow
n m
ode
(K
EY
=2),
• to
exe
cute
a r
esé!
seq
uenc
e(K
EY
= a
ny v
alué
oth
er th
an 1
or 2)
.
The
bus
con
trolle
r co
mpl
etes
any
preí
etch
cyc
le í
n pr
ogre
ss b
elor
e th
eC
PU
sto
ps o
rre
sels
.
¡f K
EY
« 1
then
ente
f Id
leel
se HK
EY
-2lh
en
ente
r P
ower
dow
nel
se exec
ule
rese
l
Instr
ucti
on
Fo
rmat
EX
TB
w
reg
(000
1011
0)(w
reg)
IDLP
D
#key
(111
.101
10)
(key
)
INC
RE
ME
NT
WO
RD
. In
crem
ente
the
valu
é of
Ihe
wo
rd o
pera
nd b
y 1.
(DE
ST
) <-
(D
ES
T) +
1
I i IN
C
wre
g
r: (
oo
oo
oi 1
1} (
wre
g)
INC
RE
ME
NT
BY
TE
. In
crem
ents
the
valu
é oí
the
byte
ope
rand
by
1.
(DE
ST
)«-(
DE
ST
}-f
1.
INC
B
breg
; (0
0010
111)
(br
eg)
JUM
P I
F B
IT I
S C
LEA
R. T
ests
Ihe
spec
ified
bit.
If t
he b
it is
set
, con
trol
pass
es to
the
next
se^
uent
ial i
nstr
uclio
n.If
the
bit
Is c
lear
, th
is in
slru
ctlo
n a
dds
toth
e pr
ogra
m c
ounl
er t
he o
ffset
bet
wee
nth
e en
a of
this
inst
ruct
ion
and
the
targ
etla
bel,
effe
ctin
g th
e ju
mp.
The
offs
et m
usí
bein
the
rang
e of-
128
to+
127.
¡f (s
peci
fied b
il) =
O th
enP
C *
- P
C 4
dis
p (N
ote
1)
JBC
br
eg,b
ilno,
cadd
(001
lObb
b) (
breg
) (d
isp)
A-8
¡niel
.«
8X
C1
96
KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tab
le A
-2.
Ins
tru
ctl
on
Sel
(Co
ntln
ue
d)
Mn
em
on
lc
JBS
JC JE JGE
JGT
Op
era
tio
n
JUM
P I
F B
IT IS
SE
T.
Tes
ts th
e s
peci
fied
bit.
If th
e b
it is
ole
ar, c
ontr
ol p
asse
s to
the
next
seq
uent
ial
Inst
ruct
ion.
li th
e b
it ís
sel,
thís
inst
ruct
ion
add
s to
the
pro
gram
coun
ter
the
offs
et b
etw
een
the
end
of t
his
inst
fuct
ion
and
the
targ
et la
bal,
effe
ctin
gth
e Ju
mp.
The
offs
et m
usí
be in
the
ran
geo
f-1
28
to+
12
7.
¡f (s
peci
fied
bit)
= 1
then
PC
«-P
C +
dis
p (
Not
e 1)
JUM
P I
F C
AR
RY
FLA
G I
S S
ET
. T
ests
the c
arry
flag. I
f the
car
ry fla
g ís
cle
ar,
cont
rol p
asse
s to
the
nex
t se
quen
tlal
ínst
ruct
ion.
If th
e c
arry
íla
g is
set
, th
isin
stru
ctio
n ad
ds to
the
pro
gram
cou
nter
Ihe
offs
et b
etw
een
the
en
do
f th
isin
stru
ctio
n an
d th
e ta
rget
labe
l, ef
fect
ing
Ihe ju
mp.
The
offs
et m
usí b
e in
the
ran
geof
-1
28
to+
l27
.
if C -
1 th
enP
C f
-PC
+ d
isp
(N
ote
1)
JUM
P IF
EQ
UA
L. T
ests
the
zer
o fl
ag. I
fth
e fla
g Ís
cle
ar, c
ontr
ol p
asse
s to
the
next
seq
uent
ial i
nst
ruct
ion.
If th
e z
ero
flag
¡s s
et,
this
inst
ruct
ion
adds
to
the
prog
ram
cou
nter
the
offs
et b
etw
een
the
end
of t
his
Inst
ruct
ion
and
the
targ
etla
bel,
effe
ctin
g th
e J
unip
. The
offs
et m
ust
be in
the
rang
e of
-128
to +
127.
If Z -
1 th
enP
C «
-PC
+ d
isp
{N
ote 1
)
JUM
P IF
SIG
NE
D G
RE
AT
ER
TH
AN
OR
EQ
UA
L. T
est
s th
e ne
gativ
o fla
g. If
the
nega
tivo
flag
is s
et, c
ontrol p
asse
s to
the
next
seq
uent
ial
inst
rucl
ion.
If th
e ne
gativ
ofla
g is
cle
ar,
this
inst
ruct
ion
add
s to
the
prog
ram
cou
nter
the
offs
et b
etw
een
the
ena
of th
is in
stru
ctío
n a
nd th
e ta
rget
labe
l, ef
fect
ing
the
|um
p. T
he o
ffset
mus
tbe
in th
e ra
nge
of -1
28
to +
127.
II N
- O
the
nP
C «
- P
C +
dls
p (
Not
e 1)
JUM
P I
F S
IGN
ED
GR
EA
TE
R T
HA
N.
Tes
ts b
oth
the
zer
o fla
g an
d th
e n
egat
iva
flag.
If e
ither
fla
g Is
sel
, co
ntro
l pas
ses
toth
e ne
xt s
equenlia
l Insl
rucl
ion. I
f bot
hfla
gs a
re c
lear
, Ih
is in
stru
ctio
n ad
ds to
the
proo
ram
cou
nter
the
offs
et b
etw
een
the
end
of th
is i
nsfr
uctio
n a
nd t
he t
arge
tla
bel,
effe
ctin
g th
e ¡u
mp,
The
offs
et m
ust
be In
the
rang
e of
-128
to +
127.
íf N *
O A
ND
2 »
O I
hen
PC
«-
PC
+ d
isp
(N
ote 1
)
A-9
Ins
tru
cti
on
Fo
rma
t
JBS
br
eg.b
itno.
cadd
(001
11bb
b)(b
reg)
(di
sp)
JC
cadd
(110
1101
1) (
disp
}
JE
cadd
(110
1111
1) (
disp
)
JGE
ca
dd
(110
1011
0) (
disp
)
JGT
ca
dd
(110
1001
0) (
dísp
)
8X
C1
96
KC
/» IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Mne
mon
lcJH JL
E
JLT
JNC
Tab
le A
-2.
Inst
ruct
ion
Set
(C
ontln
ued)
Op
era
tlon
JUM
P I
F H
IGH
ER
(U
NS
IGN
ED
). T
ests
bpth
the
zero
fla
g an
d th
e ca
rry
flag.
Ifei
lher
Ihe
car
ry íl
ag is
cle
ar o
r Ih
e ze
rolla
g is
set
, con
trol
pas
ses
to th
e ne
xtse
quen
tíal í
nslru
ctio
n. If
the
carr
y lla
g is
sel a
nd th
e ze
ro fl
ag ís
cla
ar, t
his
inst
ruct
ion
adds
to tn
e pr
ogra
m c
ount
erth
e of
fset
bet
wee
n th
e en
dof
thís
inst
rucl
ion
and
the
targ
et la
bel,
eHec
tíng
the
¡um
p. T
he o
ffset
mus
t be
in r
ange
oí
-12810+
127.
if C
= 1
AN
D 2
= 0
then
PC í
-PC
+ d
isp
(N
ote
1)
JUM
P I
F S
IGN
ED
LE
SS
TH
AN
OR
EQ
UA
L. T
esis
bot
h th
e ne
gativ
o lla
g a
n,l
Ihe
zero
fla
g. If
bot
h fla
gs a
re c
lear
,co
ntro
l pas
ses
to Ih
e ne
xt s
eque
ntía
lin
stru
ctio
n. If
eith
er fl
ag Is
sel
, th
isin
slru
ctio
n ad
ds to
the
proo
ram
cou
nter
the
offs
et b
etw
een
the
ena
of t
his
inst
ruct
ion
nad
the
larg
a! la
bal,
effe
ctin
gth
a ju
mp.
The
offs
et m
ust b
e in
the
rang
co
f-1
28
to+
12
7.
II N
- 1
OR
Z «
1 th
enP
C (
-PC
+ d
isp
(Not
e 1)
JUM
P IF
SIG
NE
D L
ES
S T
HA
N. T
ests
the
nega
tiva
flag.
If th
e fla
g is
cle
ar,
cont
rofp
asse
s to
the
next
seq
uent
ial
inst
ruct
ion.
II t
he ll
ag is
set
, thi
sin
stru
ctio
n ad
ds to
the
prog
ram
cou
nter
Ihe
offs
et b
etw
een
Ihe
ena
of t
his
inst
ruct
ion
and
the
targ
et la
bel,
effe
ctin
gth
e ju
mp.
The
offs
et m
ust b
e In
the
rang
ío
f-1
28
to+
12
7.
¡f N
= 1
then
PC t-
PC
+ d
isp
(Not
e 1)
JUM
P I
F C
AR
RY
FU
\ IS
CLE
AR
.T
ests
the
car
ry f
lag.
II th
e fla
g Ís
set
,co
ntro
l pas
ses
to th
e ne
xt s
eque
ntia
l¡n
stru
ctio
n. If
the
carr
y lla
g Ís
cle
ar,
this
inst
rucl
ion
adds
lo I
he p
rogr
am c
ounl
erIh
e of
fset
bet
wee
n th
e e
nd
ol t
his
Inst
ruct
ion
and
Ihe
targ
el la
bel.
The
offs
em
ust b
e in
the
rang
e o
f-1
28
to
+1
27
.
il C
= o
Ihen
PC
<-
PC
+ d
isp
(N
ote
1)
Insl
ruct
lon
Form
al
JHca
dd
(110
1100
1} {
disp
)
¡nie
l.8X
C19
6KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tab
le A
-2. I
nst
ruct
ion
Set
(C
on
tlnu
ed
)
JLE
ca
dd
(110
1101
0) (
disp
)
JLT
ca
dd
(110
1111
0) (
disp
)
JNC
ca
dd
(110
1001
1) (
disp
)
Mne
mon
lcJN
E
JNH
JNS
T
JNV
Op
erat
lon
JUM
P I
F N
OT
EQ
UA
L. T
ests
the
zer
ofla
g. If
the
flag
is s
et, c
ontr
ol p
asse
s to
the
next
seq
uent
ial I
nstru
ctio
n. I
f the
zer
ofla
g is
cle
ar, t
his
Inst
mct
lon
adds
to
the
prog
ram
cou
nter
the
offs
et b
etw
een
the
end
of th
is in
stru
ctio
n an
d th
e ta
rget
labe
l. T
he
offs
et m
ust be in
the
rang
e of
-1
28
to+
12
7.
if Z -
O t
hen
PC
t-P
C +
dis
p (
Not
e 1)
JUM
P I
F N
OT
HIG
HE
R (
UN
SIG
NE
D).
Tes
ts b
oth
the
zero
flag
and
the
car
ryfla
g. I
f the
car
ry f
lag
Ís s
et a
nd t
he z
ero
flag
is c
lear
, con
trol
pass
es lo
the
nex
tse
quen
tial
Inst
ruct
ion.
II
eith
er t
he c
arry
flag
is s
et o
r th
e ze
ro fl
ag Ís
set
, thí
sin
stru
ctio
n ad
ds to
the
prog
ram
cou
nter
the'
Offs
et b
etw
een
the
end
of t
his
Inst
ruct
ion
and
the
targ
et la
bel,
effe
ctin
gth
e ¡u
mp.
The
offs
et m
ust b
e In
rang
e oí
-12810+
127.
H C
- O
OR
Z -
1 th
enP
C «
- P
C +
dis
p (N
ote
1)
JUM
P I
F S
TIC
KY
BIT
FLA
G I
S C
LEA
R.
Tes
ts t
he s
ticky
bit
llag.
If th
e fla
g ís
set
,co
ntro
l pas
ses
to t
he n
ext
sequ
entia
lin
stru
ctio
n. I
f the
stic
ky b
it fla
g is
cle
ar,
this
inst
ruct
ion
add
s to
the
prog
ram
coun
ter
the
offs
et b
etw
een
the
end
of th
isin
stru
ctio
n an
d th
e ta
rget
labe
l, ef
fect
ing
the
jum
p. T
he o
ffset
mus
t be
In ra
nge
of-1
28to
+127.
if S
T -
O t
hen
PC
*-P
C +
dís
p(N
ote
1)
JUM
P I
F O
VE
RF
LOW
FLA
G I
S C
LEA
R.
Tes
ts t
he o
verf
low
fla
g. If
the
llag
is s
et,
cont
rol p
asse
s to
the
next
seq
uent
ial
inst
ruct
ion.
If th
e ov
erflo
w fl
ag Ís
cle
ar,
this
inst
ruct
ion
adds
to
the
prog
ram
coun
ter
the
offs
et b
etw
een
the
end
of t
his
Inst
ruct
ion
and
the
targ
et la
bel,
effe
ctin
gth
e ju
mp.
The
offs
et m
ust
be in
rang
e oí
-12810+
127.
if V
- O
the
nP
C «
- P
C +
dis
p (N
ote
1)
Inst
ruct
ion
Fo
rmal
JNE
ca
dd
(110
1011
1)(d
¡sp)
JNH
ca
dd
(110
1000
1) (
disp
)
JNS
T
cadd
(110
1000
0) (
disp
)
JNV
ca
dd
(110
10JD
1)(d
ísp)
A-1
0
iA
-11
vé)
8X
C196K
C/K
D I
NS
TR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Ta
ble
A-2
. In
stru
cll-
on S
et
(Contln
ued)
Mnem
oníc
JNV
T
JST
JV JVT
Opera
llon
JUM
P IF
OV
ER
FLO
W-T
RA
P F
LAG
\VC
LEA
R. T
ests
the
over
flow
-trap
(lag
. Ith
e [la
g is
set
, thl
s In
stru
ctio
n c
lear
s trn
llag
and
pass
es c
ontro
l lo th
e ne
xtse
quen
tial í
nslru
ctio
n. If
Ihe
over
ilow
-d a
plla
g is
cle
ar, t
his
Inst
ruct
lon
adds
to Ih
ipr
ogra
m c
ounl
er th
e of
fset
bet
wee
n tr
nan
ao(
this
ínsl
ruct
ion
and
the
larg
etla
bal,
effe
ctin
g th
e Ju
mp.
The
offs
et m
is!
be
lnra
ng
eo
f-1
28
to+
12
7.
if V
T =
O th
enPC
t-
PC
+ d
isp
(Not
e 1)
JUM
P IF
STI
CK
Y B
IT F
LAG
IS S
ET.
Test
s th
e st
icky
bit
flag.
If th
e íla
g Is
clea
r, co
ntro
l pas
ses
to th
e ne
xtse
quen
tial i
nstru
ctio
n. II
the
stic
ky b
it Ih
gis
sel
, thí
s in
stru
ctio
n ad
ds to
tha
prog
ram
cou
nter
the
offs
et b
efw
een
thr
endo
f thi
s in
stru
ctio
n an
d th
e ta
rget
labe
l, ef
fect
ing
the
jum
p. T
he o
ffset
mui
tbe
In ra
nge
of-
128
to +
127.
.
ifS
T«
1 th
enPC
f-
PC
+ d
isp
(Not
e 1}
JUM
P I
F O
VE
RFL
OW
FLA
G IS
SET
.Te
sts
the
over
flow
llag
. If
the
flag
is c
le-ir
.co
ntro
l pas
ses
to th
e ne
xt s
eque
ntia
lin
stru
ctio
n. If
the
over
flow
flag
is s
et, t
hsin
stru
ctio
n ad
ds lo
the
prog
ram
cou
nter
the
offs
et b
etw
een
Ihe
endo
f thi
sin
stru
ctio
n an
d th
e ta
rget
labe
l, ef
fect
ín¡
the
jum
p. T
he o
ffset
mus
í be
In ra
nge
o-1
2810
+127
.
IIV -
1 th
enPC
<-P
C +
dís
p (N
ote
1)
JUM
P IF
OV
ER
FLO
W-T
RA
P F
LAG
ISS
ET.
Tes
ts th
e ov
erílo
w-tr
ap fl
ag, l
í the
llag
Is c
lear
, con
trol p
asse
s to
the
next
sequ
entia
l ins
truct
ion.
If t
he o
verfl
ow-tr
épfla
g ¡s
set
, Ihi
s Ín
slru
ctio
n cl
ears
the
|la('
and
adds
to th
e pr
ogra
m c
ount
er th
eof
fset
bet
wee
n th
e en
d of
this
Inst
ruct
ioif
and
the
targ
et la
bel,
efie
ctln
g th
e ju
mp.
The
offs
et m
ust b
e In
rang
e oí-128
to+1
27.
¡ÍV
T-
PC
.1 th
en-
PC
+ d
isp
(Not
e 1)
Inst
ruct
ion
Fo
rmal
JNV
T ca
dd
1101
0100
} (d
isp)
JST
ca
dd
(110
1100
0) (
dísp
}
JV
cadd
(110
1110
1} (
disp
}
JVT
ca
dd
(110
1110
0) (
dísp
}
A-t
!
8XC
196K
C/K
D IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Table
A-2
. In
str
uctlo
n S
et
(Co
ntln
ue
d)
Mnem
onic
LCA
LL
LD LDB
LDB
SE
LDB
ZE
UM
P
MU
L(2
ope
rand
s)
Ope
ratlo
n
LON
G C
ALL
. P
US
Hes
the
conl
ents
of
the
prog
ram
cou
nter
(th
e re
turn
add
ress
}on
to th
e st
ack,
then
add
s to
the
prog
ram
coun
ter
the
offs
et b
etw
een
the
end
of th
lsin
stru
ctio
n an
d th
e ta
rget
labe
l, ef
fect
ing
the
cali.
The
ope
rand
may
be
any
addr
ess
in th
e en
tire
addr
ess
spac
e.
SP
f-S
P-2
(SPJ
*- P
CPC
<-
PC
+ d
lsp
LOA
D W
OR
D. L
oads
the
valu
é of
the
sour
ce w
ord
oper
and
into
the
des
tinat
lon
oper
and.
(DES
T) «
- (S
RC
)
LOA
D B
YTE
. Loa
ds th
e va
lué
of th
eso
urce
byt
e op
eran
d In
to th
e de
stln
atio
nop
eran
d.
(DES
T) *
- (S
RC
)
LOA
D B
YTE
SIG
N-E
XTE
ND
ED
. Síg
n-ex
tend
s th
e va
lué
of th
e so
urce
sho
rt-
Inta
ger
oper
and
and
load
s It
into
the
dest
lnat
ion
Inte
ger
oper
and.
(low
byt
e D
EST)
«-
{SR
C)
if (S
RC
) < S
Oh th
enjh
lgh
byt
e D
EST)
f-
0el
se (hig
h by
te D
ES
T) «
- O
FFH
end
íT
LOA
D B
YTE
ZE
RO
-EX
TEN
DE
D. Z
ero-
exte
nds
tha
valu
é of
the
sour
ce b
yte
oper
and
and
load
s ¡t
into
the
dest
inat
ion
wor
d o
pera
nd.
(low
byt
e D
EST) f-
(SR
C}
(hig
h b
yte
DE
ST)
f-
0
LON
G J
UM
P. A
dds
to th
e pr
ogra
mco
unle
r th
e of
fset
bet
wee
n th
e en
d of
this
inst
ruct
ion
and
the
targ
et la
bel,
efie
ctin
gth
e ju
mp.
The
ope
rand
may
be
any
addr
ess
in th
e en
tire
addr
ess
spac
e.
PC <
- P
C +
dís
p
MU
LTIP
LY I
NTE
GE
RS
. M
ultíp
lles
the
sour
ce a
nd d
estín
atio
n In
tege
r op
eran
ds,
usin
a s
ígne
d ar
ithm
etic
, and
sto
res
the
32-b
ít re
sult
into
the
dest
inat
ion
lona
-In
tege
r op
eran
d. T
he s
ticky
bit
llagis
unde
fined
afte
r the
inst
ruct
ion
ísex
ecut
ed.
(DES
T) «
- (D
EST)
x (S
RC
)
Inst
ruct
lon
For
mal
LCA
LL
cadd
(111
0111
1) (
disp
-low
) (d
isp-
high
)
DE
ST,
SR
C
LD
. w
reg,
wao
p
(101
000a
a) (
wao
p) (
wre
g}
DE
ST,
SR
C
LDB
br
eg, b
aop
(101
100a
a)(b
aop)
(bre
g)
DE
ST,
SR
C
LDB
SE
w
reg,
bao
p
(101
111a
a) (
baop
) (w
reg)
DE
ST,
SR
C
LDB
ZE
wre
g, b
aop
(101
01 1a
a) (
baop
) (w
reg)
LJM
P
cadd
(111
0011
1) (
disp
-low
) (d
isp-
high
)
DE
ST,
SR
C
MU
L Ire
g, w
aop
(1 1 1
1 1
1 1
0)
(01
01 1 1
aa)
(wao
p'}
(Ireg
)
A-1
3
- , w
<p
; •«
HH
gl*
8
XC
19
6K
C/K
D I
NS
TR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Ta
bla
A-2
. In
stru
ctlo
n 3
et
(Co
ntln
ue
d)
Mnem
onlc
MU
L(3
ope
rand
s)
MU
LB(2
ope
rand
s)
MU
LB(3
ope
rand
s)
MU
LU(2
ope
rand
s}
MU
LU(3
ope
rand
s)
MU
LUB
(2 o
pera
nds)
Op
era
tlon
MU
LTIP
LY I
NTE
GE
RS
. M
ultip
lles
the
two
sour
ce In
tege
r op
eran
ds,
usin
gsí
gned
arit
hmet
ic, a
nd s
tore
s th
e 32
-bit
resu
lt in
to th
e de
stin
atio
n lo
ng-I
nteg
erop
eran
d. T
he s
ticky
bit
llag
Is u
ndef
ined
afte
r th
e ¡n
stru
ctio
n Ís
exe
cute
d.
(DES
T) f
-(S
RC
1)x(
SR
C2}
MU
LTIP
LY S
HO
RT-
INTE
GE
RS
.M
ultip
lies
the
sour
ce a
nd d
estin
atio
nsh
ort-
lnte
ger
oper
ands
, usi
ng s
igna
dar
ithm
etic
, and
sto
res
the
16-b
it re
sult
Into
the
dest
inat
ion
Inte
ger
oper
and.
The
stic
ky b
it fla
g is
und
efin
ed a
fler
the
insl
ruct
ion
is e
xecu
ted.
(DES
T) t-
(OES
T) x
(SR
C)
MU
LTIP
LY S
HO
RT-
INTE
GE
RS
.M
ultip
lies
the
two
sour
ce s
hort-
lnte
ger
oper
ands
, usi
ng s
igne
d ar
íthm
etic
, and
stor
es th
e 16
-bít
resu
lt in
to th
ede
stin
atio
n In
lege
r op
eran
d. T
he s
ticky
bit f
lag
Ís u
ndel
ined
afte
r th
e in
stru
ctio
n If
exsc
uled
.
(DE
ST
)f-(
SR
C1)
x(S
RC
2)
MU
LTIP
LY W
OR
DS
, UN
S1G
NE
D.
Mul
tiplie
s th
e so
urce
and
des
tinat
ion
wor
d op
eran
ds, u
sing
uns
igne
dar
ithm
etic
, and
sto
res
the
32-b
it re
sult
into
the
dest
inat
ion
doub
le-w
ord
oper
and.
The
stic
ky b
it fla
g Ís
und
efin
edaf
ter
the
inst
ruct
ion
is e
xecu
ted.
(DES
T) t-
(DES
T) x
(SR
C)
MU
LTIP
LY W
OR
DS
, UN
SIG
NE
D.
Mul
tiplie
s th
e tw
o so
urce
wor
d op
eran
dí,
usin
g un
slgn
ed a
rithm
eltc
, and
sto
res
tht-
32-b
it re
sull
into
the
des
tinat
ion
doub
le-
wor
d op
eran
d, T
he s
ticky
bit
flag
Ísun
delln
ed a
fter
the
inst
ruct
ion
Isex
ecui
ed.
(DE
ST
)(-(
SR
Cl)
x(S
RC
2)
MU
LTIP
LY B
YTE
S,
UN
SIG
NE
D.
Mul
tiplie
s th
e so
urce
and
des
tinat
ion
byte
ope
rand
s, u
sing
uns
igne
dar
ithm
etíc
, and
sto
res
the
wor
d re
sult
into
the
dest
inat
ion
oper
and.
The
stic
kybi
t fla
g Is
und
efin
ed a
fter t
he in
stru
ctio
n s
exec
uted
.
(DE
ST)
t-
(DE
ST)
x (S
RC
)
Inst
ruct
lon
Form
atD
ES
T, S
RC
1.S
RC
2
MU
L Ire
g, w
reg,
wao
p
(111
1111
0) (
0100
11aa
) (w
aop)
(wre
g) (I
reg)
DE
ST,
SR
C
MU
LB
wre
g, b
aop
(111
111
10}
(011
1 11
aa)
(bao
p) (
wre
g)
DE
ST,
SR
C 1
.SR
C2
MU
LB
wre
g, b
reg,
bao
p
(1 1
1 1
1 1 1
0} (
0101
1 la
a) (
baop
) (b
reg)
(w
reg)
DE
ST,
SR
C
MU
LU
Ireg,
wao
p
(011
011a
a) (
wao
p) (I
reg)
DE
ST,
SR
C1.
SR
C2
MU
LU
Ireg,
wre
g, w
aop
(010
01 la
a} (
wao
p) (
wre
g) (I
reg)
DE
ST,
SR
C
MU
LUB
wre
g, b
aop
(011
11 la
a} (
baop
) (w
reg)
intg
l*
8X
C1
96
KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tab
la A
-2.
Inst
ruct
lon
Set
(Con
tlnue
d)
Mne
mon
lcM
ULU
B(3
ope
rand
s)
NE
G
NE
GB
NO
P
NO
RM
L
NO
T
NO
TB
Ope
ratio
n
MU
LTIP
LY B
YTE
S,
UN
SIG
NE
D.
Mul
tiplle
s th
e tw
o so
urce
byt
e op
eran
ds,
usin
g un
sign
ed a
rithm
etic
, an
d st
ores
the
wor
d re
sult
into
the
dest
inat
ion
oper
and,
The
stic
ky b
it fla
g is
und
efin
ed a
fter
the
inst
ruct
ion
is e
xecu
ted.
(DE
ST
)<-(
SR
C1)
x(S
RC
2)
NE
GA
TE IN
TEG
ER
. N
egat
es t
he v
alué
of t
he In
tege
r op
eran
d.
(DE
ST)
i-
-(D
ES
T)
NE
GA
TE S
HO
RT-
INTE
GE
R.
Neg
ates
the
valu
é of
the
shor
t-ln
tege
r op
eran
d.
(DE
ST)
< (D
ES
T}
NO
OP
ER
ATI
ON
. D
oes
noth
ing.
Con
trol
pass
es t
o th
e ne
xt s
eque
ntla
l in
stru
ctio
n.
NO
RM
ALI
ZE
LON
G-IN
TEG
ER
.N
orm
aliz
es t
he s
ourc
e íle
ftmos
t) lo
ng-
Inte
ger
oper
ando
(Th
at is
, it s
hifts
the
oper
and
to th
e le
ft un
til it
s m
ost
slgn
lfican
t bit
is "
1 " o
r unt
il ít
has
perfo
rmed
31
shift
s).
If th
e m
ost
sign
ifica
n! b
it is
stil
l "0"
afte
r 31
shift
s, th
ein
stru
ctio
n st
ops
the
proc
ess
and
sets
the
zero
flag
. the
Ins
truct
lon
stor
es th
eac
tual
num
ber
of s
hifts
per
form
ed In
the
dest
inat
ion
(rlg
htm
ott)
ope
rand
.
(CO
UN
T) <
- 0
do w
hlle
(M
SB
(DE
ST)
«-
0) A
ND
(CO
UN
T) <
31}
(DE
ST)
<-
(DE
ST)
x 2
(CO
UN
T) í-
(CO
UN
T) +
1en
d_w
h!le
CO
MP
LEM
EN
TW
OR
D. C
ompl
emen
tsth
e va
lué
of th
e w
ord
oper
and
(rep
lace
sea
ch "1
* w
ith a
"0" a
nd e
ach
"0 w
ith a
T).
(DE
ST)
*-
NO
T (D
ES
T)
CO
MP
LEM
EN
T B
YTE
. Com
plem
ents
the
valu
é of
the
byte
ope
rand
(re
plac
es e
ach
"1" w
ith a
"0" a
nd e
ach
"O'w
ith a
T).
(DE
ST
)f-
NO
T (D
ES
T)
Inst
ruct
lon
Form
atD
EST,
SR
C1.
SR
C2
MU
LUB
wre
g, b
reg,
bao
p
(010
111a
a) (
baop
} (b
reg)
(w
reg)
NE
G
wre
g
(000
0001
1) (
wre
g)
NE
GB
br
eg
(000
1001
1) (
breg
)
NO
P
(111
1110
1) SR
C,
DE
ST
(000
01 11
1) (
breg
) (Ir
eg)
NO
T
wre
g
(000
000
10)
(wre
g)
NO
TB
breg
(000
1001
0) (
breg
)
A-"
4A
-15
mi
eX
Cig
eK
C/K
D.I
NS
TR
UC
fON
SE
T R
EF
ER
EN
CE
Ta
ble
A-2
. In
str
uctlo
n S
et
(Co
ntin
ua
d)
Mnem
onlc
OR
OR
B
PO
P
PO
PA
PO
PF
PU
SH
Op
era
tlo
n
LOG
ICA
L O
R W
OR
DS
. OR
s th
e s
ourc
e,'
wor
d op
eran
d w
ith th
e de
stin
allo
n w
ord
iop
eran
d an
d re
plac
es t
he o
rigin
al
^de
slin
atio
n op
eran
d w
ith th
e re
sult.
The
:
tesu
lt ha
s a
"1"
in e
ach
bit p
osilion
¡nw
hích
eith
er t
he s
ourc
e or
des
linat
ion
oper
and
had
a T
.
(DE
ST)
f-
(DE
ST
) O
R (S
RC
)
LOG
ICA
L O
RB
YT
ES
. OR
s th
e so
urce
:
byts
ope
rand
with
the
des
tinal
ion
byíe
:
oper
and a
nd re
plac
es Ih
e o
rigin
alde
stin
atio
n op
eran
d w
ith th
e re
sult.
The
,
resu
lt ha
s a
"1"
in é
ach
bit p
ositi
on in
whi
ch e
ither
the
sou
rce
or d
estin
alio
nop
eran
d ha
d a
"1".
(DÉ
ST
) <-
(D
ES
T)
OR
(SR
C)
PO
P W
OR
D. P
ops
the
wor
d on
top
of th
ust
ack
and
plac
es it
at
the
dest
inal
ion
';op
eran
d.
(DE
ST)
t-
(SP
) :
SP
í-S
P +
2
PO
P A
LL. T
his
inst
ruct
ion
is u
sed
inst
ead
oí P
OP
F, to
sup
port
the
eigh
tad
ditío
nal i
nler
rupt
s. I
t pop
s tw
o w
ords
off
Ihe
stac
k an
d pl
aces
the
first
wor
din
to Ih
e IN
T_M
AS
K1/
WS
R re
gist
er a
ndth
e se
cond
wor
d ¡n
to th
eP
SW
/INT_
MA
SK
reg
iste
r-pa
ir. T
his
inst
ruct
ion
Incr
emen
ts t
he S
P b
y 4.
Inle
rrup
l-cal
ls c
anno
t occ
ur im
med
iale
ly[o
llow
ing
this
¡ns
lruct
ion.
INT
MA
SK
1/W
SR f-
(SP
)S
P í- S
P +
2P
SW
/INT
MA
SK
<-
(SP
)S
Pí-
SP
+ 2
PO
P F
LAG
S. P
ops
Ihe
wor
d o
n lo
p o
fth
e st
ack
and
plac
es it
into
the
PS
W.
,In
terr
upt-c
alls
can
not
occu
r Im
rned
iate
lyfo
llow
ing
thls
¡ns
lruct
ion.
(PS
W)
<- (
SP
)S
Pí-
SP
+ 2
PU
SH
WO
RD
. Pus
hes
the
wor
d op
eran
don
to t
he s
lack
.
SP
í-S
P-2
(SP
) t-
(DE
ST)
Inst
ruct
lon
For
mal
DE
ST, S
RC
OR
w
reg,
wao
p
(100
000a
a) (
wao
p) (w
reg)
DE
ST,
SR
C
OR
B
breg
, bao
p
(100
100a
a) (
baop
) (b
reg)
PO
P
wao
p
(110
011a
a) (
wao
p)
PO
PA
(111
1010
1)
PO
PF
(111
1001
1)
PU
SH
w
aop
(110
010a
a) (
wao
p)
8X
C1
96
KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Wn
emo
nlc
ALL
A-1
5
Ta
ble
A-2
, In
str
uc
tlo
n S
et
(Co
ntl
nu
ed
)
Op
era
tlo
n
PU
SH
ALL
. Thi
s In
stru
ctlo
n Is
use
din
slea
d o
f P
US
HF
, to
supp
ort
Ihe
eígh
tad
ditlo
na)
inte
mip
ls.
It pu
shes
tw
o w
ords
onto
the
sta
ck—
PS
W/IN
T_M
AS
K a
ndth
e w
ord
form
ed b
y th
eIN
T_M
AS
K1/
WS
R r
egis
ter-
pa¡r
.
Thl
s In
stru
ctío
n c
fear
s th
e P
SW
,IN
TJM
SK
, an
d IN
T M
AS
K1
regi
ster
san
d de
crem
ents
the
>P
by
4. I
nter
rupt
-ca
lls c
anno
t oc
cur
Imm
edla
tely
fo
llow
ing
thls
Ins
truct
ion.
SP
f-S
P2
(SP
) *-
PS
W/J
NT
MA
SK
PS
W/IN
T_M
AS
K «
- O
SP t-
SP
2(S
P)
t~ I
NT
MA
SK
1AV
SR
INT M
AS
Kf t-
O
Ins
tru
ctl
on
Fe
PU
SH
A
(111
1010
0)
PU
SH
FLA
GS
. P
ushe
s th
e P
SW
ont
oth
e to
p of
the
slac
k, th
en s
eis
It to
zer
os.
Thl
s Im
plle
s th
at a
ll In
terr
upts
are
disa
bled
. In
lerr
upt-c
alls
can
not o
ccur
Imm
edía
lely
follo
win
g th
is In
stru
ctlo
n.
SP
<-S
P-2
(SP
)«-
PS
W/IN
T_M
AS
KP
SW
/INT
MA
SK
<- O
RE
TU
RN
FR
OM
SU
BR
OU
TIN
E.
Pop
sth
e P
C o
lí th
e to
p oí
the
stac
k.
PC t-
(S
P)
PU
SH
F
(111
1001
0)
RE
SE
T S
YS
TE
M.
Inltl
aliz
es th
e P
SW
toze
ro,
the
PC
to 2
080H
, and
the
SF
Rs
toth
elri
niti
al v
alúe
s. E
xecu
ting
this
inst
ruct
ion
caus
es t
he R
ES
ET
* pi
n to
be
pulle
d lo
w f
or 1
6 st
ate
times
.
SF
R R
eset
Sta
tus
Pin
Res
et S
tatu
sP
SW
<-0
PC
<-
2080
H
RE
T
(111
1000
0)
RS
T
(111
1111
1)
SH
OR
T C
ALL
. pus
hes
the
cont
entó
of
the
prog
ram
cou
nler
(th
e re
turn
add
ress
)on
to t
he s
tack
, th
en a
dds
to th
e pr
ogra
mco
unte
r th
e or
fset
bet
wee
n th
e en
d of
thls
inst
ruct
ion
and
the
targ
et la
be!.
The
orf
set
mus
t be
In th
e ra
nge o
f-1
02
4 to
+10
23,
Incl
usiv
e.
SP (-
SP
-2(S
P) t-
PC
PC
«-P
C +
dls
p(N
ole
1)
SC
ALL
ca
dd
(001
01xx
x)(d
lsp-
low
)
SE
T C
AR
RY
FLA
G. S
eis
Ihe
carr
y fla
g.
SE
TC
.
(111
1100
1)
A-1
7
inte
¡.8X
C19
6KC
/KD
INS
TRU
CTI
ON
SE
T R
EFE
RE
NC
E
Tab
le A
-2. I
nst
ruct
lon
Set
(C
ontln
ued)
Mne
mon
lc
SH
L
SH
LB
SH
LL
Ope
ratlo
nS
HIF
T W
OR
D L
EF
T. S
hlfts
the
desl
inat
ion
wor
d op
erán
d to
the
lefí
asm
any
times
as
spec
ified
by
the
coun
top
eran
d. T
he c
ount
may
be s
peci
fied
eith
er a
s an
imm
edla
te v
alué
in th
e ra
nee
of O
to 1
5 (O
FH),
incl
usiv
e, o
ras
the
cont
ení o
f any
regi
ster
with
a v
alué
In tr
3ra
nge
of O
to 3
1 (1
FH
), in
clus
ive.
The
right
bits
of t
he re
sult
are
fille
d w
ithze
roes
. The
las
t bit
shift
ed o
ut is
sav
ed !n
the
carr
y (la
g.
Tem
p <-
(C
OU
NT
)do
whl
le T
emp
# O
C *
- H
ígh
ord
er b
it of
(DE
ST
)(D
ES
T) t-
(DE
ST)
x 2
Tem
p <
-Tem
p-.
1en
d w
hile
SH
IFT
BV
TE L
EFT.
Shl
fts th
ede
stin
atio
n by
te o
pera
nd to
the
left
asm
any
times
as
spec
ified
by
the
coun
top
eran
d, T
he c
ount
may
be
spec
ified
eith
er a
s an
imm
edia
te v
alué
in th
e ra
npe
o[ O
lo 1
5 (O
FH),
incl
usiv
e, o
r as
the
cont
ení o
f an
y re
gist
er w
ith a
val
ué In
tr e
rang
e oí
O to
31
(1 F
H),
Incl
usiv
e. T
herig
ht b
its o
í th
e re
sult
are
fille
d w
ithze
roes
. The
last
bit
shift
ed o
ut is
sav
ed In
the
carry
fla
g.
Te
mp
«-
(CO
UN
T)
do w
hile
Te
mp
-^0
C t
-Hig
h o
rder
bit
oí (D
ES
T)
(DE
ST}
t-(
DE
ST
) x 2
Tem
p í-
Tem
p - 1
end
whi
le
SH
IFT
DO
UB
LE-W
OR
D L
EF
T. S
hlfts
t ie
dest
inat
ion
doub
le-w
ord
oper
and
to th
ele
ft as
man
y tim
es a
s sp
ecifi
ed b
y th
eco
unt o
pera
nd. T
he c
ount
may
be
spec
illed
eith
er a
s an
imm
edia
te v
alué
'nth
e ra
nge
of O
to 1
5 (O
FH),
Incl
usiv
e, o
ías
the
cont
ení
of a
nv r
egis
ter w
ith a
valu
é in
the
rang
e oí
O to
31
(1 F
H),
incl
usiv
e. T
he r
ight
bits
of t
he r
esul
t ar£
fille
d w
ith z
eroe
s. T
he la
st b
it sh
ifted
oí I
is s
aved
in th
e ca
rry
flag.
Tem
p <
-(C
OU
NT
)do
whi
le T
emp *
OC
«-
Hig
h or
der b
it of
(DE
ST)
(DE
ST)
f-
(DE
ST)
x 2
Tem
p í-
Te
mp
-1en
d w
hile
Inst
ruct
lon
Fo
rmal
SH
L w
reg,
#cou
nt
(000
0100
1) (co
unt)
(w
reg)
or SH
L w
reg,
breg
(000
0100
1) (
breg
) (w
reg)
SH
LB
breg
.tfco
unt
(000
1100
1) (
coun
t) (b
reg)
or SH
LB
breg
,bre
g
(000
1100
1) (
breg
) (b
reg)
SH
LL
lreg,
#cou
nt
(000
0110
1) (
coun
t) (
breg
)
or SH
LL
Ireg.
breg
(000
0110
1) (
breg
}(lre
g)
8XC
196K
C/K
D IN
STR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Tab
le A
-2. I
nst
ruct
ion
Sel
(C
on
llnu
ed)
Mn
emo
nlc
SH
R
SH
RA
A-I
8
Op
erat
lon
LOG
ICA
L R
IGH
T S
HIF
T W
OR
D.
Shl
ftsth
e de
stin
atio
n w
ord o
perá
nd to
the
righ
tas
man
y tim
es a
s sp
eciíi
ed b
y th
e co
unl
oper
ánd.
The
cou
nt m
ay b
e sp
ecifi
edei
ther
as
an im
med
iate
val
ué in
the
ran
geof
O to
15
(OFH
), in
clus
ive,
or
as t
heco
nten
! oí
any
regl
ster
with
a v
alué
¡n
the
rang
e of
O to
31
(1F
H), In
clus
ive.
The
lef
tbi
ts o
í the
res
ult
are
fille
d w
íth z
eroe
s.T
he la
st b
it sh
ifted
out
is s
aved
in th
eca
rry
(lag.
Thl
s In
stru
ctio
n cl
ears
the
stic
ky b
it (la
gat
the
beg
lnni
ng o
f th
e in
stru
ctio
n. If
at
any
time d
urin
g th
e s
hlft
a "1
" is
shi
fted
Into
the
car
ry f
lag
and
anot
her
shlft
cyc
leoc
curs
, th
e in
stru
ctlo
n s
ets
the
stic
ky b
itfla
g.
Tem
p <
-(C
OU
NT
)do
whi
le te
mp
loC
«-
Low
ord
er b
it of
(D
ES
T)
(DE
ST
)<-(
DE
ST
)/2
(No
te2
)Te
mp
«- T
emp -1
end
whl
le
AR
ITH
ME
TIC
RIG
HT S
HIF
T W
OR
D.
Shl
fts th
e d
estin
atio
n w
ord o
perá
nd to
the
right
as
man
y tim
es a
s sp
ecifi
ed b
y th
eco
unt
oper
ánd.
The
cou
nt m
ay b
esp
ecified
eith
er a
s an
Imm
edla
te v
alué
In
the
rang
e of
O to
15
(OFH
), In
clus
ive,
or
as th
e co
nten
í of a
ny re
glst
er w
lth a
valu
é In
the
rang
e o
to to
31
(1F
H),
Incl
usiv
e. If
the
orig
inal
hig
h o
rder
bit
valu
é w
as "
O,"
zero
es a
re s
hifte
d In
. If
the
valu
é w
as '1
," o
nes
are
shift
ed i
n. T
hela
st b
it sh
ifted
out
is s
aved
in th
e c
arry
flag.
Thl
s in
stru
ctio
n c
lear
s th
e s
ticky
bit
flag
at t
he b
egln
ning
of t
he in
stru
ctio
n. If
at
any
time
durin
g th
e sh
ift a
"1*
Is s
hifte
din
to th
e ca
rry
ffag
and
anot
her
shlft
cyc
leoc
curs
, the
inst
ruct
ion
set
s th
e st
icky
bit
flag.
Te
mp
«-
(CO
UN
T)
do w
hile
Tem
p *
oC
«-
Low
ord
er b
it of
(D
ES
T)
{DE
ST
}«-
(DE
ST1
/2 (
Not
e 3)
Tem
p <-
Tem
p- 1
end
whl
le
Inst
ruct
lon
Fo
rmal
SH
R
wre
g.tfc
ount
(000
0100
0) (
coun
t) (
wre
g)
or SH
R
wre
g.br
eo,
(000
0100
0) (b
reg)
(w
reg)
SH
RA
w
reg.
#cou
nt
(000
0101
0) (c
ount
) (w
reg}
or SH
RA
w
reg,
breg
(000
0101
0) (
breg
) (w
reg)
A-1
9
¡ni
8XC
196K
C/K
D I
NS
TRU
CTJ
ON
SE
T R
EF
ER
EN
CE
Tab
le A
-2.
Inst
ruct
lor,
Set
(C
on
tinu
ad
)
Mne
mon
lcS
HR
AB
SH
RA
L
Op
eral
lon
AR
ITH
ME
TIC
RIG
HT
SH
IFT
BY
TE
.S
hift
s Ih
e dest
inatio
n b
yte
oper
and
lo th
&rig
ht a
s m
any
times
as
spec
ified
by
the
coun
l ope
rand
. The
cou
nt m
ay b
esp
eci
lied
eith
er a
s an
Imm
edia
te v
alué
in[h
e ra
nga
of O
lo 1
5 (O
FH),
incl
usiv
e, o
ras
the
con
tení
oí
any
regi
sler
with
ava
lué
in th
e ra
nge
oí O
to 3
1 (1
FH
),in
clusi
ve.
If th
e o
rigin
al h
igh
ord
er b
ilva
lué
was
"O,
" ze
roes
are
shi
fted
in.
II th
iiva
lué
was
"1,
" on
es a
re s
hifl
ed
in. T
hela
st b
it sh
ifted
out
is
save
d in
the
car
ry
•lla
g.
.;
This
inst
ruct
ion
clear
s Ih
e st
icky
bit
llag
'•'•at
the
begi
nnin
g o[
the
Inst
ruct
ion.
If a
tan
y tim
e du
ring
thes
hifl
a T
is s
hifte
d ';
into
Ihe
carr
y (F
ag a
nd a
noth
er s
hifl
cyct
aoc
curs
, the
inst
ruct
ion
sets
the
stic
ky b
it.;fla
g.
Tem
p t-
(CO
UN
T)do
whi
le T
emp *
O
;,C
«Low
ord
er b
it of
(DES
T)
.¡(D
ES
T)
<- (
DE
ST
)/2
(Not
e 3)
Tem
p í-T
em
p- 1
end
whi
le
AR
ITH
ME
TIC
RIG
HT
SH
IFT
DO
UB
LE
-W
OR
D.
Shi
fts t
he d
estin
atio
n do
uble
- •
wor
d op
eran
d to
the
righ
t as
man
y tim
esas
spe
cifie
d by
the
cou
nt (
right
mos
t)op
eran
d. T
he c
ount
may
be
spe
cifie
dei
ther
as
an I
mm
edia
te v
alué
in t
he r
ang
3oí
O to
15
{OFH
), In
clus
ive,
or
as t
heco
nten
í of
any
reg
iste
r w
ith a
val
ué i
n th
jra
nge
o( O
to 3
1 (1
FH
), in
clus
ive.
If I
he
•or
igin
al h
igh
ord
er b
it va
lué
was
"O
,"ze
roes
are
shi
fted
in.
íf th
e va
lué
was
"1,
"on
es a
re s
hift
ed In
.
Thi
s In
stru
ctio
n cl
ears
the
stic
ky b
it fla
gat
the
beg
inni
ng o
f the
ins
truc
tion.
If a
lan
y tim
e du
ring
the
shift
a T
is
shi
ft&d
Into
the
car
ry f
lag
and
anot
her
shift
cyc
looc
curs
, th
e in
stru
ctio
n s
ets
the
stic
ky b
itfla
g.
Te
mp
«-
(CO
UN
T)
do w
hile
Tem
p *
0C f
- L
ow
ord
er b
it o
f (D
ES
T)
¿D
ES
T) *-
(D
ES
TV
2 (N
ote
3)Te
mp
t-T
em
p- i
end
while
'•
Inst
ruct
ion
Form
at
SHR
AB b
reg.
ffcou
nt
(000
1101
0) (c
ount
) (br
eg)
or SHR
AB
breg
.bre
g
(000
1101
0) (b
reg)
(bre
g)
SHRA
L Ire
g.ffc
ount
(000
0111
0) (
coun
t) (
Ireg)
or SH
RA
L Ire
g.br
eg
(000
0111
0) (b
reg)
(Ire
g)
A-ÍÍ
O
8XC
196K
C/K
D IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Table
A-2
. In
stru
ctio
n S
et (
Co
ntin
ue
d)
Mn
emo
nlc
SH
RB
SH
RL
SJM
P
Op
erat
lon
LOG
ICA
L R
IGH
T SH
IFT
BYT
E. S
hifts
the
dest
inat
ion b
yte
oper
and
to th
e rig
htas
man
y tim
es a
s sp
ecifi
ed b
y th
e co
unt
oper
and.
The
cou
nt m
ay b
e sp
ecifie
dei
ther
as
an im
med
iate
val
ué in
the
rang
eof
O to
15
(OFH
), In
clus
ive,
or a
s th
eco
nten
í of a
ny r
egis
ter w
ith a
val
ué in
the
rang
e of
O to
31
(1FH
), in
clus
ive.
The
left
bits
of t
he re
sutt
are
filia
d w
ith z
eroe
s.Th
e la
st b
it sh
ifted
out
is s
aved
In th
eca
rry fl
ag.
This
inst
ruct
ion
clea
rs th
e st
icky
bit
llag
at th
e be
ginn
ing
of th
e In
stru
ctio
n. If
at
any
time
durin
g th
e sh
ift a
T
Is sh
itted
into
the
carr
y tfa
g an
d an
othe
r shi
ft cy
cle
occu
rs, t
he ín
stru
ctlo
n se
ts th
e st
icky
bit
flag.
Tem
p«-
(CO
UN
T)do
whi
le T
emp *
OC
t- L
ow o
rder
bit
of (D
EST)
(DE
ST)
í-(D
ES
T)/2
(Nol
e2)
Tem
p f-
Tem
p—1
end
whi
le
LOG
ICA
L R
IGH
T SH
IFT
DO
UB
LE-
WO
RD
. Shi
fts th
e de
stin
atio
n do
uble
-w
ord
oper
and
to th
e rig
ht a
s m
any
times
as s
pecif
ied b
y th
e co
unt o
pera
na. T
heco
unt m
ay b
e sp
ecifi
ed e
ither
as
anim
med
iate
val
ué In
the
rang
e oí
O to
15
(OFH
), in
clus
ive,
or a
s th
e co
nten
í of a
nyre
gist
er w
ith a
val
ué In
the
rang
e of
O to
31 (
1FH
), In
clus
ive.
The
left
bits
oí t
here
sult
are
fllle
d w
ith z
eroe
s. T
he l
ast b
itsh
ifted
out
is s
aved
in th
e ca
rry fl
ag.
This
inst
ruct
ion
clea
rs th
e st
icky
bit
flag
at th
e be
ginn
ing
of th
e In
stru
ctio
n. If
at
any
time
durin
g th
e sh
ift a
"1"
is s
hifte
din
to th
e ca
rry fl
ag a
nd a
noth
er s
hift
cycl
eoc
curs
, th
e ín
stru
ctío
n se
ts th
e st
icky
bit
Tem
p *-
(CO
UN
T)do
whi
le T
emp *
OC f
- L
ow
ord
er b
it o
f (D
ES
T)
(DE
ST
) f-
(D
ES
T)/
2 (N
ote
2)
Tem
p «
- T
emp -1
end
whi
le
SH
OR
T J
UM
P. A
dds
to th
e pr
ogra
mco
unte
r th
e of
fset
bet
wee
n t
he e
nd o
í th
isIn
stru
ctio
n an
d t
he t
arge
t la
bel,
efíe
ctin
gth
e Ju
mp.
The
off
set
mus
t be
In th
e ra
nge
of-
10
24
to+
l02
3,
Incl
usiv
e.
PC
f-P
C +
dis
p(N
otel
)
Inst
ruct
ion
Fo
rmat
SHRB
br
eg.tf
coun
t
(000
1100
0) (c
ount
) (b
reg)
or SHRB
br
eg.b
reg
(000
1100
0) (b
reg)
(bre
g)
SHR
L Ire
g.ffc
ount
(000
0110
0) (c
ount
) (Ir
eg}
or SHR
L Ire
g.br
eg
(000
01 IC
O) (b
reg)
(Ire
g)
SJM
P
cadd
(OOI
OOxx
x) (d
isp-
low
)
A-2
1
II8X
C19
6KC
|,|D
WS
TB
UJm
ON
SE
T R
íJÉ
RE
NC
E.
_l
'
'
Tab
le A
-2. I
nstr
üctl.
bn S
et (
Co
ntl
nu
ed)
ST
B
SU
B(3
ope
rand
s)
SU
BB
(2 o
pera
nds)
SU
BB
{3 o
pera
nds)
Op
erat
lon
.T
WO
BY
TE
NO
-OP
ER
AT
ION
. D
oes
'''no
thln
g. C
ontr
ol p
asse
s lo
Ihe
next
sequ
enlia
l ins
truc
tlon.
Thí
s ís
act
ually
atw
b-by
te N
OP
in w
hlch
the
seco
nd b
yfa
can
be a
ny v
alué
and
Is
sim
ply
¡gno
refJ
.
ST
OR
E W
OR
D. S
tore
s th
e va
lué
oí Ih
aso
urce
fle
ftm
osl
) w
ord
oper
and
into
Ihe
dest
lnat
ron
(rlg
htm
ost
) op
eran
d.
(DES
T) t-
(SR
C)
i;
ST
OR
E B
YT
E. S
tore
s th
e va
lué
of trieí"
sour
ce (
left
mo
st)
byte
ope
rand
¡nlo
Ihij
dest
inat
ion
(rlg
htm
ost
) op
eran
d.
(DE
ST
] (-
(SR
C)
SU
BT
RA
CT
WO
RD
S. S
ublra
cts
Ihe
sour
ce w
ord
ope
rand
from
the
desl
ínat
ion
wor
d op
eran
d, s
lore
s th
e '
resu
lt In
the
desl
ínat
íon
oper
and,
and
seis
the
car
ry f
lag
as th
e co
mpl
emen
t (f
borr
ovv.
(DE
ST)
<-[
DE
5T
)-(S
RC
)
SU
BT
RA
CT
WO
RD
S. S
ubtr
acts
(he
flrí'
,1so
urce
wor
d op
eran
d fr
om t
he s
econ
d, á
stor
es t
he r
esul
t ín
the
dest
inat
íon
oper
and,
and
set
s th
e ca
rry
flag
as t
heco
mpl
emen
t of
bor
row
.
'(D
ES
T)t
-(S
RC
l)-[
SR
C2
)
SU
BT
RA
CT
BY
TE
S. S
ubtr
acts
the
sour
ce b
yte
oper
and
írom
the
des
tinat
ioa
byte
ope
rand
, st
ores
the
res
ult
in t
he
•de
stín
atío
n op
eran
d, a
nd
set
s th
e c
arry :
flag
as th
e co
mpl
emen
t of
bor
row
.
-(D
ES
T)-
(SR
C)
SU
BT
RA
CT
BY
TE
S.
Sub
trac
ts th
e fír
stso
urce
byt
e op
eran
d fr
om t
he s
econ
d,st
ores
the
res
ull
In th
e de
stin
atio
nop
eran
d, a
nd s
ets
the
carr
y fla
g as
the
com
plem
ent
oí b
orro
w.
Inst
ruct
íon
Fo
rmat
inte
!.8X
C19
6KC
/tfE
ÍNS
TR
UC
TIO
N S
ET
RE
FE
RE
NC
E
SK
IP
breg
(000
0000
0) (
breg
)
SR
C,
DE
ST
ST
w
reg,
wao
p
(HO
OO
Oaa
) (w
aop)
(wre
g)
SR
C,
DE
ST
ST
B
breg
, ba
op
(110
001
aa
)(b
ao
p)
(bre
g)
DE
ST
, S
RC
SU
B
wre
g, w
aop
(01
lOIO
aa)
(wao
p) (w
reg)
DE
ST
.SR
C1
.SR
C2
SU
B
Dw
reg,
Sw
reg,
wao
p
(010
010a
a) (
wao
p) (
Sw
reg)
(D
wre
g)
DE
ST
, S
RC
SU
BB
br
eg,
baop
(010
110a
a) (
baop
) (b
reg)
SU
BC
(OE
ST
)f-(
SR
C1
)-(S
RC
2)
SU
BT
RA
CT
WO
RD
S W
ITH
BO
RR
OW
.S
ubtr
acts
the
sou
rce
wo
rd o
pera
nd fr
orrv
the
dest
lnat
lon
wo
rd o
pera
nd.
II th
e ca
rr*
flag
was
cle
ar,
SU
BC
sub
trac
ts 1
írom
the
resu
lt. It
sto
res
the
resu
lt In
the
dest
lnat
ton
oper
and
and
sets
the
carr
yfla
g as
the
com
plem
ent
oí b
orro
w.
¡
(DE
ST
) <-
(D
ES
T) -
(S
RC
) - (
1-C
)
DE
ST
,SR
C1
,SR
C2
SU
BB
D
breg
, S
breg
, ba
op
(010
110a
a) (
baop
) (S
fare
g) (
Dbr
eg)
DE
ST
, S
RC
SU
BC
w
reg,
wao
p
(101
010a
a) (
wao
p) (
wre
g)
A-2
Í
Tab
le A
-2. I
nst
ruct
lon
Set
(Co
ntl
nu
ed)
Mnem
onlc
SU
BC
B
TIJ
MP
TR
AP
XC
H
XC
HB
Op
era
tlon
SU
BT
RA
CT
BY
TE
S W
ITH
BO
RR
OW
.S
ubtr
acts
the
sou
rce
byte
ope
rand
fro
mth
e de
stin
atio
n bv
te o
pera
nd.
If th
e ca
rry
flag
was
cle
ar,
SU
BC
B s
ubtr
acts
1 fr
om
the
resu
lt. I
t sto
res
the
resu
lt In
the
dest
inat
ion
oper
and
and
sets
the
car
ryfla
g as
the
com
plem
ent
oí b
orro
w.
(DE
ST)
«- (D
ES
T) -
(SR
C)
- (1
-C)
TA
BLE
IND
IRE
CT
JU
MP
. Cau
ses
exec
utío
n to
con
tinué
at a
n ad
dres
sse
lect
ed
from
a ta
ble
of a
ddre
sses
.T
he f
irst
wor
d re
glst
er,
TB
AS
E,
cont
ains
the 1
6-b
it ad
dres
s o
f the b
egin
nlng
of t
he
tabl
e. T
he s
econ
d w
ord
regi
ster
, IN
DE
X,
cont
ains
the 1
6-b
it ad
dres
s o
f a b
yte
that
cont
ains
the
Inde
x In
to (
he t
able
. T
heIN
DE
X v
alué
mus
í be
bet
wee
n 0
and
128.
The
#by
íe o
pera
nd,
IND
EX
M
AS
K,
ís 8
-blt
Imm
edla
te d
ata to
mas
k ÍN
DE
X.
IND
EX
M
AS
K Is
AN
De
dw
ith
IND
EX
to
dete
rmin
e the
offs
et (
OFFS
ET). O
FFS
ET
Is m
ultip
lled
by
two,
the
n ad
ded
to th
eba
se a
ddre
ss (TB
AS
E)
to d
eter
min
e th
ede
stln
atlo
n ad
dres
s (D
ES
T X
).
[IND
EX
] A
ND
IND
EX
M
AS
K -
OFF
SE
T(2
x O
FFS
ET) +
TBÁ
~SE -
DE
ST
X
PC
<-
{DE
ST
X)
SO
FT
WA
RE
TR
AP
. Thi
s ¡n
stru
ctio
nca
uses
an
Inte
rrup
t-ca
ll th
at I
s ve
cto
red
thro
ugh
loca
tion
201
OH
. The
ope
ratio
n of
this
Inst
ruct
ion
is n
ot a
fiect
ed b
y th
e st
ate
of t
he ¡
nter
rupt
ena
ble
flag
In th
e P
SW
(I).
Inte
rrup
t -ca
lis c
anno
t occ
ur im
med
late
lyfo
llow
ing
this
íns
truc
tion.
SP
<-
SP
-2(S
P)
4- P
C
PC
(-(
20
1 O
H)
EX
CH
AN
GE
WO
RD
. E
xcha
nges
the
valu
é o
f th
e s
ourc
e w
ord
ope
rand
w¡th
that
oí
the
dest
inat
ion
wor
d op
eran
d.
(DE
ST
) <-
(SR
C)
EX
CH
AN
GE
BY
TE
. E
xcha
nges
the
valu
é o
f the
sou
rce
byt
e o
pera
nd w
ithth
at o
f the
des
tinat
ion b
yle o
pera
nd.
(DE
ST
) *-
(S
RC
)
Inst
ruct
ion
For
mat
DE
ST
, S
RC
SU
BC
B b
reg,
bao
p
(101110aa}(baop)(bre
g)
TB
AS
E, IN
DE
X, IN
DE
X..M
AS
K
TIJ
MP
w
reg,
[wre
g],
#by
te
(111
0001
0) (
wre
g) (
tfbyt
e) [w
reg]
TR
AP
(111
1011
1)
NO
TE
: T
his
Ínst
ruct
ion
Ís n
ot s
uppo
rted
by
revi
sión
1.2
of t
he 8
096
ass
embí
y la
ngua
ge.
The
TR
AP
Íns
truc
tion
Is in
tend
ecf
for
use
byIn
tel-p
rovi
ded
tools
. The
se to
ols
will
not
supp
ort
user
-app
licat
íon
of t
his
Inst
ruct
lon.
DE
ST
, S
RC
XC
H
wre
g, w
aop
(000
0010
0) íw
aop)
(w
reg)
(000
0101
1) (
wao
p) (w
reg)
DE
ST
, S
RC
XC
HB
br
eg.
baop
(000
1010
0) (
baop
) (b
reg)
0001
101
1) (
baop
) (b
reg)
1A
-23
m8
XC
19
6K
áíb
IN
STR
uVri
ON
SE
T R
Tabl
e A
-2. I
nstru
ctto
n S
et (C
ontln
ued)
Mne
mon
lcXO
R
XO
RB
Ope
ratio
nLO
GIC
AL
EX
CLU
SIV
E-O
R W
OR
DS
.X
OR
s th
e so
urce
wor
d op
eran
d w
ith f
tede
stin
alio
n w
ord
oper
and
and
stor
es Ih
ere
sult
in Ih
e d
eslín
alio
n o
pera
nd. T
he;
resu
jt ha
s on
es in
the
bit
posi
tions
in '
whi
ch e
ither
ope
rand
(bu
l not
bot
h) h
£ d
a"1
" an
d ze
ros
in a
ll ot
her
bit po
sitio
ns,
(DE
ST)
«-
(DE
ST)
XO
R (
SR
C)
LOG
ICA
L E
XC
LUS
IVE
-OR
BY
TES
.X
OR
s th
e so
urce
byí
e op
eran
d w
ith th
ede
stin
atio
n by
te o
pera
nd a
nd s
tore
s tt
ere
sult
in th
e d
estin
alio
n o
pera
nd.
The
resu
lt ha
s on
es in
the
bit
posi
tions
inw
hich
eith
er o
pera
nd (b
ul n
ol b
oth)
hed
aT
and
zer
os In
all
othe
r bi
t pos
ition
s. .
(DE
ST)
«-
(DE
ST)
XO
R (
SR
C)
Inst
ruct
lon
For
mat
DE
ST
, SR
C
XO
R
wre
g, w
aop
(1 0
0001
aa)
(w
aop)
(wre
g)
DE
ST
, SR
C
XO
RB
br
eg, b
aop
(100
101a
a)(b
aop)
(bre
g)
NO
TE
S;
1.
The
dísp
lace
men
t (d
isp)
is s
ign-
exte
nded
to 1
6 bi
t;*2.
In
this
ope
ratío
n, D
ES
T/2
repr
esen
ts u
nsig
ned d
ivíiion.
3.
In th
is o
pera
líon,
DE
ST
/2 r
epre
sent
a si
gned
div
isió
n. A-2
4
8XC
196K
C/K
D1N
STR
UC
TIO
N S
ET
RE
FER
EN
CE
Tab
les
A-3
and
A-4
def
ine
the
abbr
evia
tion
s an
d sy
mbo
ls u
sed
in T
able
s A
-5 a
nd A
-6.
Tab
le A
-5 s
how
s th
e ef
fect
of
each
ins
truc
tion
on
the
Prog
ram
Sta
tus
Wor
d fl
ags,
and
Tab
leA
-6 s
how
s th
e ef
fect
of
the
PSW
fl
ags
or a
spe
cifi
ed
regi
ster
bit
on c
ondi
tion
al j
ump
inst
ruct
ions
. (F
or a
ddit
iona
l Inf
orm
atio
n ab
out
the
PSW
fla
gs,
refe
r to
the
Pro
gram
Sta
tus
Wor
d de
scri
ptio
n in
App
endi
x C
.)
Tabl
e A
-3. P
SW
Fla
g A
bbre
viat
ions
Abb
revf
atlo
nC N ST V VT Z
PS
W F
lag
Ñam
eC
arry
Fla
g
Neg
ativ
o Fla
g
Stlc
ky B
it Fla
g
Ove
rflo
w F
lag
Ove
rflo
w-T
rap
Fla
g
Zer
o Fl
ag
Tabl
e A
-4. P
SW
Fla
g S
ettin
g S
ymbo
ls
Sym
bol
V — 4- T 1 0 ?
Desc
riptio
nth
e In
stru
ctio
n se
ts o
r cl
ears
the
ílag,
as
appr
opria
te.
The
ins
truc
tion
does
not
mod
ify t
he (
lag.
The
inst
ruct
ion
may
cle
ar t
he (
lag,
¡f It
is a
ppro
pria
te,
bul c
anno
t se
t it.
The
ínst
ruct
ion m
ay s
et th
e (l
ag,
¡í it
is a
ppro
pria
te, b
ul c
anno
t cl
ear
it.
The
ínst
ruct
ion
sets
the
ílag
.
The
Ins
trud
lon
cle
ars
the
flag.
The
Insl
ruct
ion
leav
es th
e fla
g ¡n
an
inde
term
inat
e st
ate.
A-2
5
8X
C196K
ÍÉ&
D IN
STR
I/CTIO
N S
ET
R^E
RE
NC
E
Table
A-5
. E
ffe
cts
of
Instr
uqtlons o
n P
SW
Fla
g S
ett
ing
s
Mnem
onlc
AD
D.A
DD
B
AD
DC
, AD
DC
B
AN
D.A
ND
B
BM
OV
. BM
OV
I
BR (
Indl
rect
)
CLR
, CLR
B
CLR
C
CLR
VT
CM
P.C
MP
B
CM
PL
DE
C,
DE
CB
DI
DIV
, D
IVB
,D
IVU
, DIV
UB
DJN
Z,
DJN
ZW
DP
TSEl
~~
!
EP
TS
EX
T. E
XTB
IDLP
DLe
gal K
eyIlle
gal K
ey
INC
INC
B
JBC
, JB
S, J
C, J
E,
JGE
, JG
T, J
H.
JLE
, JL
T. JN
C,
JNE
, JN
H,
JNS
T
JNV
JNV
T
JST.
JV
JVT
PS
W F
lag
Se
ttin
gs
Z V i V — — 1 — — V V V — — — — — — V 0 V V — — — —
N V V V — — 0 — — V V V — — — — — — V 0 V V „ — — —
C V V 0 — — 0 0 — V V V — — — — — — 0 0 V V — — — —
V V V 0 — — 0 — — V V V — V — — — — 0 0 V V — — — —
VT T T — — — — — 0 T V T — T — _ — — — 0 T T — 0 — 0
ST — — — — — — — — — — — __ — — _.
— — — 0 0 — — — — —
Mnem
onlc
LCA
LL,
LD, L
DB
,LD
BS
E,
LDB
ZE
UM
P
MU
L, M
UL8
,M
ULU
. M
ULU
B
NE
G.
NE
GB
NO
P
NO
RM
L
NO
T, N
OT
B
OR
, O
RB
PO
P
PO
PA
, P
OP
F
PU
SH
PU
SH
A, P
US
HF
RE
T
RS
T
SC
ALL
SE
TC
SH
L, S
HLB
. SH
LL
SH
R
SH
RA
, S
HR
AB
,S
HR
AL
SH
RB
, S
HR
L
SJM
P
SK
IP
ST
, ST
B
SU
B, S
UB
B
SU
BC
, SU
BC
B
TU
MP
TR
AP
XC
H, X
CH
B
XO
R, X
OR
B
PS
W F
lag S
ott
lng
s
Z — — — V — V V V — V — 0 — 0 — — V V V V — — — V i _ — — V
N — — — V — ? V V — V — 0 _ 0 — — ? 0 V 0 — — — V V — — — V
C — • — — V _ 0 0 0 — V — 0 — 0 — 1 V V V V — — — V V — — — 0
V — — — V — — 0 0 — V — 0 — 0 — — V 0 0 0 _ — — V V — — — 0
VT — — — T — — — — — V — 0 — 0 — — T — — — — — — T T — — — —
ST • — ? ? — — — — — — V — 0 — 0 — — — V V V — — — — — — — — —
¡niel.
8X
C196K
C/K
D IN
STR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Ta
ble
A-6
. E
ffe
ct
of
PS
W F
lag
s o
r S
pe
clfle
d B
its o
n C
ondltlo
nal J
um
p Inatr
uctlons
Inst
ruct
lon
DJN
Z
DJN
ZW
JBC
JBS
JNC
JNH
JC JH JGE
JGT
JLT
JLE
JNS
T
JST
JNV
JV JNV
T
JVT
JNE
JE
Jum
p s t
o D
estln
atlo
n if
decr
emen
ted
byle *
0
decr
emen
ted
wor
d * 0
spedlie
d r
egis
ter
bit =
0
spec
lfied
reg
isle
rbK
- 1
C-0
C-O
OR
Z-1
C-1
C -
1 A
ND
Z -
0
N-0
N-O
AN
DZ
-.O
N-1
N -
1 O
R Z
- 1
ST
-0
ST
-1
V-0
V-1
VT
-0
VT -
1 (d
ears
VT
)
Z-0
Z-1
Co
ntin
úe
s I
f
decr
emen
ted
byte
=• 0
decr
emen
ted
wor
d =
0
spec
ified
reg
iste
r bit
« 1
spec
ifíed
reg
iste
r bit
=• 0
C-1
C =
1 A
ND
Z =
0
C-0
C-O
OR
Z-1
N-
1
N -
1 O
R Z
- 1
N-0
N -
0 A
ND
2*0
ST
»1
ST
*0
V«
l
V-0
VT -
1 (c
lear
s V
T)
VT
-0
Z-1
z-o
A-2
7
¡nig
l,>
• 4t
iR
D IN
STR
UC
TIO
N S
ET
RE
FER
EN
CE
Tab
le A
-7 l
ists
the
¡ns
truc
tíon
opc
odes
, ¡n
heí.
adec
imal
ord
er,
alon
g w
ith
the
conr
espo
ndin
gin
stru
ctio
n m
nem
onic
s. Tabl
e A
-7.
8XC
196K
C/K
D I
nst
ruct
ion
Opc
odes
Hex
Cod
e00 01
02
03
04 05
. 06 07 08 09 OA
OB oc OD
OE
OF
10 11 12 13 14 15 16 17 18 19 1A IB 1C-1
F
20-2
7
Inst
ruct
ion
Mne
mon
lcS
KIP
CLR
NO
T
NE
G
XC
H
DEC
EX
T
INC
SH
R
SH
L
SH
RA
XC
H
SH
RL
SH
LL
SH
RA
L
NO
RM
L
Res
erve
d
CLR
B
NO
TB
NE
GB
XC
HB
DE
CB
EX
TB
INC
B
SH
RB
SH
LB
SH
RA
B
XC
HB
Res
erve
d
3JM
P
Hex
Cod
e28
-2F
30-3
7
38-3
F
40 41
42 43 44 45 46 47 48 49 4A 48
4C 4D
4E
4F 50 51 52 53 54 55 56 .57 58 59 5A
Inst
ruct
ion
Mne
mon
lcS
CA
LL
JBC
JBS
AN
D D
irect
(3
ops)
AN
D Im
med
iate
(3 o
ps)
AN
D I
ndíre
ct (
3 ops)
AN
D I
ndex
ed (
3 o
ps)
AD
D D
írect
(3 o
ps)
AD
D I
mm
edla
te (
3 ops)
AD
D I
ndlre
ct (
3 o
ps)
AD
D In
dexe
d (
3 o
ps)
SU
B D
irect
(3
ops}
SU
B I
mm
edia
te (3
ops
)
SU
B In
dlre
cl (3
ops
)
SU
B Ind
exed
{3
ops}
MU
LU D
irect
(3 o
ps)
MU
LU Im
med
late
(3 o
ps)
MU
LU In
dire
ct (
3 o
ps)
MU
LU I
ndex
ed (
3 o
ps)
AN
DB
Dire
ct (3
ops
}
AN
DB
Im
med
iate
(3 o
ps)
AN
DB
Ind
irect
(3
ops}
AN
DB
Inde
xed
(3 o
ps)
AD
DB
Dire
ct (3 o
ps)
AD
DB
Im
med
iate
(3
ops)
AD
DB
Indi
rect
(3 o
ps}
AD
DB
Ind
exed
(3 o
ps)
SU
BB
Dire
ct (3
ops)
SU
BB
Imm
edia
te (3 o
ps)
SU
BB
Ind
lrect
(3
ops)
A-2
J
8XC
196K
C/K
D IN
STR
UC
TIO
N S
ET
RE
FER
EN
CE
Tabl
e A
-7.
8XC
196K
C/K
D In
stru
ctio
n O
pcod
es (
Con
tlnue
d)
Hex
Cod
e5B 5C 5D 5E 5F 60
61
62
63 64 65 66 67 68
69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
Inst
ruct
lon
Mne
mon
lcS
UB
B I
ndex
ed {
3 op
s)
MU
LUB
Dire
ct (
3 op
s}
MU
LUB
Im
med
late
(3
ops}
MU
LUB
Ind
irect
(3
ops}
MU
LUB
Ind
exed
(3
ops)
AN
D D
irect
(2
ops}
AN
D I
mm
edla
te {
2 ops)
AN
D I
ndíre
ct (
2 op
s)
AN
D I
ndex
ed (
2 ops)
AD
D D
irect
(2
ops)
AD
D I
mm
edia
te (
2 op
s}
AD
D I
ndire
ct (
2 ops)
AD
D I
ndex
ed (
2 op
s)
SU
B D
irect
(2
ops)
SU
B I
mm
edia
te (
2 op
s)
SU
B I
ndire
ct (
2 o
ps)
SU
B I
ndex
ed (
2 ops)
MU
LU D
irect
(2
ops)
MU
LU I
mm
edla
te (
2 o
ps}
MU
LU Ind
irect
(2
ops)
MU
LU I
ndex
ed (
2 o
ps)
AN
DB
Dire
ct {2 o
ps)
AN
DB
Im
med
iate
(2
ops)
AN
DB
Ind
lrect
(2 o
ps)
AN
DB
Ind
exed
(2
ops)
AD
DB
Dire
ct (
2 ops)
AD
DB
Imm
edia
te (
2 o
ps)
AD
DB
Ind
irect
(2
ops)
AD
DB
Ind
exed
(2
ops)
SU
BB
Dire
ct (
2 ops)
SU
BB
Im
med
iate
(2
ops)
SU
BB
Indi
rect
(2 o
ps)
SU
BB
Ind
exed
(2
ops)
Hex
Cod
e7C 7D 7E 7F 80 81 82 83 84 85 86
87 88 89 8A 8B 8C 8D BE
8F 90 91 92 93 94 95
96
97
98 99 9A 9B 9C
Inst
ruct
ion
Mne
mon
lcM
ULU
B D
lrect
(2 o
ps)
MU
LÜB
Im
med
iate
(2
ops)
MU
LUB
Ind
lrecl
(2
ops
)
MU
LUB
Ind
exed
(2
ops)
OR
Dire
ct
OR
Im
med
iale
OR
Ind
írect
OR
Ind
exed
XO
R D
lrecl
XO
R I
mm
edia
te
XO
R I
ndíre
ct
XO
R I
ndex
ed
CM
P D
irect
CM
P í
mm
edla
te
CM
P In
dlre
ct
CM
P I
ndex
ed
DIV
U D
irect
DIV
U I
mm
edla
te
DIV
U Ind
irecí
DIV
U In
dexe
d
OR
B D
irect
OR
B I
mm
edia
te
OR
B I
ndire
ct
OR
B In
dexe
d
XO
RB
Dire
ct
XO
RB
Im
med
iale
XO
RB
Indí
rect
XO
RB
.Ind
exed
CM
PB
Dlre
cl
CM
PB
Imm
edia
te
CM
PB
Ind
irect
CM
PB
Ind
exed
DIV
UB
Dire
cí
A-2
9
8XC
196K
C/Í^
'ÍNS
TR
UC
"IO
NS
ET
RE
Fff
iEN
CE
Tabl
e A
-7. 8
XC
196K
C/K
D I
nstn
'ctl
on O
pco
des
(Con
tinu
ad)
Hex
Cod
e90
9E 9F AO A1
A2
A3
A4
A5
Á6
A7
A8
A9
AA
AB
AC
AD
AE
AF
BO B1 82 B3
B4 B5 86 B7
BQ B9 BA
8B BC
BD
Inst
ruct
lon
Mne
mon
lcD
IVU
B I
mm
edia
te
DIV
UB
Ind
irect
DIV
UB
Ind
exed
LO O
frec
í
l_D
Imm
edia
te
LD In
dire
ct
LD In
dexe
d
AD
DC
Dire
ct
AD
DC
Im
med
iate
AD
DC
Ind
irect
AD
DC
Ind
exed
SU
BC
Dire
cí
SU
BC
Im
med
iale
SU
BC
Ind
írect
SU
BC
Ind
exed
LDB
ZE
Dire
ct
LDB
ZE
Imm
edla
te
LDB
ZE
Indi
recl
LDB
ZE
Inde
xed
LDB
Dire
ct
LDB
Im
med
iate
LDB
Ind
irect
LDB
Inde
xed
AD
DC
B D
irect
AD
DC
B Im
med
iate
AD
DC
B I
ndire
ct
AD
DC
B I
ndex
ed
SU
BC
B O
frecí
SU
BC
B Im
med
iale
SU
BC
B I
ndire
ct
SU
BC
B In
dexe
d
LDB
SE
Dire
ct
LDB
SE
Im
med
iate
Hex
Cod
eB
E
BF
CO
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
DO
01
02
03
04
D5
06
07
08
09
DA
DB
DC
DO
DE
Inst
ruct
lon
Mne
mon
lcLD
BS
E I
ndire
ct
LDB
SE
Ind
exed
ST
Dire
ct
BM
OV
ST
Indi
rect
ST
Inde
xed
ST
B D
irect
CM
PL
STB
Ind
irect
ST
B In
dexe
d
PU
SH
Dire
ct
PU
SH
Im
med
i'ale
PU
SH
Ind
irect
PU
SH
Ind
exed
PO
P D
irect
BM
OV
I
PO
P I
ndlre
ct
PO
P I
ndex
ed
JNS
T
JNH
JGT
JNC
JNV
T
JNV
JGE
JNE
JST
JH JLE
JC JVT
JV JLT
A-3
0.
8X
C1
96
KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tab
le A
-7.
8X
C1
96
KC
/KD
In
str
uc
tlo
n O
pc
od
es
(C
on
tln
ue
d)
Hex
Cod
eD
F
EO E1 E2 E3 E4-
E6
E7 EB
-EB
EC ED EE EF FO F1
Inst
ruct
lon
Mne
mon
lc
JE DJN
Z
DJN
ZW
TIJ
MP
BR
(In
dire
ct)
Res
erve
d
LJM
P
Res
erve
d
DP
TS
EP
TS
Res
erve
d '
LCA
LL
RE
T
Res
erve
d
' O
pcod
e E
E ¡s
rese
rved
; how
ever
, It
does
no
tge
néra
te a
n u
nlm
plem
ente
d o
pcod
e In
terr
upt.
Hex
Cod
e
F2 F3 F4 F5 FG F7 F8 F9 FA FB FC FD FE
FF
Inst
ruct
lon
Mne
mon
lc
PU
SH
F
PO
PF
PU
SH
A
PO
PA
IDLP
D
TR
AP
CLR
C
SE
TC
DI
El
CLR
VT
NO
P
*D|V
/DlV
B/M
UU
MU
LB
RS
T
* S
igne
d m
ultlplic
atio
n a
nd d
ivis
ión
are
two-
byte
Ins
truc
tions
. F
or e
ach
sign
ed in
stru
ctío
n,th
e fir
st b
vte
¡s "
FE"
and
the
seco
nd Is
the
opco
de o
í the
cor
resp
ondl
ng u
nsig
ned
Insl
rudio
n.
For
exam
ple
, the
opc
ode
for
MU
LU (
3 op
eran
ds)
díre
ct Is
"4C
," s
o th
eop
code
for
MU
L (
3 op
eran
ds) d
lrect
Is
"FE
4C."
Tab
le A
-8
¡s a
map
of
the 8
XC
196K
C/K
D o
pco
des
. T
he
fir
st
díg
il o
f th
e o
pco
de
is u
sted
ve
rtic
all
y,
an
d th
e s
eco
nd
díg
it
is u
ste
d h
ori
zon
tall
y.
Th
e re
late
d
instn
iclio
n m
nem
on
ic i
s
sho
wn
at
the
inte
rsec
tio
n o
f th
e tw
o d
igit
s.
Sh
ad
ing
in
díc
ale
s re
serv
ed o
pco
des
.
A-3
1
Áx
^8X
C196K
CM
D I
NS
TR
UC
TIO
N S
ET
RE
TE
RE
NC
E
Table
A-8
, 8
XC
19
6K
C/K
I) O
pc
od
e M
ap
(L
eft
Ha
lf)
bil3
|
bit 4
|
bit
s I
bit 6
AN
D 3
op
Im
I ln
AN
DB
3op
im
I ¡n
AD
DB
3op
lm
I Jn
AD
D 2
op
lm AD
DB
2op
Dx
JNS
T
JNH
JG
T
PO
PF
| P
US
HA |
P
OP
A
| ID
LPD
Sha
ding
indí
cale
s re
serv
ed o
pcod
es.
A-3
¡
8X
C1
96
KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tab
le A
-8.
8X
C1
96
KC
/KD
Op
co
de M
ap (
Rlg
hl
Ha
lf)
Op
-.c
od
e
Ox 1x 2x 3x 4x 5x 6x 7x 8x 9x Ax
Bx
Cx
Dx
Ex Fx
x8 SH
R
SH
RB
x9 SH
L
SH
LB
xA
SH
RA
SH
RA
B
xB XC
H
Ix
XC
HB
Ix
xC
SH
RL \D
SH
LL
\E
SH
flAL
, :-
xF
NO
RM
L
,
>s
SC
ALL
bitO di di di di di di di di di JST
- ^
* i
-. *
CL
RC
blt
l SU
E
im SU
B
im
SU
B
im SU
B
fm
aim
cwim
SU
lm
SUE
Im
PU
¡m JH
•í
,_-.
SE
TC
bit 2
3op ln
33
op In
2op In
32
op ,„
¿P
in
PB
in
BC
In
3CB
¡n
SH
In JLE
> * %
""
DI
JE
bit
3
ix ix Ix ix ix ix Ix ix Ix JC
í°
"
i
El
3S
bit
4
di di di di di di di d¡
PO
P
di JVT
DP
TS
.CL
RV
T
bit
s
MU
LL
Im MU
LU
im MU
LU
im MU
LU
lm
DIV
im
DIV
lm
LDE
Im
LDE
im
BM
OV
I
JV
EP
TS
NO
P
bit 6
3o
p' ln
33
op
*
in
2o
p' ln
32
op
*
¡n
U*
In
UB
*
• In
iZE
¡n
1SE
In
PC
¡n JLT
\í*
slgn
edm
urtip
ly/
divi
de'
bit
?
ix Ix ix ix ix Ix Ix ix
)P¡X JE
•
LCA
LL
RS
T
' S
lgne
d m
ultlp
llcat
ion
and
div
isió
n a
re tw
o-b
yle In
stru
dlo
ns.
The
flrs
t by
le Is
"F
E"
and
the
seco
nd Is
the
opco
de o
f the
cor
resp
ondl
ng u
nslg
ned
inst
ruct
lon.
Opc
ode
EE
Is re
serv
ed, bu
t it
does
not
gen
érat
e an
unl
mpl
emen
ted o
pcod
e In
terr
upt.
1A
-33
mi
8XC
l96K
C/W
;INS
TR
UC
,riO
N S
ET
RE
FER
EN
CE
Tab
le
A-9
li
sts
insi
ruct
ions
al
ong
wit
h ih
eir
leng
lhs
and
opco
des
for
each
ap
plíc
able
addr
essí
ng m
ode.
The
re a
re i
wo
colu
mns
for
eac
h ad
dres
sing
mod
e. T
he f
irst
col
umn
list
sth
e in
stru
ctio
n le
ngth
, an
d ih
e se
cond
col
umn
list
s th
e he
xade
cim
al o
pcod
es.
For
inde
xed
¡nst
ruct
ions
, tr
ie f
irst
colu
mn
lisl
s in
stru
ctio
n h
ng
ths
as S
/L,
whe
re S
is
the
shor
t-in
dexe
din
stru
ctío
n le
ngth
and
¿ i
s th
e lo
ng-i
ndex
ed i
nMru
ctio
n le
ngth
. A d
ash
¡n a
ny c
olum
n (•
—)
indí
cale
s "n
ol a
ppli
cabl
e."
Tabl
e A
-9. I
nst
nic
llon
Uen
gth3
and
Hex
adec
lmal
Opc
odes
Indl
rect
Aríth
met
lc (i
Mne
mon
ic
AD
D (
2 o
ps)
AD
D (
3 op
s)
AD
D8
(2 o
ps)
AD
DB
(3 o
ps)
AD
DC
AD
DC
B
CM
P
CM
PB
SU
S (
2 op
s)
SU
B (3
ops
)
SU
BB
(2 o
ps)
SU
BB
(3 o
ps)
SU
BO
SU
BC
B
Dlre
ct
3 4 3 4 3 3 3 3 3 4 3 4 3 3
64 44 74 54 A4
B4
88 98 68 48 78 58 A8
B8
Irr 4 5 3 4 4 3 4 3 4 5 3 4 4 3
8XC
196K
C/K
D IN
STR
UC
TIO
N S
ET R
EFE
RE
NC
E
Tab
le A
-9. I
nst
ruct
lon
Len
gths
and
Hex
adec
lmal
Opc
odea
(C
ontln
ued)
Ari
thm
etlc
(G
roup
II)
Mne
mon
ic
DIV
DIV
B
DIV
U
DIV
UB
MU
L (
2 op
s)
MU
L (
3 op
s)
MU
LB (
2 op
s)
MU
LB (
3 op
s)
MU
LU (
2 op
s)
MU
LU (3
ops
)
MU
LUB
(2
ops)
MU
LUB
(3
ops)
Dlre
ct
4 4 3 3 4 5 4 5 3 4 3 4
FE8C
FE9C
8C 9C
FE6C
FE4C
FE7C
FE5C
6C 4C 7C 5C
Imm
edla
te
5 4 4 3 5 6 4 5 4 5 3 4
FE8D
FE9D
8D 9D
FE6D
FE4D
FE7D
FE5D
6D 4D 7D 5D
Indl
rect
(D
4 4 3 3 4 5 4 5 3 4 3 4
FE
8E
FE
9E
8E 9E
F3
6E
FE..4
E
FE
7E
FE
5E
6E 4E
7E 5E
Inde
xed
S/L
O
í
5/6
5/6
4/5
4/5
5/6
6/7
5/6
6/7
4/5
5/6
4/5
5/6
FE8F
FE9F
8F 9F
FE6F
FE4F
FE7F
FE5F
6F 4F 7F 5F
Logl
cal
Mne
mon
ic
AN
D (
2 op
s}
AN
D (
3 op
s)
AN
DB
(2
ops)
AN
DB
{3
ops)
OR
OR
B
XO
R
XO
RB
Dlre
ct
3 4 3 4 3 3 3 3
60 40 70 50 80 90 84 94
Imm
edia
te
4 5 3 4 4 3 4 3
61 41 71 51 81 91 85 95
Indl
rect
0)
3 4 3 4 3 3 3 3
62 42 72 52 82 92 86 96
Inde
xed
S/L
' 0)
4/5
5/6
4/4
5/5
4/5
4/5
4/5
4/5
63 43 73 53 83 93 87 97
A-3
4
.1A
-35
Tab
te A
-9.
Inst
ruct
lon L
en
gth
s a
nd
He
xad
ecl
ma
l O
pco
des
(Contin
uad)
Stíic
íT
A-3
{¡
8XC
196K
C/K
D IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Ta
ble
A-9
. In
stru
ctlo
n L
ength
s and
Hexa
decl
mal
Opco
des
(Contln
ued)
Cali
Mnem
onlc
LCAL
L
SC
ALL
RE
T
TRA
P
Dlre
ct
— — — 1
— — — F7
Imm
edia
te
— — — —
— — — —
Indlrect
0)
— .
_ 1 —
— — FO —
Indexe
dS
/L
0)
-73
2J—
— —
FF(2
)
zw — —
Conditl
onal J
um
p
Mne
mon
lc
DJN
Z
DJN
ZW
JBC
JBS
JC
.
JE JGE
JGT
JH JLE
JLT
JNC
JNE
JNH
JNS
T
JNV
JNV
T
JST
JV JVT
Dlre
ct
— — — — _ _ — — — — — — — — — — — — — —
— — — — — — — — — — — — — — — — — — — —
Imm
edia
te
— — — — — — — — — __ — — — — — — — — — —
— — — — — — — — „ — — — _ — — — — — — —
Ind
lre
ct.
d>
— — — — — — — — — — — — — — _ — — — — —
— — — — — — — — — — — _ — — — — — — — —
Inde
xed
S/L
Oí
3/—
3/—
3/_
3/—
1/—
1/— I/—
1/—
1/—
1/—
1/—
1/—
1/— y— i/— i/— i/— i/— i/— i/—
EO E1
30-3
7
38-3
F
DB
DF
D6
D2
D9
DA
DE
D3
D7
D1
DO
.
D5
•
D4
D8
DD
DC
A-3
7
•^rx
W
8XC
196K
C/K
DIN
ST
RU
CT
.ON
SE
T R
EF
ER
EN
CE
Tab
le A
-9. I
nst
ruct
lon L
en
gth
s an
d H
exa
de
cim
al
r»)
8XC
196K
C/K
D I
NS
TR
UC
TÍO
N S
ET
RE
FE
RE
NC
E
Ta
ble
A-9
. In
stru
ctlo
n L
en
gth
a a
nd
Hexa
deci
mal
Opc
odes
(C
ontln
ued)
Sin
gle
Mnem
onlc
CLR
CLR
B
CM
PL
DE
C
DE
CB
EX
T
EX
TB
INC
INC
B
NE
G
NE
6B
NO
T
NO
TB
Dlrect
— — — — _ — — — — — — _ —
01 11 C5
05 15 06 16 07 17 03 13 02 12
Imm
edla
te
— — — — — — — — — — — — —
— — _ — _ — — — — — — — —
Indi
rect
d)
— — — _ — — — — _ — _ — —
— __ — — — — — — — — — — _
Inde
xed
S/L
0»
— — _ — — — _ — _ — — — _
— — _ — _ : — —
NO
TE
S:
1.
Indi
rect
nor
mal
and
indi
rect
aul
o-in
crem
ent
shar
e Ih
e sa
me o
pcod
es,
as d
o sh
ort-
and
iong
-lnde
xed
mcí
des.
To
use
Indi
rect
nor
mal
or
shor
t-ln
dexe
d m
ode,
the
seco
nd b
yte
of Ih
e In
stru
ctlo
n m
usí
be e
ven.
To
use
Indl
rect
aut
o-in
crem
ent
or lo
ng-Ind
exed
mod
e, t
he s
econ
d b
yle
oí
the
ínst
ruct
ion
mus
t be
odd
.
2.
For
thes
e In
stru
ctio
ns (
SC
ALL
, S
JMP
, LC
ALL
, LJ
MP
}, th
e 3
leas
t-sl
gnlfi
cant
bits
of t
he o
pcod
e a
reco
ncat
enat
ed w
¡th th
e 8
bits
to
form
an
11-b
tt, 2
's c
ompJ
emen
t of
fset
.
A-3
8A
-39
8X
C196K
j|í<
D I
NS
TR
Í'IC
TIO
N S
ET
FÍW
ER
EN
CE
Tab
le A
-IO
lis
ts i
nstr
ucíio
ns a
ipha
betic
ally
\\;h
hin
gro
ups,
alo
ng w
ilh t
heír
exe
cutio
n tim
es,
expr
esse
d in
st
ate
times
. T
he
tabl
e de
nol(,
s ex
ecut
íon
times
fo
r in
dire
ct
and
inde
xed
addr
essi
ng m
odes
as
R/M
, w
here
R I
s ih
e ex
ecut
ion
lime
usí
ng S
FR
s an
d ¡n
tern
al
RA
M(O
H-I
FF
H)
and
M í
s th
e ex
ecut
ion
time
usin
g th
e m
emor
y co
ntro
ller
(200
H-O
FFFFH
).
Tab
le A
-10.
8X
C19
6KC
/KD
Ins
truc
ihrí
n E
xecu
tion T
imes
(In
Sta
te T
imes
)
Ari
thm
etí
c""
v.8X
C19
6KC
/KD
IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Table
A-1
0. 8
XC
196K
C/K
D I
nst
ruct
lon
Exe
cutio
n T
imes
(Contlñ
ued)
Ari
thm
etíc
(G
rou
p II
)
Mnem
onlc
DIV
DIV
B
DIV
U
DIV
UB
MU
L (
2 op
s)
MU
L (3
ops
)
MU
LB (
2 op
s)
MU
LB (
3 op
s)
MU
LU (
2 op
s)
MU
LU (
3 op
s)
MU
LUB
(2
ops)
-
MU
LUB
(3
ops)
Dire
ct26 18 24 16 16 16 12 12 14 14 10 10
Imm
ed.
27 18 25 16 17 17 12 12 15 15 10 10
Indirect
Norm
al
28/3
1
20/2
3
26/2
9
18/2
1
18/2
1
18/2
1
14/1
7
14/1
7
16/1
9
16/1
9
12/1
5
15/1
5
Au
to-l
nc.
29/3
2
21/2
4
27/3
0
19/2
2
19/2
2
19/2
2
15/1
8
15/1
8
17/1
9
17/1
9
13/1
5
12/1
6
Inde
xed
Short
29/3
2
21/2
4
27/3
0
19/2
2
19/2
2
19/2
2
15/1
8
15/1
8
17/2
0
17/2
0
12/1
6
12/1
6
Long
30/3
3
22/2
5
28/3
1
20/2
3
20/2
3
20/2
3
16/1
9
16/1
9
ia/2
1
18/2
1
14/1
7
14/1
7
Loglc
al
Mnem
onlc
AN
D (
2 op
s)
AN
D (
3 op
s)
AN
DB
{2
ops)
AN
DB
(3
ops)
OR
OR
B
XO
R
XO
RB
Dlre
ct4 5 4 5 4 4 4 4
Imm
ed.
5 6 5 6 5 5 5 5
Indirect
Norm
al
6/8
7/10 6/8
7/10 6/8
6/8
6/8
6/8
Auto
-lnc.
7/9
8/11
-
7/9
8/11 7/9
7/9
7/9
7/9
Indexe
dS
hort
6/6
7/10 6/8
7/10 6/8
6/8
6/8
6/8
Long
7/9
8/11 7/9
8/11 7/9
7/9
7/9
7/9
A-4
0
iA
-41
Tabl
e A
-10.
8X
C19
6KC
/KD
Inst
ruct
lon
Exe
cutl
on
Tim
es (
Co
ntl
nu
ed)
•¡n
iel.
8XC
196K
C/K
D IN
ST
RU
CT
ION
SE
T R
EF
ER
EN
CE
Tab
le A
-10. 8
XC
196K
C/K
D I
nst
ruct
lon
Exe
cutl
on
Tim
es (
Co
nti
nu
ed)
Mnem
onlc
BR
(In
dire
ct)
LJM
P
SJM
P
TIJ
MP
inle
rnal
/inta
rnal
exte
rnal
/inle
rnal
exte
rnal
/ext
erna
l
Mne
mon
lcLC
ALL
RE
T
SC
ALL
TR
AP
Mne
mon
lcLC
ALL
RET
SC
ALL
TR
AP
Jum
p
Dlrec
t
— — — 15 18 21
Dlr
ect
— — — 16
Imm
ed.
— — — 15 18 21
Ind
irec
tN
orm
al
7 —
.
—
Au
to-ln
c.7 _ — "
Ind
exed
Sh
ort
7 — 7 —
Cal
i (In
tern
a! S
tack
)
Imm
ed.
— — — —
Indire
ctN
orm
al
— 11 — —
Au
to-l
nc.
— — — —C
ali (
Ext
ern
al S
tack
)
Dir
ect
— — — 18
Imm
ed.
— — — —
Indire
ctN
orm
al
— 14 — —
Au
to-l
nc.
— — — —
Long 7 7 —
Index
edS
hort
— — 11 —
Long 11 :
Index
edS
hort
— — 13 —
Long
13 , _ —
A-4
3
un
BX
C196K
C/J
PJN
ST
RU
C7IO
N S
ET R
EF
^E
NC
E
Tab
le A
- 10.
BX
C19
6KC
/KD
In
stru
ctlo
n E
xecu
tlo
n T
imes
(C
on
tin
ued
)
Co
nd
ítlo
na
Jum
p
Sh
ort
-ln
dex
ed
5 (ju
mp
nol t
aken
), 9
(Jum
p ta
kei)
DJN
ZW80
Cl9
6KC
on!y
8XC
196K
C/K
D7
(jum
p no
t tak
en),
6 (ju
mp
nol t
aken
},
5 (ju
mp
not t
aken
),
5 O'
ump
not t
aken
),
¡nie
l.8
XC
19
6K
C/K
D I
NS
TR
UC
TIO
N S
ET
RE
FE
RE
NC
E
Table
A- 1
0. 8
XC
19
6K
C/K
D I
nstr
uctlo
n E
xecu
tlo
n T
imes
(Co
ntin
ue
d)
Mnem
onlc
NO
RM
L
SH
L
SH
LB
SH
R
SH
RA
SH
RA
B
SH
RA
L
SH
RB
SH
RL
Mnem
onlc
BM
OV
BM
OV
I
Mnem
onlc
CLR
C
CLR
VT
D!
El
IDLP
DV
al íd
key
Inva
lld k
ey
NO
P
RS
T(In
clud
ing
(etc
hoí
con
flgur
atio
nby
le)
SE
TC
SK
IP
Sh
lft
Dlr
ect
8 +
1 p
er sh
íft (
9 fo
r 0 s
hift)
6 +
1 per
shl
ft (7
lor 0
shi
ft)
6+
1 p
er sh
ift (7
(or 0
shi
ft)
6 +
1 pe
r sh
ift (
7 (o
r 0
shift
)
6 + 1
per
shi
ft (7
(or 0
shl
ft}
6 +
1 pe
r shi
ft (7
for 0
shi
ft}
7+
1 p
er s
hift
(8 fo
r 0 s
hift)
6 +
1 p
er s
hífl
(7 fo
r 0 s
hift)
7 +
1 p
er sh
lft (
8 fo
r 0 s
hlft) B
lock
Long-ln
dexe
d
inte
rnal
/inte
rnal
6
+
Spe
rwor
dex
tern
al/ín
tern
al
6 + 1
1 p
er w
ord
exte
rnal
/axt
erna
l 6
+ 1
4 pe
r w
ord
inte
rnal
/inte
rnal
7
+ 8
per w
ord
+ 1
4 pe
r int
erru
ptex
lern
al/ln
tern
al
7 +
11
per w
ord
+14
per
Inte
rrupt
exte
rnal
/ext
erna
l 7
+1
4 pe
r wor
d +
14 p
er In
terr
upl
Dlre
ct
2 2 2 2 — 2 20 2 3
Specl
al
Imm
ed.
— — — — B 25 — — —
Indlrect
Norm
al
— — — — — — — —
Auto
-lnc.
— — — — — — _ —
Indexe
dS
hort
— —:
—
—
Long ,
_ _ — — . —
A-4
5
8XC
196K
C7Í
te>
INS
TRU
CC
IÓN
SE
T R
EÍfe
lEN
CE
Tab
le A
-10.
8X
C19
6KC
/KD
Inst
rucl
jon
Exe
cutlo
n T
imes
(C
ontln
ued)
Mne
mon
icD
PTS
EPTS M
nem
onic
CLR
CLR
B
CM
PL
DE
C
DEC
B
EX
T
EX
TB
INC
INC
B
NE
G
NE
GB
NO
T
NO
TB
PT£
Dlr
ect
2 2
Imm
ed.
— —
Indlrect
N<.
rmal
— í—
Aut
o-ln
c.— —
Inde
xed
Sho
rt— —
Sln
gje
Dlr
ect
3 3 7 3 3 4 4 3 3 3 3 3 3
Imm
ed.
— — — — — — — ~ — — — — —
f In
dlrec
tN
orm
alL_ r- ~ ! '— r- r f- — ^ — —
Aut
o-ln
c.— — — — — — — — — — — — —
Long — —
Inde
xed
Sho
rt— — — — — — — — — — — — —
Long — .
— — — — — — — — .
— — — —
A-4
Í:.
1
¡nie
l.8X
C19
6KC
/KD
INS
TR
UC
TIO
N S
ET
RE
FER
EN
CE
Tab
le A
-11.
8X
C19
6KC
/KD
PT
S C
ycle
Exe
cutlo
n T
imes
PT
S C
ycle
s
PTS
Mod
e
Sin
gle
Tra
nsfe
r m
ode
Inle
rnal/in
tern
al
exte
rnal
/inte
rnal
exte
rnal
/exl
erna
l
Blo
ck T
rans
ler
mod
e¡n
tern
at/in
lern
alex
tern
al/in
lern
alex
tern
al/e
xter
nal
A/D
Sea
n m
ode
SF
Rs/
Inte
rnal
RA
MM
emor
y C
ontr
olle
r
HS
I mod
eS
FR
s/In
tern
al R
AM
Mem
ory
Con
trol
ler
HS
O m
ode
SF
Rs/
Inte
rnal
RA
MM
emor
y C
ontr
olle
r
Exe
cutlo
n T
ime
(In
Sta
te T
imes
)
18 21 24 13 +
7 p
er tr
ansí
er (
1 m
ínim
um)
1 6
+ 7
per
tran
síer
(1
mín
imum
)19
+ 7
per
tran
sler
(1
mín
imum
)
21 25 12 +
10
per
tran
sler
(1
mín
imum
)1
6+
10
per
tran
síer
( 1
mín
imum
)
11 +
1 0
per
tran
sler
(1 m
ínim
um)
15
+1
0 p
er t
rans
ler
( 1 m
ínim
um)
A-4
7
m8X
C19
6KC
/KD
SIG
ÜA
L D
ES
CR
IPT
ION
S
Fu
nct
lon
Ñam
e
AD
O-A
D7
AD
8-A
D15
Add
itlo
nal
Fu
nct
lon
s
P3.
0-P
3.7
P4.
0-P
4.7
Sel
ecte
d b
y
Bus
acc
ess
toex
tern
alad
dre
ss
1
Table
B-2
. S
ignal
DeS
jcrlp
tlons
(C
on
tinu
ad
)
Des
crlp
tlon
AD
V#
•I/O
ALE
CC
R.3
=0
AIN
C#
ALE
P2.
4/T
2RS
TEA
# =
VE
A
{pro
gram
mín
gm
ode)
CC
R.3
-1
AN
GN
D
_
B-2
Sys
tem
Add
ress
/Dat
a Bu
s. T
hese
pin
spr
oyid
e a
mul
tiple
xed
addr
ess
and
data
bus
.D
urin
g th
e ad
dres
s ph
ase
of th
e bu
s cy
cle,
addr
ess
bits
0-1
5 a
re p
rese
nted
on
the
bus
and
can
be la
lche
d us
lng
ALE
or A
DV
#.D
urin
g th
e da
ta p
hase
, 8-
or
16-b
ít da
ta Is
trans
ferr
ed.
Add
ress
Val
íd. T
his
activ
e-lo
w o
utpu
t sl
gnal
¡s a
sser
ted
only
dur
ing
exte
rnal
mem
ory
acce
sses
.
AD
V#
indí
cale
s th
at v
alid
add
ress
Info
rmat
ion
¡s a
vaila
ble
on th
e sy
stem
add
ress
/dat
a bu
s,Th
e si
gnal
rem
ains
low
whl
le a
val
ld b
uscy
cle
Is in
pro
gres
s an
d is
retu
rned
hig
h as
soon
as
the
bus
cycl
e co
mpl
etes
.
The
AD
V#
sign
al ¡
s us
ed b
y an
ext
erna
l lat
chto
dem
ultip
lex
the
addr
ess
(rom
the
addr
ess/
data
bus
, A
DV
# ca
n al
so b
e us
edw
lth a
dec
oder
to g
enér
ate
chlp
-sel
ects
for
exte
rnal
mem
ory.
Aut
o In
crem
ent,
In S
lave
Pro
gram
mín
gM
ode,
this
act
ive-
low
inpu
t sl
gnal
ena
bles
the
auto
-incr
emen
t mod
e. A
uto
Incr
emen
t al
low
sre
adln
g (ro
m o
rwrit
inq
to s
eaue
ntia
l EPR
OM
loca
tlons
with
out r
equi
ring
addr
ess
trans
acíio
ns a
cros
s th
e pr
ogra
mm
ing
bus
for
each
read
or w
rite.
Add
ress
Lat
ch E
nabl
e. T
his
activ
e-hí
ghou
tput
sig
nal i
s as
serte
d on
ly d
urin
g ex
tern
alm
emor
y ac
cess
es.
ALE
Indí
cale
s th
at v
alíd
add
ress
Info
rmat
ion
Is a
vaila
ble
on th
e sy
stem
add
ress
/dat
a bu
san
d sí
gnal
a th
e st
art o
f a v
alid
bus
cyc
le.
ALE
difie
re (r
om A
DV
# In
that
it Is
no!
ret
urne
dhl
gh u
nlil
a ne
w b
us c
ycle
is to
beg
ln.
ALE
¡s u
sed
by a
n ex
tern
al la
tch
tode
mul
tiple
x th
e ad
dres
s (ro
m th
ead
dres
s/da
ta b
us.
ñeíe
renc
e gr
ound
for
the
A/D
con
verte
r and
Ihe
logl
c us
ed to
read
Por
t 0. A
NG
ND
mus
tbe
con
nect
ed fo
r the
A/D
con
verte
r an
d P
ort
O to
(un
ctio
n.
¡niel.
8X
C1
96
KC
/KD
SIG
NA
L D
ES
CR
IPT
ION
S
Tab
le B
-2.
Sfg
nal
Des
crip
tions
(C
ontin
ued)
Fun
ctio
nÑ
ame
BHE#
BR
EO
*
BUSW
IDTH
CLK
OU
T
CP
VE
R
Additl
onal
Fun
ctlo
nsW
RH
#
P1.
5
P2.6
T2U
P-D
N
Sel
ecte
d b
y
CC
R.2
-1
WS
R.7
-1
CC
R.1
-1
IOC
3.1
-0
8X
C196K
Dan
d8
XC
19
6K
C(C
-Ste
p) only
EM
- V
EA(p
rogr
amm
ing
mod
e)
Typ
e
O o I o o
Des
crlp
tlon
Byt
e H
igh
Ena
ble.
Thi
s ac
tive-
low
out
put
sign
al Is
ass
erte
d on
ly d
urin
g w
ord
writ
esan
d hl
gh b
yte
writ
es to
ext
erna
l mem
ory.
BH
Efl
indí
cale
s th
at v
alid
dat
a Is
bel
ngtra
nsfe
rred
(writ
ten)
ove
r th
e up
per
half
oí th
esy
stem
add
ress
/dat
a bu
s.
BH
E#,
in c
onju
nctlo
n w
ith A
O, s
elec
ts th
em
emor
y by
te to
be
writ
ten:
BH
Ef
AO
B
yte
Wrlt
ten
0 0
both
byt
es0
1 hi
gh b
yte
only
1 0
low
byt
e on
ly
Bus
Req
uest
. Th
ís a
ctiv
e-lo
w o
utpu
t sig
nal I
sas
serte
d du
ring
a H
OLD
cyc
le w
hen
the
bus
cont
rolle
r ha
s a
pend
íng
exte
rna!
mem
ory
cycl
e.
The
earlt
est t
ime
in th
e H
OLD
cyc
le th
at th
ede
vice
can
ass
ert B
REQ
# is
at t
he s
ame
time
It as
serts
HLD
A#.
Onc
e it
is a
sser
ted,
BREQ
# re
mai
ns a
sser
ted
until
HO
LD#
isre
mov
ed.
Whe
n th
is fu
nctlo
n is
act
iva,
the
pin
act
s as
ast
anda
rd o
utpu
t (n
ot q
uasi
-bid
lrect
iona
l).O
nce
the
alté
rnat
e fu
nctlo
n ís
ena
bled
, the
pin
func
tíons
as
BR
EO
# un
til th
e de
vice
Isre
set.
Bus
Wid
th. T
his
activ
e-hl
gh In
put s
igna
ldy
nam
ical
ly s
elec
ts t
he b
us w
ldth
. Whe
nhí
gh, B
USW
IDTH
sel
ects
a 1
6-b!
t bus
wld
th;
whe
n lo
w, i
t sel
ects
an
8-bl
t bus
wld
th,
BU
SW
IDTH
Is a
ctiv
e du
ring
a C
CR
(etc
h.
Whe
n C
CR
.1-0
the
bus
wid
th is
alw
ays
8bi
ts; t
he B
US
WID
TH slg
nal I
s ¡g
nore
d.
Clo
ck O
utpu
t. O
utpu
t of
the
¡nie
rnal
clo
ckge
nera
tor.
The
CLK
OU
T fre
quen
cy ¡s
1/2
the
osdl
lato
r fre
quen
cy in
put
(XT
ALl
) and
CLK
OU
T ha
s a
50%
dut
y cy
cle.
On
the
8XC
196K
D a
nd th
e 8X
C19
6KC
(C-
Ste
p), c
lear
ing
IOC
3.1
enab
les
CLK
OU
T;se
ttlng
IOC
3.1
disa
bles
the
slg
nal.
On
earll
erve
rslo
ns o
í the
8X
C1
96K
C, C
LKO
UT
cann
otbe
dis
able
d.
Cum
ulat
íve
Pro
gram
Ver
ifica
tlon.
Thi
s ac
tíve-
high
out
put
slgn
al In
díca
les
whe
lher
any
verif
y er
rors
hav
e oc
curre
d sl
nce
the
devi
ceen
lere
d pr
ogra
mm
ing
mod
e. C
PV
ER
rem
ains
high
unt
il a
verif
y er
ror o
ccur
s, a
t whl
ch tim
eIt
is d
riven
low
. unc
e a
n er
ror o
ccur
s,C
PVER
rem
ains
low
unt
il th
e de
vice
exi
tsor
ogra
mm
lng
mod
e. W
hen
hlgh
, CPV
ER¡n
dica
tes
that
all
loca
tions
hav
e pr
ogra
mm
edco
rrect
ly s
lnce
the
dev
ice
ente
red
arog
ram
mln
g m
ode.
B-3
Fun
ctlo
nA
ddltl
onal
Fun
ctio
ns
'»'
' '*
8XC
13T
KC
/KD
SIG
NA
L D
ES
CR
IPT
ION
S
Tab
le B
-2.
Slg
nal
De
ucr
fptlo
ns
(Con
tlnue
d) Des
crlp
tlon
Sel
ecte
d by
Pro
gram
min
gm
ode
sele
cl(E
A#
- V
EA)
EX
TIN
T
HLD
Aff
P2.
2/P
RO
G*
P0.
7/P
MO
DE
.3/A
CH
7
I P
1.6
IOC
1.1-
0
IOC
1.1-
1
WS
R.7
=1
WS
R.7
-
Ext
erna
l Acc
ess.
Thi
s ac
tive-
low
Inpu
t si
gnal
dire
cts
mem
ory
acce
sses
to
on-c
hip
or
on-
chip
mem
ory.
Whe
n lo
w,
¡t s
elec
ls o
ff-ch
lpm
emor
y; w
hen
hígh
, it
sele
cts
on-c
hip
RO
Mor
EP
RO
M.
EA
# is
sam
pled
only
on
Ihe
risin
g ed
ge o
fR
ES
ET
*.
EA
# = '
caus
es m
u ue
vice
mod
e se
lect
ed b
y I
For
RO
Mle
ss d
evic
es,
EA
# m
ust b
e tle
d l
ow,
Ext
erna
l Jnt
erru
pt.
IOC
1.1
ass
lgns
thi
s in
put
to e
ither
P2.
2 or
P0.
7. E
XT
INT
mus
t be
asse
rled
íor
gre
ate
r tha
n tw
o st
ate
times
to
guar
ante
e Ih
at ít
Is re
cogn
ized
. In
Pow
erdo
wn
mod
e, E
XTI
NT
cau
ses
the
chip
to r
elu
rn to
nor
mal
ope
ratín
g m
ode.
EX
TIN
TIs
nor
mal
ly a
sam
pled
inpu
t, ho
wev
er, t
hepo
wer
dow
n cl
rcui
try
uses
It a
s a
leve
l-se
nsiti
vo ín
put
in P
ower
dow
n m
ode.
P2.
2 al
way
s ge
nera
les
EX
TIN
T1
(INT
13,
203A
H).
Whe
n IO
C1.
1 -
O, a
ris
ina
edge
on
the
P2.
2 pi
n a
lso
gene
rale
s E
XT
INT
(IN
T07
.20
0EH
). E
XT
INT
and
EX
TIN
T1
mus
t be
asse
rtea
for
gre
ate
r tha
n tw
o st
ate
times
to
guar
ante
e th
at th
ey a
re re
cogn
ized
.
Whe
n IO
C1.1
-1,
a ris
ing
edge
on
the
P0.
7pi
n g
ener
ales
exl
erna
l int
erru
pt E
XT
INT
ÍINT
07,
200E
H).
EX
TIN
T m
ust
be a
sser
ted
íor
grea
ter t
han
two
stat
e tim
es t
o gu
aran
tee
that
it Is
rec
ogni
zed.
O
Bus
Hol
d A
ckno
wle
dge.
Thi
s ac
tive-
low
outp
ut Ind
ícal
es t
hat
the
8XC
196K
C/K
D h
asre
leas
ed t
he b
us a
s a
resu
tl of
ano
ther
devl
ce a
sser
ting
HO
LD*.
Whe
n Ih
ls f
unct
lon
Is a
ctiv
e, th
e pi
n ac
ts a
s a
stan
dard
out
put
(nol
qua
sl-b
idire
ctlo
nal).
Onc
e Ih
e H
LD
Af
func
tion
is e
nabl
ed,
the
pin
func
tions
as
HLD
A#
until
the
devi
ce Is
rese
t.
Bus
Hol
d. T
his
activ
e-lo
w In
put
Is u
sed
tore
ques
t co
ntro
l of t
he b
us.
Whe
n th
is f
unct
lon
Is a
ctiv
e, th
e pi
n a
cts
as a
stan
dard
Ínpu
t (n
ot q
uasi
-bid
lrect
iona
l). O
nce
the
alté
rnat
e fu
nctio
n is
ena
bled
, th
e pi
nfu
nctio
ns a
s H
OLD
tf unlil
the
devi
ce í
s re
sel.
r8X
C19
6KC
/KD
SIG
NA
L D
ES
CR
IPT
ION
S
Tab
le B
-2. S
lgna
l D
escr
lptlo
ns (
Con
tlnue
d)
Fun
ctlo
nÑ
ame
HS
I.O
HS
I.1
HS
I.2
HS
I.3
HS
O.O
HS
0.1
HS
O.2
HS
0.3
HS
O.4
HS
O.5
INS
T
NM
I,
Ad
dltl
on
al
Fun
ctlo
nsIN
T04
int
erru
pt/T
2 r
eset
sou
rce
T2 c
lock
sou
rce
HS
O.4
HS
O.5
_ HS
I.2
HS
I.3
Sel
ecte
d by
IOC
O.O
-1
IOC
O.2
-1
IOC
O.4
-1
IOC
O.6
-1
_ IOC
1.4
-1
IOC
1.6
-1
Typ
e
I I I I O o o o I
Des
crlp
tlon
Inpu
t to
the H
igh-
Spe
ed In
pul m
odul
e.
The
HS
I.O p
in c
an a
lso
be u
sed
to g
en
éra
tean
Inte
rrup
t. A
ris
ing
edge
on
HS
I.Oge
nera
les
the
HS
I.O P
in in
terr
upt
(IN
T04
,20
08H
). H
SI.O
mus
t be
ass
erle
d fo
r gre
ate
rth
an tw
o s
tate
tim
es to
gua
rant
ee th
at It
isre
cogn
ized
.
In a
dditi
on, w
hen
IOC
O.5
-1,
a r
isin
g e
dge'
onH
Sl.
Ore
sets
TÍm
er2
.
Inpu
t to
the H
igh-
Spe
ed In
put
mod
ule.
Whe
n IO
CO
.7-0
and
IOC
3.0
-0,
the
HS
I.1 p
iníu
nctio
ns a
s th
e T
2 cl
ock
sour
ce.
Inpu
t to
the
Hig
h-S
peed
Inp
ut m
odul
e. N
ote
that
HS
I and
HS
O íu
nctio
ns c
an b
e ac
tive
atIh
e sa
me
time,
in w
hich
cas
e th
e pi
n ac
ts a
san
out
put t
hat th
e H
SO
mon
ltors
.
Inpu
t to
the
Hig
h-S
peed
Inpu
t m
odul
e. N
ote
that
HS
I and
HS
O f
unct
ions
can
be
activ
e at
the
sam
e tim
e, in
whí
ch c
ase
the
pin
acts
as
an o
utpu
t Ih
at I
he H
SO
mon
itors
.
Out
puts
(ro
m th
e H
igh-
Spe
ed O
utpu
t m
odul
e.
Out
put
(rom
the H
igh-
Spe
ed O
ulpu
t m
odul
e.N
ote th
at th
e H
SI a
nd H
SO
func
tions
can
be
adlv
e a
t the
sam
e tim
e, In
whi
ch c
ase
Ihe
pin
acts
as
an o
utpu
t th
at t
he H
SO
mon
ltors
.
Out
put
(rom
the
Hig
h-S
peed
Out
put
mod
ule.
Not
e th
at Ih
e H
SI
and
HS
O (
uncí
tons
can
be
activ
e at
the
sam
e tim
e, In
whi
ch c
ase
the
pin
acts
as
an o
utpu
t th
at th
e H
SI m
onlto
rs.
Inst
ruct
ion
Fet
ch. T
his
sign
al Is
val
ld o
nly
durin
q e
xter
nal m
emor
y re
ad c
ycle
s. W
hen
hig
h.lN
ST
Indí
cale
s th
at a
n In
stru
ctio
n Is
beln
g f
etch
ed; w
hen
low
, it
Indí
cale
s th
at d
ata
Is b
elng
rea
d.
INS
T c
an b
e u
sed
In a
pplic
atlo
ns t
hat r
equl
rese
para
ta m
emor
y ba
nks
for in
stru
ctio
ns a
nddala
. (N
ole
tha
t C
CB
byt
es a
nd I
nter
rupt
vect
ors
are c
onsl
dere
d d
ata
.)
Non
mas
kabl
e In
terr
upt.
A p
ositi
vo t
rans
ltion
caus
es a
vec
tor
thro
ugh
the N
MI i
nter
rupt
at
loca
tlon
203
EH
. N
MI
mus
t be
ass
erle
d fo
rgr
eate
r th
an o
ne s
tale
tim
e to
gua
rant
ee t
hat
it Is
rec
ogni
zed.
NM
I Is
use
d by
Int
el to
ols
that
cou
ld c
onfli
ctw
ith u
ser s
oftw
are.
Whe
n N
MI
is n
ot u
sed,
Itsh
ould
be
tied
low
.
B-4
B-5
Fun
ctio
nÑ
ame
PO
.OP
0.1
P0.
2P
0.3
P0.
4P
0.5
P0.
6P
0.7
P2.
0P
2.1
P2.
2P
2.3
P2.
4P
2.5
P2.
6P
2.7
P3.
0-P
3.7
P4.
0-P
4.7
I PA
CT
í
PA
LÉ*
1 PM
OD
E.O
PM
OD
E.1
PM
OD
E.2
PM
OD
E.3
Ad
dit
ion
al
Sele
cte
d b
yF
un
cti
on
s
AC
HO
_
iA
CH
Í 1
1A
CH
2A
CH
3A
CH
4/P
MO
DE
.OA
CH
5/P
MO
DE
.1A
CH
6/P
MO
DE
.2A
CH
7/P
MO
DE
.3/E
XTI
NT
1
PW
M1
PW
M2
BR
EQ
#H
LDA
ffH
OLD
*
TX
D/P
VE
R#
RX
D/P
ALE
#E
XT
INT
/PR
OG
*T
2CLK
T2R
ST
/AIN
C*
PWM
OT
2UP
-DN
/CP
VE
RT
2CA
PT
UR
E/P
AC
T
AD
Q-A
D7
AD
8-A
D15
IOC
3.2=
0IO
C3.
3=0
WS
R,7
=0W
SR
.7-0
IOC
1.5
-0S
PC
ON
.3.0
IOC
1.0-
0
P2.
1/R
XD
P0.
4/A
CH
4P
0.5/
AC
H5
P0.
6/A
CH
6P
0.7/
AC
H7
^ Tab
le B
-2.
Slg
nal D
es'c
rlpllo
ns (
Con
lfnue
d)
fype
|
Des
crlp
tlon
Por
t 0.
Thi
s po
rt ¡
s an
8-b
it, h
igh-
impe
danc
a,¡n
put-
only
port
. Por
t O is
rea
d (o
nlyí
atio
catio
n O
EH in
HW
indo
w 0
. P
O.O
-P0.
7 ar
edi
gita
l ínp
uts.
The
se p
lns
may
índ
lvid
ually
be
used
as
anal
oq
inpu
ts (
AC
Hx)
or
digi
tal í
nput
s (P
O.x
).W
hile
it is
pos
sibl
e fo
r th
e pm
s to
func
tion
sím
ulta
neou
sly
as a
nalo
g an
d di
gita
l ínp
uts,
this
ís
not
reco
mm
ende
a be
caus
e re
adín
gP
ort
O w
hile
a c
onve
rsió
n Is
In p
roce
ss c
anpr
oduc
e un
relia
ble
conv
ersi
ón res
ults
.
AN
GN
D a
nd V
^FF
mus
t be
con
nect
ed f
orP
ort
O a
nd t
he A
/D c
onve
rter
to f
unct
ion.
Por
t 1.
Thi
s po
rt is
an
8-bi
t, qu
asi-
bfdí
rect
iona
l Inp
ut/o
utpu
t po
rt. P
ort
1 Is
rea
dan
d w
ritte
n al
loca
tlon
OFH
In H
WIn
dow
0.
The
addi
tiona
l fu
nctio
ns a
ct a
s st
anda
rd L
Opí
ns {
not
quas
l-bid
írect
íona
l).
Por
t 2.
Thi
s po
rt is
an
8-bi
t, m
ultif
uncl
iona
lpo
rt. P
ort 2
is r
ead
and
writ
ten
at l
ocat
lon
10H
inH
Wín
dow
O.
Por
ts 3
and
4. T
hese
are
B-b
it, b
idlre
ctlo
nal,
inpu
t/out
put.p
orts
with
ope
n-dr
aln
out
puts
.T
he p
lns
are
shar
ed w
lth th
e m
ultlp
laxe
dad
dres
s/da
ta b
us,
whl
ch h
as s
tron
g in
tern
alpu
ll-up
s. P
orts
3 a
nd 4
can
be
read
and
writ
ten
only
as
a w
ord,
at l
ocat
ion
1FF
EH
.
Dur
ing
Pro
gram
min
g M
odes
, the
se p
orts
func
tion
as th
e P
BU
S.
Pro
gram
mln
g A
ctiv
e. In
Aut
o P
rogr
amm
lng
Mod
a, P
ACT)
¥ lo
w In
díca
les
that
prog
ram
mln
g ac
tlvity
Is o
ccur
ring.
Pro
gram
min
g A
LE.
Whe
n P
ALÉ
* Is
ass
erte
d,da
ta a
nd c
omm
ands
on
Por
ts 3
and
4 a
rere
ad In
to t
he d
evic
e.
Pro
gram
mln
g M
ode
Sel
ect.
Det
erm
ines
the
EP
RO
M p
rogr
amm
ing
algo
rithm
that
¡spe
rform
ed.
PM
OD
E is
sam
pled
afte
r a
devi
cere
set
whe
n E
A#
- V
EA
and
mus
t be
stab
lew
hile
the
dev
ice
Is o
pera
tlng.
1.0
EA# -
VE
A•
(pro
gram
min
gI m
ode)
EA# .
VEA
(pro
gram
mln
gm
ode)
EA
*-V
EA
(pro
gram
min
gm
ode)
B-6
8X
C1
96
Rtí
?K
D S
IGN
AL
DE
SC
RIP
TIO
NS
Tab
le B
-2.
Slg
nal
Des
crlp
tlons
(C
ontin
ued)
Funct
ion
Ñam
e
PR
OG
*
PV
ER
PW
MO
PW
M1
PW
M2
RD
#
RE
AD
Y
RE
SE
T*
RX
D
f
T2C
AP
TUR
E
Additional
Fun
ctlo
naP
2.2/
EX
TIN
T
P2.
0/T
XD
P2.5
P1.
3
P1.
4
P2.
1/P
ALE
*
P2.
7/P
AC
T*
Sel
ecte
d b
y
EA
# -
VE
A
(pro
gram
mln
gm
ode)
EA
# -
VE
A(p
rogr
amm
lng
mod
e)
IOC
1.0
-1
IQC
3.2-
1
IOC
3.3-
1
~ SP
CO
N.3 -
1
Typ
e
I O o o o o I
I/O 1/0
QB
D
Desc
riptlo
n
Pro
gram
min
g S
tart.
Thi
s a
ctiv
e-lo
w ín
put ¡
sva
lia o
nly
In S
iave
Pro
gram
min
g M
ode.
Whe
nas
sert
ed,
PR
OG
ff ca
uses
the
data
on
the
prog
ram
mln
g bu
s to
be
pro
gram
med
Into
the
EP
ñOM
. Whe
n P
RO
G#
Is d
eass
erte
d, th
epr
ogra
mm
lng
puls
e !s
ter
min
ated
.
Pro
gram
Ver
ifíca
tíon.
In P
rogr
amm
ing
Mod
es,
this
act
lve-
high
out
pul s
ignalls
asse
rted
to in
díca
la th
at th
e w
ord
has
prog
ram
med
cor
rect
ly.
Pul
sa W
idth
Mod
ulat
or (P
WM
) O
utpu
t 0.
If P
WM
O Is
forc
ed h
igh
on t
he r
isin
g ed
ge o
fR
ES
ET#,
the d
evic
e e
nter
s T
est M
ode.
PW
M O
utpu
t 1.
PW
M O
utpu
t 2.
Rea
d s
lgna
l out
put
to e
xter
nal m
emor
y. R
D#
is a
sser
ted
only
dur
ing
exte
rnal
mem
ory
read
s.
Rea
dy In
put.
This
sig
nal
¡s u
sed
to le
ngth
enex
tern
al m
emor
y cy
cies
by
gane
ratln
g "w
ait
stat
es"
for In
tería
cing
to s
low
mem
ory.
Whe
nR
EA
DY
Is h
lgh,
CP
U o
pera
tion
cont
inúe
s In
,a
norm
al m
anne
r. 11
RE
AD
Y Is
low
prio
r to
the fa
lllng
edg
e o
f C
LKO
UT, t
he m
emor
yco
ntro
ller
inse
rís w
aií
stat
es u
ntil
the
next
posi
tive
tran
sltlo
n In
CLK
OU
T o
ccur
s w
ithR
EA
DY h
lgh
or until
the n
umbe
r of
wai
tst
ates
Is e
qual
to th
e nu
mbe
r pr
ogra
mm
edin
to C
CR
.4 a
nd C
CR
.5.
RE
AD
Y Ís
Igno
red
for all In
tern
a! m
emor
y ac
cess
es. R
EA
DY
isac
tive
durin
g a
CC
R f
etch
.
Res
et in
put t
o a
nd o
pen-
drai
n o
utpu
t fro
m th
ech
ip. A
lalll
ng e
dge
on R
ES
ET
fl In
itiat
es th
ere
sal p
roce
ss.
Whe
n R
ES
ETf
f Is
flrs
tas
serte
d, th
e c
hlp
turn
s on
a p
ull-d
own
tran
sist
or c
onne
cted
to Ih
e R
ES
ET p
in fo
r 1
6st
ate
times
. Thi
s (u
nctio
n ca
n al
so b
eac
tivat
ed b
y a w
atch
dog tim
er o
verfl
ow o
r by
-ex
ecut
ion
of th
e R
ST
Inst
ruct
ion.
InP
ower
dow
n m
oda,
the
res
et p
roce
ss c
ause
sth
e c
hip
to r
etur
n to
nor
mal
ope
ratin
g m
ode.
Rec
elve
Ser
ial
Dat
a. In
mod
es 1
, 2, a
nd 3
,R
XD
Is u
sed to
rece
lve s
eria
l por
t dat
a. In
mod
e 0,
it lu
nctio
ns a
s an
Inpu
t or
an
open
-dr
aln
outp
ut f
or d
ata.
A r
isin
g e
dge
on P
2.7
capt
ures
the
valu
é of
Tim
er 2
in th
e T
2CA
PT
UR
E re
glst
er a
ndtri
gger
s a
Tim
ar 2
Cap
ture
Inte
rrup
t (IN
T1
1 ,
2036
H).
T2C
AP
TU
RE
mus
t be
ass
erte
d (o
rgr
eate
r th
an tw
o st
ate
times
to
guar
ante
e th
att i
s re
cogn
ized
.
B-7
inijjJ
,
Funct
lon
Ñam
eI T
2CLK
8X
Cl9
Ífl¿
/KD
SIG
N A
L D
ES
CR
IPttíl ON
S
Ad
dltí
on
al
Fu
nct
lon
s
Tab
le B
-2.
Slg
nal
Des
críp
tlon
s (C
on
ilnu
ed)
P2.
3IO
CO
.7-0
and
IOC
3.0-
0
BA
UD
_RA
TE
.1
5-0
T2R
ST
T2U
P-D
N
»
TX
D
P2.
4/A
INC
*
P2.
6/C
PV
ER
P2.
0/P
VE
R
IOC
O.3
-1 a
ndIO
CO
.5-0
IOC
2.1-
1
IOC
1.5
-1i
WR
Ltf
WR
U
CC
R.2
-1
CC
R.2
-0
CC
R.2
-0
Des
crlp
tlo
n
Tim
er 2
clo
ck In
put
and
Ser
ial p
ort
baud
raf
e ge
nera
tor
Inpu
t.
Tim
er 2
Res
et. A
ris
ing
edge
on
T2R
ST
rese
ts T
imer
2.
Tim
er 2
Up/
Dow
n C
ontr
ol. T
his
activ
e-hi
ghin
put
cont
rois
the
dlre
ctio
n o
í th
e T
imer
2co
unte
r. W
hen T
2UP
-DN
Is h
igh,
Tim
er 2
cou
nts
do
wn
;wh
en
T2
UP
:DN
Is lo
w,T
ime
r2co
unts
up.
Tra
nsm
tt S
eria
l Dat
a, in
mod
es 1
, 2,
and
3,TX
D í
s us
ed to
transm
lt se
rial p
ort
data
. In
mod
e O
, it Is
use
d a
s th
e se
rial d
ock
outp
ut
Hoi
dlna
TX
D lo
w o
n th
e ris
ing
edge
of
RE
SE
T*
caus
es th
e devk
» to
ente
r ON
CE
mod
a,
PW
R
Dig
ital s
uppl
y vo
ltage
(+5
vol
ts).
PW
R
Pro
gram
mln
g v
olta
ge. A
lso
the
tlmln
g p
in lo
rth
e "r
etur
n (r
om p
ower
-dow
n" d
rcult.
PV
'R
Reíe
rence
vol
tage
for
the
A/D
con
vert
er,
VREF
Is a
lso
the
sup
ply
volta
ge t
o th
e an
alog
porti
on o
f the
A/D
co
nve
rte
r and
the
logl
cus
ed t
o re
ad P
ort
0. V
REF
mus
t be
con
nect
edfo
r th
e A
/D a
nd P
ort
O to
fun
ctJo
n.
Dig
ital d
rcul
t gr
ound
(O
volts
). T
here
are
múl
tiple
Vss
pln
s, a
ll of
whl
ch m
usí b
eco
nnec
ted.
•
Wrlt
e, T
his
actlv
e-lo
w o
utpu
t In
díca
les
that
an
exte
rnal
writ
e Is
occ
urrin
g. T
his
slgn
al is
asse
rted
onl
y du
ring e
xter
nal m
emor
y w
rltes
.
Writ
e H
igh.
Dur
ing
16-
blt
bus
cyde
s, t
hís
activ
e-lo
w o
utpu
t slg
nal
Is a
sser
ted d
urin
ghi
gh b
yte
writ
es a
nd W
ord
writ
es.
Dur
ing
8-b
lt bu
s cy
cles
, WR
H*
Is a
ssert
ed
lor
all w
rite
oper
anon
s.
Writ
e Lo
w.
Dur
ing 1
6-bl
t bus
cyd
es,
thís
activ
e-lo
w o
utpu
t sig
nal
is a
sser
ted
durin
glo
w b
yte
writ
es a
nd w
ord w
rites
.
Dur
ing
8-b
¡t bu
s cy
cles,
WR
L# I
s as
sert
ed fo
ral
l writ
e o
pera
tions
.
Inpu
t of
the
on-c
hip
osd
llato
r in
vert
er a
nd o
íth
e In
tern
al c
lock
genera
tor.
If an
ext
erna
l osc
lllat
or Is
use
d, X
TA
L1 a
lso
serv
es a
s th
e 8X
C19
6KC
/KD
clo
ck I
nput
(th
eX
TA
L1 V
IH spedlíc
atlo
n m
ust
be m
al.)
Out
put
of th
e on
-chi
p o
scill
ator
inve
rter
.
B-8
8XC
196K
C/K
D S
IGN
AL
DE
SC
RIP
TIO
NS
Tab
le B
-3 l
ists
the
def
ault
fun
ctio
ns o
f th
e 8X
C19
6KC
/KD
I/O
and
con
trol
pin
s w
ith
thei
rva
lúes
dur
ing
and
afte
r re
set.
Tab
le B
-4 d
efin
es t
he p
in s
tatu
s te
rmin
olog
y.
Tab
le B
-3.
Pin
Res
et S
tatu
s
Pin
Ñam
e
AC
HO
-AC
H7
PO
RT
1
TX
D
RX
D
EX
TIN
T
T2C
LK
T2R
ST
PW
MO
— AD
O-A
D15
HS
I.O,
HS
I.1
HS
I.2/H
SO
.4
HS
I.3/H
SO
.5
HS
O.O
-HS
O.3
ALE
BH
E#
BU
SW
IDT
H
CLK
OU
T
EA
#
INS
T
NM
I
RD
#
RE
AD
Y
RE
SE
T*
WR
#
Multi
ple
xed
Port P
ina
PO
.O-P
0.7
P1.0
-P1.7
P2.
0
P2.
1
P2.
2
P2.
3
P2.
4
P2.
5
P2.6
-P2.7
P3.0
-P4.7
— — — — — — — — _ — — .
— — — —
Pin
Sta
tus
Durin
g R
eset
Und
efin
ed In
puts
(N
ote
1)
Wea
k P
ull-u
ps (
!IL s
pec)
Str
ong
Pul
l-up
(lu
n s
pec)
Und
elin
ed In
put
(Not
e 3)
Und
efin
ed In
put (N
ote 3
}
Und
elin
ed In
put
(Not
e 3)
Und
efin
ed In
put
(Not
e 3)
Méd
ium
Pul
l-dow
n
Wea
k P
ull-u
ps
Wea
k P
ull-u
ps "
Und
efin
ed I
nput
(N
ote
3)
Und
efin
ed I
nput
(N
ote 3
)
Und
efin
ed I
nput
(N
ote
3)
Wea
k P
ull-d
own
Wea
k P
ull-u
p
Wea
k P
ull-u
p
Und
efin
ed In
put (
Not
e 3
)
CLK
OU
T (
Str
ongl
y D
ríven
)
Und
efin
ed I
nput
(N
ote 3
)
Wea
k P
ull-d
own
Wea
k P
ull-d
own (l|m
spe
c)
Wea
k P
ull-u
p
Und
efin
ed I
nput
(N
ote
3)
Méd
ium
Pul
l-up
(R
RS
T sp
ec}
Wea
k P
ull-u
p
Pin
Sta
tus
After
Res
et
Und
efin
ed I
nput
s (N
ote
1)
Wea
k P
ull-u
ps (1
|L s
pec)
Str
ongl
y D
riven
Und
efln
ed In
put
(Not
e 3)
Und
efin
ed In
put (N
ote 3
)
Und
elin
ed In
put
(Not
e 3)
Und
afin
ed I
nput
(N
ote
3)
Str
ongl
y D
riven
Waa
k P
ull-u
ps
Add
ress
/Dat
a B
us o
rO
pen-
Dra
ln I/
O (
Not
e 2)
Und
efln
ed I
nput
(N
ote
3)
Und
efin
ed I
nput
(N
ote
3)
Und
efin
ed I
nput
(N
ote
3)
Wea
k P
ull-d
own
Stro
ngly
Driv
en
Str
ongl
y D
riven
Und
efin
ed I
nput
(N
ote
3)
CLK
OU
T (
Str
ongl
y D
riven
)
Und
efin
ed I
nput
(N
ote
3)
Stro
ngly
Driv
en
Wea
k P
ull-d
own (l|H
i sp
ec)
Str
ongl
y D
riven
Und
efln
ed I
nput
(N
ote
3)
Méd
ium
Pul
l-up
(R
RST
spe
c)
Stro
ngly
Driv
en
NO
TE
S:
1.
The
se p
ins
are
allo
wed
to f
loat
. H
owev
er, i
t Is
reco
mm
ende
d th
at u
nuse
d p
lns
be tl
ed h
igh
or
low
.
2.
The
sta
te o
í th
ese
plns
dep
ends
on
devi
ce c
onlig
urat
lon.
If th
e ad
dres
syda
ta b
us I
s ac
tive,
the
plns
act
as
a st
rong
ly d
riven
bus
; ot
herw
lse,
the
y ac
t as
an o
pen-
drai
n I/
O p
ort
and
are
left
float
ing.
3.
Th
ese
pln
s m
ust
be d
riven
and
not
left
ftoat
lng.
Inpu
t vo
ltage
mus
t not
exc
eed
VC
G d
urin
g p
ower
-up.
4.
Con
sult
the
8XC
196K
C/K
D d
ata s
heet
for
sped
ficat
ions
.
B-9
8XC
19, ¡jj
^C/K
D S
IGÍI
AL
DE
SC
RIW
JDN
S
Tab
le B
-4. P
in S
u tu
s D
escr
lptl
on
s
Pin
Sta
tus
Wea
k P
ull-u
p
Méd
ium
Pul
l-up
Stro
ng P
ull-u
p
Wea
k P
ull-d
own
Méd
ium
Pul
l-dow
n
Str
ongl
y D
riven
Hig
h
Ap
pro
xim
ate
Val
ué
70 u
A
1 m
A
12 m
A
200
HA
1 m
A
¡ ee
VQ
H s
peci
f ica
tíon
Slro
ngly
Priv
en L
ow
j ee V
OL s
peci
ficatio
n
NO
TE
:
The
se t
ypic
al m
áxim
um v
alí a
s ar
e ap
prox
imat
e; t
hey
are
prov
ided
for
refe
renc
e on
ly í
nd a
re n
ot
guar
ante
ed.
B-1
0
rSI
GNA
L DE
SCRI
PTIO
NS
Tab
le B
-5.
8X
C1
96
KC
/KD
68-
Lead
PLC
C P
acka
ge P
in A
ssig
nm
en
ts
Pin
No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 '30 31 32 33 34
Pin
Funct
ion(s
)
Vcc
EA
#
NM
I
P0.
3/A
CH
3
P0.
1/A
CH
1
PO
.O/A
CH
O
P0.
2/A
CH
2
P0.
6/A
CH
6/P
MO
DE
.2
P0.
7/A
CH
7/P
MO
DE
.3/E
XTIN
T
P0.
5/A
CH
5/P
MO
DE
.1
P0.
4/A
CH
4/P
MO
DE
.O
AN
GN
D
VR
EF
Vss
P2.
2/E
XT
INT
/PR
OG
ÍI
RE
SE
T#
P2.
1/R
XD
/PA
LES
P2.
0/T
XD
/PV
ER
P1.
0
P1.
1
P1.
2
P1.
3/P
WM
1
P1.
4/P
WM
2
HS
I.O
•
HS
I.1
HS
I.2/H
SO
.4
HS
I.3/H
SO
.5
HS
O.O
HS
O.1
P1.
5/B
RE
CM
f
P1.
6/H
LDA
*
P1.
7/H
OLD
#
P2.
6/T
2UP
-DN
/CP
VE
R
HS
0.2
Pin
No.
35 36 37 38 39 40 41 42 43 44 45 46 47 4a 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
'.66 67
*
68
Pin
Funct
lon(s
)
HS
O.3
Vss
VpP
P2.
7n"2
CA
PT
UR
E/P
AC
T#
P2.
5/P
WM
O
WR
#/W
RL#
BH
E#/
WR
H#
P2.
4/T
2RS
T/A
INC
#
RE
AD
Y
P2.
3/T
2CLK
P4.
7/A
D15
P4.
6/A
D14
P4.
5/A
D13
P4.
4/A
D12
P4.
3/A
D1
1
P4.
2/A
D10
P4.
1/A
D9
P4.
0/A
D8
P3.
7/A
D7
P3.
6/A
D6
P3.
5/A
D5
P3.
4/A
D4
P3.
3/A
D3
P3.
2/A
D2
P3.
1/A
D1
P3.
0/A
DO
RD
#
AL
E/A
DV
*
INS
T
BU
SW
IDT
H
CLK
OU
T
XT
AL2
XT
AL1
Vss
B-1
1
Í96K
C/K
D¡:
;iG
NA
LD
ES
ÓW
ÍPTI
ON
S
Tab
le B
-6.
8XC
196K
C/K
D 8
0-Le
ad Q
FP
Pac
kag
e P
in A
sslg
rim
ents
Pin
No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Pin
Funct
lon(s
)P
3.1/
AD
1
P3.
0/A
DO
RD
#
ALE
/AD
Vff
1NST
BU
SW
IDTH
CLK
OU
T
XT
AL2
:
XT
AL1
Vss
Vss
Veo Vcc
EA#
NM
!
P0.
3/A
CH
3
P0.
1/A
CH
1
PO
.O/A
CH
O
P0.
2/A
CH
2
P0.
6/A
CH
6/P
MO
DE
.2
P0.
7/A
CH
7/P
MO
DE
.3/E
XT
INT
No
Con
nect
lon
P0.
5/A
CH
5/P
MO
DE
.1
P0.
4/A
CH
4/P
MO
DE
.O
AN
GN
D
VREF
Vss
P2.
2/E
XT
INT
/PR
OG
*
Vcc
RE
SE
Tií
j
P2.
1/R
XD
/PA
LE#
P2.
0/T
XD
/PV
ER
Vss
P1.
0
P1.1
P1.
2
P1.
3/P
WM
1
P1.
4/P
WM
2
HS
I.O
HS
I.1
Pin
No.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
•
65
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
Pin
Funct
lon(a
)H
SI.2
/HS
O.4
Vss
HS
I.3/H
SO
.5
HS
O.O
HS
0.1
P1.
5/B
RE
Q*
P1.
6/H
LDA
*
P1.
7/H
OLD
*
P2.
6^T
2UP
-DN
/CP
VE
R
HS
O.2
Vss
Vcc
HS
O.3
Vss Vss
VPP
P2.
7/T
2CA
PT
UR
E/P
AC
T#
P2.
5/P
WM
O
WR
#AV
RLf
l
BH
EffA
VR
Hí
P2.
4íT
2RS
T/A
INC
i(f
RE
AD
Y
Vss
P2.
3n"2
CLK
P4.
7/A
D15
P4.
6/A
D14
P4.
5/A
D13
P4.
4/A
D12
P4.
3/A
D11
P4.
2/A
D10
P4.
1/A
D9
P4.
0/A
D8
P3.
7/A
D7
P3.
6/A
D6
Vcc
P3.
5/A
D5
P3.
4/A
D4
P3.
3/A
D3
Vss
P3.
2/A
D2
B-1
2
•
ANEXO B,3
TA
PP
EN
DIX
C8X
C19
6KC
/KD
RE
GIS
TE
RS
Thi
s ap
pend
ix p
rovi
des
refe
renc
e in
form
atio
n ab
out
the
regi
ster
s of
the
8X
C19
6KC
/KD
.T
able
C-l
lis
ts t
he m
odul
es a
nd m
ajor
com
pone
nts
of t
he 8
XC
196K
C/K
D w
ith
thei
r re
late
dco
nfig
urat
ion
and
stat
us r
egis
ters
. T
able
C-2
lis
ts th
e ho
rizo
ntal
win
dow
s (H
Win
dow
s) w
ith
the
spec
ial
func
tion
re
gist
ers
(SFR
s) a
nd f
uncí
ions
ava
ilab
le in
eac
h. T
able
C-3
lis
ts t
heSF
Rs,
arr
ange
d al
phab
etic
ally
by
mne
mon
ic, a
long
wit
h re
gist
er ñ
ames
, ad
dres
ses,
and
res
etva
lúes
. T
able
C-4
lis
ts t
he i
nter
rupt
s of
the
8X
C19
6KC
/KD
, th
e ve
ctor
toc
atio
ns fo
r bo
thno
rma!
and
PT
S in
terr
upt v
ecto
rs,
and
inte
rrup
t pri
orit
ies.
Tab
le C
-5 l
ists
int
erru
pt
sour
ces
wit
h th
eir
rela
ted
inte
rrup
t vec
tors
, th
e m
ask.
bits
tha
t en
able
the
int
emip
ts,
and
the
regi
ster
bits
tha
t se
lect
the
sou
rces
. Fo
llow
ing
the
tábl
es,
indi
vidu
al d
escr
ipti
ons
of t
he r
egis
ters
'are
arra
nged
alp
habe
tica
lly.
Tabl
e C
-1.
Mod
ules
and
Ret
ated
Reg
lste
rs
A/D
AD
_CO
MM
AN
D
AD
_RE
SU
LT .
AD
_TIM
E
IOC
2 Inte
rrup
tsIN
T_M
ASK
INT
_MA
SK
1
INT
_PE
ND
INT_
_PEN
D1
Chl
p C
onflg
.C
CR
HS
I
HSI
_MO
DE
HS
LSTA
TUS
HS
I_TI
ME
IOCO
1OS1
I/O P
orts
IOP
OR
TO
1OP
OR
T1
IOP
OR
T2
IOP
OR
T34
Sta
ckSP
HS
O
HS
O_C
OM
MA
ND
HS
OJT
IME
IOC
1
IOC
2
IOSO
IOS
1
IOS
2 Ser
ial P
ort
BA
UD
_RA
TE
SB
UF
(R
X)
SB
UF
(T
X)
SP
_CO
N
SP
_ST
AT
Wat
chdo
gW
ATC
HD
OG
PTS
PTSB
LOC
K
PTS
CO
N
PT
SC
OU
NT
PTSD
ST
PTS_
REQ
PT
S_S
/D
PTSS
EL
PT
SS
RC
PTSS
RV
Tlm
er 1
T1M
ER1
IOC
1
1OS1
Wln
dow
Sel
ect
WS
R
PW
M
PWM
O_C
ON
TRO
L
PW
M1_
CO
NTR
OL
PW
M2_
CO
NT
RO
L
IOC
2
IOC
3 Tlm
er 2
TIM
ER
2
T2
CA
PT
UR
E
IOC
O
IOC
1
IOC
2
1OC
3
Zer
oZE
RO
_RE
G
C-1
8XC
196K
C/K
D R
EG
IST
ER
Tab
le C
-2.
Sp
ecla
l Fun
ctio
n R
egls
ter
(SF
R) H
WIn
do
ws
Hex
Ad
dr.
00 01 02 03 04 05 06 07 08 09 OA
OB
OC
00
Rea
d/W
ríte
Rea
d
WH
te
Rea
d
Wrlt
e
Rea
d
Wrll
e
Rea
d
Wrít
e
Rea
d
Writ
e
Rea
d
Writ
e
Rea
d
WH
te
Rea
d
Wrlt
e
Rea
d
Writ
e
Rea
d
Writ
e
Rea
d
Writ
e
Rea
d
Wrll
e
Rea
d
Writ
e
Rea
d
Writ
e
HW
Indo
w 0
ZE
RO
_RE
G (
LO)
ZE
RO
J3E
G (
LO)
ZE
RO
JHE
G (
Hl)
ZE
RO
_RE
G (
Hl)
AD
_RE
SU
LT
(LO
)
AD
_CO
MM
AN
D
AD
_RE
SU
LT(H
I)
HS
I_M
OD
E
HS
LTIM
E (
LO)
HS
OJT
IME
(LO
)
Hsr
riME
(Hi)
HS
O_T
IME
(H
l)
HS
LS
TA
TU
S
HS
O_C
OM
MA
ND
SB
UF
(R
X)
SB
UF
(TX
)
1NT_
MA
SK
INT
_MA
SK
INT
_PE
ND
1NT_
PE
ND
TIM
ER
1 (L
O)
WA
TC
HD
OG
TIM
ER
1 (
Hl)
ÍOC
2
TIM
ER
2 (L
O)
TIM
ER
2 (
LO)
TIM
ER
2 (
Hl)
TIM
ER
2 (
Hl)
H'Y
Indo
wl
ZE
RO
..RE
6 (
LO)
ZER
O._
RE
G (
LO)
ZE
RO
.,RE
G
(Hl)
ZE
RO
..RE
G (
Hl)
Res
erve
d
AD
_TI\
flE
AD
JTIM
E
PT
SS
I-L(L
O)
PT
SS
tfL
(LO
)
PT
SS
IÍL
(HI)
PT
SS
IIL
(HI)
PT
SS
RV
(LO
)
PT
SS
I IV
(LO
)
PT
SS
MV
(HI)
PT
SS
TV
(H
l)
INTJv
AS
K
INT
Jv.A
SK
INT
_FE
ND
INT
_FE
ND
Res
eí /
ed
Res
eive
d
IOC
3 (N
ota
2)
IOC
3 {
Not
e 2)
Res
é ve
d
HW
Indo
w 1
5
ZE
RO
_RE
G (
LO)
ZER
O__
RE
G (
LO)
ZE
RO
_RE
G (
Hl)
'
ZE
RO
_RE
G (
H!)
AD
J3O
MM
AN
D
AD
_R
ES
ULT
(LO
)
HS
I_M
OD
E
AD
_R
ES
UL
T(H
I)
HS
O_T
IME
(LO
)
HS
LT
IME
(LO
)
HS
OJT
IME
(H
l)
HS
I_JI
ME
(HI)
HS
O_C
OM
MA
ND
HS
LS
TA
TU
S, b
its 0
, 2, 4
, 6
SB
UF
(T
X)
SB
UF
(RX
)
INT
_MA
SK
INT
_MA
SK
INT
^PE
ND
INT
.PE
ND
WA
TC
HD
OG
TIM
ER
1 (L
O)
IOC
2, e
xcep
t bil
7 (
Not
e 1)
TIM
ER
1 (H
l)
T2C
AP
TU
RE
(LO
)
T2C
AP
TU
RE
(LO
)
T2C
AP
TU
RE
(H
l)
T2C
AP
TU
RE
(H
l)
C-2
"BX
C19
6KC
/KD
RE
QIS
TE
RS
Tab
le C
-2.
Spe
clal
Fun
ctlo
n R
egls
ter
(SF
R)
HW
Ind
ow
s (C
on
tin
uad
)
Hex
Addr.
OE
OF
10 11 12 13 14 15 16 17 18 19
Rea
d/W
rlte
Rea
d
Writ
e
Rea
d
Wrlt
e
Rea
d
Writ
e
Rea
d
Wrlt
e
Rea
d
Writ
e
Rea
d
Writ
e
Rea
d
Writ
e •
Rea
d
Writ
e
Rea
d
Writ
e
Rea
d
Wrt
te
Rea
d
Writ
e
Rea
d
Writ
e
HW
Indo
w 0
IOP
OR
TO
BA
UD
_RA
TE
ÍOP
OR
T1
IOP
OR
T1
IOP
OR
T2
IOP
OR
T2
SP
_ST
AT
SP
_CO
N
INT_P
EN
D1
INT
_PE
ND
1
INT
_MA
SK
1
INT
_MA
SK
1
WS
R
WS
R
loso
IOC
O
IOS
1
IOC
1
IOS
2
PW
MO
_CO
NT
RO
L
SP
(LO
)
SP
(LO
)
SP
(H
l)
SP
(H
l)
HW
Indo
w 1
Res
erve
d
Res
erve
d
Res
erve
d
Res
erve
d
INT_P
EN
D1
INT
^PE
ND
!
INT
_MA
SK
1
INT
_MA
SK
1
WS
R
WS
R
Res
erve
d
PW
M2_
CO
NT
RO
L
PW
M2_C
ON
TR
OL,
PW
M1_
CO
NT
RO
L
PW
M1_
CO
NT
RO
L
SP
(LO
)
SP
(LO
)
SP
(H
l)
SP
(H
l)
HW
Indo
w 1
5
Res
erve
d
Res
erve
d
Res
erve
d
SP
_CO
N
SP
_ST
AT
(N
ote
3)
INT_P
EN
D1
INT_P
EN
D1
INT_
_MA
SK
1
1NT_
MA
SK
1
WS
R
WS
R
IOC
O,
exce
pt b
it 1 (
No
tel)
IOS
O, e
xcep
t bits
6 a
nd 7
IOC
1
IOS
1 ,
exce
pl b
its 6
and
7 (
Not
e 3)
PW
MO
__C
ON
TRO
L
IOS
2 (N
ote
3)
SP
(LO
)
SP
(LO
)
SP
(H
l)
SP
(H
l)
NO
TE
S:
1. IO
C2.
7 a
nd IO
C0.
1 a
re n
ot la
tche
d a
nd w
ill re
ad a
s "1
" (p
rech
arge
d b
us)
,
2. T
he I
OC
3 r
egls
ter w
as p
revi
ousl
y ca
lled
T2C
ON
TR
OL
or T
2CN
TC
.
3. W
ritin
g to
the
SP
_ST
AT
, IO
S1,
and
IO
S2
regi
ster
s In
HW
Indo
w
15 s
eis
the
stat
us b
its,
but
does
not
cau
sein
terr
upts
.
C-3
Mie
l./ 8X
C19
6KC
/KD
RE
GIS
TE
RS
Table
C-3
. SF
R Ñ
ame,
Ad
dre
ss, a
nd R
eset
Sta
tus
Re
gls
ter
Mn
em
on
lcA
D_C
OM
MA
ND
AD
_RE
SU
LT
AD
_TIM
E
BA
U D
ÓR
ATE
HS
LMO
DE
HS
L.S
TA
TU
S
HS
LTIM
E
HS
O_C
OM
MA
ND
HS
OJT
IME
INT
_MA
SK
INT_M
AS
K1
INT_P
EN
O
INT_P
EN
D1
loco
IOC
1
IOC
2
IOC
3
IOP
OR
TO
10P
OR
T1
Re
gls
ter
Ñam
e
A/D
Com
man
d R
egls
ter
A/O
Res
ult
Reg
lste
r
A/D
Tim
e R
egis
ter
Bau
d R
ata R
egls
ter
HS
I Mod
e R
egls
ter
HS
I Sta
tus
Reg
lste
r
HS
I Tim
e R
egis
ter
HS
O C
om
mand
Reg
iste
r i
HS
O T
ima
Reg
lste
r
Inte
rrup
t M
ask
Reg
lste
r .
Inte
rrup
t M
ask
Reg
lste
r 1
Inte
mip
t P
endl
ng R
egls
ter
Inte
rrup
t P
endi
ng R
egls
ter 1
I/O C
ontr
ol R
egls
terO
I/O C
ontr
ol R
egls
ter
1
I/O C
ontr
ol R
egis
ter
2
I/O C
ontr
ol R
egls
ter
3
Por
t 0 R
egls
ter
Por
t 1
Reg
lste
r
Hex
Ad
dr. 02
03,0
2 03 OE
03 06
05,0
4 06
05,0
4 08 13 09 12 15 16
OB
OC
OE OF
Bln
ary
Res
et V
alu
é
XX
XX
X
XX
X
0111
11
11
1100
00
00
1111
111
100
00
00X
0
1111
111
1xo
xo
xoxo
xxxx
xx
xx
xxxx
xx
xx
xxxx
xx
xxxx
xx
xxxx
xx
xx
xxxx
0000
00
00
0000
00
00
0000
00
00
0000
00
00
0000
00
X0
0010
00
01
XOO
O
0000
KC
-B
1111
00
10K
C-C
K
D
1111
00
00
xxxx
xx
xx11
11 1
111
C-4
8XC
196K
C/K
D R
EG
IST
ER
S
Table
C-3
. S
FR
Ñam
e, A
dd
ress
, and
Res
et S
tatu
s (C
ontln
ued)
Re
gls
ter
Mnem
onlc
IOP
OR
T2
IOP
OR
T34
loso
IOS
1
IOS
2
PT
SS
EL
PT
SS
RV
PW
MO
_CO
NT
RO
L
PW
M1_
CO
NT
RO
L
PW
M2_
CO
NT
RO
L
SB
UF
(R
X/T
X)
SP
SP
_CO
N
SP
_ST
AT
T2C
AP
TU
RE
TIM
ER
1
TIM
ER
2
WA
TC
HD
OG
WS
R
ZE
RO
_RE
G
Regls
ter
Ñam
e
Por
t 2
Reg
lste
r
Por
t 3
and
4 R
egis
ter
I/O S
tatu
s R
egls
ter
0
I/O S
tatu
s R
egls
ter
1
l/O-S
tatu
s R
egls
ter 2
PT
S S
elec
t Regls
ter
PT
S S
ervi
ce R
egls
ter
PW
MO
Contr
ol R
egls
ter
PW
M1 C
ontr
ol R
egis
ter
PW
M2
Con
trol
Reg
iste
r
Ser
ial
Por
t B
uffe
r
Sta
ck P
olnt
er
Ser
ial P
ort
Con
trol
Reg
lste
r
Ser
ial
Por
t S
tatu
s R
egis
ter
Tim
er 2
Cap
ture
Reg
lste
r
Tlm
er 1
Val
ué R
egls
ter
Tim
er 2
Val
ué R
egis
ter
Wat
chdo
g T
imer
Reg
iste
r
Wln
dow
Sel
ect R
egis
ter
Zer
o R
egis
ter
Hex
Ad
dr. 10
1FFE 15 16 17
05
,04
07,0
6 17 16 17 07
19,
18 11 11
OD
, OC
OB
.OA
OD
, OC OA 14
01,0
0
Bln
ary
Res
et V
alu
é
1100
00
01
1111
1111
111
1
1111
0000
00
00
0000
00
00
0000
00
00
0000
00
00
0000
00
00
0000.
0000
00
00
0000
0000
00
00
0000
00
00
0000
00
00
0000
00
00
0001
11
01
0001
10
00
0000
10
11
0000
10
11
xxxx
xx
xx
xxxx
xx
xx00
00
0000
00
00
0000
0000
00
00
0000
00
00
. xx
xx
xxxx
XX
XX
00
00
0000
00
00
0000
00
00
C-5
Miel
,8X
C19
6Kt/
KD
RE
GIS
TI
A/D
Com
mand
Re
gls
ter
AD
CO
MM
AN
Dí
02H
MW
Indo
w O
(Wrl
te),
HW
ind
ow
15
(Rea
d)
rTh
e A
/D C
omm
and
Reg
iste
r se
lect
s th
e^A
/D c
hann
el n
umbe
r to
be
conv
erle
d, c
ontr
ols
whe
ther
the
A/D
con
vert
er s
tart
s im
med
iaíe
ly o
r w
ith a
n H
SO c
omm
and,
and
sel
ects
eith
er8-
bito
r 10
-b¡t
conv
ersi
ón m
ode.
\D
•
~
7 6
5 4
3 2.
1
0
R
R
R
I
AD
_CH
AN
_SE
L
GO
;
. A
D M
On
F
Bit
Num
ber{s)
0-2
3 4 5-7
Bit
Mne
mon
lc
AD
_CH
AN
_SE
L
GO
AD
_MO
DE
—
Bit
Ñam
e ,
Res
etS
tate
A/D
Cha
nnel
; X
XX
Sel
ectio
n
( !; [
A/D
Con
vers
ión
Sou
rce
A/D
Con
vers
ión
Mod
a
—
X X XX
X
Desc
rlptlo
n
Thes
e th
ree
bits
sel
ect t
he c
hann
elnu
mbe
r for
con
vers
ión:
Bit
2 1
0
Cha
nnel
00
0
AC
HO
0 0
1
ACH1
0 1
0 A
CH
20 1
1
AC
H3
1 0
0 A
CH
41 0
1
AC
H5
1 1
0 A
CH
61
1 t
AC
H7
This
bit
dete
rmin
es a
l wha
t pol
nt a
conv
ersi
ón Is
to s
tart:
1= S
tart
Imm
edia
tely
0=
HSO
initi
ates
con
vers
ión
Thls
bit
dete
rmin
es w
heth
er a
n 8-
bit o
r a10
-bit
conv
ersi
ón Is
to b
e pe
rform
ed.
1= 8
-bÍt
conv
ersi
ón0*
10
-bil
conv
ersi
ón
Res
erve
d; a
lway
s w
rite
as z
ero.
8XC
196K
C/K
D R
EQ
IST
ER
S
A/D
Res
ult
Reg
lste
rA
DJE
SU
LT
03/0
2H
HW
ind
ow
O (R
ead
), H
Win
do
w 1
5 (W
rlte
)
The
AD
_RE
SUL
T rc
gist
er c
onsi
sts
of t
wo
byte
s. T
he h
igh
byte
con
tain
s th
e ei
ght
mos
t-si
gnif
ican
t bi
ts f
rom
the
A/D
con
vert
er.
The
low
byt
e in
dica
tes
the
A/D
cha
nnel
num
ber
that
was
use
d fo
r th
e co
nver
sión
, in
dica
tes
whe
ther
a c
onve
rsió
n is
cur
rent
ly i
n pr
ogre
ss,
and
cont
ains
the
tw
o le
ast-
sign
ific
ant
bits
fro
m
a te
n-bi
t A
/D c
onve
rsió
n. T
he A
D_R
ESU
LT
regi
ster
is
clea
red
whe
n a
new
con
vers
ión
is s
tart
ed;
ther
efor
e, t
o pr
even
t lo
sing
dat
a, b
oth
byte
s m
ust
be re
ad b
efor
e a
new
con
vers
ión
star
ts.
AD
^R
ES
UL
T15
14
13
12
11
10
98
76
54
32
1
O
AD
_CH
AN
_NU
M
AD
_ST
AT
US
AD
_MO
DE
_ST
AD
_RE
SU
LTO
AD
_RE
SU
LT1
AD
_HI
A00
40-A
O
Bit
Num
ber(s
)0-2
3 4 5
Bit
Mnem
onlc
AD
_CH
AN
_NU
M
AD_S
TATU
S
AD
_MO
DE
_St
—
Bit
Ñam
e
A/D
Cha
nnel
Num
ber
A/D
Sta
tus
A/D Con
vers
ión
Mod
a
—
Res
etS
tate
000
0 0 0
Desc
rlptlo
n
The
A/D
cha
nnel
num
ber t
hat w
as u
sed
for
the
conv
ersi
ón.
Indí
cale
s th
e st
atus
of t
he A
/D c
onve
rter.
Up
to 8
sta
te ti
mes
are
requ
ired
to s
etth
ls b
it fo
llow
tng
a st
arí c
omm
and.
Whe
nte
stín
g th
ls b
it, w
alt a
t lea
st th
e 8
stat
etim
es.
1 = A
/D c
onve
rsió
n is
In p
rogr
ess
0= A
yDIs
idle
Indí
cale
s w
heth
er th
is is
an
8-bi
t or a
10-
blt c
onve
rsió
n.
1-
8-bÍ
t con
vers
ión
0= 1
0-bi
t con
vers
ión
Res
erve
d; a
lway
s w
rite
as z
ero.
C-9
8XC
196K
CÍ/K
D R
EG
ISTE
RS
AD
R
ES
UL
T
Bit
Num
ber(
s)6 7 B
-15
Bit
Mne
mon
lc
AD
_RE
SU
LT
O
AD
_RE
SU
LT
1
AD
_HI
Bit
Ñam
e
Bit
Oo
f 10
-B¡t
Co
nv.
B¡1
1 of
10-
Bii
Con
v.
A/D
Hig
hR
esul
t
; R
eset
j S
tate
;i ;1 1111
111
0
Des
crlp
tlon
Bit
0 (Ih
e LS
B)
ot a
10-
blt
conv
ersi
ón.
Bit
1 of
a 1
0-bl
t co
nver
sión
.
The
8 m
ost-
slgn
ifica
nt b
its o
í th
e re
sult
from
the
A/D
con
vert
er.
t¡n
iel.
8XC
196K
C/K
D R
EG
ISTE
RS
A/D
Co
nve
rsió
n T
ime
Reg
lste
rA
D_T
IME
03H
HW
indow
1 (
Re
ad
/Wrl
te)
The
A
D_T
1ME
re
gíst
er
prog
ram
s th
e sa
mpl
e ti
me
and
conv
ersi
ón
tim
e fo
r th
e A
/Dco
nver
ter.
The
se v
alúe
s ar
e us
ed w
hen
IOC
2.3
is s
et.
Whe
n IO
C2.
3 is
cle
ar (
80C
196K
B-
com
pati
ble
mod
e) I
OC
2.4
cont
rols
the
sam
ple
and
conv
ersi
ón t
imes
.
The
sa
mpl
e ti
me
(SA
M)
is t
he l
engt
h of
tim
e th
at t
he a
nalo
g in
put
chan
nel
¡s a
ctua
lly
conn
ecte
d to
the
sam
ple
capa
cito
r. S
ampl
e ti
me
m'is
t be
lon
g en
ough
to
allo
w t
he s
ampl
eca
paci
tor
to c
harg
e pr
oper
ly,
but
not
so l
ong
that
the
inp
ut w
ill
chan
ge a
nd c
ause
err
ors.
The
conv
ersi
ón
tim
e (C
ON
V)
dete
rmin
es
the
leng
th o
f ti
me
requ
ired
to
con
vert
the
ana
log
volt
age
on t
he s
ampl
e ca
paci
tor
to a
dig
ital
val
ué.
Con
vers
ión
tim
e m
ust
be l
ong
enou
gh t
oal
low
the
com
para
tor
lo s
ettl
e an
d re
solv
e th
e vo
ltag
e, b
ut n
ot s
o lo
ng t
hat
the
sam
ple
capa
cito
r w
ill
dísc
harg
e an
d lo
se a
ccur
acy.
AD
T
IME
76
54
32
10
Bit
Num
ber(
s)0-4
5-7
Bit
Mne
mon
lc
CO
NV
SA
M
Bit
Ñam
e
A/D
Co
nve
rtT
ime
A/D
Sam
ple
Tim
e
Res
etS
tate
1111
1
111
Des
crlp
tlon
Th
ese
bits
spe
ctfy
the
conve
rsió
n ti
me.
CO
NV
mus
t be
(ro
m 2
to 3
1 , i
ncl
usi
ve.
Th
ese
bits
spe
clfy
the
sam
ple
time.
SA
Mm
ust
be f
rom
1 to
7, in
clusi
ve.
NO
TE
S:
1. T
he r
egis
ter
pro
gra
ms
the s
peed
at w
hlc
h t
he A
/D c
an r
un —
not
the
spe
ed a
t whi
ch It
can
con
vert
corr
ect
ly. C
onsu
lt th
e d
ata
sheet
for
reco
mm
ended v
alú
es.
2. I
nttía
lize
the A
/D r
eg
lste
rs In
thls
ord
er:
AD
_T
IME
, IO
C2,
and
AD
__C
OM
MA
ND
.
3. D
o n
ol s
tart
a c
on
vers
ión u
slng
the
AD
__TI
ME
re
gis
ter
(IO
C2.3
-1)
wh
en a
n 8
0C
196K
B-c
om
patib
leco
nve
rsió
n {
IOC
2.3
-0)
Is in
pro
gre
ss, an
d v
lce v
ers
a.
C-1
0C
-11
8XC
1C6K
C/K
D R
EG
ISTE
RS
AD
JTIM
E
The
fol
low
ing
form
ulas
are
use
d to
com
pute
sam
ple
and
conv
ersi
ón t
imes
.
SA
M=
(TsA
MxF
osc-
2)/4
CO
NV
= [(
TC
QN
VxF
olS
O-3
í/B
j_]
/ i
whe
re:
TSA
M
¡s th
e sa
mpl
e tim
e, in
fis
ec,
íro
m t
he d
ata
shee
t
TCO
NV
is
the
conve
rsió
n li
me,
ín jr
sec,
(ro
m t
he d
ata
shee
t
Fose
is
the
XT
AL1
Ire
quen
cy, i
r M
Hz
B
is t
he n
umbe
r oí
bits
to
be c
onve
rted
(8
or 1
0)
rinte
l.8X
C19
6KC
/KD
RE
GIS
TER
S
Bau
d R
ate
Reg
lste
rB
AU
D^R
AT
EO
EH
HW
ind
ow
O(W
rite
)
The
Bau
d R
ate
regi
ster
sel
ects
the
ser
ial
port
bau
d ra
le a
nd c
lock
sou
rce.
U m
ust
be w
rilt
enw
ith
two
byie
s, t
he l
east
-sig
nifí
cant
by
le f
irst
. T
he
mos
t-si
gnif
ican
t bi
t se
lect
s th
e cl
ock
sour
ce.
The
lo
wer
15
bits
rep
rese
n! B
AU
D_V
AL
UE
, an
uns
igne
d in
tege
r th
at
dete
rmin
esth
e ba
ud r
ate.
BA
UD
_VA
LU
E h
as a
máx
imu
m v
alué
of
32,7
67 a
nd c
an e
qual
zer
o on
lyw
hen
usin
g X
TA
Ll
in a
sync
hron
ous
mod
es 1
, 2, a
nd 3
.
BA
UD
_RA
TE
15
14
13
12
11
10
97
65
43
21
0
BA
UD
J/A
LUE
CLO
CK
_SR
CA
0042
-AO
Bit
Num
ber(
s)0-1
4
15
Bit
Mne
mon
lc
BA
UD
_VA
LU
E
CL
OC
K^
SR
C
Bit
Ñam
e
Baud
Rat
e
Seria
l Por
tCl
ock
Sour
ce
Res
etS
tate
000000X
000
00 O
Ox
0
Des
crlp
tlon
Th
ese
bits
con
stltu
te t
he B
AU
D_V
AL
UE
.Lo
ad th
e le
ast-s
lgni
fican
t by
le f
irst.
Thls
bit
dete
rmin
es w
heth
er t
he s
eria
lpo
rt i
s cl
ocke
d (
rom
an
inte
rnal
or
anex
tern
a! s
ourc
e.
1»
XT
AL
1 (In
tern
al s
ourc
e)0=
T2C
LK
(ex
lern
al s
ourc
e)
C-1
2C
-13
^8X
C19
6KC
/KD
RE
GIS
TR
SiT
C
BA
UD
_RA
TE
The
fol
low
ing
form
ulas
are
use
d ¡n
det
erhi
ning
bau
d ra
les.
i r*
Syn
chro
nous
Mod
e 0:
BA
UD
_VA
LUÉ -
fose
Asy
nchr
onou
s M
odes
1,2
, an
d 3:
B
AU
D_V
ALU
E •
Bau
d R
ate
x 8
Fose
-1
or
;-1
or
T2C
LKB
aud
Rat
e
T2C
LKB
aud
Rat
e x
16
' "'
B
aud
Rat
e x
8
where
: f B
Fos
e
's t
he X
TA
L1 [
requ
ency
, !n
NÍH
z
Co
mm
on
baud r
ale
val
úes
usi
ng X
TA
L1
at
16 M
Hz
are
sh
ow
n b
elo
w.
Bau
dR
ate
9600
4800
2400
1200 300
íBA
UD
V
ALU
É
Mod
,3 0
83¿O
H
86ÍÍ2
H
8DÓ
4H
9AC
AH
E82.
BH
Mod
es 1
, 2, 3
8067
H
80C
FH
81A
OH
8340
H
8D04
H
C-1
4
8XC
196K
C/K
D R
EG
ISTE
RS
Chl
p C
on
fig
ura
ron
Reg
lste
rC
CR
The
Chi
p C
onfi
gura
ron
Reg
iste
r (C
CR
) co
ntro
ls P
ower
dow
n m
ode,
bus
wid
th,
bus
cont
rol
sign
áis,
int
erna
l R
EA
DY
mod
e, a
nd i
nter
nal
mem
ory
prot
ecti
on,
In n
orm
al o
pera
ting
mod
e, t
he C
CR
is
load
ed f
rom
the
Chi
p C
onfi
gura
ron
Byt
e (C
CB
) al
loca
tion
201
8H i
n ei
ther
int
erna
l or
ext
erna
l m
emor
y, d
epen
ding
on
the
stat
e of
the
EA
#pi
n.
(EA
# lo
w
sele
cts
exte
mal
m
emor
y;
EA
# hi
gh
sele
cts
inie
rnal
m
emor
y.)
ínpr
ogra
mm
ing
mod
e, t
he C
CR
is
loa
ded
from
th
e P
rogr
amm
ing
Chi
p C
onfi
gura
ron
Byt
e(P
CC
B).
The
CC
B o
r PC
CB
¡s
the
firs
t by
te f
etch
ed f
rom
m
emor
y af
ter
a de
vice
res
et.
The
CC
R i
s lo
aded
onl
y on
ce d
urin
g th
e re
set
sequ
ence
; on
ce i
t is
loa
ded,
the
CC
R c
anno
t be
chan
ged
unti
l th
e ne
xt d
evic
e re
set.
If t
he R
EA
DY
pin
is
pul
led
low
dur
ing
the
CC
R
felc
h,
the
bus
cont
roll
er a
utom
atic
ally
inse
rís
a m
áxim
um o
f th
ree
wai
t st
ates
int
o th
e C
CR
bus
cyc
le.
Thi
s al
low
s a
CC
R
fetc
hfr
om s
low
mem
ory.
CC
R.4
and
CC
R.5
con
trol
the
num
ber
of w
ait
stat
es i
nser
ted
into
the
bus
cycl
e.
CC
R7
65
43
21
0
PD
BW
O
WR
AL
E
IRCC
TIR
C1
LOCO
LOC
1
C-1
5
Cin
tel,
8XC
1J6K
C/K
D R
EG
ISTE
RS
CC
R Bit
Num
ber(
s)0 i 2 3 4
-5
6-7
Bit
Mne
mon
lc
PD BW
O
WR
ALE IRC
O-IR
C1
LOC
O-L
OC
1
Bit
Ñam
e
Pow
erdo
vn
Ena
ble
Bus
wid
trí-
Con
trol
Sel
ect W
He
Slro
be M
xie
Sel
ect
Add
ress
Val
id S
tr( b
eM
ode
Inte
rnal
Rea
dyC
ontr
ol
Lock
Bits
Res
etS
tate
1 1 i l 10 00
Des
crip
tton
Con
lrols
whe
ther
the ID
LPD
#2
Inst
rudl
on c
ause
s th
e de
vlce
to e
nter
Pow
erdo
wn m
ode.
Cle
arln
g th
ls b
it al
rese
t can
pre
vent
acc
iden
tal
eñlry
Into
Pow
erdo
wn
mod
e.
1-
enaW
e P
ower
dow
n m
ode
0=
dlsa
ble
Pow
erdo
wn
mod
e
Sel
ects
dyn
amlc
or 8-
blt
bus
wfd
lh.
1-
dyna
mlc
bus
wid
th; b
us w
ldth
Isco
ntro
lled
by th
e B
US
WID
TH
pin
BU
SW
IDT
H-1
,16
-bltb
us
BU
SW
IDT
H=0
, 8-b
lt bu
s
0«
the
devl
ce Is
lock
ed In
to 8
-blt
mod
ean
d th
e B
US
WID
TH
pin
ís ¡g
nore
d
Sel
ects
Ihe
wrlt
e s
trobe
sig
náis
to b
ege
nera
ted
(or
16-b
lt cy
cles
:
1-
WR
# an
d B
HE
# ar
e ge
nera
ted
InS
tand
ard
Bus
and
Add
ress
Val
idS
trob
e m
odas
.
0-
WR
L# a
nd W
RH
# ar
e g
ener
ated
InW
rlte
Str
obe
and
Add
ress
Val
id w
ithW
rite
Stro
be m
odes
.
Sel
ects
the
add
ress
val
ld s
igná
is to
be
gene
rale
d.
1-
ALE
Is g
ener
ated
to la
tch
the
valid
addr
ess
in S
tand
ard
Bus
and
Wrlt
eS
trobe
mod
es.
0= A
DV
ff Is
gen
eral
ed in
pla
ce o
f A
LEan
d ca
n be
use
d as
a s
impl
e ch
lpse
lect
for
exte
rnal
mem
ory.
Llm
lt th
e nu
mbe
r of
wal
t st
ates
thal
can
be in
serte
d w
hlle
the
RE
AD
Y p
in is
hel
dlo
w. W
alt s
tate
s ar
a In
serte
d in
to Ih
e bu
scy
cle
elth
er u
ntll
the
RE
AD
Y p
in is
pul
led
high
or
until
thls
Inte
rnal
num
ber
!sre
ache
d.
IRC
1 IR
CO
M
ax. W
alt
Sta
tes
00
1
0 1
21
0
3
1 1
RE
AD
Y p
in c
ontr
olle
d
Det
erm
ine th
e p
rogr
amm
íng p
rote
ctio
nsc
hem
e fo
r In
tern
a! m
emor
y.
LOC
1 LO
CO
P
rote
ctlo
n
0 0
read
and
wrlt
e pro
ted
0 1
read
pro
tect
onl
y1
0
'
writ
e pr
otec
t onl
y1
1 no
pro
tect
lon
T8X
C19
6KC
/KD
RE
GIS
TER
S
HS
I Mod
e R
egis
ter
HS
IjwoD
E03
HH
WIn
dow
O (W
rlte
), H
Win
dow
15
(Rea
d)
The
HS
I M
ode
regi
ster
con
trol
s, f
or e
ach
HS
I pi
n, w
hich
of
four
typ
cs o
f ev
enls
trig
ger
aca
ptur
e in
to t
he H
SI
FIF
O: e
ach
posi
tive
tran
sitio
n, e
ach
nega
tivo.
tran
sitio
n, e
very
tra
nsiti
on(b
oth
posi
tive
and
nega
tive)
, or
a s
erie
s of
eig
ht p
ositi
ve t
rans
ition
s. T
he
pins
mus
í be
indi
vidu
ally
ena
bled
thr
ough
the
IOC
O re
gist
er.
HS
I_M
OD
E7
65
43
21
0
v_r1
"i r
1
SL.
HS
IOJv
tOD
E
HSI1
M
nP
E~
UC
ln
í.»
t~\n
c=
WRI
S M
nnp
A00
43-A
O
Bit
Nu
mb
er(
s)
0-1
2-3
4-5
6-7
Bit
Mn
em
on
lc
HS
IOJv
lOD
E
HS
I1_M
OD
E
HS
I2_M
OD
E
HS
I3_M
OD
E
Bit Ñ
am
e
HS
I.O M
ode
HS
I.1 M
ode
HS
I.2 M
ode
HS
I.3 M
ode
Res
etS
tate
11 11 11 11
De
sc
rip
tlo
n
HSI
.O tr
ansi
tion
mod
e
HS
I.1 tr
ansi
tion
mod
e
HS
I.2 tr
ansi
tion
mod
e
HS
I.3 t
rans
ltion
mod
e
Eac
h tw
o-bi
t fie
ld d
efin
es t
he tr
ansi
tion
mod
e fo
r th
e co
rres
pond
ing
pin:
Tra
nsltl
on M
ode
Enc
odln
g
Bft
10 0 1 1
Blt
O
0 1 0 1
Des
crip
tlon
Eig
ht p
ositi
ve t
rans
itlon
s tri
gger
a c
aptu
re in
to th
e H
SI F
IFO
.
Eac
h po
sitiv
e tra
nsili
on t
rlgge
rs a
cap
ture
Into
the
HS
I FIF
O.
Eac
h ne
gativ
e tran
sitio
n tr
igge
rs a
cap
ture
ínto
the
HS
I FIF
O.
Eve
ry tra
nsiti
on (b
oth
pos
itive
and
neg
ativ
e) t
rigge
rs a
cap
ture
into
Ihe
HS
I FIF
O.
C-1
6C
-17
RE
GIS
TE
RS
F
¡niel.
HS
I Sta
tus
Reg
iste
rH
SLS
TA
TU
S;
06H
HW
Indo
w 0
-r(R
ead)
, HW
Indo
w 1
5 (W
rlte
bits
O, 2
, 4, 6
)
The
HS
LS
TA
TU
S r
egis
ter
indí
cale
s H
SI e
venl
sta
tus
and
curr
ent
pin
stal
es. T
he H
SI_
TIM
Ere
gist
er c
onia
ins
the
asso
ciat
ed t
ime
tag,
Rea
ding
HS
I_T
IME
unl
oads
the
hol
ding
reg
iste
r. lf
you
read
H
SIJ
TIM
E
befo
re
HS
LS
TA
TU
S,
the
stat
us
¡nfo
rmat
ion
asso
ciat
ed
wít
h th
eH
SL
TIM
Eti
mel
agis
los
t.
lf t
he H
SI
hold
ing
regi
.ste
r co
ntai
ns n
o ev
ents
, th
e ev
ent
stat
us b
its
¡n t
his
regi
ster
ar
ein
dete
rmin
ate;
how
ever
, the
pin
sta
te b
íts c
an b
e re
ad a
l an
y ti
me,
Thi
s al
low
s re
adin
g th
eH
SI p
ins
as i
nput
s ev
en w
hen
ihey
are
rol
ena
bled
to
the
HS
I un
ít. W
ríti
ng t
o H
SL
ST
AT
US
¡n H
Win
dow
15
sets
the
eve
nt s
tatu
s bi
ts b
ul d
oes
not
affe
ct t
he p
in s
tate
bit
s. N
ote
that
acu
rren
t pi
n st
ate
is n
ot n
eces
sari
ly r
elat
ad t
o th
e co
rres
pond
ing
even
t st
atus
bit
, sin
ce o
ther
even
ts m
ay h
ave
occu
rred
sinc
e th
e pi
n gt
ate
was
las
t w
ritt
en.
The
IO
CO
reg
iste
r co
ntro
ls t
he a
ltér
nale
fun
ctio
ns
of
HSJ
.O-H
S1.3
, an
d th
e H
SL
MO
DE
regi
ster
con
trol
s th
e pi
n ev
ents
tha
t w
ill
;rig
ger
a ca
ptur
e in
to t
he H
SI F
IFO
.
HS
I S
TA
TU
S7
6 5
4 3,
" 2
1 O
HS
IO_
HS
IO_
•HS
IL
HS
IL
HS
I2_
HS
I2_
HS
I3_
HS
I3
EV
EN
T
ST
AT
EV
EN
T
ST
AT
.EV
EN
T
ST
AT
EV
EN
T
ST
AT
8X
C1
96
KC
/KD
RF
.GIS
TE
RS '
HS
I S
TA
TU
S
Bit
Num
ber(s)
0 1 2 3 4 5 6 7
Bit
Mne
mon
lc
HS
IO_E
VE
NT
HS
IG_S
TAT
HS
ILE
VE
NT
HS
I1_S
TA
T
HS
I2_E
VE
NT
HS
I2_S
TA
T
HS
I3_E
VE
NT
HS
I3_S
TA
T
Bit
Ñam
e
HS
I.O P
inE
vent
HS
I.O P
inS
tatu
s
HS
I.1 P
inE
vent
HS
I.1 P
inS
tatu
s
HS
I.2 P
inE
vent
HS
I.2 P
inS
tatu
s
HS
I.3 P
inE
vent
HS
I.3 P
inS
tatu
s
Resé!
Sta
te0 X 0 X 0 X 0 X
Dé
scrl
plfo
n
1-
an e
vent
occ
urre
d o
n p
in H
SI.O
0=
no e
vent
Cur
rent
(sta
te o
f the
HS
I.O pin
.
1» a
n ev
ent
occu
rred
on
pin H
SI.1
0-
no e
vent
Cur
rent
sta
te o
( th
e H
SI.1
pin
.
1 =
an e
vent
occ
urre
d on
pin
HS
I.20»
no
eve
nt
Cur
rent
sta
te o
í the
HS
I.2 p
in.
1
an e
vent
occ
urre
d o
n p
in H
SI,
30-
no
eve
nt
Cur
rent
sta
te o
f the
HS
I.3 p
in.
C-1
8C
-19
8XC
19U
KC
/KD
RE
GIS
TE
RS
¡nie
l.fm
8XC
196K
C/K
D R
EG
IST
ER
S
HS
I Tim
e R
egis
ter
HS
IJTIM
E04
, 05H
HW
indow
O (
Read),
HW
Indow
15
(Wrlt
e)
HS
O C
om
mand
Re
gis
ter
HS
O^C
OM
MA
ND
06H
HW
Indow
O (
Wrlt
e),
HW
Indow
15 (
Read)
The
HSI
Tim
e re
gist
er c
onta
ins
the
timo,
wíth
res
pect
to
the
Tim
er I
cou
nt v
alué
, at
whi
chan
HSI
eve
nt w
as i
rigg
ered
. Whe
n an
e\t
occu
rs o
n an
HSI
pin
, the
HSI
JTIM
E r
egis
ter
islo
aded
wilh
the
cur
rcnt
16-
bit
Tim
er I
./a
lue.
Thi
s ti
me
is s
tore
d in
to t
he H
SI F
IFO
, alo
ngw
ith t
he f
our e
vent
sta
tus
bits
in
the
HSI
...ST
ATU
S re
gist
er.
Rea
ding
the
HSI
_TIM
E re
gist
er u
nloa
dsM
he h
oidi
ng r
egis
ter.
Ifyo
u re
ad H
SI_T
IME
befo
reH
SLST
AT
US,
the
stat
us i
nfor
mat
ion
as.io
cíat
ed w
ith t
he H
SIJH
ME
tim
e ta
g is
lost
. If H
SIho
idin
g re
gist
er c
onta
ins
no e
vent
s, H
S.'JT
IME
is
inde
term
inat
e. W
ritin
g to
HS
IJH
ME
inH
Win
dow
15
load
s th
e ho
idin
g re
gist
er,'o
verw
ritin
g an
y ot
her d
ata.
HSI
_T
IME
15
14
L
13
— —
• —
12
11
10
9 8
7-
6 5
4 3
2 1
0
~"
II H
-^I
TIM
F{L
n)
HS
I T
IME
(HI)
A00
45-A
O
Bit
Num
ber(s
)0-7 8-15
Bit
Mne
mon
lc
HS
LJIM
E (L
O)
HSI
_TIM
E (H
I)
Bit
Ñam
e
HS
IEve
nl
Tim
e
HS
I E
venl
Tim
e
Res
etS
tate
XX
XX
XX
XX
XX
XX
X
XX
X
De
scrl
ptlo
n
The
low
er e
lght
bits
of
the
HS
I ev
ent
time.
The
upp
er e
lght
bits
of t
he H
SI
even
ttim
e.
The
HSO
mod
ule
can
trig
ger
even
ts a
t sp
ecif
íc t
imes
with
min
imal
CPU
ove
rhea
d. T
heH
SO C
omm
and
Reg
iste
r de
term
ines
wha
t ev
ent
or e
vent
s w
ill
occu
r w
ithín
th
e H
SOm
odul
e at
the
tim
e sp
ecif
ied
in th
e H
SO_T
IME
reg
iste
r.
HS
O C
OM
MA
ND
76
54
32
10
CM
D_T
AG
HS
OIN
T_E
NA
PIN
_CM
D
TIM
ER
_SE
L
CA
M
LOC
KA
00
46
-AO
Bit
Num
ber(s
)0-3
4 5
Bit
Mnem
onlc
CM
D_T
AG
HS
OIN
T_E
NA
PIN
_CM
D
Bit
Ñam
e
HS
OC
omm
ands
Ena
ble/
Dís
able
HS
OIn
terr
upt
Set
/Cle
arS
elec
ted
HS
O P
in
Res
etS
tate
xxxx
X X
Desc
rlptlo
n
Det
erm
ines
wha
t ev
ent
ore
ven
ls w
illoc
cur
at th
e ti
me s
peci
fied
InH
SO
T
IME
. (S
ee I
he "
CM
DJT
AG
Enc
dciln
g" ta
ble.
)
Det
erm
ines
whe
ther
an
HS
O e
vent
gene
rale
s an
inte
rrup
t.
1-
gené
rate
an
Inte
rrup
t0-
no
inte
rrup
t
Whe
n th
ls b
it Is
set
, pr
ogra
mm
ed H
SO
pin
eve
nts
gené
rate
the
HIg
h-S
peed
Out
put
Inte
rrup
t (IN
T03
, 20
06H
) an
dIn
tem
al e
vent
s ge
néra
le th
e S
oftw
are
Tim
er in
terr
upt
(INT
05,
200A
H).
Whe
n a
n In
terrupl I
s ge
nera
ted,
the H
SO
even
t st
atus
bits
ín th
e IO
S1
and
IOS
2re
gíst
ers
mus
t be
Inte
rrog
ated
tode
term
ine
Whí
ch e
vent
cau
sed
the
inte
rnjp
t.
Det
erm
ines
w
heth
er t
he e
ffect
of
aC
MD
T
AG
com
man
d s
ets
or c
lear
s th
esp
eclfí
ed p
in o
r pí
ns.
1=
Se
tth
ep
fn(s
)0=
C
lear
the p
ín(s
)
C-2
0C
-21
8XC
19f
KC
/KD
RE
GIS
TÉR
S
HS
O
CO
MM
AN
D
8XC
196K
C/K
D R
EG
ISTE
RS
Bit
Num
ber(
s)
6 7
Bit
Mnem
onlc
TIM
ER_S
EL
CA
MJ.
OC
K
Bit
Nam
.í
Sele
ctTl
mer
I/
Tím
er 2
LocK
Ení
ryIn
lo C
AM
Res
etS
tate
X X
De
scrl
ptlo
n
Sele
cts
the
timar
rel
eren
ce (o
r Ihe
HSO
com
man
d.
1=
Sele
ct T
imer
20»
Se
lect
Tlm
er 1
Whe
n IO
C2.
6 Is
sel
(com
man
d lo
ckin
gen
able
d), t
hls
bll c
ontro
ls w
heth
er th
eH
SO c
omm
and
Is lo
cked
into
the
CAM
or c
lear
ed a
fter e
xecu
tlon.
1-
Lock
com
man
d In
to C
AM
0=
Ole
ar c
omm
and
Irom
CAM
afte
rex
ecut
ion
Wrlt
íng
a "1
" lo
1O
C2.
7 cl
ears
all
entrl
es(lo
cked
or n
ot)
from
the
CAM
, as
does
ach
lp r
eset
.
CM
DJT
AG
Enco
dln
g
Bit 3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
Bit 2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
Bit 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 t
Bit 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Com
manil
Mne
mon
loHS
OO
HS0
1H
SO
2
HS
O3
HS
04H
SO5
HSO
01 '
HSO
23 *
smo
SWT1
SW
T2
SW
T3
HSO
ALL
*. — T
2RS
T
A D
De
flnlti
on
Swltc
h H
lqh-
Spee
d O
utpu
t 0S
wllc
h H
ígh-
Spee
d O
utpu
t 1S
wltc
h H
lqh-
Spe
ed O
utpu
t 2Sw
ltch
Híg
h-Sp
eed
Out
put 3
Swltc
h H
lah-
Spe
ed O
utpu
t 4Sw
itch
Hig
h-Sp
eed
Out
put 5
Swllc
h H
lqh-
Spee
d O
utpu
ts 0
and
1S
wltc
h H
igh-
Spe
ed O
utpu
ts 2
and
3Pr
ogra
m S
oftw
are
Tlm
er 0
Proq
ram
Sof
twar
e Tí
mer
1Pr
ogra
m S
oftw
are
Tlm
er 2
Proq
ram
Sof
twar
e Tl
mer
3S
wltc
h H
íqh-
Spe
ed O
utpu
ts 0
, 1 ,
2, 3
, 4, 5
Res
erve
d; d
o no
t use
Res
et T
lmer
2St
art a
n A/
D C
onve
rsió
n' I
n Ih
ese
conf
igur
atio
ns, t
wo
or m
ore
pins
ara
¡'at o
r cle
ared
slm
ulta
neou
sly.
HS
O T
ime
Reg
lste
rH
SO
JTIM
E05
/04H
HW
ind
ow
O (W
rlte
), H
WIn
do
w 1
5 (R
ea
d)
The
HSO
Tim
e re
gist
er s
peci
fies
the
tim
e at
whi
ch a
n H
SO c
omm
and
is to
be
exec
uted
. T
heco
mm
and
is
spec
ifie
d by
H
SO_C
OM
MA
ND
.O-H
SO_C
OM
MA
ND
.3,
and
the
tim
errc
fere
nce
is s
elec
ted
by H
SO_C
OM
MA
ND
.6.
Whe
n lo
adín
g ev
ents
int
o th
e C
AM
, w
rite
lo
the
HSO
^CO
MM
AN
D re
gist
er f
irst
, the
n w
rite
to H
SO_T
IME
.
HS
O_T
IME
15
14
13
12
11
10
9 8
7 6
5 4
3 2
1 O
HS
O_T
IME
(LO
)
HS
O_T
IME
(HI)
A00
47-A
O
Bit
Num
ber(s)
0-7 8-15
Bit
Mnem
onlc
HSO
JTIM
E (L
O)
HSO
_TIM
E (H
l)
Bit
Ñam
e
HSO
Com
man
dEx
ecut
íon
Tim
e, L
owBy
te
HS
OC
omm
and
Exe
cutio
nTi
me,
Hlg
hB
yle
Res
etS
tate
xxxx
xxxx
De
scrl
ptlo
n
Thls
is Ih
e lo
w b
yte
o( H
SO_T
IME,
whi
chsp
eclfie
s th
e tim
e at
whi
ch a
n H
SOco
mm
and
is to
be
exec
uted
.
Thls
Is th
e hl
gh b
yte
oí H
SO T
IME
,w
hich
spe
cífie
s th
e tim
e at
vvf
ilch
anH
SO c
omm
and
Is to
be
exec
uted
.
C-2
2C-
23
8XC
196K
/KD
Inte
rrup
t M
ask
Reg
lste
rIN
T_M
AS
K08
HA
ll H
WIn
dow
s (R
ead/
Wrlt
e)
The
Inte
mip
t M
ask
regís
ter
enab
les
or
dis
able
s (m
asks
) in
div
idual
inte
rrupts
. (P
SW
.2glo
bally
ena
bles
or
dis
ablc
s se
rvic
ing o
frll
mask
able
inte
nru
pls
.) I
NT
_M
AS
K c
an b
e r
ead
from
or
wrilte
n t
o a
s a
byt
e r
cgís
ter
in a
l! H
Win
dow
s. I
NT
__M
AS
K i
s th
e l
ow
byt
e o
f th
eP
rogr
am S
tatu
s W
ord
(P
SW
); t
here
fore
, P
US
HF
or
PU
SH
A s
aves
this
regis
ter
on
the
sta
ckan
d P
OP
F o
r P
OP
A r
esto
res
it.
INT
MA
SK
76
54
32
1
O
TIM
EFLM
AS
K
AD
_MA
SK
HS
IDA
TJd
AS
K
HS
OJM
SK
. H
SIO
_MA
SK
. S
WT
_MA
SK
. S
ER
JvlA
SK
, E
XT
INT
MA
SK
C-2
4
8XC
196K
C/K
D
RE
GIS
TE
RS
INT
MA
SK
Bit
Num
ber(
s)
0 1 2 3 4 5 6 7
Btt
Mne
mon
lc
TIM
ER
_MA
SK
AD
^MA
SK
HS
IDA
TJd
AS
K
HS
O_M
AS
K
HSIO
__M
ASK
SW
T_M
AS
K
SE
R_M
AS
K
EXTI
NT_
_MAS
K
Bit
Ñam
e
Tlm
er 1
or
"Orn
ara
Ove
rílow
A/D Con
vers
ión
Com
plet
e
HS
I Dat
aA
valla
bie/
FIFO
Ful
l
HS
O O
utpu
tE
vent
HSI
.OE
xtem
alIn
terru
pt
Sof
twar
eTl
mer
Ser
ial P
ort
EX
TIN
T o
rP0
.7In
terru
pt
Rese
tS
tate
0 0 0 0 0 0 0 0
Descrlptlo
n
Set
ting
thls
bit
enab
les
the
Tlm
erO
veríl
ow in
terr
upt
(INTO
O, 2
000H
). B
olh
Tim
er 1
and
Tim
er 2
can
gen
érat
e th
eIN
TOO
Inte
rrup
t. S
ettin
g IO
C1.
2 se
lecl
sTl
mer
1 a
s a
sour
ce; s
ettln
g IO
C1.
3se
lecl
s Tl
mer
2 a
s a
sour
ce. T
imer
2 c
ange
néra
te e
ither
INTO
O o
r IN
T12,
but
shou
ld n
ot b
e co
nd'g
ured
for b
oth.
Set
tlng
thls
bit
enab
les
the
A/D
Con
vers
ión
Com
plet
e In
terr
upt (
INT0
1.20
02H
).
Set
ting
thls
bit
enab
les
the
HS
I D
ata
Ava
llabl
e In
terru
pt (
INT0
2, 2
004H
).IO
C1.
7 se
lect
s [h
e so
urce
oí t
heIn
terru
pt.
Set
tlng
thls
bit
enab
les
the
Hig
h-S
peed
Out
put
inte
rrupt
(IN
T03,
200
6H).
Set
ting
thls
bit
enab
les
the
HSI
.O P
inin
terr
upt
(INT0
4, 2
008H
).
Set
tlng
thls
bit
enab
les
the
Sof
twar
eTim
erln
terrup
t (IN
T05,
200
AH
).
Set
ílng
thls
bit
enab
les
the
Ser
ial P
ort
inte
rrup
t (IN
T06,
200
CH
). w
hfch
ís th
e80
96B
H-c
ompa
tíble
con
figur
atlo
n.
II th
is b
it Is
sel
, IN
TMA
SK
I.O a
ndIN
TMA
SK
1.1 s
houl
d b
e cl
eare
d,dí
sabl
ing
the
Rec
eíve
and
Tra
nsm
itín
terr
upts
.
Set
ting
this
bit
enab
les
the
EX
TIN
TIn
terru
pt (
INT0
7, 2
00E
H).
IOC
1.1
sele
cts
the
inte
rrup
t sou
rce
(P0.
7 or
P2.
2).
C-2
5
BX
C1
9(
KC
/KD
RE
GIS
TE
RS
*f
«m
«J.In
terr
upt
Mas
k R
egis
ter 1
INT
_MA
SK
113
HA
ll H
WIn
dow
s (R
ead/
Wrlt
e)
The I
nte
rrupl
Mask I
re
gis
ter
en
ab
les
or
dis
ab
les
(mask
s)
ind
ivid
ua
l in
terr
upts
. (P
SW
.2
glo
bally
en
ab
les
or
dis
ab
les
serv
icin
g o
f all
ma
ska
ble
in
tem
ipts
.) I
NT
_M
AS
Kl
can
be
read
from
or
wri
tte
n t
o a
s a b
yie
re
gis
ter
in a
ll H
WÍn
do
ws.
PU
SH
A
save
s th
is re
gis
ter
on
th
e
sta
ck, and
PO
PA
re
sto
res
it.
INT
M
AS
K1
76
54
31
O
TLM
AS
K
RLM
AS
K
HS
I4_M
AS
K
T2
CA
P_
MA
SK
. T
2O
VF
_M
AS
K
, E
XT
INT
1_M
AS
K
. F
IFO
_M
AS
K
. N
MI
MA
SK
C-2
6
8X
C196K
C/K
D R
EQ
IST
ER
S.
INT
MA
SK
1
Bit
Num
ber(
s)
0 i 2 3 4 5 6 7
Bit
Mne
mon
lc
TU
MA
SK
RI_
MA
SK
HS
I4_M
AS
K
T2C
AP
_MA
SK
T2O
VF
_MA
SK
EX
TIN
T1_
MA
SK
FIF
O_M
AS
K
NM
LMA
SK
Bit Ñ
am
e
Tra
nsm
itIn
terrup
t
Rec
elve
Inte
rrup
t
HS
I FIF
O 4
Inte
rrup
t
TIm
er2
Cap
ture
Inte
rrup
t
Tlm
er2
Ove
rfiow
Inte
rrup
t
EX
TIN
T P
inIn
terr
upl
HS
I FIF
OFul
l Int
erru
pt
NM
I
Rese
tS
tate
0 0 0 0 0 0 0 0
Descrlptlon
Set
ting
thls
bit
enaW
ea t
he T
rans
mrt
Inte
rrup
t (IN
T08
, 203
0H).
If th
ls W
t Is
set,
INT
MA
SK
1.1 s
houl
dal
so b
e s
et a
nd IN
TlM
AS
K.6
sho
uld
be
deare
d.
Set
tlng
thls
bH
ena
bles
the
Rec
elve
Inte
rrup
t (IN
T09
, 203
2H).
If th
ls W
t Is
set,
INT
M
AS
K1.
0 sh
ould
also
be s
et a
nd IN
TI.M
AS
K.6
sho
uld b
edeare
d.
Set
ting
thls
bit
enab
les
the H
SI F
IFO
4In
terr
upt
(INT
10, 2
034H
).
Set
ting
thls
bH
ena
bles
the T
lmer
2C
aptu
re I
nter
rupt
(IN
T11
, 203
6H).
Set
ting t
hls
bit en
able
s th
e T
lmer
2O
verfi
ow Int
erru
pt (
INT12
, 203
8H).
IOC
2.5 s
elec
ts th
e ov
erflo
w b
ound
ary
(or
INT12
.
Set
ting th
ls b
H e
nabl
es th
e E
XT
INT
1ln
terr
upt(
INT
13,2
03A
H).
P2.
2 c
an g
enér
ate
eith
er th
e E
XTIN
TIn
terrup
t (IN
T07
) or
the E
XTIN
T1
Inte
rrup
t (IN
T13
).
Set
tlng
thls
bit
enab
les
the
HS
I FIF
O F
üll
Inte
rrup
t {IN
T14
, 203
CH
).
Thl
s n
on-fu
nctío
nal m
ask
brt e
xlst
s fo
rde
slgn
sym
met
ry. T
he N
onm
aska
ble
Inte
rrup
t (N
MI)
is e
nabl
ed fo
r bo
th 0
and
1. A
tway
s w
rlte
zer
o to
thls
bit.
C-2
7
8XC
'I96K
C/K
D R
EG
ISTE
RS
Inte
rrup
t P
endi
ng R
egis
ter
INT_
PE
ND
09H
Ail
HW
Indo
ws
(Rea
d/W
rlte)
Whe
n ha
rdw
are
dele
cts
a pe
ndin
g ¡r
tcm
ipl,
it
sets
ihe
cor
resp
ondi
ng b
it in
IN
T_P
EN
D o
r1N
T_P
EN
D1.
W
hen
the
vect
or
ís
take
n,
the
hard
war
e cl
ears
th
e pe
ndin
g^ b
it.
The
INT
_PE
ND
reg
iste
r can
be
read
fro
rr
or w
ritt
en t
o in
all
HW
indo
ws.
Sof
twar
e ca
n ge
néra
tean
¡nt
erru
pt b
y se
ttin
g th
e co
rres
pond
ing
inte
rrup
t pe
ndin
g b
it.
fNT
P
EN
O7
65
43
21
0
TIM
ER__
PEN
D
AD
J>E
ND
HS
IDA
T_P
EN
D
, HS
CLP
EN
D
. H
SIO
^PE
ND
. S
WT_
PE
ND
.S£R
_PE
ND
. E
XTI
NT
PEN
O
¡nie
l.8X
C19
6KC
/KD
RE
QIS
TER
S
INT
PE
NO
Bit
Num
ber(s)
0 i 2 3 4 5 6 7
Bit
Mne
mon
lc
TIM
ER
^PE
ND
AD
_PE
ND
HS
IDA
T_P
EN
D
HS
O_P
EN
D
HS
ICLP
EN
D
SW
T_P
EN
D
SE
R_P
EN
D
EX
TIN
T_P
EN
D
Bft
Ñam
e
Tim
er 1
or
Tlm
er2
Ove
rtlo
w
A/D
Con
vers
ión
Com
plet
e
HS
I D
ata
Ava
llabl
e/FIF
O F
ull
HS
O O
utpu
tE
vent
HS
I.OE
xter
nal
Inte
rrup
t
Sof
twar
eT
ímer
Ser
ial P
orl
EX
TIN
T P
inor
P0,
7In
terr
upt
Reset
Sta
te
0 0 0 0 0 0 0 0
Des
crlp
tlon
Whe
n s
el,
thls
bit
Indí
cale
s a
pen
ding
Tlm
erO
verílo
w In
terrup
t (IN
TOO
). It
Ísdeare
d w
hen
the
Inte
rrup
t ve
ctor
a (o
2000
H.
Whe
n se
t, th
ls b
it In
díca
les
a p
endi
ngA
/D C
onve
rsió
n C
ompl
ete I
nter
rupt
(INT01
). It
Is d
eare
d w
hen th
e M
terrup
lve
ctor
s to
200
2H.
Whe
n se
t, th
ls b
it In
díca
les
a p
endi
ngH
SI
Dat
a A
valla
ble
Inte
rrup
t (1
NT0
2J. U
Isdeare
d w
hen th
e In
terrup
t ve
ctor
s to
2004
H.
Whe
n s
et, t
hls
bit In
díca
les a
pen
ding
Hlg
h-S
peed
Out
put
Inte
rrup
t (IN
T03
). It
is c
lear
ed w
hen th
e In
terr
upt
vect
ors
to20
06H
.
Whe
n s
et, th
ís b
it In
díca
les a
pen
ding
HS
I.O P
in In
terr
upt
(IN
TW
). It
Is d
eare
dw
ñen
the
Inle
rrup
t ve
ctor
s to
200
8H,
Whe
n s
et,
thls
bit
Indí
cale
s a
pen
ding
Sof
twar
e "H
mer
Inte
rrup
t {IN
T05
), It
¡scl
eare
d w
hen t
he In
terrup
t ve
ctor
s to
200A
H.
Whe
n s
et,
thls
bit
Indí
cale
s a
pen
ding
Ser
ial
Por
t in
terr
upt
(INT
06).
It i
s de
ared
whe
n th
e In
terr
upt
vect
ors
to 2
00C
H.
Whe
n s
et,
thls
bit
Indí
cale
s a
pend
ing
EX
TIN
T in
terr
upt (IN
T07
). It
is c
iear
edw
hen
the
Inle
rrup
t ve
ctor
s to
200
EH
.
C-2
8C
-29
«íny
.8X
C19
6KC
/KD
RE
GIS
TE
RS
Inte
rrupt
Pendin
g R
egls
ter
1IN
T_P
EN
D1
12H
All
HW
Indo
ws
(Rea
d/W
rlte)
Wh
en h
ard
war
e d
etec
ts a
pen
din
g in
ürr
up
t, ¡
t se
ts t
he
corr
esp
on
din
g bi
t in
IN
T_P
EN
D o
r
INT
_P
EN
DI.
W
hen
th
e v
ecto
r is
ta
ken
, th
e h
ard
war
e cl
ears
th
e pe
ndin
g b
it.
Th
e
INT
_P
EN
Dl
reg
iste
r ca
n
be
read
fr
om
or
wri
tten
lo
in
al
l H
Win
do
ws,
S
oft
war
e ca
n
gen
érat
e an
in
terr
up
t b
y s
etti
ng t
he
corr
esp
on
din
g i
nte
nu
pt
pen
din
g b
it.
(NT
P
EN
D1
76
54
3.
21
0
TLP
EN
D
RLP
EN
D
HS
I4_P
EN
D
T2C
AP
_P
EN
D
T2O
VF
JDE
ND
EX
TIN
T1_P
EN
D
FIF
O_P
EN
D
. N
MI
PE
NO
C-3
0
¡nie
l.8X
C19
6KC
/KD
RE
QIS
TE
RS
INT
P
EN
D1
Bit
Num
ber(
s)
0 1 2 3 4 5 6 7
Bit
Mnem
onlc
TI_P
EN
D
RI_
PE
ND
HS
I4_P
EN
D
T2C
AP
_PE
ND
T2O
VF_
PE
ND
EX
TIN
T1_P
EN
D
FIFO
^PE
ND
NM
I_P
EN
D
Bit
Ñam
e
Tran
smit
Inte
rrupt
Rec
elve
Inte
rrupt
HS
I FIF
O 4
Inte
rrupt
Tim
er2
Cap
ture
Inte
rrupt
Tim
er2
Ove
rflow
Inte
rrupt
EX
TIN
T P
inIn
terru
pl
HS
I FIF
OFu
ll In
terru
pt
NM
I
Rese
tS
tate
0 0 0 0 0 0 0 0
De
scrl
ptlo
n
Whe
n se
l, th
ls b
it In
díca
les
a p
endi
ngTr
ansm
it In
terru
pt (
INT0
8). I
l is
ciea
red
whe
n th
e In
terru
pt v
ecto
rs (o
203
0H.
Whe
n se
t, th
ls b
it in
díca
les
a pe
ndin
gR
eceí
ve in
terru
pt (I
NT0
9). I
t Is
clea
red
whe
n th
e In
terru
pt v
ecto
rs lo
203
2H.
Whe
n se
t, th
is b
it In
díca
les
a pe
ndln
gH
SI F
IFO
4 in
terru
pt (
INT10
). It
isde
ared
whe
n th
e in
terru
pt v
ecto
rs to
2034
H.
Whe
n se
t, th
is b
it In
díca
les
a p
endi
ngTl
mer
2 C
aptu
re In
terru
pt (I
NT1
1).
II Is
clea
red
whe
n th
e in
terr
upt v
ecto
rs to
2036
H.
Whe
n se
t, th
ls b
it In
díca
les
a pe
ndin
gTi
mer
2 O
verfl
ow In
terr
upt (
INT1
2). I
t Is
clea
red
whe
n th
e In
terru
pt v
ecto
rs to
2038
H.
Whe
n se
t, th
ls b
it in
díca
les
a pe
ndin
gE
XTI
NT1
Inte
rrupt
(IN
T13)
. It I
s cl
eare
dw
hen
the
inte
rrup
t vec
tors
to 2
03A
H.
Whe
n se
t, th
ls b
it In
díca
les
a pe
ndin
gH
SI
FIFO
Ful
l Int
erru
pt (
INT1
4).
It is
clea
red
whe
n th
e in
terr
upt v
ecto
rs to
203C
H.
Whe
n se
t, th
ls b
it In
díca
les
a pe
ndin
gN
MI
Inte
rrupt
(IN
T15)
. It I
s cl
eare
d w
hen
the
inte
rrup
t vec
tors
to 2
03E
H.
C-3
1
¡niel,
8X
C1
96
KC
/KD
RE
GIS
TE
RS
Input/O
utp
ut
Contr
ol R
egls
ler
OIO
CO
15H
HW
Indo
w O
(Wrlte
), H
WIn
dow
15
(Read)
Th
e
IOC
O r
eg
iste
r se
lect
s th
e e
xte
rna
] clo
ck a
nd
re
set
sou
rce
s fo
r T
imer
2 a
nd
en
ab
les
or
dis
ab
les
the H
SI
inpul
fun
ctio
n o
f th
e' four
HS
I pin
s. W
hen
IO
CO
¡s
read in
H
V/in
do
w 1
5,
IOC
O. I
WÍI
I a
lwa
ys
rea
d a
s "I"
be
cau
je i
ts v
alu
éis
nol
latc
he
d.
IOC
O
76
54
32
1
O
HS
IO_E
NA
SW
JT2R
ST
HS
I1_E
NA
T2
RS
T_
EN
A
. H
SI2
_E
NA
T2
RS
T_
SR
C
HS
I3_E
NA
.T2
CL
K S
RC
C-3
2
8X
C196K
C/K
D R
EG
IST
ER
S
IOC
O Bit
Num
ber(
s)
0 1 2 3 4 5 6 7
Bit M
nem
onlc
HS
IO_E
NA
SW
JT2R
ST
HS
I1_E
NA
T2R
ST
_EN
A
HS
I2_E
NA
T2R
ST
_SR
C
HS
I3_E
NA
T2C
LK_S
RC
Bit Ñ
am
e
Ena
ble
HS
I.Oas
HS
I Inp
ut
Tim
er 2
Sof
twar
eR
eset
Ena
ble
HS
i.Oas
HS
I in
put
Tim
er 2
Ext
erna
lR
eset
Sou
rce
Ena
ble
HS
I.Oas
HS
I inp
ut
Tim
er 2
Res
etS
ourc
e
Ena
ble
HS
I.Oas
HS
I inp
ut
Tim
er 2
Clo
ckS
ourc
e
Rese
tS
tate
0 X 0 0 0 0 0 0
Descrlptlon
Thi
s bi
t con
trol
s w
heth
er e
venl
s on
the
HS
I.O p
in a
re lo
aded
Into
the
HS
I PIF
O.
1-
anab
leda
s H
SI i
nput
0-
disa
bled
as
HS
I inpu
t
Writ
lng a T
lo th
ls b
it re
sets
TJm
er 2
.T
hls
bit w
lll a
lway
s re
ad b
ack
as "1
" ín
HW
Indo
w 1
5.
1-
rese
t Tim
er 2
eac
hwri
te0-
no
act
íon
Thl
s bi
t co
ntro
ls w
heth
er e
vent
s on
the
HS
I.1 p
in a
re lo
aded
Into
the
HS
I F
iFO
.
1*
enab
led
as
HS
I ¡np
ut0-
di
sabl
ed a
s H
SI I
nput
Thl
s bi
t ena
bles
ext
erna
l res
et o
f Tim
er2.
The
ext
erna
l res
et s
ourc
e is
the
risin
ged
ge o
f el
ther
T2R
ST
or
HS
I.O, a
sse
lect
ed b
y IO
C0.
5.
1-
enab
le e
xter
nal r
eset
0-
dlsa
ble
Thi
s bil
cont
rols
whe
ther
eve
nts
on th
eH
SI.2
pin
are
load
ed In
to t
he H
SI F
IFO
.
1-
enab
led
as
HS
I Inp
ut0-
di
sabl
ed a
s H
SI i
nput
Thi
s bi
t sel
ects
the
exíe
rnal
res
et s
ourc
elo
r T
imer
2. IO
C0.
3 m
ust
be s
el to
enab
le t
he e
xter
nal r
eset
.
1 -
H
SI.O
pin
risi
ng e
dge
0-
T2R
ST p
in (P
2.4)
risi
ng e
dge
Thi
s bi
t con
trol
s w
heth
er e
vent
s on
the
HS
I.3 p
in a
re lo
aded
Inlo
the H
SI
FIF
O.
1-
enab
led a
s H
SI i
nput
0= d
isab
led
as
HS
I in
put
Thi
s bi
t se
lect
s th
e ex
íern
al c
lock
sou
rce
for
Tim
er 2
. IO
C3.
0 m
ust b
e de
ared
toen
able
the e
xter
nal c
lock
sou
rce.
1-
HS
I.1 p
in0»
T2C
LK p
in (
P2.
3)
C-3
3
1
¡niel.
^196
KC
/KD
RE
GIS
TER
S
Inpu
t/Out
put
Co
ntr
ol R
egls
tür
1IO
C1
16H
HW
indo
w O
(Wrlt
e), H
Wln
dow
15
(Rea
d)
The
IO
C1
regi
ster
sel
ects
the
outp
u1. f
unct
ions
of
P2.
5 an
d P
2.0;
ena
bles
or
disa
bles
HS
O.4
and
HS
0.5
as
outp
uts;
and
sel
ects
int
erru
pt s
ourc
es f
or E
XT
INT
(IN
T07,
200E
H),
Tim
er
Ove
rflo
w (
INTO
O,
2000
H),
and
HS
l-.D
ata
Ava
iiabl
e (IN
T02, 20
04H
).
IOC
1e
c¿ i ; (.
••2
1 0 I
PW
M_S
EL
_ P
XT
INT
R
RO
Tin
vp
IM
T
•_ T
?nV
F
INT
- H
S04
FN
A
T*n
fiF
l
HS
O'í
FNA
HR
| IN
TA
D05
3-A
O
Bit
Num
t>er
(3}
0
Bit
Mne
mon
lc
PW
M^S
EL
Bit
fía
me
Sel
ecf P
2.5/
PW
M O
utpu
t
Res
etS
tate
1
Desc
rlptlo
n
Thls
bit
cont
rols
whe
ther
P2.
5 fu
nctio
nsas
a P
WM
out
put p
in o
r as
a st
anda
rdou
tput
por
t pin
.
1- P
WM
outp
ut p
in0-
st
anda
rd o
utpu
t por
t pin
¡niel.
8XC
196K
C/K
D R
EG
ISTE
RS
IOC
1 Bft
Num
ber(
s)
1 2 3 4 5 6 7
Bft
Mne
mon
lc
EX
TIN
T_S
RC
T1O
VF
JNT
T20V
FJN
T
HS
O4_
EN
A
TX
D_S
EL
HS
O5_
EN
A
HS
IJN
T
Bft
Ñam
e
Sel
ect
Ext
emal
Inte
rrupt
INT0
7S
ourc
e
Ena
ble
Tlm
er1
Ove
rflow
Inle
rrup
t
Ena
ble
Tim
ar2
Ove
rflow
Inte
rrup
t
Ena
ble
HS
O.4
Pin
as O
utpu
t
Sel
ect P
2.0/
TXD
Out
put
Ena
ble
HS
0.5
Pin
as O
utpu
t
Sel
ect H
SI
Inte
rrup
tS
ourc
e
Rea
etS
tate
0 0 0 0 1 0 0
Desc
rlptlo
n
Thl
s bi
t sel
ects
the
EX
TIN
T e
xtem
alIn
terr
upt
sour
ce (
INT
07, 2
00E
H).
INT_M
AS
K.7
mus
t be s
et lo
ena
ble
the
Inte
rrup
t.
1- P
0.7
0.
P2.2
Bot
h Ti
mer
1 a
nd T
lmer
2 c
an g
enér
ate
the
Tlm
er O
verfl
ow In
lerrup
t (IN
TOO
,20
00H
). T
hls
bit co
ntro
ls w
heth
er a
nov
erílo
w o
n T
imer
1 g
ener
ales
the
Inte
rrup
t. IN
T M
AS
K.O
mus
t be
set
toen
able
the
Inte
rrupt
. IO
S 1
.5 In
díca
les
the
ínle
rrup
t st
atus
.
1«
enab
le T
lmer
1 a
s so
urce
0-
dlsa
ble
Tlm
er 1
as
sour
ce
Bot
h T
lmer
1 a
nd T
imer
2 c
an g
enér
ate
the
Tlm
er O
verfl
ow In
terru
pt (
INTO
O,
2000
H).
Thl
s bi
t co
ntro
ls w
heth
er a
nov
erflo
w o
n Tl
mer
2 g
ener
ales
the
inte
rrup
t. IN
T_M
AS
K.O
mus
t be
set t
oen
able
thd
inte
rrup
t. IO
S1.
4 In
díca
les
the
Inte
rrup
t sta
tus.
1-
enab
le T
imer
2 a
s so
urce
0-
dlsa
ble
Tlm
er 2
as
sour
ce
HS
O.4
is m
ultlp
lexe
d w
ith th
e H
S1.2
Inpu
t pi
n. T
hls
bit
enab
les
the
outp
utfu
nctb
n o
í H
SO
.4.
1 -
en
abJe
d as
outp
ut0-
dl
sabl
ed a
s ou
tput
Thl
s bi
ts c
ontro
ls w
heth
er P
2.0
(unc
tions
as t
he T
XD
out
put o
f the
ser
ial p
ort
tran
smltt
er o
r as
a s
tand
ard
outp
ut p
ort
pin.
1- se
rial p
ort T
XD
out
put
0-
stan
dard
out
put
port
pin
HS
0.5
Is m
ultlp
lexe
d w
ith th
e H
SI.3
Inpu
í pin
. T
his
bit
enab
les
the
outp
utfu
nctlo
n of
HS
O.5
.
1-
enab
led
as o
utpu
t0-
dl
sabl
ed a
s ou
tput
'
Thl
s bi
t sel
ects
the
sour
ce o
f the
HS
ID
ata
Ava
iiabl
e In
terr
upt
(INT02
, 200
4H).
INT
_MA
SK
.2 m
ust b
e se
t to
ena
ble
the
Inte
rrup
t.
1-
HS
IFIF
Ofu
ll0-
H
SI H
oldi
ng R
egis
ter
load
ed
C-3
4C
-35
8XC
196K
C/K
D R
EG
ISTE
RS
Input/O
utp
ut
Contr
ol R
egls
tár
2
IOC
2O
BH
HW
indo
w O
(W
rite)
, HW
Indo
w 1
5 (R
ead)
The
IO
C2
regi
ster
con
trol
s th
ree
Tin
er
2 op
tions
, th
e cl
ock
pres
cale
rs f
or t
he P
WM
and
the
A/D
con
vert
er,
and
the
sour
ce f
or A
/D c
onve
rsió
n tim
e de
term
inat
ion.
IO
C2
als
o en
able
san
d dí
sabl
es l
ock
ing
com
man
ds i
nlc.
the
HS
O C
AM
, an
d it
can
clea
r al
l en
trie
s fr
om t
heH
SO
CA
M.
\2
76
54
32
10
FAS
T__T
2_E
NA
T2U
D_E
NA
SLO
W^P
WM
AD
_TIM
E_E
NA
AD
_FA
ST
T2A
LTJN
T
I_O
CK
_EN
A
CA
M
CLR
Bit
Num
ber(
s)
0 1
Bit
Mne
mon
lc
FA
ST
_J2_
EN
A
T2U
D_E
NA
Bit
Ñam
e
Ena
ble
1 Im
er2
Fas
tIn
crem
eiit
Ena
ble T
mer
2 U
p/D
own
Cou
nt
Res
etS
tate
0 0
De
scri
ptlo
n
Thl
s bi
t con
trols
whe
ther
Tim
er 2
opér
ales
!n fa
st í
ncre
men
t or
norm
alm
ode.
1-
fast
Ínc
rem
ent m
ode;
cou
nt e
very
stat
e0-
no
rmal
mod
e; c
ount
eve
ry e
lght
stat
es
Whe
n fa
st in
crem
ent
mod
e is
ena
bled
,do
not
use
Tlm
er 2
as
the
HS
Ore
fere
nce
and
do n
ot r
eset
Tim
er 2
.
Thi
s bi
t con
trols
whe
ther
Tlm
er 2
func
tions
as
an u
p co
unte
r or
as
anup
/dow
n co
unte
r
1-
if P
2.6
» l
.co
un
tdo
wn
U P
2.6
•= 0
, co
unt
up0«
cou
nt u
p on
ly
C-3
6
8XC
196K
C/K
D R
EG
IST
ER
S
IOC
2 Bit
Num
ber(
s)
2 3 4 5 6 7
Bit
Mne
mon
lc
SLO
W_P
WM
AD
__TI
ME
_EN
A
AD
_FA
ST
T2A
LT
JNT
LOC
K_E
NA
CA
M_C
LR
Bit Ñ
am
e
Ena
ble
PW
MC
lock
Pre
scal
er
Ena
bíe
AD
TIM
ER
egls
ter
Dis
able
A/D
Clo
ckP
resc
aler
Sel
ect
Tlm
er2
Ove
rtlo
wB
ound
ary
Ena
ble
Lock
ed C
AM
Ent
ries
Cle
ar A
llC
AM
Ent
ries
Res
etS
tate
0 0 0 0 0 x
De
scrl
ptlo
n
Thl
s bi
t co
ntro
ls th
e P
WM
out
put pe
rlod
by e
nabl
lng
ord
ísab
ling
a cl
ock
pres
cale
r {d
ivid
e -b
y-tw
o) o
n P
WM
.1 ,
PW
M.2
, and
PW
M.3
.
1-
enab
le;
PW
M o
utpu
t pe
rfod
is 5
1 2
stat
e lim
es0-
dí
sabl
e; P
WM
out
put p
erio
d !s
256
stat
e tim
es
Thi
s bi
t sel
ects
whe
ther
the
A/D
conv
ersi
ón t
imes
are
con
trolle
d by
the
AD
_TIM
E re
gist
er o
r by
the
(ast
and
norm
al c
onve
rsió
n m
odes
ot t
he80
C19
6KB
,
1-
AD
TIM
E r
egis
ter
0*
BO
C~Í
96K
B-c
ompa
tible
mod
e
Whe
n th
is b
it is
cle
ar,
IOC
2.4
enab
les
ordi
sabl
es th
e A
/D c
lock
pre
scal
er fo
rco
mpl
ete
80C
196K
B c
ompa
tibili
ty.
In e
OC
196K
B-c
ompa
tible
mod
e (IO
C2.
3cl
eare
d), t
his
bjt co
ntro
ls th
e A
/Dco
nver
sión
tim
e pe
riod
by
enab
ling
or
disa
blin
g th
e A
/D c
lock
pre
scai
er (di
vide
-by
-tw
o).
U
dísa
ble;
con
vers
ión
time
Is 8
9.5
stat
etim
es, 8
0C19
6KB
nor
mal
mod
e0-
en
able
; con
vers
ión
tim
e Is
.156
,5st
ate
times
, 80C
196K
B fa
st m
ode
II IO
C2.
3 Is
sel
, thi
s bi
t is
igno
red.
Thl
s bi
t se
lect
s th
e ov
erflo
w b
ound
ary
íof
the T
imer
2 O
vertl
ow In
terrup
t (IN
T12
,20
38H
), IN
T__M
AS
K1.
4 m
ust
be s
el to
enab
le t
he in
terr
upt.
WFFFH
/8000H
bou
ndar
y0=
OFF
FFH
/OO
OO
H b
ound
ary
Thi
s bi
t en
able
s an
d dl
sabl
es c
omm
and
lock
ing.
Whe
n th
is b
it is
set
,H
SO
C
OM
MA
ND
.7 c
ontro
ls w
helh
erIn
divf
Bua
l com
man
ds a
re lo
cked
into
the
CA
M o
r cl
eare
d a
fler
exec
ullo
n.
la
Ena
ble
com
man
d lo
ckin
g0-
DIs
able
com
man
d lo
ckin
gW
ritín
g a
"1"
to IO
C2.
7 c
lear
s al
l en
trie
s(lo
cked
or
nol)
(rom
the
CA
M, a
s do
es a
chip
rese
t.
Set
ting
thís
bit
clea
rs a
ll en
trie
s [e
ven
lock
ed e
ntrie
s} fr
om the
HS
O C
AM
. Thi
sbi
t Is
not
latc
hed;
¡t w
ill a
lway
s re
ad a
sT
in H
Win
dow
15.
C-3
7
8X01
96K
C/K
D R
EG
ISTE
RS
TIn
put/O
utpu
t C
on
tro
l Reg
lsttf
r 3
J
IOC
3O
CH
HW
Indo
w 1
(Rea
d/W
rlte)
¡nie
l.8X
C19
6KC
/KD
RE
GIS
TER
S
IOC
3
The
IO
C3
regi
sler
sel
ccts
eít
her
an;.
inte
rna!
or
an e
xtem
al c
lock
sou
rcc
for
Tim
er 2
and
sele
cts
[fie
func
tion
of
pi
n P
l.2J
and
pin
PI.
3.
(Thi
s re
gist
er
was
pr
evio
usly
ca
lled
T2C
ON
TR
OL
orT
2CN
TC
.)
*
IOC
3 76
54
32
10 L
T2_E
NA
^Res
erve
d (8
XC
196K
C ,
ear
líer
vers
ions
)C
LKO
UT^
DIS
(8X
C19
6KD
and
8X
C19
6KC
(C
-Ste
p))
>W
M2
SE
L
Bit
Num
ber(
s)0 1 2 3 4-7
Bit
Mne
mon
lc
T2_
EN
A
Res
erva
d
CLK
OU
TJD
IS
PW
M1_
SE
L
PW
M2_
SE
L
—
Bit
Ñam
e
Tim
er 2
Inte
rna!
Clo
ck E
nabl
e
Res
erva
d
CLK
OU
TD
lsab
le
PW
Ml
Sel
ect
PW
M2
Sel
ecl
—
Res
etS
tate
0 0 0 0 0 1111
Des
crlp
tlon
Thi
s bi
t con
trol
s w
heth
er T
imer
2 is
cloc
ked
inte
rnal
ly o
r ex
tefn
ally
.
1-
Inte
rna!
sou
rce
0-
exte
rnal
sou
rce:
inO
CO
.7-1
.HS
Uif
IOC
0.7=
0( T
2CLK
(P
2.3)
IOC
2.0 c
ontr
ols
whe
ther
TIm
er 2
cou
nts
ever
y cl
ock
(fast
íncr
emen
t m
ode)
or
ever
y eí
ght d
ocks
(no
rmal
mod
e).
On
earlí
erve
rslo
ns o
í tha
8X
C19
6KC
,th
is b
it Is
rese
rved
; afw
ays
writ
e as
zer
o.
On
the
8XC
196K
C (
B-S
tep)
. thi
s b
ltwjll
arw
ays
read
bac
k as
"1"
in H
WIn
dow
1(p
rech
arge
d b
us).
Thi
s bi
t ha
s be
en im
plem
ente
d o
n th
e8X
C19
6KC
(C
-Ste
p) a
nd 8
XC
196K
D to
enab
le o
rdls
able
the
CLK
OU
T s
lgna
l.Thi
s ca
n b
e u
sed to
redu
ce n
olse
Insy
slem
s th
al d
o no
t req
uire
the
CLK
OU
Tsl
gnal
. The
act
ual v
alué
oí t
he b
it w
illre
ad b
ack
in H
Wín
dow
1.
1.
dísa
ble C
LKO
UT
'0.
enab
le C
LKO
UT
Thi
s bí
t sel
ecís
the
P1.
3 p
in fu
nctio
n.
1-
PW
M1 o
utpu
t0-
quas
l-bid
írect
íona
l por
t pin
Whe
n th
is b
it Is
set
, P
1.3
has
str
ong
pull-
ups
and
pul
l-dow
ns. T
his
pin
can
be
swilc
hed
bet
wee
n (u
nctio
ns w
ithou
t ade
vice
res
et.
Thi
s bi
t sel
ects
the
P1.
4 pi
n íu
nctlo
n.
1-
PW
M2 o
utpu
t0»
qu
asi-b
idire
ctío
nal p
ort p
in
Whe
n Ih
ls b
it Is
set
, P
1.4 h
as s
trong
pul
í-up
s an
d pu
ll-do
wns
. T
his
pin
can
besw
itche
d b
etw
een íu
nctio
ns w
ilhou
t ade
vice
res
et.
Res
erve
d; a
lway
s w
rite
as
zero
.
C-3
8C
-39
8X
C1í'6
KC
/KD
RE
GIS
TE
RS
¡niel.
8X
C1
96
KC
/KD
RE
GIS
TE
RS
Inp
ut/
Ou
tpu
t P
ort
O R
eg
lste
rIO
PO
RT
OO
EH
HW
Ind
ow
O(R
ea
d)
Pon
O is
an
inpu
t-on
ly p
ort.
To r
educ
e no
ise,
Por
t O is
mon
itore
d on
ly w
hen
a re
ad o
ccur
s.Th
e pi
ns c
an b
e us
ed a
s an
alog
inpu
ts ta
the
A/D
con
verte
r (A
CH
r) a
nd d
igita
l inp
uts
(P0_
0at
Ih
e sa
me
time,
but
th
is ¡
s no
t re
com
men
ded.
Pin
P
0.7
can
also
be
conf
igur
ed a
s an
cxte
mal
int
emip
t.
IOP
OR
TO
76
54
32
10
AC
HO
/PO
.O
AC
H1/
P0.
1
AC
H2/
P0.
2
AC
H3/
P0.
3
AC
H4/
P0.
4
AC
H5/
P0.
5
AC
H6/
P0.
6
AC
H7/
P0.
7A
0056
-OA
Bit
Num
ber(
s)0 1 2 3 4 5 6 7
Bit
Mne
mon
lc
AC
HO
/PO
.O
AC
H1/
PO
.I
AC
H2/
P0.
2
AC
H3/
P0.
3
AC
H4/
P0.
4
AC
H5/
P0.
5
AC
H6/
P0.
6
AC
H7/
P0.
7
Bit
Nai ie
AC
HO
/PO
0
AC
H1/
P0.
1
AC
H2/
PQ
.2
AC
H3/
PC
.3
ACH
4/PC
'.4
AC
H5/
PC
.5
AC
H6/
PC
.6
AC
H7/
PC
.7
Re
set
Sta
te
X X X X X X X *X
Descrlption
Ana
log
Cha
nnel
0/In
put
Pin
PO
.O
Ana
log
Cha
nnel
I/ln
put
Pin
P0.1
Ana
log
Cha
nnel
2/ln
put
Pin
P0.
2
Ana
log
Cha
nnel
3/ln
put
Pin
P0.3
Ana
log
Cha
nnel
4/ln
pul P
in P
0.4
Ana
log
Cha
nnel
5/ln
put
Pin
P0.5
Ana
log
Cha
nnel
6/ln
put
Pin
P0.
6
Ana
log
Cha
nnel
7/ln
put
Pín
P0.
7
Input/O
utp
ut
Port
1 R
eg
lste
rIO
PO
RT
1O
FHH
WIn
dow
O
(Re
ad
/Wrí
te)
Al!
Port
1 p
ins
are
qu
asi-
bid
ire
ctio
na
l u
nle
ss t
he
alté
rna
te f
un
ctio
n i
s se
lect
ed.
Thre
e p
ins
shar
e fu
nct
íons
with
the
bus-
hold
sig
náis
; tw
o
pin
s sh
are
fu
nct
ions
with
P
WM
outp
uls
.
When
the p
ins
are
co
nfig
ure
d a
s V
O p
ins,
th
ey
can
be
rea
d or
wri
tte
n.
When
the p
ins
are
config
ure
d f
or
the
ír a
ltérn
ate
fu
nct
ion
s, t
hey
can
be
rea
d but
not
wri
tte
n.
IOP
OR
T1
76
54
32
10
P1.
0
P1.
1
P1.
2
P1.
3/P
WM
1
P1.
4/P
WM
2
P1.
5/B
RE
Q#
P1.
6/H
LDA
#
P1.7
/HO
LD
*
C-4
0C
-41
¡niel
8XC
196K
C/K
D R
EG
ISTE
RS
IOP
OR
T1
Bit
Num
ber(
s)
0 1 2 3 4 5 6 7
Bit
Mne
mon
lc
Pi.O
Pí.
l
P1.
2
P1.
3/P
WM
1
PÍ.4
/PW
M2
P1.
5/B
RE
Q*
P1.
6/H
LD
A*
P1.
7/H
OL
D*
Bit
Na .n
e
PI.O
Pl.
l
P1.
2
PI.
3/P
AM
1
P1.
4/P
WM
2
P1.
5/B
RE
G#
P1.
6/H
LDA
#
P1.
7/H
OLD
#
Res
etS
tate
1 1 1 1 1 f 1 1
Des
crlp
tlon
I/O P
in P
I.O
l/OPI
nP1.
1
I/O P
in P
1. 2
l/O
PIn
P1
.3/P
WM
1 O
utpu
t
Settl
ng IO
C3.
2 en
able
s P
1.3
as th
ePW
M1
outp
utpl
n.
I/O P
in P
1.4/
PW
M2
Out
put
Set
ting
IOC
3.3
enab
les
P1.
4 as
Ihe
PW
M2
outp
ut p
in.
I/O P
in P
1.5/
Bus
Req
uest
Set
tlng
WS
R.7
enab
les
P1.
5 as
BR
EO
*.O
nce
the
HO
LD p
roto
col
!s e
nabl
ed, t
hepi
n f
unct
ions
as
BR
EO
* un
til t
he d
evlc
eIs
res
el.
BR
EQ
# Is
act
lvat
ed a
s an
out
put
whe
nth
e bu
s co
ntro
ller
has
a pe
ndin
g e
xter
na!
mem
ory
cycl
e. O
nce
BR
EO
* Is
asse
rted
, ít
rem
alns
ass
erte
d un
til t
heH
OLO
# Is
rem
oved
.
I/O P
in P
1,6/
Hold
Ack
now
ledg
e
Set
tlng
WS
R.7
ena
bles
P1.
6 as
HLD
Atf
.O
nce
Ihe
HO
LD
pro
toco
l Is
enab
led,
the
pin
íunc
tlons
as
HLD
A#
until
the
devl
ceIs
res
et
HLD
A#
is a
ctlv
ated
as
an o
utpu
t w
hen
the
8XC
196K
C/K
D r
elea
ses
the
bus
inre
spon
so t
o an
oth
erd
evlc
e as
sert
lng
HO
LD
#.
l/O
PIn
P1.
7/H
old
lnp
ut
Set
tlng
WS
R.7
ena
bles
P1.
7 as
H
OL
Díí.
Onc
e th
e H
OLD
pro
toco
l Is
enab
led, t
hepi
n fu
nctlo
ns a
s H
OL
D#
until
tha
devi
ceis
res
el.
HO
LD
# Is
act
ivat
ed a
s an
Inpu
t by
ade
vice
to
requ
est
cont
rol o
t th
e bu
s.
C-4
2
8XC
196K
C/K
D h
£GIS
TE
RS
Input/O
utp
ut
Port
2 R
eg
lste
rIO
PO
RT
210
HH
WIn
do
w O
(R
ea
d/W
rlte
)
Por
t 2
cont
ains
in
put-
only
, ou
tput
-onl
y,
and
quas
i-bi
dire
ctio
nal
por!
pin
s.
The
al
térn
ate
func
tion
s m
ust
be e
nabl
ed t
hrou
gh t
he a
ppro
pria
te c
ontr
ol r
egis
ters
.
IOP
OR
T2
76
54
32
10
P2.
0/T
XD
P2.
1/R
XD
P2.
2/E
XT
INT
P2.
3fi"2
CLK
P2.
4/T
2RS
T
P2.
5/P
WM
O
P2.
6/T
2UP
-DN
P2.
7/T
2CA
P
C-4
3
8X
C1
95
KC
/KD
RE
GIS
TE
RS
IOP
OR
T2
Bit
Num
ber(
s)0 1 2 3 4 5 6 7
Bit
Mne
mon
ic
P2.
0/TX
D
P2.
1/R
XO
P2.
2/E
XT
INT
P2.
3/T2
CLK
P2.
4/T
2RS
T
P2.
5/P
WM
O
P2.
6/T
2UP
-DN
P2.
7/T2
CA
P
Bit
Nan
e
P2.
0/TX
O
P2.
1/R
XO
P2.
2/E
XTI
JT
P2.
3/T2
CL
<
P2.
4/T
2RS
T
P2.
5/P
WM
)
P2.
6/T
2UP
-DN
P2.
7/T2
CA
P
Res
olS
tate
1 0 0 0 0 0 1 1
Oés
crip
tlon
Out
put
Pin
P2.
0
Set
tlng
IOC
1.5
enab
les
the
pin
as T
XD
,w
hich
ser
ves
as th
e tra
nsm
ft pi
n fo
r 'T
seria
l por
! mod
as 1
, 2,
and
3 a
nd th
esh
íft d
ock
for
mod
e 0.
Inpu
t P
in P
2.1
Set
ting
SP
CO
N.3
ena
bles
the
pin
as
RX
D. T
n m
odes
1 ,
2, a
nd 3
, RX
D Is
use
dto
rec
elve
ser
ial p
ort da
ta.
In m
ode
0, it
lunc
tbns
as
an In
put
or a
n op
en-d
raln
outp
ut fo
r dat
a
Inpu
t P
in 2
.2.
Cle
arin
g IO
C1.
1 se
lect
s P
2.2
as th
eso
urce
lor
the
EX
TIN
T In
tenu
pt
(INT
07,
200E
H).
P2.
2 ca
n ge
néra
te e
lther
EX
TIN
T(IN
T07)
or
EX
TIN
T1 (
INT13
, 203
AH
).
Inpu
t P
in P
2.3
Cle
arin
g IO
C0.
7 e
nabl
es th
e pi
n as
the
exte
rna!
doc
k In
put
for T
imer
2.
Inpu
t P
in P
2.4
Cle
arin
g IO
C0.
5 en
able
s th
e pi
n as
the
exte
rna!
resé
! to T
imer
2. I
OC
0.3
mus
íbe
sel
lo e
nabl
e th
e ex
tern
al re
set.
Out
put
Pin
P2.
5
Set
tlng IO
CI.0
ena
bles
Ihls
pin
as
the
PWM
O o
utpu
t.
Qua
sl-b
ldlre
ctlo
nal p
in P
2.6.
Set
tlng IO
C2.
1 e
nabl
es t
he p
in a
s th
edl
rect
lon
cont
rol f
or T
imer
2. T
imer
2co
unts
up
whe
n th
e pi
n is
low
and
cou
nts
dow
n w
hen
the
pin
is h
igh.
Qua
sl-b
ídlre
ctlo
nal p
in P
2.7
A r
isln
g ed
ge o
n P
2.7
capt
ures
the
valu
éoí
Tim
er 2
in th
e T
2CA
PT
UR
E reg
lste
ran
d ge
nera
les
a Ti
mer
2 C
aptu
rein
terr
upl(I
NT
1l,2
036H
).
8X
C196K
C/K
D R
EG
IST
ER
S
Inp
ut/O
utp
ut
Por
ts 3
and
4 R
egis
ter
IOP
OR
T34
1FFE
H
Por
ts 3
and
4 c
onta
in b
idir
ecti
onal
por
t pi
ns w
ith
open
-dra
in o
utpu
ts.
The
pin
s ar
e sh
ared
wit
h th
e m
ulti
plex
ed a
ddre
ss/d
ata
bus.
The
pin
s au
tom
atic
ally
sw
itch
to
thei
r sy
stem
bus
func
tion
s w
hen
EA
# is
low
and
to
thei
r op
en-d
rain
por
t fu
ncti
ons
whe
n E
A#
is h
igh.
Por
ts 3
and
4 ca
n be
rca
d an
d w
ritte
n on
ly a
s a
wor
d, a
l lo
catio
n 1F
FEH
.
IOP
OR
T34
15
14
13
12
11
10
9 8
7 6
5 4
3 2
1 O
P3.
0/A
DO
P3.1
/AD
1
P3.2
/AD
2
P3.3
/AD
3
. P
3.4
/AD
4
P3.5
/AD
5
P3.6
/AD
6
P3.7
/AD
7
P4.0
/AD
8
P4.1
/AD
9
P4.2
/AD
10
P4.3
/AD
11
P4.4
/AD
12
P4.5
/AD
13
. P
4.6
/AD
14
. P
4.7
/AD
15
A01
72-A
O
Bit
Num
ber(
s)0-7 8-15
Bit
Mne
mon
ic
P3.
0-P
3.7
/AD
O-A
D7
P4.
0-P
4.7
/AD
8-A
D15
Bit
Ñam
e
P3.
0-P
3.7
/AD
O-A
D7
P4.
0-P
4.7
/AD
8-A
D15
Re
set
Sta
te
1111
111
1
1111
-111
1
Descrlptlon
Bid
irect
iona
l po
rt pi
ns P
3.0-
P3.
7 d
urin
gex
tern
al a
cces
ses
(EA
# «
0); o
ther
wis
e,A
DO
-AD
7.
Bid
irect
iona
l por
t pín
s P
4.0-
P4.
7 d
unng
exte
rnal
acc
esse
s (E
A#
» 0
}; o
ther
wis
e,A
D8-
AD
15.
C-4
4C
-45
BX
C19
6KC
/KD
RE
GIS
TE
RS
Inpu
t/Out
put
Sta
tus
Reg
iste
r O
IOS
O15
Hr¡n
iel.
8X
C1
96
KC
/KD
RE
GIS
TE
RS
IOS
O
HW
Indo
w O
(Rea
d), H
WIn
dow
15
(Wrlt
e)
Th
e I
OS
O r
eg
iste
r in
díc
ale
s th
e c
urr
en
sta
le o
f th
e H
SO
pin
s. W
ritin
g lo
th
e c
orr
esp
ondin
g
bits
(IO
SO
.O-IO
S0.5
) in
HW
ind
ow i
5 c
an s
et
or
cle
ar
the H
SO
pin
s. Í
OS
0.6
and IO
S0.7
indíc
ate
the c
urr
en
t st
ate
of
the
HS
O C
AM
fil
e
and
the
HS
O h
old
ing
re
gis
ter. (
IOS
0.6
and
IOS
0.7
cannot
be w
ritten.)
IOS
O
76
54
32
10
. H
SO
O_S
TA
T
. H
SO
1_S
TA
T
HS
O2_S
TA
T
, H
SO
3_S
TA
T
HS
04_S
TA
T
HS
O5_S
TA
T
HR
CA
M_S
TA
T
HR
S
TA
T
Bit
Num
ber(
s)
0 1 2 3 4 5 6 7
Bit
Mnem
onlc
HS
OO
_STA
T
HS
O1_
ST
AT
HS
O2_
ST
AT
HS
03_S
TA
T
HS
O4_
ST
AT
HS
05_S
TA
T
HR
CA
M_S
TA
T
HR
_ST
AT
Bit
Ñam
e
HS
O.O
Sta
te
HS
O.1
Sta
te
HS
O.2
Sta
te
HS
O.3
Sta
te
HS
O.4
Sta
te
HS
O.5
Sta
te
HS
O C
AM
and H
oldi
ngR
egis
ter
Sta
te
HS
O H
oldi
ngR
egis
ter
Sta
te
Rese
tS
tate
0 0 0 0 0 0 0 0
Descrlptlon
Cur
rent
sta
te o
f the
HS
O.O
pin
.
Cur
ren!
sta
te o
í the
HS
O.1
pin
.
Cur
rent
sta
te o
( Ihe
HS
O.2
pin
.
Cur
rent
sta
te o
( the
HS
O.3
pin
.
Cur
rent
sta
te o
f the
HS
O.4
pin
.
HS
O.4
is a
bld
irect
íona
l por
t pi
n a
nd Is
mul
tlple
xed
with
the
HS
I.2 p
in. S
ertln
gIO
C1.
4 e
nabl
es th
e o
utpu
t fu
nctlo
n o
fH
SO
.4.
Cur
rent
sta
ta o
f the
HS
O.5
pin
.
HS
O.5
Is a
bld
irect
lona
l por
t pi
n a
nd Is
mul
tlple
xed
with
the H
SI.3
pin.
Ser
tlng
IOC
1.6
enab
les
the
outp
ut f
undl
on o
fH
SO
.5.
Cur
rent
sla
te o
f the
HS
O h
oldi
ng r
egis
ter
and
CA
M.
0-
HS
O h
oldi
ng re
gist
er Is
em
pty
and
at
leas
t on
e C
AM
slo
t is
em
pty
1 -
H
SO
hol
ding
reg
lste
r Is
f ull
To
avol
d ov
erw
ritin
g a
curr
ent
valu
é, d
ono
t writ
e to
the h
oldi
ng re
glst
er u
ntll
eith
er th
ts b
it or
IO
S0.
7 Is
cle
ared
.
Cur
rent
sta
te o
í th
e H
SO
hol
ding
regi
ster
.
0-
HS
O h
oldi
ng r
egls
ter I
s em
pty
1 -
HS
O h
oldi
ng r
egls
ter i
s fu
ll
To
avol
d ov
erw
rltln
g a
curr
enj v
alué
, do
not w
rite
to th
e ho
ldin
g re
gist
er u
ntll
eith
er th
ls b
it or
IOS
0.6
Is c
lear
ed.
C-4
6C
-47
8XC
1 36
KC
/KD
RE
GIS
TER
S8X
C19
6KC
/KD
RE
GIS
TER
S
Input/O
utp
ut
Sta
tus R
egís
ter i
IOS
116
HH
WIn
dow
O (R
ead),
HW
Indow
15 (
Wrl
te)
The
IO
S I
regi
ster
con
tain
s fl
ags
that
in
díca
te w
hich
eve
nts
trig
gere
d ¡n
terr
upts
. IO
S I.
Oth
roug
h IO
S 1.
5 in
díca
te t
he s
tatu
s of
íof
twar
e ti
mer
s, T
imer
2,
and
Tim
er 1
. Rea
ding
IO
S1cl
ears
bils
IO
S1.
0-IO
SI.
5. W
riti
ng t
e IO
S1.
0-IO
SI.
5 se
ts o
r cl
ears
the
bit
s, b
ul d
oes
not
trig
ger
inte
rrup
ts.
IOS
1.6
and
IOC
I.7
indí
cate
the
sta
tus o
fth
e H
SI
FIF
O r
egis
tera
nd t
he H
SI
hold
ing
regi
ster
.IO
S 1.
6 an
d IO
S 1.
7 ca
nnot
be
wrí
tten
.
IOS
17
65
43
21
0
, S
WT
FO
SW
TF
1
, S
VV
TF
2
SW
TF
3
T2JD
VF
T1_O
VF
FIF
O_F
ULL
HS
I R
DY
IOS1 B
itN
umbe
r{s)
0 1 2 3 4 5 6 7
Bit
Mne
mon
lc
SW
TFO
SW
TF
1
SW
TF
2
SW
TF3
T2J
DV
F
TIJD
VF
FIFO
_FU
LL
HS
I_R
OY
Bit
Ñam
e
Sof
twar
eTim
er 0
Fla
g
Sof
twar
eT
imer
1 F
lag
Sof
twar
e .
Tlm
er 2
Fla
g
Sof
twar
eTi
mer
3 F
lag
Tim
ar 2
Ove
rflow
Flag
Tim
er 1
Ove
rflow
•
Flag
Slx
th F
IFO
Ent
ry F
lag
HS
I H
oldi
ngR
egis
ter
Dat
a R
eady
Re
set
Sta
te
0 0 0 0 0 0 0 0
Des
crlp
tlon
Thl
s bi
t, w
hen
sel,
Indí
cale
s th
atS
oftw
are
Tim
er 0
has
exp
ired,
[rig
gerln
gIN
T05
(200
AH
). IN
T_M
AS
K.5
mus
t be
set lo
ena
ble
the
Inle
rrup
t.
Thls
bit,
whe
n se
t, in
díca
les
that
Sof
twar
e Ti
mer
1 h
as e
xpire
d, tr
lgge
ríng
INT0
5 (2
00A
H).
INT_
MA
SK
.5 m
usí b
ese
t lo
ena
ble
the In
terrup
t.
Thl
s bi
t, w
hen
set,
indí
cale
s th
atS
oftw
are
Tim
er 2
has
exp
lred,
trig
gerin
gIN
T05
(200
AH
). IN
T_M
AS
K.5
mus
t be
set lo
ena
ble th
e In
terrup
t.
Thl
s bi
t, w
hen
set,
Indí
cale
s th
atS
oftw
are
Tlm
erS
has
exp
lred,
trig
gerin
gIN
T05
(200
AH
). IN
T_M
ÁS
K.5
mus
t be
set
to e
nabl
e th
e In
terrup
t.
Bot
h T
imer
1 a
nd T
imer
2 c
an g
enér
ate
aTi
mer
Ove
rflo
w In
terr
upt
(INTO
O, 2
000H
).
Thl
s bi
t, w
hen
set
, Ind
ícal
es th
at T
imer
2Iri
gger
ed th
e in
terr
upt.
INT_
MA
SK
.Om
ust
be s
et to
ena
ble
the
inte
rrup
t.
Bot
h Ti
mer
1 a
nd T
lmer
2 c
an g
enér
ate
aTim
er O
verfí
ow In
terrup
t (IN
TOO
, 200
0H).
Thl
s bit,
whe
n se
t, In
díca
les
that
Tlm
er 1
trigg
ered
the
inte
rrup
t. IN
T_M
AS
K.O
mus
t be
set
to
enab
le t
he i
nter
rupt
.
Thl
s bi
t, w
hen
sel,
Indí
cale
s th
al th
e H
SI
FIFO
has
slx
or
mor
e en
tries
,in
depe
nden
! of t
he h
oldi
ng r
egls
ler.
Thi
s ev
ent c
an g
enér
ate
elth
eran
HS
ID
ata
Ava
llabl
e in
terr
upt
(INT0
2, 2
004H
)or
an
HS
I FIF
O F
ull I
nter
rupt
(IN
T14
,20
3CH
), b
ut s
houl
d no
t be
conf
igur
ad fo
rbo
th.
Thl
s bi
t. w
hen
set,
indí
cale
s th
at th
e H
SI
hold
ing
regl
ster
has
bee
n lo
aded
.
Whe
n IO
C1.
7 Is
cle
ar, t
his
even
tge
nera
les
an H
SI D
ata
Ava
llabl
efn
terr
upt
(INT
02, 2
004H
).'IN
T_M
AS
K.2
mus
t be
set t
o en
able
the
inte
rrup
t.
C-4
8C
-49
inte
!.
Inpu
t/Out
put
Sta
tus
Reg
iste
r,'!
*8
XC
19
6K
C/K
D R
EG
IST
ER
S
IOS
217
HH
WIn
dow
O (R
ead)
, HW
Indo
w 1
5 (W
rlte)
The
IO
S2 r
egis
ter c
onta
ins
fiag
s th
a[ i
ndíc
ate
whi
ch H
SO e
vent
s ha
ve o
ccun
red.
Wri
ting
to
IOS2
set
s or
cle
ars
the
stat
us b
its,
bu.
doe
s no
t tr
igge
r in
terr
upts
. R
eadi
ng I
OS
2 cl
ears
all
bits
.
HSOO^EVENT
HSO1 EVENT
HSO2_EVENT
HSO3_EVENT
HS04_EVENT
HS05_EVENT
T2RST_EVENT
AD EVENT
HS
O1_
EV
EN
T
| H
SO
.1 P
in
| O
Eve
nt
HS
O2_
EV
EÑ
T
I H
SO
.2 P
in
| O
Eve
nt
HS
O3_
EV
EN
T
HS
O.3
Pin
|o
Eve
nt
HS
O4_
EV
EN
T
HS
O.4
Pin
|o
~
Eve
nt
HS
O5_
EV
EN
T
HS
O.5
Pin
|f
l
6 7
T2R
ST_
_EV
EN
T
AD
_EV
EN
T
Eve
nt
Tim
er 2
Res
et E
veru
A/D
Con
vers
ión
Sla
rt E
venl
Descrl
ptl
on
Thl
s bi
t, w
hen
set,
Indí
cale
s th
at a
n H
SO
com
man
d to
ggle
d th
e H
SO
.O p
in.
Thís
bit,
whe
n se
t, In
díca
les
that
an
HS
Oco
mm
and
togg
led
the
HS
O.1
pin
.
Thls
bit,
whe
n se
t, In
díca
les
that
an
HS
Oco
mm
and
togg
led
the
HS
O.2
pin
,
Thls
bit,
whe
n se
t, In
díca
les
that
an
HS
Oco
mm
and
togg
led
the
HS
O.3
pin
.
Thls
bit,
whe
n se
t, in
díca
les
that
an
HS
Oco
mm
and
togg
led
Ihe
HS
O.4
pin
.
This
bit,
whe
n se
t, In
díca
les
that
an
HS
Oco
mm
and
togg
led
Ihe
HS
O.5
pin
.
Thl
s bi
t, w
hen
set,
Indí
cale
s th
al a
n H
SO
com
man
d re
sel T
imer
2.
Thls
bit,
whe
n se
t, In
díca
les
that
an
HS
Oco
mm
and
slar
ted
an A
/D c
onve
rsió
n.
C-5
0
8XC
196K
C/K
D R
EG
IST
ER
S
Pro
gram
min
g P
ulse
Wld
th R
egis
ter
PP
W
(no
dlre
ct a
cces
s)
The
Pro
gram
min
g P
ulse
Wid
th r
egis
ter
is a
cces
sibl
e on
ly d
urin
g A
uto
Pro
gram
min
g m
ode.
It i
s lo
aded
fro
m e
xtem
al a
ddre
ss 4
015/
40I4
H.
The
val
ué i
n th
e PP
W "
regi
ster
det
erm
ines
the
prog
ram
min
g pu
lse
wid
th.
The
pro
gram
min
gpu
lse
wid
th
mus
t be
at
le
ast
lOO
^is
for
prog
ram
min
g to
fun
ctio
n co
rrec
tly,
The
m
ost-
sign
ific
an!
bit
(PP
W. 1
5) m
ust
alw
ays
be s
et.
The
hi
gh b
yte
of P
PW u
sual
ly c
onta
ins
80H
and
the
low
byt
e us
uall
y co
ntai
ns 0
5H,
alth
ough
the
y ca
n ho
ld o
ther
val
úes.
15
14
1
3
12
1
1
10
9
87
65
43
21
0
1
PP
WJ/A
LU
E
Bit
Num
ber(s)
0-1
4
15
Bit
Mne
mon
lc
PP
W_V
ALU
E
PP
W_M
SB
Bit
Ñam
e
Pro
gram
-m
ing
Pul
seW
ldth
PP
W M
osl-
Slg
nffic
ant
Bit
Res
etS
tate
00000101
0000000
1
Des
crlp
tlon
The
se b
its u
sual
ly e
qual
OSH
, the
cor
red
valu
é fo
rXT
AU -
8 M
Hz.
Wrlt
e th
ede
slre
d P
PW
VA
LUÉ
to th
ese
bits
.
This
bft
mus
t alw
ays
equa
l -1.
"
Use
the
fol
low
ing
form
ula
and
roun
d th
e re
sult
to t
he n
ext
high
er í
nteg
er v
alué
to
dete
rmin
eth
e pr
oper
PP
W_V
AL
UE
.
PP
W_V
ALU
E -
(0.
6944
x F
QSC
) - 1
wh
ere
:
PP
W_V
ALU
E
te
a 15
-bltw
ord
FOSC
Is
the
XTA
L1 f
requ
ency
, In
MH
z
For
exa
mpl
e, a
ssum
e X
TA
LI
is 8
MH
z:
PP
W V
ALU
É -
(0.6
944
x 8
) -
1-
5.5
552-1
- 4.
5552
- 5
C-5
1
<*)8X
C19
6KC
/KD
RE
GIS
TE
RS
Pro
gram
Sta
tus
Wor
dP
SW
(no
dlre
ct a
cces
s)
8XC
196K
C/K
D R
EG
fST
ER
S
PS
W
The
PSW
act
uail
y co
nsis
tí o
f tw
o by
tos,
The
hig
h by
te i
s th
e st
atus
wor
d, w
hich
is
desc
ribe
dhe
re;
the
low
byt
e is
the
IN
T_M
ASK
reg
iste
r. T
he s
tatu
s w
ord
cont
ains
one
bit
(PS
W.I
) th
atgl
obal
ly e
nabl
es o
r di
sabl
es s
ervi
cirg
of
al
! m
aska
ble
inte
rrup
ts,
one
bit
(PSW
.2)
that
enab
les
or d
isab
les
the
Peri
pher
al T
.-an
sact
ion
Ser
ver
(PT
S),
and
six
Boo
lean
fl
ags
that
refl
ect
the
stat
e of
a u
ser'
s pr
ogra
m.
The
sta
tus
wor
d po
rtio
n of
the
PS
W c
anno
t be
acc
esse
d di
rect
iy. T
o ac
cess
the
sta
tus
wor
d,pu
sh t
he v
alué
ont
o th
e st
ack
(PU
SHF)
, th
en p
op t
he v
alué
to
a re
gist
er (
POP
íest
_reg
).
The
PUSH
F an
d PU
SHA
ins
truc
tion
s sa
ve í
he P
SW i
n th
e sy
stem
sta
ck;
PO
PF
and
PO
PA
rest
ore
it. The
El
and
DI
inst
ruct
ions
set
and
cls
ar P
SW
.I;
the
EPT
S a
nd D
PTS
ins
truc
tion
s se
l an
dcl
ear
PSW
.2.
Var
ious
in
stru
ctio
ns
U.st
, se
t, an
d cl
ear
the
Boo
lean
fla
gs.
(App
endi
x B
cont
ains
one
tab
le t
hat
show
s th
e ef
fec
I of
inst
ruct
ions
on
the
PSW
fla
gs a
nd o
ne t
hat
show
sth
e ef
fect
of
PSW
fla
gs o
n co
ndhi
onal
ju
mp
inst
ruct
ions
.)
PS
W7
65
43
21
O
ST I PS
E
C VT
V N Z
Bit
Num
berfs
)
0 1 2 3
Bit
Mne
mon
lc
ST I PS
E
C
Bit
Ñam
e
Stlc
ky B
itFla
g
Inte
rrup
tD
isab
le(G
loba
l)
PTS
Ena
ble
Car
ry F
lag
Res
etS
tate
Des
crlp
tlon
Thi
s fla
g is
set
to in
díca
te th
at, d
urin
g a
righl s
hfft,
a T
has
been
shi
fted
!nto
the
Car
ry fl
ag a
nd t
hen
shlft
ed o
ut. T
his
bit I
sun
defln
ed a
fter
a m
ultip
ly o
pera
tion.
The
Stic
ky B
it fla
g ca
n be
use
d w
ith th
eC
arry
fla
g to
allo
w fi
ner
reso
lutio
n in
roun
ding
dedsb
ns.
(S
ee th
e de
scrip
tíon
of t
he C
arry
flag
for d
etai
ls.)
This
bit
glob
ally
ena
bles
or d
isab
les
the
serv
ldng
of a
ll m
aska
ble
Inte
rrup
ts (
that
Is, a
ll In
lerr
upts
exc
ept
NM
!, T
RA
P, a
ndU
nim
plem
ente
d O
pcod
e). T
he b
its In
INT
MA
SK
and
INT_
MA
SK
1 In
dMdu
ally
enaE
le o
r dls
able
the
inte
mjp
ts. T
he E
lIn
stru
ctlo
n se
ts th
is b
it; D
I cle
ars
!t.
1« en
able
Inte
rrup
t ser
vicl
ng0-
dl
sabl
e in
terr
upt
serv
icln
g
Thi
s bi
t glo
bally
ena
bles
or d
lsab
les
the
Per
iphe
ral T
rans
actlo
n S
erve
r (P
TS).
The
EP
TS I
nstru
ctlo
n s
ets
this
bit;
DP
TScl
ears
it.
1-
enab
le P
TS
0-
dísa
bleP
TS
This
fla
g is
set
to
Indí
cate
the
sta
te o
f an
aríth
met
lc c
arry
(ro
m th
e m
ost-s
lgnt
fican
tbi
t of
the
ALU
or
the
stat
e of
the
last
bit
shift
ed o
ut o
( an
ope
rand
. If
a su
btra
ctlo
nop
erat
ion g
ener
ales
a b
orro
w, t
he C
arry
flag
¡s c
lear
ed.
C
Val
ué o
f B
lt« S
hlft
ed
OH
0 <'
/>LS
8
1 a
fclS
B
Nor
mal
ly, t
he r
esul
t is
roun
ded
up if
the
Car
ry f
lag
Is s
et. T
he S
tlcky
Bit
nag
allo
ws
a F
iner
reso
lutio
n In
the rou
ndin
gde
cisi
ón.
C
ST
V
alúa
of
Bits
Shlft
ed
Off
00
-0
0 1
> 0
and
< fc
LS
B
1 0
-'/jL
SB
1 1
> V
i LS
B a
nd <
1 L
SB
C-5
2C
-53
8XC
1D6K
C/K
D R
EG
ISTE
RS
PT
S C
on
tro
l R
eg
lste
rP
TS
CO
NO
ffs
et
1 f
rom
PT
S C
on
tro
l B
loc
k
Thr
ee b
its o
f th
e P
TS
CO
N r
egis
ter
dete
rmin
e th
e P
TS
mod
e: s
ingl
e tr
ansf
er,
bloc
k tr
ansf
er,
A/D
, H
SO
, or
HS1
. The
PT
S m
ode
defin
es t
he fu
nctio
ns o
f th
e re
mai
ning
fiv
e bi
ts.
PT
SC
ON
has
one
conf
igur
atio
n fo
r th
e si
ngle
and
blo
ck t
rans
fer
mod
es a
nd o
ne fo
r th
e A
D,
HS
O, a
ndH
SI
mod
es.
The
con
figur
atio
ns a
re d
'íscr
ibed
sep
arat
ely
here
. (P
SW
.2,
cont
rolle
d by
the
DP
TS a
nd E
PTS
inst
ruct
ions
, glo
bally
ina
bles
or
disa
bles
the
PTS
.)
PT
SC
ON
(S
ing
le a
nd
Blo
ck T
ran
sler
Mo
des
)7
65
43
21
O
. D
I
. S
I
DU
SU
BW
PT
SM
OD
E
Bit
Num
ber(
s)0 1 2 3 4 5-7
Bit
Mne
mon
lc
DI
SI
DU
SU
BW
PT
SM
OD
E
Bit
Nar
re
PTS
DS
T
Incr
emen
t
PTS
SR
CA
uto-
Incr
emen
t
Upd
ate
PTS
DS
T
Upd
ate
PTS
SR
C
Byt
e/W
ord
Tran
sfer
PTS
Mod
e
Res
olS
tate
0 0 0 0 0 000
Desc
rlptlo
n
Set
ting
thls
bit
caus
es t
he P
TSde
stin
atio
n re
gist
er to
Incr
emen
t at t
heen
d of
eac
h P
TS c
ycle
.
Set
tlng
thls
bit
caus
es t
he P
TS s
ourc
ere
oíst
er to
Incr
emen
t at t
he e
nd o
í eac
hP
TS c
ycle
.
Set
ting
this
brt
caus
es t
he P
TSD
ST
regi
ster
to re
taln
Its fi
nal v
alué
at t
he e
ndof
a P
TS c
ycle
. Cle
arin
g rí
caus
es t
here
gist
er r
ever
t to
the
valu
é th
at e
xist
ed a
tth
e be
glnn
lng
of t
he P
TS
cyc
le.
Set
ting Ih
ls b
it ca
uses
the
PTS
SR
Cre
gist
er to
rel
aln
Its f
inal
val
ué a
t the
end
of a
PTS
cyd
e. C
lear
íng
It c
ause
s th
ere
gist
er to
rev
ert t
o th
e va
lué
Ihat
exi
sted
at th
e b
egln
nlng
of t
he P
TS
cyd
e.
Set
tíng
this
bit
spec
ifies
a b
yte tr
ansf
er.
Cle
arln
g It
spec
ifies
a w
ord
tran
sfer
.
Thes
e bf
ts s
pecl
ty th
e P
TS m
ode:
Bft
7 6
50
00
S
ingl
e T
rans
fer
1
0
0
Blo
ck T
rans
fer
8XC
196K
C/K
D R
EG
ISTE
RS
PT
SC
ON
PT
SC
ON
(A
/b,
HS
O,
and
HS
I M
od
es}
76
54
32
10 1o
UP
DT
PTS
MO
DE
Bit
Num
ber(
s)0 1 2 3 4 5-7
Bit
Mne
mon
lc
— — — UP
DT
— PT
SM
OO
E
Bit
Ñam
e
— — — Upd
ate
Reg
lste
r
— PTS
Mod
e
Res
etS
tate
0 1 0 0 0 000
Desc
rlptlo
n
Alw
ays
zero
.
Alw
ays o
ne.
Alw
ays
zero
.
Settl
ng th
ls b
it ca
uses
the
asso
dale
dre
gist
er to
be
load
ed w
itfi t
he v
alué
that
exls
ts a
l the
end
oí a
PTS
cyc
le.
Cle
arin
g H
caus
es th
e re
gist
er to
be
load
ed w
ith th
e va
lué
that
exi
sted
at t
hebe
glnn
lng
of th
e PT
S cy
cle.
Mod
* R
egls
ter
A/D
P
TS
S/D
HS
I P
TS
DS
TH
SO
P
TSS
RC
Alw
ays
zero
.
The
se b
its s
pedf
y th
e P
TS
mod
e:
Bit
7
6
5
1 1
0
A
/D0
1 1
HS
O0
0
1
HS
I
C-56
C-5
7
8XC
1ÍÍ6
KC
/KD
riE
GIS
TE
RS
PTS
Cou
nt R
egls
ter
PT
SC
OU
NT
Off
set
O fr
om
PT
S C
on
tro
l B
lock
The
PT
SC
OU
NT
reg
iste
r is
use
d in
all
PTS
mod
es.
PT
SC
OU
NT
def
ines
the
num
ber
of P
TS
cycl
es t
o be
exe
cute
d co
nsec
utiv
ely
w'th
out
CPU
int
erve
ntio
n. S
ince
PT
SC
OU
NT
is
an 8
-bí
t va
lué,
the
máx
imum
num
ber
of c
ycle
s is
256
. PT
SCO
UN
T i
s de
crem
ente
d at
the
end
of
each
PT
S cy
cle.
W
hen
PTSC
OU
NT
re
ache
s ze
ro,
hard
war
e cl
ears
th
e co
rres
pori
ding
PTSS
EL
bit
and
seis
the
PT
SSR
V b
it, w
hich
req
uest
s th
e en
d-of
-PT
S in
terr
upt.
Whe
n th
een
d-of
-PT
S in
terr
upt
is c
alle
d, h
ardw
are
clea
rs t
he P
TSS
RV
bi
t. T
he P
TS
SE
L b
it m
usí
bese
l m
anua
lly
to r
e-en
able
the
PT
S ch
anne
l.\T
76
54
2 1
O
PTS
CO
UN
T
Bit
Num
ber(
s)0-7
Bit
Mne
mon
lc
PT
S^C
OU
NT
Bit
Nano
Con
secu
tivo
PTS
Cyc
hs
Res
etS
tate
xxxx
xxx
x
De
scrf
ptlo
n
Def
ines
the
num
ber o
( PTS
cyc
les
to b
eex
ecut
ed c
onse
cutiv
ely
wlth
out C
PUIn
terv
entio
n. M
áxim
um v
alué
is 2
56.
C-5
8
8XC
196K
C/K
D R
EG
IST
ER
S
PT
S D
est
inatlo
n R
egls
ter
The
PT
SD
ST
reg
iste
r is
use
d in
sin
gle
tran
sfer
, bl
ock
tran
sfer
, an
d H
SI m
odes
. P
TS
DS
Tpo
ints
to
the
dest
inat
ion
mem
ory
loca
tion
. PT
SDST
is
opti
onal
ly i
ncre
men
ted
at t
he e
nd o
fa
PTS
cycl
e. I
n si
ngle
tra
nsfe
r m
ode,
PT
SCO
N.O
and
PT
SC
ON
.2 c
ontr
ol w
heth
er P
TS
DS
Tis
in
crem
ente
d.
In
bloc
k tr
ansf
er
mod
e,
PTSC
ON
.O
cont
rols
w
heth
er
PT
SD
ST
is
incr
emen
ted
afte
r ea
ch
tran
sfer
and
PT
SC
ON
.2 c
ontr
ols
whe
ther
PT
SDST
ret
ains
its
fin
alva
lué
or r
ever
ts t
o it
s or
igin
al v
alué
. In
HSI
mod
e, P
TS
CO
N.3
det
erm
ines
whe
ther
PT
SDST
is u
pdat
ed a
t th
e en
d of
the
PT
S cy
cle.
PT
SC
>ST
15 L
1413
— -—
—
12
11
10
98
76
54
32
10
1If
pT
sriR
T(L
n)
PT
SD
ST
(HI)
AO
H5-
AO
Bit
Num
ber(
s)0-7 8-15
Bit
Mne
mon
lc
PT
SD
ST
(LO
)
PT
SD
ST
(H
l)
Bit
Ñam
e
PTS
Des
tinat
lon
Add
ress
,Lo
w B
yte
PTS
Des
tínat
íon
Addr
ess,
HIg
h By
le
Res
etS
tate
XX
XX
XX
XX
xxxx
xxx
x
Desc
rlptlo
n
Low
byl
e o(
the
PTS
dest
inat
ion
áddr
ess.
Hig
h by
le o
( the
PTS
des
tinat
ion
áddr
ess.
C-5
9
8XC
1'96
KC
/KD
RE
GIS
TE
RS
PT
S A
D R
eg
iste
rP
TS
_RE
GO
ffse
t 3 fro
m P
TS
Co
ntr
ol B
lock
The
PT
S_R
EG
re
gis
ter
is u
sed
in A
/D' m
ode.
PT
S_R
EG
po
ints
to
add
ress
02H
. Wh
en
rea
dih
is
loca
üon
conta
ins
the
AD
_R
RS
ULT
re
gist
er;
whe
n w
ritt
en
, it
cont
ains
th
eA
D_
CO
MM
AN
D r
eg
iste
r.
PIS
RE
G15
14
L_
131
2 1
1 1
0 9
87
65
43
21
0
-"
I ,.
„ ,
PTS
R
EG
(LO
)
.. A
0146
-AO
Bit
Num
ber(
s)
0-7
8-1
5
Bit
Mne
mon
lc
PTS
_RE
G (
LO)
PTS
_RE
G (
Hl)
Bit
Nar
.ie
Req
isle
rA
dare
ss, .
Low
Byt
e .
Reg
iste
rA
dare
ss,
Hlg
h By
le
Res
etS
tate
xxxx
xxx
x
xxxx
xxx
x
Desc
rtptlo
n
Low
byt
e of
the
AD
_RE
SU
LT re
gist
erad
dres
s.
Hlg
h by
te o
f the
AD
RE
SU
LTre
glst
erad
dres
s.
C-G
O
¡niel.
8XC
196K
C/K
D R
EG
IST
ER
S
PT
S S
ou
rce
/De
stln
atlo
n R
eg
iste
rP
TS__
S/D
Offs
et 3
fro
m P
TS
Contr
ol B
lock
The
PT
S_S
/D r
egis
ter
is u
sed
in A
/D m
ode.
PT
S_S
/D p
oint
s to
the
mem
ory
loca
tío
n th
atco
ntai
ns t
he A
/D c
omm
and/
data
table
. In
a P
TS
A/D
cyc
le,
the
wo
rd t
hat
PT
S_S
/D p
oin
ts t
o¡s
lo
ad
ed
in
to
a te
mpora
ry
inte
rnal
reg
iste
r,
PT
S_S
/D
is
íncr
emen
ted
by
2,
then
th
eA
D_R
ES
ULT
re
gist
er
is
sto
red a
t th
e
upda
ted
PT
S_S
/D
addr
ess.
PTS
CO
N.3
co
ntr
ols
whe
ther
PT
S_S
/D i
s up
date
d a
t th
e en
d of
a P
TS
cyc
le,
to p
oin
t to
the
nex
t w
ord
in
the
A/D
table
.
PT
S_S
/D15 L
1413 —
— — •
12
11
10
98
76
54
32
1
0
1iT
Q
/p(i
o)
S/D
(HI) A
OH
7-A
O
Bit
Num
ber(
s)
0-7 8-15
Bit
Mnem
onlc
S/D
(LO
)
S/D
(HI)
Bit
Ñam
e
Sou
rce/
Des
tinar
onA
ddre
ss,
Low
Byt
e
Sou
rce/
Des
tlnat
lon
Add
ress
,H
lgh
Byt
e
Re
set
Sta
te
XX
XX
XX
XX
xxxx
xxx
x
De
scrl
ptlo
n
Low
byt
e of
the
sour
ce/d
estln
atlo
nad
dres
s.
Hlflh
byt
e of
the
sour
ce/d
estln
atlo
nad
dres
s.
C-6
1
8XC
190K
C/K
D R
EG
ISTE
RS
PT
S S
ele
ct R
eg
iste
r (H
I/LO
)P
TS
SE
L05/0
4 H
HW
Indo
w 1
(Rea
d/W
rite)
The
PT
SSE
L r
egis
ter c
onsi
sts
of t
wo
byte
s. P
TSS
EL
sel
ects
eit
her
a PT
S cy
cie
or a
nor
mal
inte
mip
t se
rvic
e ro
utin
e Co
r ea
ch o
í fi
tteen
in
tenu
pt r
eque
sts.
Set
ting
a b
it se
lect
s a
PTS
cyci
e; c
lear
ing
a bi
t sel
ects
a n
orm
al i
ntcr
rupt
ser
vice
rou
tine
.
Whe
n P
TS
CO
UN
T r
each
es z
ero,
har
dvar
e cl
ears
the
cor
resp
ondi
ng P
TSS
EL
bi
t an
d se
isth
e PT
SSR
V b
it, w
hich
req
uest
s th
e en
d-of
-PT
S in
terr
upt.
Whe
n th
e en
d-of
-PT
S in
terr
upt
isca
lled
, ha
rdw
are
clea
rs th
e PT
SSR
V b
it. T
he P
TSS
EL
bit
mus
t be
set
man
uall
y to
re-
enab
leth
e PT
S ch
anne
l.
Eac
h in
terr
upt
can
be m
aske
d by
the
CO
Tes
pond
ing
bit
in t
he I
NT
_MA
SK
or
INT
_MA
SK
lre
gist
er. T
he P
TS
is g
loba
lly
enab
led
or d
isab
led
by P
SW
.2.
PTS
,BE
L15 R
1 413
12
1110
c }£1
T€5
54
32
10
T1O
VF
SE
L
An
RFI
HR
IHA
T
RF
I
H.s
n SF
I •
HSI
O S
EL
SW
T S
EL
SE
R
SE
L
EX
TIN
T S
EL
Tí
SE
L
Rl
SE
L
HR
W
SFI
T2C
AP
SE
L
. T2
OV
F S
EL
EX
TIM
T1 S
EL
TIFO
SE
L A00
62-B
O
8XC
196K
C/K
D R
EG
ISTE
RS
PT
SS
EL
Bit
Num
ber(
s)0 i 2 3 4 5 6 7
Bit
Mne
mon
lc
TIO
VF
_SE
L
AD
_SE
L
HS
IDA
T_S
EL
HS
O_S
EL
HS
IO_S
EL
SW
T_S
EL
SE
R_S
EL
EX
TIN
T_S
EL
Bit
Ñam
e
Tlm
erO
verfl
owIn
terr
upt
Sel
ect
A/D
Con
vers
ión
Com
píet
eIn
terr
upt
Sel
ect
HS
I Dat
aA
valla
ble/
FIFO
Ful
lIn
terr
upt
Sel
ect
HS
O O
utpu
tE
vent
Inte
rrupt
Sel
ect
HS
I.OE
xtem
alIn
terr
upt
Sel
ect
Sof
twar
eT
imer
Inte
rrup
tS
elec
t
Ser
ial P
ort
Inte
rrup
t '
Sel
ect
EX
TIN
T P
inor
P0
.7In
terr
upt
Sel
ect
Res
etS
tate
0 0 0 0 0 0 0 0
Oes
crlp
tlon
Set
ting
th!s
bit
caus
es a
Tlm
erO
verfl
ow in
terr
upt
(INTO
O)
to b
eha
ndle
d by
a P
TS
cyd
e.
Set
ting
this
bit
caus
es e
n A
/DC
onve
rsió
n C
ompl
ete
Inte
rrup
t(IN
T01
) to
be
hand
led
by a
PTS
cyci
e.
Set
ting
thls
bit
caus
es a
n H
SI D
ata
Ava
ilabl
e In
terru
pt (I
NT0
2) to
be
hand
led
by a
PT
S c
yde.
Set
tfng
thls
bit
caus
es a
Hlg
h-S
peed
Out
put In
terrup
t {IN
Í03J
tobe
han
dled
by
a P
TS c
yde.
Set
ting
thls
bit
caus
es a
n H
SI.O
Pin
Inte
rrup
t (IN
T04)
to b
e ha
ndle
d by
aP
TS c
ycie
.
Set
ting
this
bit
caus
es a
Sof
twar
eT
lmer
Inte
rrup
t (IN
T05J
to b
eha
ndle
d by
a P
TS c
yde.
Set
ting
this
bit
caus
es a
Ser
ial P
ort
Inte
rrup
t (IN
T06)
to
be h
andl
ed b
y a
PT
S c
ycie
.
Set
ting
thls
bit
caus
es a
n E
XTI
NT
pin
or
P0.
7 ín
terrup
l (IN
T07)
to b
eha
ndle
d by
a P
TS c
yde.
C-6
3
Cin
tel.
8X
C1
96
KC
/KD
RE
QIS
TE
RS
PT
SS
EL
Bit
Num
ber(
s)
8 9 10 11 12 13 14 15
Bit
Mnem
onlc
TI_SE
L
RI_
SE
L
HS
I4_S
EL
T2C
AP
_SE
L
T2O
VF
_SE
L
EX
TIN
T1_S
EL
FIFO
_SE
L
—
Bit
Nsr
rle iTr
ansm
it i.
Inte
mjp
! .'
Sel
ect
Rec
elve
f
Inle
rrup
t '
Sel
ect
HS1
FIF
O 4
Inle
rrup
t ,
Sel
eci
Tlm
er 2
•
Cap
ture
Inte
rrup
t •
Sel
ect
Tlm
er 2
i
Ove
rflow
'
Inte
rrup
tS
elec
i
EX
TIN
T P
hín
terr
upt
iS
elec
t
HS
I FIF
O '
Full
Inte
rnet
Sel
ect
—
Re
set
Sta
te
0 0 0 0 0 0 0 0
De
acrl
ptlo
n
Set
ting
thls
bit
caus
es a
TI I
nter
rupl
(INT0
8) t
o be
han
dled
by
a P
TScy
cle.
Set
ting
thls
bit
caus
es a
n R
lÍn
terr
upt
(INT0
9) t
o be
han
dled
by
aP
TS c
ycle
.
Set
ting
thls
bit
caus
es a
n H
SI F
IFO
4 In
tern
jpt
(INT1
0) to
be
hand
led
bya
PT
S c
ycle
.
Set
ting
thls
bit
caus
es a
Tlm
er 2
Cap
ture
Int
emjp
t (IN
T1 1}
to
beha
ndle
d b
y a
PT
S c
yde.
Set
ting
Ihls
bit
caus
es a
Tlm
er 2
Ove
rflow
Int
erru
pt (I
NT1
2)
to b
eha
ndle
d b
y a
PT
S c
yde.
Set
ting
thls
bit
caus
es a
n E
XT
INT
1In
terru
pt (
INT1
3) to
be
hand
led
by
aP
TS c
ycle
.
Set
tlng
thls
bit
caus
es a
n H
SI
FIFO
Full
inte
rrup
t (IN
T14)
to b
e ha
ndle
dby
a P
TS c
ycle
.
Res
erve
d; a
lway
s w
rlle
as z
ero.
8X
C196K
C/K
D R
EQ
IST
ER
S
PT
S S
ou
rce
Reg
lste
rP
TSS
RC
Off
set
2 fr
om
PT
S C
on
tro
l B
lock
Th
e P
TS
SR
C r
egis
ter
is u
sed
in s
ing
le t
ran
sfer
, b
lock
tra
nsf
er,
and
H
SO
mo
des
. P
TS
SR
C
po
ints
to t
he
sou
rce
mem
ory
lo
cati
on
. P
TS
SR
C i
s o
pti
on
ally
in
crem
ente
d a
t th
e en
d
of
a
PT
S c
ycl
e. I
n s
ing
le t
ran
sfer
mo
de,
PT
SC
ON
. 1 a
nd P
TS
CO
N.3
co
ntr
ol
wh
eth
er P
TS
DS
T i
s
incr
emen
ted
. In
blo
ck t
ran
sfer
mo
de,
PT
SC
ON
. 1 c
on
tro
ls w
het
her
PT
SD
ST
is
incre
men
ted
afte
r ea
ch
tran
sfer
an
d
PT
SC
ON
.3
con
tro
ls
wh
eth
er P
TS
DS
T
reta
ins
its
fin
al
va
lué
or
rever
ts to
it
s o
rig
inal
v
alu
é.
In H
SO
m
ode,
P
TS
CO
N.3
d
eter
min
es
wh
eth
er P
TS
SR
C is
up
dat
ed a
t th
e en
d o
f th
e P
TS
cy
cle
.
PT
SS
RC 15
14
13
12
11
10
9 8
7 6
5 4
'3
2 1
O
PT
SS
RC
(LO
)
PTS
SR
C(H
I)AD
UB-A
O
Bit
Num
ber(
s)
0-7 8-15
Bit
Mnem
onlc
PT
SS
RC
(LO
)
PTS
SR
C (
HI)
Bit Ñ
am
e
PTS
Sou
rce
Add
ress
,Lo
w B
yte
PTS
Sou
rce
Add
ress
,H
lgh
Byt
e
Re
set
Sta
te
xxxx x
xxx
xxxx x
xxx
Descrlptlon
Low
byt
e of
the
PTS
sou
rce
addr
ess.
Hlg
h by
fe o
f the
PTS
sou
rce
addr
ess.
C-6
4C
-65
&
. , %
.B
XC
19")
KC
/KD
RE
OIS
TE
RS
8XC
196K
C/K
D R
EQ
ISTE
RS
PTS
Ser
vice
Reg
lste
rP
TSS
RV
07/0
6HH
Win
dow
1 (R
ead/
Wrlt
e)
PTS
SR
V
The
PT
SSR
V r
egis
ter
cons
ists
of
two
hyte
s. P
TSS
RV
is
use
d by
the
har
dwar
e to
ind
ícat
eth
at t
he f
inal
PT
S cy
cle
has
been
ser
vice
d. W
hen
PT
SC
OU
NT
rea
ches
zer
o, h
ardw
are
clea
rsth
e co
rres
pond
ing
PTSS
EL
bit
and
seis
the
PT
SSR
V
bit
, whi
ch r
eque
sts
the
cnd-
of-P
TS
inte
rrup
t. W
hen
the
end-
of-P
TS
inte
mip
t is
cal
led,
har
dwar
e cl
ears
the
PT
SSR
V b
it.
The
PTSS
EL
bit
mus
t be
sel
man
uall
y to
re-
iína
ble
the
PTS
chan
nel.
Tbe
PT
S is
glo
ball
y en
able
d or
dis
able
d by
PSW
.2,
whi
ch i
s se
t w
ith
the
EPT
S i
nstr
ucti
onan
d cl
eare
d w
ith
the
DPT
S i
nstr
ucti
on.
Inte
rrup
ts a
re e
nabl
ed o
r di
sabl
ed (
mas
ked)
by
the
corr
espo
ndin
g bi
ts i
n th
e IN
T_M
ASK
and
IN
T_M
AS
K1
regi
ster
s. I
ndiv
idua
l in
terr
upts
are
enab
led
as P
TS
cycl
es b
y th
e co
rres
ponc
ing b
its
in t
he P
TS
SE
L r
egis
ter.
The
end
-of-
PT
S in
terr
upt
vect
ors
thro
ufíh
the
sam
e lo
cati
on t
hat
the
corr
espo
ndin
g no
rmal
inte
rrup
t ve
ctor
wou
ld.
For
exam
ple,
if
PT
SS
EL
.8 i
s se
t, th
e T
I in
terr
upt
is h
andl
ed b
y it
sPT
S ve
ctor
at
2050
H w
ith
its
end-
of-P
TS
vect
or a
t 20
30H
. (R
efer
to
Tab
le C
-4 f
or i
nter
rupt
vect
or l
ocat
ions
.)
PTS
SR
V15
14
13
12
11
10
9
8 7
6 5
4 3
2 1
O
T1O
VF
_SR
V
AD
_SR
V
HS
IDA
T_S
RV
HS
O_S
RV
HS
IO_S
RV
SW
T_S
RV
SE
R_S
RV
EX
TÍN
T_S
RV
TI_
SR
V
RI_
SR
V
HS
I4_S
RV
T2C
AP
_SR
V
T2O
VF
_SR
V
EX
TPIN
_SR
V
FIF
CLS
RV A
0063
-BO
C-6
6C
-67
iny«
8XC
196K
C/K
D R
EG
ISTE
RS
8XC
196K
C/K
D R
EG
IST
ER
S
PT
SS
RV
Bit
Num
ber(
s)
0 1 2 3 4 5 6 7
Bit
Mne
mon
lc
T1O
VF
_SR
V
AO
_SR
V
HS
IDA
TJS
RV
HS
O_S
RV
HS
IO_S
RV
SW
T_S
RV
SE
R_S
RV
EX
TIN
T__S
RV
Bit
Ñam
o
Tlm
er 1
Ove
rflo
wIn
terrup
t -
Ser
ve
A/D
•
Con
vers
ión*
Com
plet
ein
terr
upt
Ser
ve
HS
Í Dat
aA
vaila
ble/
FIFO
Ful
lIn
tern
Jpl
Ser
ve
HS
O O
utpi
/tE
vent
Inte
rrup
tS
erve
HS
I.OE
xter
n al
Inte
rrup
tS
erve
Sof
twar
eTl
mer
Inle
rrup
tS
erve
Ser
ial
Por
tIn
terr
upt
Ser
ve
EX
TIN
T P
inor
P0.
7In
terr
upt
Ser
ve
Res
etS
tate
0 0 0 0 0 0 0 0
Deacr
lptlo
n
Thi
s bi
t Is
sel
whe
n P
TS
CO
UN
T f
or t
heT
imer
1 O
verf
low
PT
S c
hann
el re
ache
sze
ro, w
hlch
Inltiat
es a
n e
nd-o
f-PT
SIn
lerr
upt
thro
ugh
loca
tíon
2000
H.
'
Thl
s bi
t Is
set
whe
n P
TS
CO
UN
T fo
r th
eA
/D C
ompl
ete
PT
S c
hann
al re
ache
sze
ro, w
hlch
Iníti
ates
an
end-
oí-P
TS
inte
rrup
t th
roug
h lo
catlo
n 2
002H
.
Thl
s bll
Is s
et w
hen P
TS
CO
UN
T fo
r th
eH
SI
PT
S c
hann
el r
each
es z
ero,
whl
chin
itlat
es a
n en
d-of
-PT
S In
terr
upt
thro
ugh
loca
tlon
2004
H.
Thl
s bi
t Is
set
whe
n P
TS
CO
UN
T fo
r th
eH
SO
PT
S c
hann
el r
each
es z
ero,
whl
chin
ltiat
es a
n en
d-of
-PT
S In
terr
upt
thro
ugh
loca
tion 2
006H
.
Thl
s bi
t Is
set
whe
n P
TS
CO
UN
T fo
r th
eH
SI.O
PT
S c
hann
el r
each
es z
ero,
whi
chIn
itlat
es a
n e
nd-o
f-PT
S i
nter
rupt
thro
ugh
loca
tlon
2008
H.
Thi
s bi
t Is
set
whe
n P
TS
CO
UN
T fo
r th
eS
oftw
are
Tlm
er P
TS
cha
nnel
reac
hes
zero
, whl
ch In
ltiat
es a
n en
d-of
-PT
Sin
terr
upt
thro
ugh
loca
tlon
200A
H.
Thl
s bi
t is
set
whe
n P
TS
CO
UN
T fo
r th
eS
eria
l Por
t P
TS
cha
nnel
rea
ches
zer
o,w
hich
Inttl
ates
an
end-
of-P
TS
Int
erru
plth
roug
h lo
catio
n 2
00C
H.
Thl
s bi
t is
set w
hen P
TS
CO
UN
T fo
r the
EX
TIN
T P
TS
cha
nnel
rea
ches
zer
o,w
hich
Inlti
ates
an
end-
ol-P
TS
Inte
rrup
tth
roug
h lo
catio
n 20
0EH
,
PTS
SR
V
Bit
Num
ber(
s)
8 g 10 11 12 13 14 15
Bit
Mne
mon
lc
TLS
RV
RI_
SR
V
HS
I4_S
RV
T2C
AP
_SR
V
T2O
VF
_SR
V
EX
TP
IN_S
RV
FIF
O_S
RV
—
Bit
Ñam
e
Tran
smH
Inte
nrup
tS
erve
Rec
eive
Inte
rrup
tS
erve
HS
I FIF
O 4
Inte
rrup
tS
erve
Tlm
er 2
Cap
ture
Inte
rrup
tS
erve
Tlm
er 2
Ove
rflow
Inte
rrup
tS
erve
EX
TIN
T P
inIn
tern
jpt
Ser
ve
HS
I FI
FOFul
l In
terr
upt
Ser
ve
—
Res
etS
tate
0 0 0 0 0 0 0 0
Desc
rlptlo
n
Thls
btí
Is s
et w
hen
PT
SC
OU
NT
lor
the
TI
PT
S c
hann
el r
each
es z
ero,
whl
chin
ítiat
es a
n e
nd-o
f-PT
S In
terrup
t th
roug
hlo
catio
n 20
30H
.
Thl
s bi
t Is
set
whe
n P
TS
CO
UN
T fo
r th
eR
l PTS
cha
nnel
reac
hes
zero
, whl
chIn
ltiat
es a
n en
d-of
-PT
S in
terr
upt
thro
ugh
loca
tlon
203
2H.
Thl
s bi
t Is
set
.whe
n P
TS
CO
UN
T f
or th
eH
SI4
PT
S c
hann
el r
each
es z
ero,
whl
chIn
itlat
es a
n en
d-of
-PT
S in
terr
upt
thro
ugh
loca
tion
2034
H.
Thl
s bi
t Is
set
whe
n P
TS
CO
UN
T fo
r th
eT
2 C
aptu
re P
TS
cha
nnel
reac
hes
zero
,w
hlch
Initf
ates
an
end-
ol-P
TS
Inte
rrup
tth
roug
h lo
catlo
n 2
036H
.
Thl
s bi
t Is
set
whe
n P
TS
CO
UN
T f
or th
eT
lmer
2 O
verf
low
PT
S c
hann
el r
each
esze
ro, w
hlch
Ini
tlate
s an
end
-of-
PT
SIn
terr
upt
thro
ugh
loca
tlon
203
8H.
Thi
s bi
t Is
set
whe
n P
TS
CO
UN
T f
or t
heE
XT
PIN
PT
S c
hann
el r
each
es z
ero,
whi
ch In
itlat
es a
n en
d-of
-PT
S I
nter
rupt
thro
ugh lo
catlo
n 2
03A
H.
This
. bit
Is s
et w
hen
PT
SC
OU
NT
for
the
FIFO
PT
S c
hann
el r
each
es z
ero,
whi
chin
ltlal
es a
n en
d-of
-PT
S in
terr
upt
thro
ugh
loca
tlon
203C
H.
Res
erve
d; a
iway
s w
rtte
as
zero
.
C-6
8C
-69
8XC
1&S
KC
/KD
R
EG
ISTE
RS
PWM
O C
on
tro
l R
egls
ter
PW
MC
TC
ON
TR
OL
17H
HW
indo
w O
(Writ
e), H
Win
dow
15
(Rea
d)
PWM
O i
s m
ulti
plex
ed w
ith
P2.5
. IO
CI.
O m
usí
be s
et t
o en
able
the
PW
MO
out
put
func
tion
.
The
P
WM
's e
ight
-bit
coun
ter
¡s i
ncre
men
ted
ever
y st
ate
tim
e (w
ith
the
PWM
pr
esca
ler
disa
bled
) or
eve
ry t
wo
stat
e ti
mes
(w
ith
the
PWM
pre
scal
er e
nabl
ed).
W
hen
the
coun
ter
iseq
ual
to z
ero,
the
PW
MO
out
put
is d
ríve
n hi
gh.
It r
emai
ns
high
un
til
the
coun
ter
valu
ém
atch
es t
he v
alué
in
this
reg
iste
r, a
t w
nlch
tim
e th
e ou
tput
is
pull
ed l
ow.
Whe
n th
e co
untc
rov
erfl
ows,
the
out
put
is a
gain
sw
itche
d hi
gh.
Whe
n PW
MO
__C
ON
TR
OL
equ
als
zero
, th
eou
tput
is
alw
ays
low
.
The
PW
MO
_CO
NT
RO
L r
egis
ter,
in
con
junc
tion
w
ith
IOC
2.2,
det
erm
ines
how
lo
ng
the
PWM
O o
utpu
t is
held
hig
h du
ring
the
pi Is
e, e
ffec
tive
ly c
ontr
olli
ng t
he d
uty
cycl
e. T
he v
alué
wri
tten
to
PWM
O^C
ON
TR
OL
reg
iste
r ca
n be
fro
m O
to 2
55 s
tate
tim
es (
0% t
o 99
.6%
du
tycy
cle)
.
Sett
ing
ÍOC
2.2
enab
les
the
PW
M's
div
ide-
by-t
wo
cloc
k pr
esca
ler;
cle
arin
g IO
C2.
2 di
sabl
esit.
Whe
n th
e pr
esca
ler
is e
nabl
ed,
the
tota
l le
ngth
of
the
puls
e is
512
sta
te t
imes
and
th
ePW
MO
_CO
NT
RO
L v
alué
is
mul
tipl
ied
by 4
. W
hen
it is
dis
able
d,
the
tota
l pu
lse
leng
th í
s25
6 st
ate
tim
es a
nd t
he P
WM
O_C
ON
TR
OL
val
ué i
s m
ulti
plie
d by
2.
PWM
O
CO
NT
RO
L7
65
43
21
O
STA
TEJT
IME
S
Bit
Num
ber(s)
0-7
BU M
nem
onlc
ST
AT
EJ1
ME
S
Bit
Ñam
a
PWM
O H
ighSt
ale
Tim
as
Res
etS
tate
0000
000
0
Desc
riptlo
n
Thes
e bi
ts d
eter
min
e th
e nu
mbe
r oí s
tate
times
that
the
PWM
O o
utpu
t fs
held
hig
hdu
ring
the
pulse
. Writ
e a
hexa
decl
mal
valu
é (O
OH
- FFH
) to
thfs
reg
lste
r.
C-7
0
8XC
196K
C/K
D R
EG
ISTE
RS
PW
MO
_C
ON
TR
OL
The
fol
low
ing
form
ulas
are
use
d to
det
erm
ine
the
PW
M p
erio
d an
d th
e ti
me
that
the
out
put
is h
eld
high
:
PWM
Per
iod
(In fi
sec.
) -
PW
M* H
igh
(in us
ec.) -
Clo
ck P
resc
aler
Dis
able
d(IO
C2.
2=K
))
51_2
_
Clo
ck P
resc
aler
Ena
bled
(IOC
2.2=
1)
102.
4
Fose
PW
Mx
CO
NT
RO
L x
2
Fos
e
Fose
PWM
x_C
ON
TRO
L x
4Fo
se
whe
re:
Fose
Is th
e XT
AL1
frequ
ency
, In
MH
z
For
exam
ple,
if
FQSC
equ
als
16 M
Hz,
'the
n th
e pe
riod
of
the
PWM
ou
tput
w
avef
orm
is
32 u
s. I
f IO
C2.
2 is
cle
ar a
nd P
WM
O_C
ON
TR
OL
equ
als
8AH
(13
8 de
cim
al),
PW
MO
is
held
high
for
17
.25
us
(and
lo
w f
or
14.8
us)
of
the
tota
l 32
us,
re
sult
ing
in a
dut
y cy
cle
ofap
prox
imat
ely
54%
. W
hen
IOC
2.2
is s
et, t
he s
ame
valú
es w
ould
pro
duce
a p
erio
d of
64
usan
d PW
MO
wou
ld b
e he
ld h
igh
for
34.5
us
(and
low
for
29.
5 us
), fo
r th
e sa
me
duty
cyc
le,
appr
oxim
atel
y 54
%.
C-7
1
CeIn
tel.
8XC
196K
C/K
D R
EGIS
TER
S
PW
M1
Contr
ol
Reg
tste
rP
WM
1_C
ON
TRO
L16
HH
WIn
dow
1 (R
ead/
Wrlt
e)
PW
MI
ís m
ulti
plex
ed w
ith
P1.3
. IO
C3Í
mus
t be
set
to
enab
le t
he P
WM
I ou
tput
fun
ctio
n.
The
P
WM
l_C
ON
TR
OL
reg
iste
r, i
n co
njun
ctio
n w
ith
IOC
2.2,
det
erm
ines
ho
w
long
th
ePW
M I
out
put i
s he
ld h
igh
duri
ng t
he p
ulse
, eff
ecti
vely
con
trol
ling
the
dut
y cy
cle.
The
val
uéw
ritt
en t
o P
WM
I^C
ON
TR
OL
reg
iste
r ca
n be
fro
m O
to 2
55 s
tate
tim
es (
0% t
o 99
.6%
dut
ycy
cle)
. Pl
ease
re
fer
to
the
PWM
G_C
ON
TR
OL
re
gist
er
desc
ript
ion
for
addi
tion
alin
form
atio
n.
PW
M1
CO
NT
RO
L7
65
43
21
O
STA
TE
TIM
ES
Bit
Num
ber(
s)0-7
Bit
Mne
mon
lc
STAT
E_TI
MES
Bit
Nar
re
PWM
l Hífh
Stal
e Ti
mes
Res
etS
tate
00000000
Des
crip
tion
Thes
e bi
ts d
eter
min
e th
e nu
mbe
r oí s
tate
times
that
Ihe
PWM
1 ou
tput
is h
eld h
ighdu
ring
the p
ulse
. Writ
e a
hexa
dedm
alva
lué
(OO
H- F
FH) t
o th
is re
glsl
er.
C-7
2
¡niel.
8XC
196K
C/K
D
REG
ISTE
RS
PW
M2
Con
trol
Reg
iste
rP
WM
2_C
ON
TR
OL
17H
HW
Indo
w 1
(Rea
d/W
rlte)
PW
M2
is m
ulti
plex
ed w
ith
Pl .
4. I
OC
3.3
mus
t be
set
to
enab
le t
he P
WM
2 ou
tput
fun
ctio
n.
The
P
WM
2_C
ON
TR
OL
reg
iste
r, i
n co
njun
ctio
n w
ith
IOC
2.2,
det
erm
ines
how
lo
ng
the
PW
M2
outp
ut i
s he
ld h
igh
duri
ng t
he p
ulse
, eff
ecti
vely
con
trol
ling
the
dut
y cy
cle.
The
val
uéw
ritt
en t
o P
WM
2_C
QN
TR
OL
reg
iste
r ca
n be
fro
m O
to 2
55 s
tate
tim
es (
0% t
o 99
.6%
dut
ycy
cle)
. P
leas
e re
fer
to
the
PWM
O^C
ON
TR
OL
re
gist
er
desc
ript
ion
for
addi
tion
alin
form
atio
n.
PW
M2
CO
NT
RO
L7
65
43
21
0
STAT
E
TIM
ES
Bit
Num
ber(
s)0-7
Bit
Mne
mon
lc
STA
TEJI
ME
S
Bit
Ñam
e
PWM
2 H
lghSt
ate T
imes
Res
etS
tate
00000000
Des
crip
tion
Tríe
se b
its d
eter
min
e th
e nu
mbe
r of s
tale
times
that
the
PWM
2 ou
tput
is h
eld
high
durin
g th
e pu
lse.
Writ
e a
hexa
decí
mal
valu
é (O
OH -
FFH)
to th
is re
gist
er.
C-73
8XC
196K
C/K
D R
EQ
ISTE
RS
Seria
l Por
t R
ecei
ve B
uffe
r R
egfs
ter
SB
UF
(R
X)
07H
HW
Indo
w O
(R
ead)
, H
WIn
dow
15 (W
rlte)
The
Ser
ial
Port
Rec
eive
B
uffe
r re
gist
er c
onta
ins
data
rec
eive
d fr
om
the
seri
al
port
. T
hese
rial
por
t re
ceiv
er i
s do
uble
-buf
fere
d an
d ca
n be
gin
rece
ivin
g a
seco
nd d
ata
byte
bef
ore
the
firs
t byl
e is
rea
d. D
ata
is h
eld
in t
he r
ecei
ve s
hift
reg
iste
r un
til t
he l
ast
data
bit
is r
ecei
ved,
then
the
dat
a by
te is
loa
ded
into
SB
UF
(RX
). I
f da
ta i
n th
e sh
ift
regi
ster
is l
oade
d in
to S
BU
F(R
X)
befo
re th
e pr
evio
us b
yte
is r
ead,
(fíe
ove
rflo
w e
rror
bit
is s
et (
SP
_ST
AT
.2).
The
dat
a in
SB
UF
(RX
) w
ill
alw
ays
be t
he l
ast
byte
rec
eive
d, n
ever
a c
ombi
nati
on o
f th
e la
st t
wo
byte
s.
BX
C19
6KC
/KD
RE
QIS
TER
S
Seria
l Port
Tra
nsm
lt B
uffer
Regis
ter
SB
UF
(RX
)-
76
54
32
10
RX
DA
TAAo
oea-A
O
SB
UF
(TX
)07
HH
WIn
dow
O (W
rlte),
HW
Indo
w 1
5 (R
ead)
The
Ser
ial
Port
Tra
nsm
it B
uffe
r re
gist
er c
onta
ins
data
tha
t is
rea
dy f
or t
rans
mis
sion
. In
mod
es 1
, 2,
and
3, w
riti
ng t
o S
BU
F (T
X)
star
ts a
tra
nsm
issi
on. I
n m
ode
O, w
riti
ng t
o SB
UF
(TX
) st
arts
a t
rans
mis
sion
onl
y if
the
rec
eive
r is
dis
able
d (S
P__C
ON
.3=0
).
Bit
Num
ber(
s)0-7
Bit
Mne
mon
lc
RX
_DA
TA
Bit
Ñam
o
Data
Rece
ived
Res
etS
tate
0000
0000
Des
crlp
tlon
The
se b
its c
onta
in th
e la
st b
yle
of
data
rece
rved
from
Ihe
ser
ial p
ort.
SB
UF
(TX
)7
65
43
21
0
TX
DAT
A
Bit
Num
ber(
s)0-7
Bit
Mne
mon
lc
TX
_DA
TA
Bit
Ñam
e
Dat
a to
Tra
nsm
lt
Res
etS
tate
0000
0000
Des
crlp
tlon
The
se b
rts c
onta
in a
byt
e oí
dat
a to
be
tran
smltt
ed b
y th
e se
rial p
ort.
C-7
4C
-75
m8X
C19
SK
C/K
D R
EG
ISTE
RS
Sta
ck P
olnt
er
8XC
196K
C/K
D R
EG
ISTE
RS
SP19
/18H
All
HW
Indo
ws
(Rea
d/W
rite)
The
sys
tem
's s
tack
poi
nler
may
poí
nt a
nyw
here
¡n
the
64K
int
emal
or
exte
rnal
mem
ory;
it
mus
t be
wor
d al
ignc
d an
d m
ust
alw
ays
be
init
iali
zed
befo
re
use.
T
he
stac
k po
inte
r ¡s
decr
emen
ted
befo
re
a PU
SH a
nd i
ncre
men
ted
afte
r a
POP,
so
the
stac
k po
inte
r sh
ould
be
init
iali
zed
to t
wo
byte
s ab
ove
the
high
est
stac
k lo
cati
on.
If s
tack
ope
rati
ons
are
not
bein
gpe
rfor
med
, lo
cati
ons
18H
and
19H
may
be
used
as
stan
dard
RA
M.
SP
15
14
V.
Bit
Nuf
nber
(s)
0-7
8-15
Bit
13 — - —
12 111
10
r
Mne
mon
lc
SP
_LO
SP
_H!
98
7 !J
^_
Bit
Nar
rm
Stac
k Po
InO
r(L
O)
Stac
k Po
lnlo
r(H
l)
65
. — - —
43
2
— — T
—
Res
etS
tate
xxxx
xxx
x
xxxx
xxx
x
0
__;
cjp
1
n
SP
_HI
Des
crfp
tlon
The
low
byt
e oí
the
syst
em's
stac
kpo
inte
r.
The
hlgh
byt
e of
the
sysl
em's
sla
ckpo
inte
r.
Ser
ial P
ort
Co
ntr
ol R
egls
ter
SP
__C
ON
11H
HW
Indo
w O
(Writ
e), H
WIn
dow
15
(Rea
d)
Tlie
Ser
ial
Por
t C
ontr
ol r
egis
ter
sele
cts
the
Com
mun
icat
ions
mod
e an
d en
able
s or
di
sabl
esth
e re
ceiv
er, e
ven
pari
ty c
heck
ing,
and
nin
e-bi
t da
ta t
rans
mis
sion
.
TX
D s
hare
s a
pin
wit
h P2
.0.
IOC
1.5
mus
t be
set
to
enab
le t
he T
XD
fun
ctio
n. T
XD
ser
ves
asth
e tr
ansm
it pi
n fo
r se
rial
por
t m
odes
1, 2
, an
d 3
and
the
shif
t cl
ock
for
mod
e 0.
RX
D s
hare
sa
pin
wit
h P
2.1.
SP_
_CO
N.3
mus
t be
set
to
enab
le t
he R
XD
fun
ctio
n. R
XD
rec
eive
s se
rial
port
dat
a in
mod
es 1
, 2,
and
3 an
d fu
ncti
ons
as a
n ín
put
or a
n op
en-d
rain
out
put
for
data
in
mod
e 0.
SP
CO
N7
65
43
21
0
SE
R_M
OD
E
PE
N
RE
N
TB
8
C-7
6C
-77
¡nie
l,
SP
C
ON
Bit
Num
ber(
s)
0-1 2 3 4 5-7
Bit
Mne
mon
ic
SE
R_M
OD
E
PE
N
RE
N
TB
8
—
Bit
Ñam
e
Mod
eS
elec
tlon
Eve
n P
arity
Ena
ble
Rec
elve
Ena
ble
Tra
nsm
ltN
lnth
Dat
a,Bi
t
—
Re
set
Sta
te
11 0 1 0 000
Des
crlp
tlon
The
se t
wo
bits
sel
ect
the
Com
mun
icat
ions
mod
e.
BII1
B
ltO
0 0
Mod
e 0
0 1
Mod
e 1
1
0
Mod
e 2
1
1
Mod
e 3
In m
odes
1 a
nd 3
, set
tlng
this
bit
enaW
esth
e p
aríty
func
tlon,
Thl
s bi
t m
ust b
ecl
eare
d ff
mod
e 2
Is u
sed.
Wne
n th
ls b
itis
set
, TB
8 ta
kes
the
even
par
íty v
alué
on tr
ansm
lssl
ons.
With
pan
ty e
nabl
ed,
SP
S
TA
T.7
bec
omea
(he
Rec
elve
Par
ityE
rror
bit.
Set
tlng th
ls b
it en
able
s th
e R
XD
func
tlon
of t
he P
2.1/
RX
D p
in.
Whe
n th
ls b
it fs
set
,a
hlgh
-to-
low
tran
sltlo
n on
the
pin
sta
rts
a re
cept
ion In
mod
e 1 ,
2, o
r 3.
In m
ode
0,th
ls b
it m
ust
be c
lear
lor
tran
smls
sion
tobe
gln
and
mus
t be
set
for
rece
ptio
n to
begl
n. C
lear
ing
this
bit
stop
s a re
cept
ion
in p
roqr
ess
and In
hibl
ts fu
rther
rece
ptlo
ns.
Thl
s Is
the n
lnth
dat
a bH
that
wfll
be
tran
smltt
ed In
mod
e 2
or 3
, Thl
s bH
iscl
eare
d al
ter
each
tran
smls
sion
, so
itm
ust
be s
et b
efor
e S
BU
F (
TX
) is
wrlt
ten.
Whe
n S
PC
ON
.2 Is
set
, thi
s bi
t ta
kes
onth
e ev
en p
aríty
val
ué.
Res
erve
d; a
hvay
s w
rite
as
zero
s.
C-7
8
8XC
196K
C/K
D R
EG
IST
ER
S
Ser
ial
Por
t S
tatu
s R
egis
ter
SP
^STA
T11
HH
Win
dow
O (R
ead)
, HW
Indo
w 1
5 (W
rlte
)
The
Ser
ial
Pon
Sta
tus
regi
ster
con
tain
s bi
ts th
at i
ndíc
ate
the
stat
us o
f th
e se
rial
por
t.
SP
S
TA
T7
65
43
21
0
R
R
FE TI
. R
l
. R
PE
/RB
8
C-7
9
8XC
195K
C/K
D R
EG
ISTE
RS
SP_S
TAT
Bit
Num
ber(
s)
0-1
2 3 4 5 6 7
Bit
Mne
mon
lc
— OE
TXE
'
FE TI
Rl
RPE
/RB8
Bit
Ñam
e
~
;O
verru
nEr
ror
SBUF
(TX)
Empt
y ,
Fram
ing
('Er
ror
¡
Tran
smlt
Inte
rrupt
Rec
eive
Inte
rrupt
Rec
eíve
dPa
rity
Erro
r/R
ecei
ved
Bit
8
i
Res
etS
tate
11 0 0 1 0 0 0
Desc
rlptlo
n
Res
erva
d; a
rway
s w
rite
as z
ero.
Thls
bit
Is s
et H
data
In th
e re
celve
shj
ltre
gjst
er Is
load
ed In
to S
BUF
(RX)
bel
ore
the
prev
ious
bit
Is r
ead.
Rea
ding
SP_S
TAT
dear
s th
ls b
it.
Thls
bit
Is s
et lí
the
trans
mlt
buffe
r is
empt
y an
d re
ady
to a
ccep
t up
to tw
och
arac
ters
. U Is
cle
ared
whe
n a
byle
fsw
ritte
n to
SBU
F (T
X).
This
bit
Is s
et lí
a s
top
bit i
s no
t lou
ndw
ithln
the
appr
oprla
te p
erlo
d of
tim
e.R
eadi
ng S
P_ST
AT d
ears
thi
s bi
t.
Thls
bit
Is s
el a
t the
beg
lnnl
ng o
í the
sto
pbi
t tra
nsm
issi
on. R
eadi
ng S
P_ST
ATcl
ears
thls
bit.
Thls
bit
Is s
et w
hen
the
last
dat
a bi
t Is
sam
pled
. Rea
ding
SP
STA
T cl
ears
thls
bit.
Thls
bit
need
not
be
clea
r for
the
aeria
lpo
rl to
rece
lve
data
.
RPE
Is s
et II
par
ity Is
dlsa
bled
(SP
CO
N.2
-0)
and
the
nint
n da
ta b
itre
ceTv
ed Is
hlg
n.
RB8
Is s
et ií
par
ity ¡s
ena
bled
(SP
_CO
N.2
-1 ) a
nd a
par
ity e
rror
occu
rred.
Rea
ding
SP^
STAT
cle
ars
thls
bit.
c-eo
inté
l.8X
C19
6KC
/KD
RE
GIS
TER
S
Tim
er 2
Cap
ture
Reg
iste
rT
2CA
PT
UR
EO
D/O
CH
HW
Ind
ow
15 (
Read
/Wri
te)
A r
isin
g ed
ge
on P
2.7
cau
ses
the
valu
é of
Tim
er 2
to
be c
aptu
rad
¡nto
the
T2C
AF
TU
RE
regi
ster
and
gen
eral
es a
Tim
er 2
Cap
ture
int
erru
pt (
INT
I ) ,
203
6H).
IN
T_M
AS
K 1 .3
mus
t be
set
to e
nabl
e th
e in
terr
upt.
T2C
AP
TU
RE
15
14
13
12
11
10
9 8
7 6
5 4
3 2.
1
O
T2__
VALU
E (L
O)
T2_
VA
LUE
(Hí)
A00
69-A
Q
Bit
Num
ber(
s)
0-7
8-1
5
Bit
Mne
mon
lc
T2_V
ALU
E (L
O)
T2_V
ALU
E (H
l)
Bit
Ñam
e
Tim
er 2
Low
Byte
Tim
er 2
Hlg
hBy
te
Res
etS
tate
XXXX
XXX
X
XXXX
XXX
X
De
scrl
ptlo
n
Thes
e bi
ts c
onta
ln th
e lo
w b
yte
oí th
eca
ptur
ad va
lué
oí T
imer
2.
Thes
e bi
ts c
onta
ln th
e hl
gh b
yte
oí th
eca
ptur
ed v
alué
oí T
imer
2.
C-8
1
•«fe
. Inte
l.8X
C19
6KC
/KD
RE
GIS
TE
RS
Tlm
er 1
Reg
iste
rTIM
ER
1O
B/O
AH
HW
Indo
w O
(R
ead)
, H
WIn
dow
15
(Wrlt
e)
The
tw
o by
tes
of t
he T
IME
R I
regi
ster
con
tain
the
val
ué o
f T
imer
I.
Thi
s re
gist
er c
an b
ew
ritt
en, a
llow
ing
Tim
er I
to
be i
niti
aliz
ed t
o a
valu
é ot
her
than
zer
o.
Tim
er I
¡s
a 16
-bit,
fre
e-ru
nnin
g ti
mer
tha
t is
inc
rem
ente
d ev
ery
eigh
t st
ate
tim
es. S
etti
ngIO
CI.
2 ca
uses
an
over
flow
to
gen
érat
e a
Tim
er O
verf
low
in
terr
upt
(IN
TOO
, 20
00H
) if
INT
_Jvt
ASK
.O is
als
o se
l, en
abli
ng t
he in
terr
upt.
Use
cau
tion
whe
n w
riti
ng t
o T
imer
1 i
/ th
e H
SI a
nd H
SO m
odul
es a
re i
n use
. HSO
tim
een
trie
s in
the
CA
M d
epen
d on
exa
ct m
alch
es w
ith
Tim
er I
. Als
o, c
hang
ing
Tim
er 1
bet
wee
nin
com
ing
even
ts o
n th
e H
SI
line
s w
ill c
ornt
pt r
elat
ive
refe
renc
es b
etw
een
even
ts.
T1M
ER
1 {H
l)A
00?0
-A0
Bit
Nu
mb
er{3
)
0-7
8-15
Bit
Mn
emo
nlc
TIM
ER1
(LO
)
TIM
ER1 (
Hl)
Bit
Nam
n
Tim
er 1
Valu
é, H
Igh
Byte
Tim
er 1
Valu
é, L
owBy
líj
Res
etS
tate
0000
0000
0000
0000
Des
crip
tlo
n
Thes
e bi
ts c
onst
ítute
the
low
byt
e of
the
Tim
er 1
val
ué.
Thes
e bi
ts c
onst
ítute
Ihe
hígh
byt
e oí
the
Tim
er 1
val
ué.
C-8
2
8XC
196K
C/K
D R
EQ
IST
ER
S
Tlm
er 2
Reg
lste
rT
IME
R2
OD
toC
HH
WIn
dow
O (R
ead/
Wrlt
e)
The
tw
o by
tes
of t
he T
IME
R2
regi
ster
con
tain
the
val
ué o
f T
imer
2.
Thi
s re
gist
er c
an b
ew
ritt
en, a
llow
ing
Tim
er 2
to
be i
niti
aliz
ed t
o a
valu
é ot
her
than
zer
o.
Tim
er 2
is
a 16
-bit
coun
ter t
hat
can
be c
lock
ed e
ithe
r in
tern
ally
or
exte
rnal
ly, d
epen
ding
on
the
stat
e of
1O
C3.
0. I
f an
ext
erna
! cl
ock
sour
ce i
s se
lect
ed,
1OC
0.7
cont
rols
whi
ch o
f tw
oex
tem
al s
ourc
es i
s us
ed.
Dep
endi
ng o
n th
e st
ate
of I
OC
2.0,
Tim
er 2
cou
nts
ever
y ei
ght
cloc
ks (
norm
al m
ode)
or
ever
y cl
ock
(fas
t in
crem
ent m
ode)
.
IOC
2.I
cont
rols
the
dir
ecti
on o
f T
imer
2.
Wit
h IO
C2.
1 cl
ear,
Tim
er 2
cou
nts
up.
Wit
hIO
C2
I se
t, T
imer
2 c
ount
s up
or
dow
n, d
epen
ding
on
the
stat
e of
P2.6
. Use
cau
tion
whe
nth
is f
eatu
re i
s en
able
d an
d w
orki
ng w
ith
the
HS
O. I
f T
imer
2 d
oes
not c
ount
thr
ough
all
64K
valú
es, e
vent
s in
the
CA
M m
ay n
ever
mat
ch t
he t
imer
.
A T
imer
2 o
verf
low
can
gen
érat
e ei
ther
a T
irne
r O
verf
low
int
erru
pt (
INTO
O,
2000
H)
or a
Tim
er
2 O
verf
low
in
terr
upt
(IN
T12
, 20
38H
).
Set
or
clea
r IO
CI.
3,
INT
_MA
SK.O
, an
dIN
T_M
AS
KI.
4 to
con
figu
re T
imer
2 f
or t
he d
esir
ed i
nter
rupt
.
Thi
s re
gist
er c
an b
e cl
eare
d by
har
dwar
e, s
oftw
are,
or
an H
SO c
omm
and,
dep
endi
ng o
n th
est
atcs
ofI
OC
Ü.3
,IO
CO
.l,
and
HS
O_C
OM
MA
ND
.O-H
SO
_CO
MM
AN
D.3
, res
pect
ivel
y.
TIM
ER
2 15 ^
1413 .— —
•12 1
1 1
0
98
76
54
32
1
0
— >P
— i
\ - '
T1M
FR?
(LO
)
TIU
FR
?
(HI1
A00
71-A
O
Bit
Num
ber(
s)0-7
S-1
5
Bit
Mne
mon
lc
TIM
ER
2 (L
O)
TIM
ER
2 (H
l)
Bit
Ñam
e
Tim
er 2
Val
ué, L
owB
yte
Tim
er 2
Val
ué, H
Igh
Byt
e
Res
et
.S
tate
0000
0000
0000
0000
Desc
rlptlo
n
Thes
e bi
ts c
onst
ltute
the
low
byt
e oí
the
Tlm
er 2
val
ué.
Thes
e bi
ts c
onsl
ltute
the
hígh
byt
e of
the
Tim
er 2
val
ué.
C-8
3
r8X
C19
5KC
/KD
RE
GIS
TÉR
S8X
C19
6KC
/KD
RE
GIS
TÉR
S
UP
RO
M S
pecl
al F
unct
lon
Reg
líJte
rU
SFR
1FF
6H(R
ead)
The
UPR
OM
(U
nera
seab
le P
RO
M)
SFR
con
tain
s lw
o bi
ts t
hat
disa
ble
exte
rna!
Fet
ches
of
data
an
d in
slru
ctio
ns.
The
se
bits
can
be
prog
ram
med
, bu
t ca
nnot
be
era
sed.
(R
efer
to
Cha
pter
14,
"P
rogr
amm
ing
the
Non
-Vol
atil
e M
emor
y,"
for
deta
ils.
) T
he r
emai
ning
bit
s.ar
ere
serv
ed.
I ;WA
RN
ING
The
se b
its
can
be p
rogr
amm
ed,
buí
can
neve
r be
era
sed,
Pro
gram
min
g th
ese
bits
rnak
es
dyna
mic
fa
ilur
e an
alys
is •
impo
ssib
lc.
For
this
re
ason
, de
vice
s w
ith
prog
ram
med
UP
RO
M b
its
cann
ot b
fi re
turn
ed t
o In
tel
for
fail
ure
anal
ysis
.
Watc
hdog T
lmer
Reg
lste
rA
HH
WIn
dow
O (C
lear
/Ena
ble)
i HW
Indo
w 1
5 (R
ead)
Unl
ess
it is
cle
ared
eve
ry 6
4K s
tate
tim
es,
the
wat
chdo
g ti
mer
res
ets
the
8XC
196K
C/K
D.
To
clea
r th
e w
atch
dog
tim
er,
send
a "
lEH
" fo
llow
ed i
mm
edia
tely
by
an "
EIH
" to
loc
atio
nO
AH
in
HW
indo
w 0
. C
lear
ing
this
reg
iste
r the
fir
st t
ime
enab
les
the
wat
chdo
g w
ith
an i
niti
alva
lué
of
OO
OO
H,
whi
ch i
s in
crcm
ente
d on
ce
ever
y st
ate
tim
e. A
fter
it
is e
nabl
ed,
the
wat
chdo
g ca
n be
dis
able
d on
ly b
y a
rese
t. T
he e
ight
mos
t-si
gnif
ican
t bi
ts o
f th
e w
atch
dog
valu
é ca
n be
rea
d in
HW
indo
w 1
5.
US
FR
7 6
5 4¡
3
2 1
0
R
R
R
_R[
R
R
jD
En
PF
IA
CK
M7-
AO
WA
TC
HD
OG
76
54
32
10
WA
TCH
DO
G
Bit
Num
ber(
s)0-1 2 3 4-7
Bit
Mne
mon
lc
— DE
D
DE
I
—
' Bit
Ñam
ó
— Disa
ble
Exte
rna!
!
Data
fetc
h
Disa
ble
Exte
rnal
Inst
ruct
ion
íetc
h .
—
Res
etS
tate
00 0000
Des
crip
tfon
Rese
rved
; alw
ays
write
as
rero
.
Setti
ng th
ís bi
t pre
vení
s th
e bu
sco
ntro
ller (
rom
exe
cutin
g ex
tem
al d
ata
read
s an
d w
rites
. Any
atte
mpt
to a
cces
sda
ta th
roug
h th
e bu
s co
ntro
ller i
nltla
tes
are
set.
Setti
ng th
ís b
it pr
even
ís th
e bu
sco
ntro
ller (
rom
exe
cutin
g ex
tern
alIn
stru
ctio
n (e
lche
s. A
ny a
ttem
pt lo
load
an e
xler
nal a
ddre
ss in
ittat
es a
rese
t.
Rese
rved
; alw
ays w
rite
as z
ero.
Bit
Nu
mb
er(s
)0-7
Bit
Mn
emo
nlc
WA
TCH
DO
G
Bit
Ñam
e
Wat
chdo
gTl
mer
Val
ué
Res
etS
tate
xxxx
xxx
x
Des
crlp
tlon
Thls
byt
e co
ntai
ns th
e 8
mos
l-slg
níHc
ant
bits
of t
he c
urre
nl v
alué
of t
he W
atch
dog
tlmer
.
C-8
4C
-85
i r
8XC
196K
C/K
D R
EG
ISTE
RS
Wfn
dow
Sel
ect
Reg
iste
rW
SR
14H
All
HW
Indo
ws
(Rea
d/W
rlte
)
The
W
SR
has
two
func
tion
s.
One
bi
l sn
able
s an
d di
sabl
es t
he
bus-
hold
pro
toco
l. T
here
mai
ning
bit
s se
lect
hor
izon
tal
win
dow
y (H
WÍn
dow
s) a
nd v
erti
cal
win
dow
s (V
Win
dow
s).
PUSH
A s
aves
thi
s re
gist
er o
n th
e st
ack,
and
PO
PA r
esto
res
it.
Hor
izon
tal
win
dow
s (H
Win
dow
s) a
llow
rcc
ess
to t
he S
peci
al F
unct
ion
Rcg
iste
rs (
SFR
s) b
ym
appí
ng a
24-
byte
wín
dow
int
o th
e lo
wes
t 24
byte
s of
the
Low
er R
egis
ter
Fil
e. H
Win
dow
sO,
I, a
nd 1
5 ar
e ím
plem
ente
d on
the
8X
C59
6KC
/KD
. All
othe
r H
Win
dow
s are
res
erve
d.
Ver
tica
l W
indo
ws
(VW
indo
ws)
map
sec
üons
of
RA
M i
nto
the
uppe
r se
ctio
n of
the
Low
erR
egis
ter
File
, in
32-
, 64-,
or
128-
byte
incr
emen
ts. T
he 8
XC
196K
C h
as 5
12 b
ytes
of
inte
mal
RA
M,
whi
ch c
an b
e m
appe
d in
to s
ixte
en 3
2-by
te V
Win
dow
s, e
ight
64-
byte
VW
indo
ws,
or
four
128
-byt
e V
Win
dow
s. T
he 8
XC
I96K
X>
has
1024
byt
es o
f in
tem
al R
AM
, whi
ch c
an b
em
appe
d in
to t
hirí
y-tw
o 32
-byt
e V
Win
dow
s, si
xtee
n 64
-byt
e V
Win
dow
s, o
r ei
ght
128-
byte
VW
indo
ws.
HW
indo
ws
and
VW
indo
ws
cann
ot b
e ac
tive
at
the
sam
e ti
me.
To
swit
ch b
etw
een
win
dow
s,w
rite
the
win
dow
num
ber
into
bit
s 0-
3 a
nd s
el o
r cl
ear
bits
4-6
, as
app
ropr
iate
. S
ee t
hew
indo
w s
elec
lion
ta
blcs
fo
r cl
arif
icat
ioi,
and
refe
r to
th
e "M
emor
y Sp
ace
Part
itio
ning
"ch
apte
r fo
r add
itio
nal
info
rmat
ion.
WS
R7
6 5
4 .3
2
1 O
WO
-W3
W4
W5
W6
HLD
EN
C-6
6
8XC
196K
C/K
D R
EQ
ISTE
RS
WS
R Bit
Num
ber(
s)0-3 4 5 6 7
Bit
Mne
mon
lc
WO
-W3
W4
W5
W6
HLD
EN
Bit
Ñam
e
Win
dow
Sel
ect
Bits
0-3
Win
dow
Sel
ect
Bit
4
Win
dow
Sel
ect
Bit
5
Win
dow
Sel
ect
Bit
6
HO
LDff/
HLD
A#
Pro
toco
lE
nabl
e
Res
etS
tate
0000
X X X 0
Des
crlp
tlon
Writ
e th
e nu
mbe
r of
the
desl
red
HW
Indo
w o
r V
Win
dow
Into
thes
e lo
urbi
ts a
nd s
elec
t th
e w
indo
w s
lze
byse
ttíng
eith
er W
SR
.4, W
SR
.5, o
r W
SR
.6.
Val
ld H
Win
dow
s ar
e 0,
1,
and
15. V
alfd
VW
indo
ws
are
0-1
5 fo
r th
e 8X
C1
96K
Can
d 0-3
1 fo
r Ih
e 8X
C19
6KD
. To
sele
ctV
Win
dow
s 1
6-3
1 ,
you
mus
í als
o se
tbo
th W
SR
.4 a
nd W
SR
.6.
Set
thls
bit
to s
pedf
y a
128-
byte
VW
indo
w o
r, fo
r the
8X
C19
6KD
onl
y, to
spec
ífy a
32.
-byt
e V
Win
dow
fro
m 1
6-31
.O
lher
wls
e, c
lear
it.
On
the
8XC
196K
C, s
ettln
g th
is b
itse
lect
s a
128-
byte
VW
indo
w.
On
the
8XC
196K
D, i
f WS
R.6
Is c
lear
,se
tting
thls
bit
sele
cts
a 12
8-by
teV
Win
dow
. II W
SR
.6 is
set
, thl
s bi
tfu
nctio
ns a
s th
e hl
gh b
tt of
the
VW
indo
wnu
mbe
r fo
r 32
-byt
e V
Win
dow
s 16
-31.
Set
thls
bit
to s
peci
fy a
64-
bvte
VW
indo
w.
Oth
erw
lse,
cie
ar íl
.
Set
thi
s bi
t to
spe
cify
a 3
2-by
teV
Win
dow
. Oth
erw
ise,
cle
ar It
,
Thls
bit
enab
les
or d
isab
les
the
bus-
hold
prot
ocol
.
1-
enab
le0-
dlsa
ble
HW
tndo
w S
elec
tlons
Des
lred
HW
Indo
wH
Win
dow
O
HW
Indo
w 1
HW
Indo
w 1
5
Dev
lce
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
WS
R B
its7 X X X
6 0 0 0
5 0 0 0
4 0 0 0
3 0 0 1
2 0 0 1
1 0 0 1
0 0 1 1
Hex
Val
uéO
OH
01H
15H
C-8
7
WS
R
8XC
196K
C/K
D R
EG
ISTE
RS
128-
Byt
e V
WIn
dow
Sel
ectlo
ns
64-B
yte
VW
Indo
w S
ele
ctlo
ns
Des
lred
VW
Indo
w
0 1 2 3 4 5 6 7
Add
ress
to
Rem
ap
OO
OO
H
0080
H
OtO
OH
0180
H
0200
H
0280
H
0300
H
0380
H
Dev
lce
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
D
8XC
196K
Ü
8XC
196K
D
8XC
196K
D
WS
R B
its7 X X X X X X X X
6 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0
4 1 1 1 1 1 1 1 1
3 0 0 0 0 0 0 0 0
2 0 0 0 0 1 1 1 1
1 0 0 1 1 0 0 1 1
0 0 1 0 1 0 1 0 1
Hex
Val
ué
10H
11H
12H
13H
14H
15H
16H
17H
Des
lred
VW
Indo
w
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Add
ress
to
Rem
ap
OO
OO
H
0040
H
0080
H
OO
CO
H
0100
H
0140
H
0180
H
01C
OH
0200
H
0240
H
0280
H
02C
OH
0300
H
0340
H
0380
H
03C
OH
Dev
lce
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
O
8XC
196K
C
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
P
8XC
196K
D
WS
R B
its7 X X X X X X X X X X X X X X X X
6 0 0 0 0 0 0 0 0 0 0 0 0
" 0 0 0 0
5 1 1 1 1 1. 1 1 1 I 1 1 1 1 1 1 1
4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Hex
Val
ué20
H
21H
22H
23H
24H
25H
26H
27>i
28H
29H
2AH
2BH
2CH
2DH
2EH
2FH
C-8
8
WS
R
8XC
196K
C/K
D R
EQ
IST
ER
S
32-B
yte
VW
Indo
w S
elec
tlon
s
Des
I red
VW
Indo
w
0 1 2 3 4 5 6 7 8 9 .
10 11 12 13 14 15 16 17 18 19 20
' 21 22 23 24 25 26 27 28 29 30 31
Addre
ss to
Rem
ap
OO
OO
H
0020
H
0040
H
0060
H
0080
H
OO
AOH
OO
CO
H
OO
EOH
0100
H
0120
H
0140
H
0160
H
0180
H
01A
OH
01C
OH
01E
OH
0200
H
0220
H
0240
H
0260
H
0280
H
02A
OH
02C
OH
02E
OH
0300
H
0320
H
0340
H
0360
H
0380
H
03A
OH
03C
OH
03E
OH
Dev
lce
8XC
196K
C/K
D
8X
01
96K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8X
C1
96
KC
/KD
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
C/K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8X
CÍ9
6K
D
8X
C1
96
KD
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
8XC
196K
D
WS
R B
its
7 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 °. 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 '1 0 1
Hex
Val
ué40
H
41H
42H
43H
44H
45H
46H
47H
48H
49H
4AH
4BH
4CH
4DH
4EH
4FH
50H
51H
52H
53H
54H
55H
56H
57H
58H
59H
5AH
5BH
5CH
5DH
5EH
5FH
C-8
9
c».ífc
i<C
196K
C/K
D R
EG
ISTE
HÉ
f)
Zero
Reg
lste
rZ
ER
O_
RE
G01
/OO
HA
ll H
WIn
dow
s (R
ead/
Writ
e)
The
tw
o-by
te Z
ero
regi
ster
is
alw
ays
equa
l to
zer
o. l
t is
use
ful
as a
fix
ed
sour
ce o
f th
eco
nsta
ntze
ro f
or c
ompa
riso
ns a
nd c
alcu
lati
ors.
ZE
RO
_RE
G c
an a
lso
be u
sed
as t
he W
OR
Dva
riab
le i
n a
long
-'mde
xed
refe
renc
e.
Thi
s co
mbi
nati
on o
f re
gist
er s
elec
tion
an
d ad
dres
sm
ode
enab
les
dire
ct a
ddre
ssin
g of
an
y lo
cati
on
in
mem
ory.
A
C
MP
L
(com
pare
lo
ng)
inst
ruct
ion-
wit
h Z
ER
O_R
EG
for
ces
a co
mpa
re w
ith
a "g
ener
ated
" 32
-bit
zer
o va
lué.
ZE
RO
_RE
G•
15
14
13
12
11
10
9 8
7 6
5 4
3 2
1 O
ZER
O (L
O)
ZER
O (H
l)A
0074
-AO
Bit
Num
ber(
s)0-7
8-15
Bit
Mne
mon
lc
ZE
RO
(LO
)
ZE
RO
(H
l)
Bit
Ñam
e
Zer
oR
egls
ter
Low
Byl
e
Zer
oR
egis
ter
Hig
h B
yte
.Res
etS
tate
0000
0000
00000000
Desc
rlptlo
n
Th!s
Is
the
low
byt
e o(
the
zero
reg
iste
r.
Thl
s Is
Ihe
hlgh
byt
e oí
trie
zer
o re
gist
er.
Q-9
0
ANEXOC
ESQUEMA Y SILUETAS BE LA
TARJETA BE EVALUACIÓN
— oiN M
UH 12 jS*•o rfcn-X
C12. C11
U15
IN | [ Q_
JP6 JP6- ^ JP1 °
C10
co
CQ
níP
^ DC13P
gáí
70f - iJPIO
U5
51
C5
Ou»r>CTfTJ OS •
U3C3
C24
N
C25
JP3 ,_R9C=K :Js"D
U2.C2
C23
MO)
C26
C13 "
cr5.
1—'C19
.UlC1
C22
Cro-
U27 .)c
'U7
C21
c
' N»
C29
.ueC6
ua Cfi
C20
C29
r- O(SJ <M
(N
i
DIAGRAMA DE SILUETAS DE LA TARJETA DEPERIFÉRICOS
O *•'*
CD'
0112
O 5 eO
O a s
Lista de Materiales
Nombre /
UOU1,U2, U3U4,U5,U6U7,U8U9,U10un,ui2U13, U20, U26U14
U15U18, U19U21,U27,U28,U29U22,U23,U24, U25H9, H10Hl, H2, H3, H4JP1, JP3, JP5, JP6, JP9, JP10JP2, JP7C1...C29Ylcl...c5, c6, c9c7,c8RS1, RS2, RS3
Ul, U2, U3, U4, U5, U6, U7U8, U9, U10unU12, U13, U14, U15
U19
U18
U17
Ha, Hb, He
HdLCD151,52LB1
53, 54RS4
DEO....DE15RO...R15
HÜ^BTña/VeSfa1
Integrado
8XC196KC207116273262644066
74L50074LS08
MAX232CPE74HC1474LS37374LS3274LS138
tK2&¿£eIá74LS37374LS24474C92274LS4774LS0272LS32
74HC14
Ee&W/ja /JHHHHHHHHBBHHBHMIHiDescripción
Microcontrolador
RAM
EPROMRAM
Swítch BilateralCompuertas NANDCompuerta ANDDrivers/Receívers
Compuerta NEGLatch
Comperta ORDecodificador 3 a 8Headers 40 pinesHeaders 20 ptnes
Jumper 3
Capacitor 10 nFCristal 16 MHz.Capacitor 1 microFCapacitor 30 pF
Resistencias Integradas 10 Kohms
^ ^ §••••••••• •••1Latch
Buffer de Entradas DigitalesManejador de TecladoDecodificador BCD 7 Segmentos Open ColectorCompuerta ÑORCompuerta ORCompuerta NOTHeader de 20 pinesHeader de 40 pinesOptrex Liquid Crista! DisplayDisplay 7 segmentosBarra de LEDsDip-switchesTeclado (16 teclas)LEDsResistencias
ÁNEXDD
DESOMOPCION DE LOS
INTEGRADOS UTILIZADOS EN LA
TARJETA DE EVALUACIÓN
Qu
ad
2-l
np
utN
OR
Gat
e
Max
Rat
ings
/Ope
ratin
g C
ondi
tions
RA
TIN
GS
Ma
.lmu
mA
Ko
wíb
le
Sup
pl)-
Voll»
9*
Guifinln
d O
penlin
gS
üppl
y V
olta
je H
*nye
Mi.l
mum
Inpul V
oltt
gc
Miiim
um
Vol
t»s«
ta
Op«
n-C
olle
cto
rOu
lpu
tl'
Opeiíiin
g F
ie»
-A ir
Tem
pítilt
ifí
Rtn
ge
Sto
f»9*
Tem
petíiu
te R
ing*
74
SE
RIE
S
7
74H
SE
RIE
S
7
74LS
SE
RIE
S
DIO
DE
INP
UT
S
7
EM
ITT
EB
INP
UTS
7
74S
SE
RIE
S
7
4.75
to S
.ÍS
6J
7
5.5
7
7 7
5.5
7
E.5
7
0 lo
f7
0
-6S
W+
15
0
U*J
ITS
* V t 1»
tv r i'c ¡•c
Supply
Cur
rent
s
DE
VIC
E
EC
G74
02 LS
02
S02
ICC
H ím
A)
Tot
al W
ith O
utpu
ts H
igh
TY
P
8 1.6
17
MA
X
16 3.2 29
'CC
L (m
A)
Tot
al W
ith O
utpu
t! Li
TY
P
14 2.8
26
MA
X
27 5.4 45
Sw
itch
ing
Ch
ara
cte
rist
ics
at V
cc =
5V
, TA =
25°
C
EC
G74
02,7
4LS
02,7
4S02
M
13
12
II 10
9
8
.280
"(7.
ll)
MA
X.
I Z
3 4
5 6
7
.Z00
"(3.
08)
—!
1~.IO
O"(2
.S4)
typ.
IV
!A
II
IV
ÍA
í»
GH
O
DE
VIC
E
EC
G74
02 LS
02
S02
CO
ND
ITIO
NS
CL =
15
pF
(Ru =
400ÍÍ
CL =
15
PF
, R
u = 2
kn
CL =
15
pF
, R
L =
280ÍÍ
CL=
50
pF
, R
L =
280ÍÍ
IPLH
íf"
) •
Pro
paga
tion
Del
ay (F
ime,
Low
-To-
Híg
h Le
vel ^
utp
ut
MIN
T
YP
nA
X
12
22
10
15
3.5
5.5
5 7.
5
'PH
L i"
1)
Pro
paga
tíon
Del
ay T
ime,
Híg
h-T
o-Lo
w L
eve!
Out
put
MIN
T
YP
M
AX
B
15
10
15
3.5
5.5
5
7.5
EC
G74
02,7
4|
o u UJ C3 O UJ O O UJ
w z 3 N §5 ^ N § * O ^ (fl g o z o u ce u; U
J E ce 0.
X 5 ST >- z 2 X 2 ST í z g X 5 ST f- z i
•^ CN Oí
"o *ü —1
X X
>
03 O eq o" eq o
& "o í a c •J Jj í o >¿
> in T E (V T K 51
"o a E Ü a c >
oí T tn r e CU r a
u j
íf a. o s T S r o o T
c 3 u 3 D.
3 O •5 J .c .01
X _p
e 2 * u u SP "o > a O •5 _J X X o
> X 2 >*
n'
tN ,j.
fí ^ CN ^ „.
(N X E t _p
E o (M ai co
c U 1 O S i o O
;> in ó U) o" in M O ^ Ó "í
X S n j
_c S S
"
Hu u í
f > a O I Í o o
^ es E -> n _p
"~ " "1 Ul
>- E 3 n £ c s 3 | -
t c „ o > (N- >- < E u u % S o 1
o •f
r
I S Q
' < •í 3
<j
3.
; •í
x 2 • u u i
• i
' í
"1
X
o V) o CN
t*;
N >-
Q.
C ^ .
n d >- a. c ^
<
ID f tq T
c 1 " a — J 5 o J
t i; ^ < u u e £ 3 U 4-«
,
< E
S T o T o T o ? Ul
f CQ T
£i
X 5 i u u
3 a.
O 3 D
go
5.c
3
w
u
J
JD « x 5 V U U c 3 O "a a 3 CO u _y
24
E^G
Sem
ico
nd
uct
ors
luad
2-ln
put
Pos
NA
ND
Gat
e
Vla
x R
ati
ng
s/O
pe
rati
ng
C
on
ditío
ns
RA
TIf
JGS
Má
xim
um
Alío
wib
le
Supply
Vo
lt ag
e
Guaia
nte
vd O
petílin
g
Su
pp
ly V
olU
ge
fíin
qt
Mín
imum
Inpol
Vol
taoc
Má
xim
um
Volu
oe lo
Ope
n-
Col
Ice ¡o
r O
ulp
utl*
Op*(
alin
g F
fM-A
ir
Tem
paia
luie
Ran
o»
Slo
iíge
Te
mp
ert
lure
R)n
¡j«
1A
SE
RIE
S
7
74H
SE
RIE
S
7
74
LS
SE
RIE
S
DIO
OE
IfJP
UT
S
7
EM
ITT
ER
INP
UTS
7 .
74s;,
SE
R.E
S
UN'T
S
L,
7 í¡
V
'i
4.7
Sto
5.2
5
'\
5.5
7
5.5
7
7 7
5.5
7
5.5
-|
V
n7
; v
i1 í 'c
0 lo
*7
0
,
-65
lo
f 1
50
J
"C
Su
pp
ly C
urr
en
ts
DE
V1C
E
00
HOO
LSO
O
soo
ICC
H l
mA'
To
tal W
ith O
utp
uti H
igh
TY
P
4 10 0,8 10
MA
X
8 16.8
1.6
16
ICC
L t
mA
) ;
Tota
l W
ith O
utp
uH
Lo
w;
TY
P
' 12 26 2.4
20
MA
X
22
''40
«
4.4
36
¡wítchin
g C
hara
cte
ristics
at V
cc =
5V
, T
A =
25
°C
DE
VIC
E
00 HOO
LSO
O
SOO
CO
ND
ITIO
NS
CL =
15
pF
, R
L =
400Í7
CL=
25
pF
, R
L-2
80
n
Cu_
" 1
5 p
F. R
L =
2k
fí
Ct.
-: 1
5 p
F, R
L =
280S
Í
tpLH ("1
",
:
Pro
pagitio
n D
e(»
y T
inw
,
Loi
-To-H
igh L
twl
Outp
'Jt
MIN
T
YP
M
AX
;
11
225.
9 10
9 15
2 3
4.5
tpH
L ("
*)
Pro
paga t ¡o
n D
tlay T
ÍITM
,
Hig
h-T
o-L
ow
Levd O
utp
ut
MIN
TY
P
MA
X
7 15
6.2
10
10
15
23
5
¡ E
CG
7400,
74^
; 74
LSO
O,
74S
i 1 'UN
ITS
' V
i _ü-
I
14
13
12
11
10
9 B
I 2
34
36
7
— .7
85"(
I9.9
4)M
AX
. — H
nH
"7-T
7T
T1~T
fTT
~n
•c °C
I1II
III
^
U.
4w
|_fo
|_Jn|_
|ñLf!i]_[T
É>J &
r^ r
^IJ
liJlifLTliJ
liJU
11
IV
1A
n
1Y
Pro
paga t ¡o
n D
tlay T
ÍITM
,
t H
igh-T
o-L
ow
Levd O
utp
ut
MIN
TY
P
MA
X
7 15
tPS
*'
E
CG
74
00
, 74
HO
O, 7
4LS
OO
, '
40
0,
00 — i
Z80"(
7.ll)
MA
X.
i
^.2
00"(
5.0
8)
f y.
t — \
/ V
5
/ %
sS
4
.*>
00"(
2.3
4)
" 5
TT
P.
„ 1 a; *- & E *-<n
.t-A
, 2 *
J
• i
>n
o
J
1^
Elé
ctric
a)
Chara
cte
ristica
over
recom
men
z D
EC
G74
• ' i S
X í I z z n. 1- Z 2 X I £ z I o. H Z Z
CO
ND
ITIO
NS
PA
R Á
ME
TE
R
> ts 1 1 c £ _j ÍE I
>
O o'
co o" o
a i ¿
T E i
T
li -
~1
2m
A
T T
1, -
~l8
mA
e S u
í o E 0 | >
a T 8 T f S •T C a 1 -C X 1
V ri (N ri ri cv
S j Ü | u
T
g. "5 I U -s i o
E o (V o
U _J O _í J
o o" ci o (-Í o o o o
ó E j
u i
0 í
Oulp
ut
Voltig
e
a j o
E
"1 ín
o r- >
5 u u
E 3 i U >
<
o o -T « ts >
o ui o r- ri
>
S o >
Inpot
Curienl
-j -s, X i
E
ID ri 1 ID
O >
7 d ^
E u
Inpul
Curí
enl
-i
<
S T o 1 o n i 8 T o i 0)
i u
3 O ? £
¿5
U
M
S c U a ín u
T C e \ o ? 3 t c T3 "; c j=
alu
es
are
at V
cc •
5V
, T
A -
25°C
.
«n n
n» n
ntn
iít s
houlrf
hfl s
hortod
at
a t
imo,
and f
nr
EC
G74H
. 7
4L
S a
nri 7
45 d
ure
iinn
nf
shnrt rlrn
\ll
lypic
al
Not m
n/B
Ih
¿ ~
Ñ
20
EC
GS
emic
onduct
or
EC
G7-
408,
74H
08,7
4LS
08,
74S
08
Qua
d 2-lnput
AN
D G
ate
Max
Ratin
gs/
Opera
ting C
ondí
tions
RA
TIN
GS
Máx
imum
Allo
wablí
Sup
ply
Vol
tage
Gua
nnte
ad O
pcrit
ing
Sup
ply
Voltige
Rin
yt
Mín
imum
Inp
ut V
a!t»
je
Máx
imum
V<j
|t>g*
lo O
p«n-
Col
lsct
ot O
utp
uti"
Opf
lcai
lng
Fre
fAIi
Tsm
perttu
re fíin
ye
Slo
nqt
Tem
p*r»
tuie
Ran
ge
74
SE
RIE
S
7
74H
SE
RIE
S
7
74LS
SE
RIE
S
DIO
DE
1NP
UTS
7
EM
ITT
ER
INP
UTS
74S
SE
RIE
S
'
7 I7 ^
4.75
to
5.2
5
l|
5.5
7
5.S
7
7 7
5.5
*
5.5
71 7
0 to
+70
-65
to+
15
0 ,'
UN
ITS
V V V V *C °C
Su
pp
ly C
urr
en
ts14
13
12
II
10
9 6
DE
VIC
E
08 H08
LS08
SO
S
ICCH
<m
Al
Tota
l W
ith O
utpu
ti H
ígh
TY
P
11 28 2.4
18
MA
X
21 40 4.8
32
Tota
l With
Out
puts
Low
TY
P
20 ;
42
4.4
32
MA
X
33
,
64 8.8
57
12
34
56
7
. ,
.Z0
0"(
5.0
8)
j—.7
85"(
I9.9
4)M
AX
.—j
T M
AX.
Sw
itchin
g C
ha
ract
eri
stic
s a
t vcc =
5V
, TA =
25°
C
DE
VIC
E
08 H08
LS08
S08
CO
ND
ITIO
NS
CL=
15
pF
RL "
400ÍÍ
CL =
25
PF
RL -
28on
CL*
15
PF
RL
- 2 k
n
CL
= 15
PF
RL »
280
Í1
CL
» 5
0 pF
RL =
28on
tpLH
(ni
) .
Pro
paga
tion
Del
ay T
ím*!
Low
-To-
Hig
h Le
vel Q
utj^
ut
MIN
TY
P M
A;:
17.5
27
J i >7.
6 12
*
10
15.
2.5
4.
5 7
6 9
tfH
L (
ni)
Prop
aga
tion
Del
ay T
ime,
Hig
h-T
o-Lo
w L
evel
Out
put
MIN
T
YP
M
AX
12
19
8.8
12
-
12
20
2.5
5 7.
5
7.5
11
3ft
G7
40
8,7
4H
08
f74
LS
*f r-s U O UJ li- r- ia O Ul *r r> U ü Ul
<• r- CD O LU
É Z D 00 9 o 3 S 3 V) z O )-~ Q Z O u C U
J t- iu
PA
RA
M
2 oír t z z X í > z X t aT t 2 5 $ ST >• z E
> N N (N £In
put
Vo
l
•£ i >"
> n o o o 6
£ C i J >
3 e 0) V f o a E
Input C
U
>
- 2 , •p .!• ^e s u
N 1 U)
T E T ^-
4 § i S T S T S a i c u 1 a O -1 .f ÍL I _O
>
ri r~ t ñ - « « •T N 1 ri i tN
(V I .£ "
Í£ s
u
g "™
1 O 5
8.
ir > o
E B)
O tN E
Ou
tou
t
1 1
J _p
> «1 u o n o o rs o" t o N o
5 _o .e 8
o j| -j o >
o E ' o
j
<
- > ^ c
Inoul
Cur
-
C o r-.
> > K
Inpoi V
olt
E 1 E
c
o o (V >•
3
c
Inpul
Cur
i
*i T
i
O f< ; J
n a .£- c
Inpul
Cur
t
I _=!
E n r^ S T O -^ „ i
U u
tN O ^
E
8 T a 7 § T ? 8 o •t 1
U) T
S 3 u
| O
Sho
rt C
Ír<
Curten!
-»
H (?) „ £ y *> c
Sup
ply
Cl
U u
CG
CG
CG
-- 1 S
o
2
c
32
EC
GSe
mic
ondu
ctor
s£C
G74Í3
, 74
LS
13, 7
414,
74L
S14
, 74
132,
74L
S13
2
Sch
mitt
Tri
gg
ers
Max
R
ati
ng
s/O
pe
rati
ng
Con
dilio
ns
14
13
12
II
10
9 S
RA
TIN
GS
Má
xim
um
Alie
nable
Sufip
ly V
olla
ge
Guaia
ntH
d O
p^i
alin
g
Supply
VolU
ge
Ran
tjí
Mjji
mu
m Inpui V
oln
g*
Má
xim
um
Vo
ltío
e lo
Oi>
en-
Co
llee
ioi O
utp
uir
Opera
ling
Fre
e^A
ii
Tem
peía
lure
Ran
ge
Sío
tage
Ttm
pe
ralu
rf R
tnge
74
SE
RIE
S
7
74
H
SE
RIE
S
7
74LS
SE
RIE
S
DIO
OE
1NP
UT
S
7
EM
ITT
ER
INP
UT
S
7
74S
,
SE
RIE
S
7 ' 1
4.7
5 lo
5.2
5
5.5
7
5.5
7
7 7
5.5
7
5.5
;
7
1;0
[ot7
0
65
la*l5
0
UN
ITS
V V V V c -c
I 2
3 4
S 6
7
, _.
„ .2
00"(
5.06
).7
8Í
(I9.
94JM
AX
. (
í" M
AX.
EC
G74
13,
EC
G74
LS13
-Dua
l N
AN
Dfe
chm
itt T
rigg
er
VCC
ID
JC
«C
IB
JA
JI
EC
G74
14
EC
G74
L514
-HQ
X S
chm
itf
EC
G74
132,
EC
G74
LS13
2-Q
uad
Tngger,
Inv
erte
r 2-ln
put
Sch
mitt
Trig
ger
NA
ND
Gat
e
H^>°1
H
->>1 T
\^
IB
"C
1C
ID
tT
CN
Di*
ir
IA
ir
w
ir
una
IA
J»
;T
CNO
Sw
itch
ing
Cha
ract
eris
tícs
at
Vc
c =
5V
, TA =
25°
C
DE
VIC
E
EC
G74
13 14,1
32
LS13
LS14
, LS
132
CO
ND
ITIO
NS
CL -
15 p
F, R
L =
-40
0n
CL =
15
PF
, R
u =
2kíí
tpLH (r
»)
Pro
paga
tlon
Del
ay T
ime,
Low
-To-H
iflh L
tȒl
Out
íxJt
TY
P
MA
X
18
27
•'
15
22
15
22
15
22
tpH
L <
"")
Pro
paga
tion
Dcl
ay T
ime,
Hig
h-T
o-L
ow
Lev
cl O
ulp
ut
TY
P
MA
X
15
22
15
22
18
27
15
22
EC
G74
13,
74L
S13
, 7414, 7
4LS
14,
7413
2, 7
4L
42
1
. 1 o c 1 o a "c "T i? w 3 rg S. E cu íl I S & o T3 -8 U E E S £
irís
tics
ov
er
r 1 U" 3 ÜJ
r* D U tu
P z B g ri 3 (N 2 *~ r: in O P | ce u;
Ul E Q.
X i 5T I- Z X S H i i- z E X •t 2 o. Z I X CL"
t~ Z I
en te T r* — ui
M -'
Ul
(N £ líl
™ ir u u í "< •o 1 i
e-G
oín
g T
h
c Q.
,.
q 03 O in o _ "~ oí o «3 O - O <D o -• oí o" 10 o" lí> L
hie
ihold
Volu
ge
f- '5 1 j (•
EO O O 03 O W o £O O ^ o" 03
O Q O > 0 'c fc U I ^
Ul T U) T T E r- T I "5 o. É u 1 >T E eo T
c £ u u
a. f § i i i | (j
.eve
l O
utp
i
1 :
ri IN ^ ri •í (N ^ ri » ri i. tv
C Zi H '*,
C*
X
S
5
u
"
^*
C
I I á t i >5
E
. to ID 10
it C
urr
ent
i 5 ti -i _p
i u
o o
n u
o e
E -T
D
C S i £
it V
oltíg
e
a S o £
^ tv O •í o ÍN O O O
-
<
1 E
C
l£>
X
—
¡
X \ ~¿
-
E Q n •j ^ •í f ? í > lí -, •o o •í 1- " i; i 1 L i j J
E EO J
%p *?' in ec f >
*
ir -. "i 1 ¿ 't O j ¡ i L i _¡ j
E
- - K > 5 "e _c E j 5 c C S _c -o
c >E u >
< 3
O O 3 r- > c c ] 1 :
3 CN >
S u >"
E ? C-J T a: P (N T 03
?'
? q T o" >-
5 i > c (J I c j -d
E i T 9 10 i 02 Ifl íf> 0. T in T CD T _ s i ^ í C c C .t; t L t -8
UJ oí ÍÑ
n
V C
urr
en!
S ^S IC D¿ ^ !s E ¡ 1
- oí m' CN t- o >~
£
„ in " T Si r- í „ 5 ^ x 5 i >
r- 5 n
« S i Í o _ e C e
i rw EO
r-i
n 5 i"
o oC
N S tj) n ñ o (N „ j 6
o* ín tv i tj H m U U 3 I
B *
S
fe
•-
3 s
EC
G74
30,
74H
30,
74L
S30
, 74
S30
, 74
S13
3
EC
GS
emic
on
du
cto
rs¿ 2
-o
2
e
CG
74se
co
Qua
d2-l
nput
OR
Gat
e
Ma
x R
ati
ng
s/O
pe
rati
ng C
on
ditio
ns
EC
G74
32,
74LS
32
valú
es a
rea
tVc
cA
ll ty
píca
and
for
EC
G74
H,
EC
G74
LEsh
ort
citc
urt s
houl
d n
ot e
x«
^ S
Sw
itchin
g C
hara
cte
ristics
ai V
cc =
5V
, T
A =
25
C
tpH
L M
Pro
pagatio
n D
ela
y T
ime,
HÍg
h-T
o-L
ow
Levd O
utp
ut
tpLH I"5'
Pro
pagatio
n D
ela
y T
ime,
Low
-To-H
igh
Level O
utp
ut
Z £ X I a. ;C
ON
DIT
ION
S
ui
O UJ O
|!O
01
2 jí
N
CSn
u
CC
C
E
uT
u.o.
o
in
\na
u
u C
9 f
ro v
or-
•-
\n
ui
Tf
U3
OJ ta
m tn•*
irí
its tí
tí0
C
co
cocv
tv
n u
J
JE
E
C
IL
tLCL
a
Un o m
1
^ B w- 3 WJ
RA
TIN
GS
Manm
um
Allo
wa
ble
Supply
Vo
lta
ge
Gu
ara
nle
ed O
pítaling
Supply
Volla
ge
Ra
ng
e
Ma
jcim
um
1ip
ul
Vo
lta
ge
Ma
«im
um
Vo
lta
ge lo
Open
Co
lle
cto
iOu
lpu
ti'
Üpeía
ling
Fre
e-A
u
lem
pira
tur e
Range
Sto
ogí
Terr
peía
ture
Range
-í
7411
M
LS
SE
RIE
SD
IOD
E
EM
ITT
ER
U
NIT
SS
ER
IES
S
ER
ES
S
ER
IES
1NP
UTS
IN
PU
TS
77
7
77
V V
4.75
lo 5
.25
5.5
5.5
7 5.
5 5.
5 V
77
7
77
V C
01
0*7
0
65 io
« 1
50
C
Sw
itchi
ng C
hara
cter
istic
s at
Vc
c =
5V, T
A =
25°
c
DE
VIC
EEC
G74
32 LS32
CO
ND
ITIO
NS
CL *
15 p
F
RL «
4000
CL* 1
5 p
F
RL
= 2
kfi
tpLH
(ns
) tp
HL
t™l
Pro
paga
tion
Del
ay T
ime,
Pro
paga
tion
Del
ay T
ime,
Low
-To-H
igh
Lev
el O
utp
ut
Hig
h-To-
Low
Lev
el O
utpU
t
MIN
T
YP
M
AX
M
IN
TY
P
MA
X
10
15
14
22
14
22
14
22
-
_1*
18
IV
JA
78
ir
G
NU
H
II
¡7
U
10
9
EC
G74
32,
74L
S32
•w B u UJ
W H 5 D (S 3 es M O P O o u (T UJ
UJ £ < ce IX
X E : oT ¡Í z E X < £T >- H 2 2
> es (S Si
"5 > | -j ¿ -s, i I >"
>
co o" 03 O
™ "5 > a _c ~ > Í o _i _J >^
in T < E es T n - f o a E ü Í >"
> Ul T < E co T N -="
J >
S S « g co c 3 U 1 3 O — > -C X I o
>
n ri r-;
rs v có «r es
X i n I O . > es r >" e" ,
S ii u >
% ~5 > | =j O ~v _í
•& X .S
< E « to
c i u 1 3 O S i D -I _]
O
r *> i 3 ,0
1 5 í O "S i 'S í ' 'x £ j • c
"S - n • u
>*
rf
8. "o > 's i ~ > o J -
o >
V o" < E * -i _o
"*
<
> \a "i * > % ~o > 3 a -S E i 2 c t 3 U I c -r
E ,_ o > r-> " >
K 1 U >
<
o n > V es" " >" c 3 U i C • > -J -& X I
i o es f-;
rs* " > x_ E i u >
<
;> r) o « >" c 3 u a c "5 > _j í o j
to n ? to T i- d n >"
< u >
<
S T 9 Ul T co T
~ 2 n U
>
" E 3 U 1 o u U s ü J
"i ic e-í
(S rs Lfl -6 X 1 3 O o K c 3 U >- TI a a _a
< E (9 CT)
O)
•« e*i
(S
X i n u >
Í o _i | 3 O ,0 1-
> J
ui
3 sí
EC
GS
emic
on
du
cto
rsE
CG
7433
, 74
38,
74LS
;
Buf
fers
Max
Ra
tin
gs/O
pa
ratí
ng C
on
ditio
ns
RA
TIN
GS
Miií
mum
Allo
wib
ltS
uppl
y V
olti
o*
Guifin
l»*d
Op
ífitin
g
Supply
Volt>
9« ñ
ir>9«
Mín
imum
Inpul V
olu
ij*
Mix
imum
Vo
lUje
lo
Op*
n-C
olle
cloi
Ou
tpu
ti*
Op«fí(
In)
F (e
í-A
lrT
cnpcr
ilurc
R»n
ge
Slo
r*9«
Te
mp
*rtlü
r« R
tn^
74
SE
RIE
S
7
74H
SE
RIE
S
7
741.
5 S
ER
IES
DIO
DE
INP
UTS
7
EM
ITT
ER
INP
UTS
7
4.75
10
5.25
6.5
7
5.5
7
7 7
5.5
7
Ola
«70
74S
SE
RIE
S
7 5.5
7
-65 lo
+ 1
50
UN
ITS
V V V V
3C °c
Sup
ply
Cur
rent
s
DE
VIC
EE
CG
74
33
38 LS38
ICCH
<f"
*lT
ota
l W
ith O
utp
ut!
HÍ(p
h
TY
P
12 5 0.9
MA
X
21
8.5
2
ICC
L Im
A)
To
tal
With
Ou
tpu
ts L
ow
TY
P
33
34 6
MA
X
57
54 12
Sw
itchi
ng C
hara
cter
istic
s at
Vc
c =
5V
, TA =
25°
C
DE
VIC
EE
CG
74
33
38 LS38
CO
ND
ITIO
NS
CL -
60
pF
RL =
133ÍZ
CL=
150
pF
RL =
133fi
CL
-45
pP
Ru *
133
Í1
CL -
45 p
F
RL -
667Í1
ipLH
1™
)P
ropa
garo
n D
el»y
Tim
a,Lo
wT
o-H
igh
Leve
l Out
put
MIN
TY
P
MA
X
10
15
15
22
14
22
20
32
IPH
L 1™
)P
ropa
garo
n D
elny
Tim
e,H
igh-
To-L
ow L
evel
Out
put
MIN
TY
P
MA
X
12
18
16
24
11
18
18
28
M
13
IZ
ti 10
9
.280"(
7.||)
MA
X.
I Z
3
4
S
£
7
-.785"(
I9.9
4)M
AX
.—H
P
MA
:?
EC
G74
33-Q
uad
2-ln
put
ÑO
R
Buf
fiw
íth
Ope
n C
olle
ctor
Out
put m
EC
G74
38,
EC
G74
LS38
-Qua
d 1
Inpu
t N
AN
O
Buf
fer
with
O
peC
olle
ctor
Ou
tpu
t
'*
'•
I*
í*
JB
ÍV
ON
D
EC
G74
LS13
6, 7
4LS
266
Elé
ctri
ca!
Ch
arac
terí
stíc
j ov
er r
ecom
men
ded
oper
atin
g fr
ee-a
ir te
mí
erat
uie
rang
e lu
nles
s ol
lierw
ise
nole
d).
PA
RA
ME
TE
R
VIH
VIL
V| 'OH
VQH
IOL
VOL
"i IIH "IL Ice
Hig
h Le
vel I
nput
Vol
taoe
Low
Lev
el I
nput
Vol
tage
tnpU
t C
lam
p V
olta
ge
Hig
h Le
vel O
utpu
t C
urre
nt
Híg
h Le
vel O
utpu
t V
olla
ge
Low
Lev
el O
utpu
t C
urre
nt
Low
Lev
el O
utpO
t V
olta
ge
Inpul C
urre
nt a
t Máx
imum
Inpu
t V
olta
ge
Hig
h Le
vel I
nput
Cun
en!
Low
Lev
el I
nput
Cur
rent
Sup
ply
Cur
rent
í cyfv
pmor
Js
1. i-V
cc =
Min
, h
=-1
8 m
A
Vcc =
Min
. Vj
,,. =
2V
f k
Vcc =
Mín
VIH
= 2
VV
,L =
Ma
x
VC
C,M
«
jl(L
=M
ax
JIC
L =
4 m
A
: V
, =
5.5V
;\,=
7V
Vcc =
Max
. V,
;' 2.7
V
Vc
c =
Max
Vc
c=
Ma
x(;
V,
= 0.
4 V
V,»
0.5
V
LS
266
EC
G74
LS13
6, L
S26
6 .
MIN
T
YP
ID
MA
X
2
0.8
-t.5 10
0
5.5
8
0.35
0.
5
0.4
0.2
40
-0.6
6.1
108
13
UN
ITS
V V V
PA V
mA V
mA
PA
mA
mA
I) A
ll ly
ptca
l val
uei a
<e a
l Vc
c •
5V
, TA •
25'
C.
!l IG
C ''
m«a
iurtd
with
one
Inpu
t oí
e»c
h ya
te a
t -t.S
V. th
tot
h«r
Inpu
ti gi
ound
w
and
the
ouip
otí o
pen.
EC
GS
emic
onduct
ors
De
cod
ers
/De
mu
ltip
lexe
rsTh
ese
Sch
otlk
y-cl
am
pe
d ci
rcuí
ls a
re d
esíg
ned
lo b
e us
edin
hig
h'pe
rfor
man
ce m
emor
y-de
codi
ng o
r dala
-roulin
g a
p-pl
icat
ions
, re
quiri
ng v
ery
shor
t pr
opag
atio
n de
lay
times
. In
higr
í-per
form
ance
mem
ory
syst
ems
thes
e de
code
rs c
an b
eus
ed t
o m
inim
íze
the
eff
ects
of
sysl
em d
ecod
ing.
W
hen
used
wilh
h!g
h-sp
eed
mem
orie
s, t
he d
elay
tim
es o
f th
ese
deco
ders
ara
usu
ally
les
s th
an t
he t
ypic
al a
cces
s tim
e of
!he
mem
ory.
Tht
s m
eans
ihal I
he e
f f e
cliv
e s
yste
m d
elay
in-
tiodu
ced
by t
he d
ecod
er ís
neg
ltgib
le.
The
LS13
8 an
d S
138
deco
de o
ne-o
f-ei
ght
lines
, ba
sed
upon
the
con
dítio
ns a
t th
e th
ree
bína
ry s
elec
t in
puts
and
the
thre
e en
able
inpuís
. T
wo
act
íve-
low
and
one
act
ive
-hi
gh e
nabl
e in
puts
red
uce
the
need
for
exte
rnal
gat
es o
r fn-
verle
ts w
hen
exp
andi
ng,
A 2
4-lín
e de
code
r ca
n be
im
-pl
emen
led w
ith n
o ex
tern
al I
nvef
ts,
and
a 32
-líne
dec
oder
lequ
ítes
only
one
fnv
erte
r. A
n en
able
inpu
t ca
n be
use
d as
a da
ta inp
ut f
or d
emul
tiple
xíng
app
ticat
íons
.
The
LS13
9 co
mpr
íses
tw
o se
pára
te t
wo-
IÍne
-to-
four
-IÍn
ede
code
rs in
a s
ingl
e p
acka
ge, T
he a
ctív
e-lo
w e
nabl
e in
put
can
be u
sed
as a
dat
a lin
e Ín
dem
ultip
lexí
ng a
pplíc
atío
ns.
Fe
atu
res
• D
esig
ned
spec
itíca
Ky
for h
igh-
spee
d:
Mem
ory
deco
ders
Dat
a tr
ansm
issi
on s
yste
ms
• S
138
and
LS
138
3-lo
-8-li
ne d
eco
de
rs in
corp
óral
e 3
enab
le i
nput
s to
sím
plífy
cas
cadi
ng a
nd
/or
data
rece
ptio
n
• LS
139
conl
ains
tw
o fu
lly I
ndep
ende
n! 2
-to-
4-lin
ede
code
rs/d
emul
típle
xers
• S
chotlk
y cl
ampe
d for h
igh
per
form
ance
LSI 3
8S1
38LS
139
TYP
ICA
LP
RO
PA
CA
TIO
N D
ELA
Y(3
LE
VE
LS O
F LO
GIC
)
21
ni
8 ns
21 n
i
TYP
ICA
LPO
WER
DIS
SIP
ATI
ON
32
mW
245
mW
34 m
W
16
13
M
Ti
12
M
10
9
AA
AA
ftA
AA
tftf
tftf
tftf
tftf
12
3*
56
78
.260
16.6
0)
MA
X,
EC
G74
LS13
8, E
CG
74S
138-
Dua
l l-o
f-8
DA
IAO
UT
IMII
r-
YO
Yl
VI
VJ
Y*
TÍ
* 16
• c
G;A
C7
B ct
v;
í í
í
>-
SIU
CI
INA
BLE
EC
G74
LS13
9-D
ual 1
-oM
^A i
14
c A
í va
\ \I
vi
cA
• Y
O
rt
i i
r y
Tí
VI
? r
llfLüM
IJLLÍU
JU
JlJj
1C
. I*
U
1Y
O IV
I IV
7 1V
J G
SO
Eléctrica I Cha ráete rístí es over recommended operatíng free-air temperature range (unless otherwise noted)
PARAMETER
V,H
VIL
V!
"OH
Voy
IOL
"."'*"•
h
IIH
IIL
los
"ce
High Level Input Voltage
Low Level Input Voltage
Input Clamp Voltage
High Level Outpul Current
High Level Output Voltage
Low Level Output Current
L^.r-X.f_! S_...oi V_::^.j -.=— í
Input Current at Máximum Input Voltage
High Level Input Current
Low Level Input Current
Short Circuit Outpul Current
Supply Current
CONDITIONS
Vcc =• Min, 1, --18 mA
Vcc - Min, VIH - 2V
VIL » Max, IOH - Max
V^T"-'MÍñ.'V
Vlu - Max
Vcc - Max
Vcc =• Max
Vcc - Max
V c c »Max(2)
¡r,L » Max" -„. •~-^"-.]
IOL =• 4 mA
V, - 5.5V
V, »7V
V, =• 2.7 V
V, ' 0.4V
V, « 0.5 V
Vcc * Max
Outputs Enabled and Open
LS138.S138
LSI 39
ECG74
LS138, LS139
MIN TYP(I) MAX
2
0.8
-1.5
-400
2.7 3.4
8
•¿••-*-r - 0.3S •*-- G.o
0.4
0.1
20
-0.36
-30 -130
6.3 10
6.8 11
ECG74
S13S
MIN TYPÍ1) MAX
2
0.8
-1.2
-10OO
2.7 3.4
20
-.-• . - • -- c.3
1
50
-2
-40 -100
49 74
60 90
UNITS
V
V
V
MA
V
mA
- - '_"
mA
MA
mA ,
mA
>
mA
ü)
U)u00
cou
til All tVD¡«l v«lu«t ar. it Vcc - SV.TA - 25°C.(2) Not mor» than oot outpui trtould b« ihoned at a tinn.and dur»tion üf ihon circujt ihould not exceed on» wcond.
Switching Charactarirtics vcc - 5V, TA - 25BC
fARAMETER
t<^M
tfML
VI.M
«fML
tft-H
<fML
tflM
tfML
PfOp*gjtK>n D*|JV Time.
Low-to-High Lev»l Duicxji
Proptgaiion D*!«y TIm*,
High-iD-Low Leve! Ooipui
Prop*galitrfl D*liy Time,
Lowto-Hígh Level Ooipol
Pr 00*9*1100 Deliy Time,
Hlgh-io-Low Level Outpoi
Piofuqjtion Deliy Tin»,
Lowto-Hígh L»y»l Outpoi
Propagititm Del«y Tim«,
High-io-Lov» Lev«l Outpui
Prap*jiiioíi Dtlty Tin»,
Low-to-High Leve) CXitpul
Piop*qatÍon D«l«v Time,
High-to-LDw Leve) OutDOl
FROM(INPUT)
Blíury
SclíCt
Efublt
TO(OUTPUT)
Any
Any
LEVELSOFOELAY
2
3
2
3
CONDITIONS
CL • 15 pF
RL - 2 k O
ECG74
LS138
MIN TYP MAX
13 20
27 41
18 27
26 39
12 18
21 32
17 26
25 38
ECQ74
LS139
MIN TYP MAX
13 20
22 33
18 29
25 38
16 24
21 32
N/A
N/A
CONDITIONS
CL • 15 bF
RL • 28011
EC074
S134
MtN TYP MAX
«.5 7
7 10.5
7.5 12
8 12
5 8
7 11
7 11
7 11
UNITS
«
m
m
(11
m
n,
m
m
Max Ratíngs/Operating Conditions
RAT1NGS
Máximum Allow*bl«Supply VolUge
Guarí ntnd OpetitJngSupply VolUge Ring»
Mínimum Inpot Voll»9e
Miximum Volt»ge ta Open-ColleílDf Ouiputt*
Openting Fre«-AirT«np«riture Rir>9e
Stor»qe Temper «tute Rinq*
SERIES SERIES
74LS SERIES
DIODE
INPUTS
7
EMITTER
INPUTS
7
SERIES
4.75 W 5.25
5.5
7
5.5
7
7
7
5.5
7
5.5
7
0 10 +70
-65 lo +150
UNITS
V
V
V
V
•c
*c
mOO
co00
co00
EC
G74
LS
138,
74S
138,
74L
S13
9
agic
Dia
gra
ms
LS
138.
S13
B
Tru
th T
ab
les
LS
138.
S'3
8
INP
UTS
EN
AB
UE
G1 X L H H H H H H H H
G2'
H X L L U L L L L U
SE
LEC
T
C
B
X
X
X
X
L
L
L
L
L
H
L
H
H
L
H
L
H
H
H
H
A X X L H L H L H L H
OU
TP
UT
S
YO H H L H H H H H H H
Yl ;
y .
} ). r H H 11 II i: 1!
Y2 H H II H L H H H H H
Y3 H H H H H L H H H H
Y4 H H H H H H L H H H
Y5 H H H H H H H L H H
YG H H H "H H H
. H H U H
Y7 H H H H H H H H H L
•G2
-G2
A +
G2B
1
H -
Hig
fi lívrf
, L -
lo*
v Im
l, X
- d
i Vi
ort
INP
UTS
EN
AB
LE
G H L L L L
SE
LEC
T
B X L L H H
A X L H L H
YO H U H H H
YI
M H L H H
r* K 1 H L •
•1
Y3 H M H H L
H -
h!g
h l»
v»1,
L -
lo
w l
ew
l, X
- ó
V n'
t «
re
EC
GS
emic
on
du
cto
rsB
CD
/Dec
imal
De
co
de
rIta
EC
G74
I41 b
a B
CD
-to-d
edm
al d
»cod*r
des
igm
d ip
ocH
ical
lyto
drfy
* co
ld-c
atho
da in
dica
tor
tub
o*.
ful d
acod
ing
b p
rovi
ded
fo
t al
l pow
jble
input
stat
as,
For
bín
ary
¡n-
putj
lo th
roug
h 1
5, a
n th
o o
utpu
t» a
ie o
lí. T
heto
foia
the
EC
G74
141,
tarfc
ined
wlth
a m
ínim
um o
f ax
lwna
l cí
rculty
, ca
n us
e th
ese
Inva
lidoda h
Wan
klng
Ivad
lng-
and/o
r tía
itin
g-od
ga 7
0103
In a
di*pl*y.
Tru
th T
able
INPU
TD L L L L L L L L M H
C L L L L H H H H L L
B U L H H L L H H L L
A U H L H L H L H L H
10VE
R H
AN
GE
1H H H H H H
L L H H H H
H H L L H H
L H L H L H
OU
TP
UT
ON
-
0 1 2 3 4 5 6 7 S 9
NO
NE
NO
NE
NO
NE
NO
NE
NO
NE
NO
NE
H •
Hlg
h L
ovel
, L •
*Ali
olh
w o
utp
uti
Low
Unv
el
ira o
fí
Ma
x R
atí
ng
s/O
pe
rati
ng
C
on
dit
íon
s
EC
G74
141
Input
cla
mp
dio
de
s a
re
als
o p
rovid
ed l
o c
lam
p n
eg
ative
-
voltage lr?ni¡lio
m ¡n
ord
er
to m
inim
íze
tra
nsm
íssio
n-lin
e
efl
ecti
.
Fe
atu
res
• D
ríve co
ld-c
alh
od
e,
nu
me
tic i
ndic
alo
r lu
bes d
íre
clly
• F
ully
de
co
de
d i
nputs
• L
ow
lea
kag
e c
urr
en
t 5
QíJ
A@
55
V
• L
ow
pow
ef
dis
sip
ation. 55
mW
lypic
al
16 II
M
13
12
II
10
9
AA
AA
AA
flA
.26
0(6
.60
)M
AX
.
I Z
3
4 5
6 7
6
-.670"(
ZZ
.IO)M
AX
. "(
' I
*1
0
1 1
t
1
) 1
•CD
lo
oie
i-A
LD
tCO
Ofl
VD
ftlV
ER
* 0
1
1 C
TJl
iJliJ
liJU
JliJ
UJL
r
RA
TIN
GS
Mui
mum
Allo
wtb
lf
Supp
ly V
olug
e
Gui
tinie
ed O
prr
iling
íupp
'ly V
olt*
4í
Rtn
qe
Mi.i
mum
Inpul V
olt*
9c
Miiim
um V
altj
gr
lo O
pen>
CollK
loiO
utp
uli'
Opm
ling
FrW
'Aii
!*m
p«»t
uíe
fling
e
Sto
dgt
Trm
pm
iluce
Rtn
ge
.
. 74
SE
RIE
S
7
74
H
SE
RIE
S
7
74LS
SE
RIE
SD
IOD
E
INP
UT
S
7
EM
ITT
ER
INP
UT
S
7
74S
SE
RIE
S
7
4.75
to
5.25
5.5
7
5.5
7
7 7
5.5
7
5.5
7
0 to
+7
0
-65
to
» 1
50
UN
1TS
V V V V *c "C
EC
G74
198,
199
Tim
ing
Día
gram
s
cu
»*
l_J
19Í1
TY
PIC
AL
CL
EA
H, L
OA
D, H
IGH
T-S
H1F
T,
LE
'T-S
HIF
T, IN
HIB
IT, A
ND
Clí
íAR
SE
QU
EN
CE
S
Itfll
UD
ATA
wun M
UA
lltl
DA
TAw
run
119
TY
PIC
AL
CL
EA
R, S
HIF
T, I
DA
D, A
ND
IN
HIB
IT S
EQ
UE
NC
ES
EC
GS
emic
on
du
cto
rsE
CG
74L
S24
0, 7
4LS
241
74L
S24
4
Octal
Buf
fers
and
Lin
e D
nver
s w
ith 3
-Sta
te O
utp
uts
%tw
aci
al
bu
fíe
rs
and
line
d
ríve
rs
are
desi
gned
«dfic
ally
to
ím
pro
ve
both
ih
e
pe
rfo
rma
nce
and
B*ly
of
thre
e-s
tate
mem
ory
add
ress
dríve
rs, cl
ock
n«s,
and b
us-
oriente
d
rece
lve
rs a
nd t
ran
smitte
rs.
^t
desi
gner
ha
s a
ch
ole
e o
f se
lect
ed
com
bin
atlo
ns
of
Kttl
ing
and
nonin
vert
ing outp
uls
, sy
mm
etr
ica
l 5
wív
e-lo
w
ou
tpu
t co
ntr
ol)
Inputs
, a
nd
co
mp
le-
t«nl
arY
G a
nd G
inputs
. T
hese
deu
ices
fe
atu
re hlg
h
"^out,
ím
pro
ved
fan
-ín
, a
nd 4
00
-mV
no
ise
-ma
rgin
."N
EC
Q74
LS'
can
be
usad
lo
dr
ivo
lerm
inat
ed
lines
t*i l
o 13
3 oh
ms.
1 3-
Stat
B O
utpu
ts D
ríve
Bus
Lín
esor
Buf
fer
Mem
ory
Add
ress
Reg
íste
rs
1 P-
N-P
Inpu
ts R
educ
e D
-C L
oa
din
g
* H
yste
resi
s at
Inputs
Im
prov
esN
oíse
Mar
gins
TypT
csl
'OH -
[SoU
fc*
Cui
tant
)-1
5m
A
TYP'
K:»!
Pro
paga
ron
D«l
«y T
imo»
Inve
rtin
g5
0.5
n!
Non
ínve
rtln
fl
12 n
s
Typi
caT
Ena
bla/
Diu
bla
Tlm
«
18 t
is
Ty
pica
I P
owtr
Din
ipat
ion
tErv
iblo
d)In
vert
lng
Non
inva
rtín
g13
0 m
W
135
mW
TKom
men
ded
oper
atín
g c
ondítí
ons
y vo
ltage
, VC
G l«e
Not
e 11
l ou
tput
cu
fíen
t, I
i?.>-
Ceye
l om
pui c
urie
ni, [
Ifee-
air
lem
peta
lure
,
M1N
N
OM
M
AX
t ID
nei
wor
k gr
ound
l
ics o
f in
puts
and
outp
uts
EO
U1V
AU
EN
T O
FE
AC
H1N
PU
T
'LS
241
TY
PIC
AL
OF
AL
LO
UTP
UTS
'LS
24
n,'L
S2
41
,'LS
24
4;
R •
50 n
NO
M
Z01
9181
7 16
15 1
413
IZI1
QflflQQQQQQQ
.100
(2.
54)M
IN.
.I00
"(2
.54)
—{
I*-
EC
G74
LS24
0-ln
vert
ing
EC
G74
LS24
1-N
on-I
nver
tíng
(2G
)
^rijjii
^,
'/
' í*
•
•.'
Á' V
'
EC
G74
LS24
4-ln
vert
¡ng
(2G
)
alec
tric
al c
hara
cteris
ticj
EC
G74
LS
240,
74L
S24
1, 7
4LS2
44
PA
RA
ME
TE
R
VIH
H
igh
-le
vel ¡n
put
volla
ge
V|t
_ LovH
euel in
put
volta
ge
VJ
K
Inpui
clam
p v
olta
ge
Hvim
eiii
ÍVT
(.~
VT_
)
VO
H
Hig
h-l
eve
l o
utp
ul vo
ltig
e
VO
L
Lo
w-l
eve
l o
utp
ul
volt«
g«
Oll-i
taie
outp
ul
cu
rre
n!,
OZ"
h
igh
-le
vel
volta
ge a
pplie
d
Oll-i
lale
outp
ul curien!,
OZ
L
low
-le
vel
volta
ge ipolie
d
Inpul
cu
rre
ni a
i m
áxim
um
1
Input
vo
ltsg
t
I|H
H
igh-leve
l in
pui
cu
rte
n!,
an
v in
put
1|L
L
ow
-le
vel in
put
cu
iíe
nt
IOS
S
ho
M-c
ircu
lt o
utp
ul cu
ne
nt
Ice
S
upply
cu
rre
nl
Ou
tpu
lsh
igh
Qu
tpu
li lo
w
Al) o
utp
uti
diia
ble
d
TE
ST
CO
ND
ITIO
NS
1' •
VC
C-
MIN
, li--\á
:nA
Vc
c-
MIN
j
-
VIL
- o
.s v
, IQ
^ «[
viAx
VC
C-M
IM,
VIH
-12
v,V
IL-
o.5
v,
IOH
-!MAX
VC
C -
MIN
,
VIH
- 2
v.
VCG
• MA
X,
V|H
- 2
V.
>O
L-
IOL-
V0-
1'm
A
Km
A
.7.V
V0 - |.í v
VC
C -
MA
X,
V,-7
V-
Vcc •
MA
X,
V| -
^7 V
Vcc '
MA
X,
V|(
•
VCG
• M
AX
Olí
1 p
u[s
op«n
All
o,;v
'LS2
4JJ :
^•LS
24'L
S24
switc
hing
cha
ract
eris
tics,
Vcc
=
5 V
, T
A =
25°
C
, ;L
S2
44
,,L
S2
44
EC
Q7
4L
S*
MIN
T
YP
M
AX
20.8
-1.5
0.2
0.4
2.4
3.4
2
0.4
0.5 20
-20
0.1 20
-0.2
-50
-2
25
13
23
26
44
27
46
29
50
32
54
UN
IT
V V V V V V jjA
mA
ÍJA
mA
mA
mA
PA
RA
ME
TE
R
Pto
pa
ga
tio
n d
elaV
tim
e,
PLH
lo
rti-
io-h
igh
-le
vel oulp
ul
Pro
pa
ga
iion
de
lay
lime,
^
hig
h-l
o-l
ovy
-le
vel o
utp
ut
'PZ
L
Ou
tpu
l enable
tim
e l
o l
ow
le
ve!
IP2H
O
utp
ul
en
ab
le t
ime
to h
igh
leve
l
'PL
2
Ou
lpu
t dila
ble
tim
e I
rom
lo
w le
ve
l
'PH
Z
Ou
tpu
t dila
ble
tim
e I
rom
hig
li le
vel
TEST
CO
ND
ITIC
NÍ;
CL
-45
pF
/ ñt
'-óe?
n,
fCL
- 5p
F,
n\_-
^G
7n,
'LS
24
0
MIN
T
YP
M
AX
9
14
12
18
20
30
15
2315
25
10
18
'LS
241.'L
S244
MIN
T
YP
M
AX
12
18
12
18
20
30
15
2315
25
10
ia
UN
IT
ni
nt ni
ni
ni
ni
OÜ
IPU
T
INP
UT
"
OU
TP
UT
PN
PÜ
I O
'JII
JT
IN
PU
T
OU
TP
UT
IN
PU
T
OU
TP
UT
EC
Q7
4L
S2
41
US
ED
AS
RE
PE
AT
ER
JL
1 V
EL
R
ES
TO
RE
R
CO
NT
RO
L O
H M
ICflO
TíO
GR
AM
RO
M/P
RO
M•
enM
ÍMO
RY
/O
Di'E
SS
RE
fllS
HR
SY
ST
IM A
ND
/O(Í
MI'-
WO
RY
AD
DR
ES
S B
US
EC
G7
4L
S2
41
US
ED
AS
SY
S^
EK
" A
NO
/OR
ME
MO
RY
BU
S D
RIV
ER
-4.B
IT
OR
GA
NIZ
AT
ION
C
AN
BE
AP
'LIE
D T
O H
AN
DL
E B
INA
RY
OR
BC
D
EC
G74
LS
240,
74
LS
24
1,7
4
1/4
'LS
I41
DH
IVE
B
PA
HT
Y-L
INE
MU
LT1P
LE-I
NP
UT
/OU
TP
UT
BU
S
TO
OT
HtR
BU
FF
ER
S "
OÜ
IPU
T
}OU
TPU
T-TO
RT
CO
NT
RO
L
|
}1NP
UT
-PO
RI
CO
NT
RO
L
IND
EP
EN
OE
NT
4
-BIT
BU
S D
HIV
ER
S/R
EC
EIV
EH
S
IN A
SIN
GL
E P
AC
KA
OE
1 1 1 1 1
1 1 1 1 1
JT
,
NO
NE
N
ON
E
PA
RT
Y-L
INE
BU
S S
YS
TE
M
WIT
H M
ÚL
TIP
LE
IN
PU
TS
, O
UT
PU
TS
, A
ND
RE
CE
IVE
RS
AJÉ
Sem
icon
duct
o^
MM
54C
920/
MM
74C
920,
MM
54C
921/
MM
74C
921
1024
-Bit
Sta
tic S
ilico
n G
ate
CM
OS
RA
Ms
-ají-
Gen
eral
D
escr
iptio
nT
he M
M54
C92
0/M
M74
C92
0 2
56
x4
ran
dom
acc
ess
rea
d/w
rite
me
mo
ry is
ma
nu
lact
ure
d us
lng s
llIco
n g
ate
CM
OS
iech
nolo
gy.
Dat
a o
utp
ut
is t
he s
ame
po
larl
ty a
s d
ata
Input.
In
tern
al
latc
he
s st
ore
ad
dre
ss I
nputs
, C
ES
and
da
ta o
utp
ut.
Thl
s R
AM
¡s s
pe
ciflc
ally
de
sig
ne
d to
op
éra
tefr
om
sta
nd
ard
54/
74 T
TL
pow
er s
upplle
s. A
ll in
pu
ts a
nd
ou
tpu
ts a
re T
TL
com
patib
le.
The
MM
54C
921/
MM
74C
921
Is Id
entíc
al to
the
MM
54C
920/
MM
74C
920,
exc
ept
data
inp
uts
are
Inte
rnally
co
nn
ect
ed
'to
dal
a o
utp
uts
; the
num
ber
o( p
ack
ag
e le
ads
Is t
here
byre
duce
d to
18.
Com
plet
e a
ddre
ss d
ecod
ing
as w
ell
as 2
-chi
p s
elec
t íu
nc-
tions,
CE
L an
d C
ES
, an
d T
RI-
ST
AT
E*
ou
tpu
ts a
llow
eas
yex
pans
ión
with
a m
ínim
um o
í ex
tern
al c
om
ponents
. Ver
-
si .t
ility
plu
s hig
h s
peed
and
low
pow
er m
ake
thes
e R
AM
sic
sal
ele
menta
lor
use
in m
icro
proc
esso
r» m
lnic
om
pute
r,a¡
. well
as m
ain
(ra
me
mem
ory
ap
pllc
atlo
ns.
• '2
56
x4
-blt
org
an
lza
tlon
} A
cce
ss t
ime
:. 2
50
ns
ma
x. M
M74
C92
0, M
M74
C92
1,
27
5 ns
max
. M
M54
C92
0, M
M54
C92
1300ns
ma
x. M
M7
4C
92
0-3
, M
M74
C92
1-3
TR
I-S
TA
TE
ou
tpu
ts
Lo
w p
ow
er
On-c
hlp
re
gls
ters
Sin
gle
SV
su
pp
ly
pala
re
tain
ed
wit
h V
cc a
s lo
w a
s 2
V
See
pag
e 4-
15fo
r de
ta'le
dsp
eclfi
caíio
ns
2-^4
0
9'
MM
54C
922/
1 . .^
2216-K
ey
Enc
oder
MM
54C
923/
MM
74C
923
20-
Key
Enc
oder
Gen
eral
Des
crip
tion
Thes
e C
MO
S
key
enco
ders
pr
ovid
e al
l th
e ne
cess
ary
Ipgi
c to
íu
lly
enco
de
an a
rray
of
SP
ST
switc
hes.
The
keyb
oard
sea
n ca
n be
impl
emen
ted
by e
ither
'an
exte
rnal
cloc
k or
ext
erna
l cap
acito
r. T
hese
enc
oder
s al
so h
ave
on-
chip
pul
l-up
devi
ces
whi
ch p
erm
ít sw
itche
s w
ith u
p to
50 k
íl o
n re
sisl
ance
to
be u
sed.
No
diod
es in
the
sw
itch
arra
9 ar
e ne
eded
to
el
imín
ate
ghós
t sw
itche
s.
The
inte
rnal
de
boun
ce ci
rcuil
need
s on
ly a
sin
gle
exte
rnal
capa
cito
r an
d ca
n be
def
eate
d by
om
ittin
g th
e ca
pa
cito
r.A
D
ata
Ava
ilabl
e o
utp
ut
goes
to
a
high
lev
el w
hen
ava
lld k
eybo
ard
entr
y ha
s be
en m
ade.
The
Dat
a A
vaila
ble
outp
ut r
etur
ns t
o a
low
le
vel
whe
n th
e en
tere
d ke
y ís
rele
ased
, ev
en
íf an
othe
r ke
y is
dep
ress
ed.
The
Dat
aA
vaila
ble
will
ret
urn
high
to
indí
cate
acc
epta
nce
of t
hene
w k
ey
aíte
r a
norm
al d
ebou
nce
perí
od;
this
tw
o ke
yro
ll ov
er Ís
pro
vide
d be
twee
n an
y tw
o sw
itche
s.
An
inte
rna
l re
gist
er
rem
embe
rs
the
lasl
ke
y pr
esse
dev
en a
fter
the
key
is
rele
ased
. The
TR
I-S
TA
TE
® o
utp
uts
&'•
prov
ide
for
easy
exp
ansi
ón a
nd b
us o
pe
ratio
n an
d ar
eLP
TT
L co
mpa
tible
.
Fea
ture
s
• 50 kíl
máx
imum
sw
itch
on
res
ista
nce
• O
n o
r o
ff c
hip
cloc
k
• O
n c
hip
row
pul
l-up
dev
ices
• 2
ke
y ro
ll-ov
er
• K
eybo
uncE
elim
ínat
ion
with
sin
gle
capa
cito
r
• La
st k
ey
regi
ster
at o
utpu
ts
• T
RI-
ST
AT
E o
utp
uts
LP
TT
L co
mpa
tible
• W
íde
supp
ly ra
nge
3V
to
15V
• L
ow
pow
er c
onsu
mpt
ion
O co ro ro O co ro to Oí
-u O co ro co n co EC
onne
ctio
n D
iagr
ams
Dua
l • I n
- Un
e P
acka
gcD
ual
-ln
-Lin
e Pa
ckag
e
IHW
Yl-
HOW
Yl
-
(10*
Y)-
ntm
Y<
-
OS
CH
U10
R-
IDU
NC
LK
UK
-
CO
LUH
UIX
» -H
CO
I U"»
XI
T7
- D
AIA
OU
I A
- O
AI*
OU
I I
toiu
wn
xt
U. c
oi u»
xi ;
HO
* Y
l —
flQ
WY
l —
RO
» Y
J —
BO
WY
I —
RtW
Yl
—
OS
CIU
AIO
H —
KE
YIQ
IIKC
EM
A1K
J-\
4
' C
OU
ltilN X
] -1
J
10
PV
II*
Ord
«r N
umbc
i MM
54C
922N
or M
M74
C92
2NS
*«P
»
-DA
1AO
UI A
- D
AIA
DU
I I
-DA
IA O
UI C
L D
AIA
OU
I n
-DA
TA
OU
I t
-OA
IAA
VA
IIA
IIE
- tai
im*
xi
- eo
iunx
xi
IDtY
IICr
Ord
»r N
umb«
r M
M54
C92
3Nor
MM
74C
923N
2-41
^
*
AA
US
TJiu
io iv
iasviiu
uiti
nu
.n
f^u
ÍT-,
U,D
,,
Volis
ge
«tA
ny
Pin
Vcc -
0.3
V tc^cc
"* °-3
V
' P
acka
gc O
istip
atio
n
50o
y,
. M
M54C
W2.
MM
54C
923
-55"C
to
M2
5"C
V
GC ''
18V
MM
74
C9
22
. M
M7
4C
92
3
-40
'C t
o +
85"C
Lead T
em
pe
ran
te t
So
lda
rtn
g,
10 te
condil
3oo'
Sto
rag
eT
em
pír
atu
fe R
ang*
-65"C
to 4
150°C
DC
Ele
Ctr
ical
Ch
ara
Cte
r'lS
tiC
S M
ln/M
ax l
lmlts
app
ly a
cros
s te
mpe
ratu
ra r
ange
unl
ess
othe
rwls
e sp
ecltt
ed
PA
RA
ME
TE
RC
ON
HT
1O
NS
MIN
TY
PM
AX
UNIT
SC
MO
S T
O C
MO
S
Vy-f
P
osi
tive
-Go
ing T
hie
sh
old
Vo
llag
e a
l
Ose
and K
BM
Inputs
„
Vy_
N
eg
ative
-Go
lng T
hre
sh
old
Volla
ge
at
Ose
and K
BM
In
puis
V|f
J(]
| Logic
al "1
" In
put
Vo
lta
ge
, Exc
ep
t
Ose
and K
BM
In
puts
*•
•
V|f
j(Q
) '
Logic
al "0
" In
put
Vo
lta
ge
, E
xce
pt
Ose
and
KB
M I
nputs
ltp
Ro
w P
ull-
Up
Cu
rre
nt
at Y
l, Y
2,
Y3
,
Y4 a
nd Y
5 Inputs
VQ
UT
IH Logic
al "1
" O
utp
ut
Vo
lta
ge
VQ
UT
(O)
L°9
Íca' "°"
Outp
ut
Vo
lta
ge
Ro
n
Colu
mn "
ON
" R
esi
sta
nce
at
XI,
X2
. X
3 a
nci
X4
Ou
tpu
ts
'CC
S
upply
Cu
rie
n!
'lN
(l)
Logic
al
"1"
Inp
ut
Cu
rrcn
t a
l
Ou
tpu
t E
nable
'lN(O
) Logic
al
"0"
Input
Cu
rre
nt a
t
Ouip
ut
Enable
VC
C"
5V
., I|
N>
0.7
mA
VC
G*
10V
. I|N
> 1
.4 m
A
VC
G =
15
V, 1|N
> 2
.1 m
A
vC
Ca 5
V.
llfj>
0.7
mA
VC
C=
10
V,
l|N
>1
.4m
A
VC
G*
15
\.,
I|N
5:2
.1 m
A
VCC
= 5
V.
VGC
s i
o\
VCG
- is
\
VCG
* S
Y,VC
C =
IQ\
VCG
= is
v ,
VCC
= 5
V
V,N
= 0
.1V
CC
VCG
= io
\V
CC
=1
5K
vCc
= 5V
. IQ
--IO
/IA
VGC
S w
, IO
= ~
I°M
AV
GC
=IS
", i
o =
~io
pA
VG
C =
5V
IQ
~ l
Op
A
VGC
= io
''i I
D =
iopA
VGC
= 1
5*',
ID =
iopA
VC
C-B
V VO
= O
.BV
VC
G= 1
0'',
V
rj =
IV
VC
G= 1
5V.
VQ
= l
.OV
VG
C "
5V
O
se a
t O
V
VGC
B t
oyV
cc =
15 '
VC
CS1
5'.
V
IN
=1
5V
Vc
C-I
SV
. V
|N =
OV
. 3
6 9 0.7
'
1.4
2.1
•
• 3.
5
B 12,5
4.5
9 13.5
-1.0
3.6
6.8 10 1.4
3.2
5 4.5
9 13.5
0.5 1 1.5
-2 -10
-22 50
0
300
20
0
0.55
1.1
1.7
0.0
05
-0.0
05
4.3 8,6 12.9
2 4 6 1.5
2 2.5
.
-5'
-20
-45 0.5 1 1.5
1400
700
500
1.1
1.9
2.6 10
.V V V V V V V V V V V V
HA
ÍJA
(JA V V V V v V n
" n n
mA
mA
mA
íiA ;iA
CM
OS
/LP
TT
L 1
NT
ER
FA
CE
VIN
[1)
Logic
al
"1"
Input
Vo
lta
ge
, E
xce
pt
Ose
an
d K
BM
In
pu
ts
v!N
tO)
Lo
gic
al "
0"
Input
Vo
lta
ge
, E
xce
pt
Ose
an
d K
BM
In
puts
VO
UT
(1)
Lo
gic
al"
1"0
utp
itt
Vo
lta
ge
VO
UT
IO)
Logic
al
"0"
Ou
tpu
t V
olt
ag
e
54C
, V
CG
= 4
.5V
74C
. V
CG
= 4
.75V
S4C
, V
CG
= ^
-5V
74C
, V
cc
= 4-7
^v
54 C
. V
GC
= 4
.5V
,
IQ» -
36" '/i A
74
C,V
CC=
4.7
5V
.
IQ E
-36
1 V
A
54
C,V
CC
=
4.5
V,
74C
, V
cc. *
^.7
5V
,
IQ--
36
.V1
A
VcC
-1.5
Vcc- 1.
5
2.4
2.4
0.8
0.8
0.4
0.4
V V V V V V V V
~-
«^
w ^
,,v.<
* ,
„.-.
, m
¡
J^
P
AR
AM
ET
ER
^\S
MIN
TY
PM
AX
•
^Ü
TP
UT
OR
IVE
(S
ee 5
4C
/74
C F
am
ily C
ha
rae
tem
ticT
b'a
ta S
he
et)
(S
ho
rt C
ircu
it C
urr
en
t)
1 S
OU
RC
E^u
ipu
t S
ourc
e C
urr
en
t (P
-Ch
an
ne
l)
fcO
UR
CE
Outp
ul
So
urc
e C
urr
en
t (P
-Ch
an
ne
l)
ISIN
K
Outp
ut-
Sin
k C
urr
en
t (N
-Ch
an
ne
l)
ISIN
K
Outp
ut
Sin
k C
urr
en
t (N
-Ch
an
ne
l)
AC E
lect
rical C
haia
cteris
VC
C =
5V
,V0U
T =
OV'
TA *
25° C
VCC
= I
OV
,VO
UT =
OV
,
TA
= 2
5DC
*
VCC-
BV.V
OUT
-VCC
.T
A » 2
5° C
VCC=
IOV,
VOUT
= V
CC.
TA
= 2
5°
C
-1.7
5
-B
1.75
8
-3.3
-15 3.6 16
mA
mA
mA
mA
tiC
S T
A =
25*
C, C
L=50
pF,
unle
ss o
ther
wis
e no
led
PA
RA
ME
TE
R
tpd
O-'p
dl
Pro
pa
ga
tio
n
De
lay
Tim
e t
o
Logic
al "0
" or
Logic
al
"1"
fro
m D
.A.
'OH
i1 1
H
Pro
pa
ga
tio
n
De
lay
Tim
e f
f om
Logic
al
"0"
or
Logic
al
"1"
into
Hig
h I
mp
ed
an
ce
Sta
te
lHO
'tH
1
Pro
pa
ga
tio
n
De
lay
Tim
e I
rorn
Hig
h I
mpedance
Sta
te t
o a
Logic
al
"0"
or
Lo
gic
al
"1"
Cjjg
In
put
Capacitance
CO
UT
T
RI -
ST
AT
E O
utp
ut
Ca
pa
cita
nce
Not
e 1:
"Atn
olu
te M
áxim
um
R
atin
gs"
ai
eT
em
pe
ifltu
ie
Ra
ng
e"
the
y a
te n
ot
nie
anl
lo
CO
ND
IT1
0N
S
CL
= 50
pF,
(Fi
gure
J)
VCC
= 5
V
VC
G=
iov
VC
C=
15
V
RL
= 1
0k.
CL
= '\Q
pF
IFig
ure
2)
VC
C =
5V
R
L=
10
k
VGC =
10V
^L~
10
P^V
CC =
15
V
RL
» 1
0k,C
L=
50 p
F,
(Fig
ure
2)
VCC
= 5
V
RL
=
k
VC
C=
'O
V
CL=
50
PF
Vc
c=1
5V
Any I
nput,
(N
ote
2|
An
y O
uip
ut,
(N
ote
2)
MIN
TY
P
60
35
25
80
65
50 100
55
40
5 10
MA
X
150
80
60
200
150
110
25
0
125
90 7.5
UN
ITS
ns ns
ns ns ns ns ns ns ns PF
pF
thos
e va
lúes
buyo
nd
wh
ich
th
e s
aie
ty
o(
the
devi
ce ca
nn
ot
be
guara
nte
ed.
Exc
ep
t fo
r "O
psra
tin
gim
ply
th
at
the
dev
íces
should
be
op
eta
ted a
t th
es« l
imíts.
The lable
oí
"Ele
ctii
cal C
hara
cte
riiti
cs"
pio
videi
con
dtt
ion
s ío
t a
ctu
al
devi
ce o
pera
lion.
Hot
t 2
: C
ap
aci
tan
ce ¡
s g
ua
ran
tee
d b
y p
eri
od
ic l
esi
ing
.
Sw
itchi
ng T
ime
Wave
form
s
-v:n
VCE
1M
YO
IHlf
t ;
1
— J ii
'r—
^ r
v[c
OA
I*
y.
AV
MU
IU
A•
1
^"c
e--
'
\A
íl
oum
ii
i
CC -""
^«
vcc
Ti
"• T
2 *
RC
, T
3 •
* 0.7
RC
wh
ere
R "
. ca
pa
cito
r a
l K
BM
inpui.
VC
C —
Dtrr
Fin
/i.&
vcc
tí! —
•' "
T'°"
M
DA
IHO
UI
y
\w
VOL
•* n
1 —— J
n |
—
i I.
.H
y^r
\^c
c /
DW
Fffl
/, í
Vrr
i , „
ES
ÍITI
—1
[ — 'M
I .
B
'
1 |IK"f\h
/VO
H • - 1
If%
IÍW
CC
0*
IAO
UI
V
ÍHia
iAIt
-'
lOk a
nd C
¡i e
xte
rna
!
l,\E
1
'
FIG
UR
EC
ÍB
si
'2-
422-
43
Tru
th T
able
10
ii
12
13
14
ib
te
11
11
'Om
il f
or' M
M54
C92
2/M
M74
C92
2
Typi
cal
Per
form
ance
Cha
ract
eris
tics
Typ
ical
Ijp
vi V
)N »
t A
ny
Y I
nput
Typ
ícal R
on v
iX
Ou
tpu
i* A
"Y
2-4
4
Typ
icm
l D
tbounee
P*r
iod
(
« C
KB
M
Typ
ical
Applic
atio
ns
Syn
ehro
nou»
H«n
tfah
»k«
(MM
74C
922)
1QC
Syn
chro
noui D
ita E
ntry
Ont
o B
ui (
MM
74C
9Z2)
OA
TAA
VA
IlAllE
IINVI
TATI
ON)
T
. E
NA
IU D
Uir
ilJ
*
' I
RE
SM
JNS
EI
DA
IA A
VA
ILA
BIE
Ou
tpu
ts a
re e
nabl
ed w
hen v
alid
ent
ry ¡i
mad
e an
d90
into
TR
1-S
TA
TE
whe
n k
ey is
rele
aied
.
A»y
nchr
onou
» D
«l»
En
try
Onto
Bui
(MM
74C
922)
K*y
bo
*rd S
uppli»
n
Mln
! K
ey
Ser
leí
KL
Dig
hra
n C
ompa
nyP
aude
na, C
alif
orn
ia
'
Com
potr
onlc
» E
ngln
eerí
ng72
35 H
olly
wood
Blv
dH
olly
wo
od
, C
alifo
rnia
90O
46
<•—
•>•
OAI
A AV
AILA
ILE
, O
utp
uis
Brt I
n T
RI-
ST
AT
E u
ntll
key
¡s p
'reiw
d, ih
en
dai
a is
pla
ced
on b
us.
Whe
n k«
y i»
rele
aied
, ou
tpu
tt r
etu
rn lo T
RI-
ST
AT
E.
L ft N
oI.
3:
The
ke
ybo
ard
muy
bo
svnc
hron
ouily
«c-
nrw
d b
y om
lttin
g t
he c
apac
itor
at o
se.
»nd
driv
infl
c«c,
dir
ectly
if
the
lyit
em c
lock
A
rate ii
low
er
than
10
kHz.
2-4
5
S^^^
Exp
ansi
ón lo
32
key
Enc
oder
(M
M74
C92
2).
-+5V
The
ory
of O
pera
tion
The
MM
74C
922/
MM
74C
923
Ke
ybo
ard
E
ncod
ers
Im<
plem
ent
all
the
logi
c ne
cess
ary
to I
nte
rfa
ce a
16
or 2
0S
PS
T ke
y sw
itch
ma
trix
lo a
dig
ital s
yste
m. T
he e
ncod
erw
ill c
onve
rt a
key
sw
itch
clo
ser
to a
4(M
M74
C92
2) o
r5(
MM
74C
923)
bit
nib
ble
. The
des
igne
r ca
n co
ntro
l bot
h .
the
keyb
oa
rd s
ean
rale
and
the
key
deb
ounc
e pe
riod
byal
lerin
g th
e os
cllla
tor
cap
aci
tor,
C
0sE
i a"d
the
key
boun
ce m
ask
capa
cito
r, C
MS
K.
Thu
s, t
he M
M74
C92
2/M
M47
C92
3's
perf
orm
ance
can
be
opllm
tzed
for
man
y"ke
yboa
rds.
The
key
boar
d en
code
rs c
onne
ct t
o a
switc
h m
atrl
x th
atIs
4 r
ows
by 4
col
umns
(M
M74
C92
2) o
r 5
row
s by
4 c
ol-
umns
(M
M74
C92
3). W
hen
no k
eys
are
depr
esse
d, t
he r
owIn
puts
are
pul
led
high
by
Iníe
rnal
pul
l-ups
and
the
colu
mn
ou
tpu
ts s
eque
ntia
lly o
utp
ut
a lo
gic
"O".
The
se o
utpu
tsar
e op
en d
rain
and
are
ther
efor
e lo
w f
or 2
5% o
f the
tim
ean
d ot
herw
ise
ofí
.Th
e co
lum
n s
ean
rale
is c
ontr
olle
d by
the
osc
illa
tor
Inpu
t, w
hich
co
nsi
sts
oí ^
Sch
mitt
trig
gei
osc
llía
tor,
a 2
-blt
coun
ter,
and
a 2
-4-b
lt de
code
r.
Whe
n a
key
!s d
epre
ssed
, ke
y O
, for
exa
mp
le, n
othl
ngw
ill h
appe
n w
hen
the
XI
Inpu
t is
olí,
sin
ce Y
1 w
ill re
mai
nhi
gh. W
hen
the
XI
colu
mn
is s
cann
ed, X
1 go
es lo
w a
ncY
1 w
ill g
o lo
w.
Thi
s dl
sabl
es t
he c
ount
er a
nd k
eeps
X1
low
. Y
1 go
ing
low
als
o In
itla
tes
the
key
boun
ce c
ircui
l
tírnl
ng a
nd l
ocks
out
the
oth
er
Y in
pu
ts. T
he k
ey c
ode
tobe
out
putt
ed I
s a
com
bina
tion
oí
the
froz
en c
ount
er v
alué
and
the
deco
ded
Y in
puts
. O
nce
the
key
boun
ce c
ircu
í!tim
es
out,
the
dat
a is
latc
hed,
and t
he D
ata
Ava
ilable
(DA
V)
outp
ut g
oes
high
,
If,
durin
g th
e ke
y cl
osur
e th
e sw
itch
bou
nces
, Y
1 In
puí
wlll
go
hígh
ag
ain
, re
sta
rtin
g th
e se
an a
nd r
ese
ttln
g th
eke
y bo
unce
cir
cuitr
y.T
he
key
may
bou
nce
seve
ral t
imes
,bu
t as
soo
n as
the
sw
itch
sta
ys l
ow í
or a
deb
ounc
epe
riod,
the
clo
sure
Is
assu
med
valld
and
the
data
Is
latc
hed.
A k
ey m
ay a
lso
boun
ce w
hen
It is
rel
ease
d. T
o en
sure
that
th
e en
code
r do
es
not
reco
gniz
e th
is
boun
ce
asan
othe
r ke
y cl
osur
e, th
e de
boun
ce c
lrcu
lt m
ust
time
out
befo
re a
noth
er c
losu
re I
s re
cogn
lzed
.
The
tw
o ke
y ro
ll ov
er f
ea
ture
can
be
Illust
rate
d b
y as
-su
mln
g a
key
Is d
epre
ssed
, an
d th
en a
sec
ond
key
isde
pres
sed.
S
ince
al
l sc
annin
g
has
stopped,
and a
llot
her
Y In
puts
are
dls
able
d, t
he s
econ
d ke
y Is
not
rec
og-
nlze
d untll
the
fir
st k
ey Is
lift
ed
and
the
key
bou
nce
cir-
cuitr
y ha
s re
set.
The
outp
ut
latc
hes
fee
d T
R^S
TA
TE
» w
hic
h a
re e
nabl
edw
hen
the
Out
put
Ena
ble
(OE
) Inp
ut I
s ta
ken
low
.
2-46
d
Sem
icon
duct
or
"MM
74C
925,
MM
74C
926,
MM
74C
927,
MM
74C
928
4-D
igit
Cou
nter
s w
ith M
ultip
lexe
d 7
-Seg
men
t O
utpu
t Dri
vers
Gen
eral
Desc
riptio
nTr
íese
CM
OS
cou
nter
s co
niis
t of
a
4-di
gh c
ount
er, a
nin
tern
a! o
utpu
t la
tch,
NP
N o
utpu
t so
urci
ng d
river
s fo
ra
7-ie
gmen
t di
spla
y,
and
an
inte
rnal
m
ultip
lexi
ngcí
rcuí
try
with
fo
ur
mul
tiple
ou
tput
s.
The
mul
ti-pl
exin
g ci
rcuí
t ha
s its
ow
n fr
ee-r
unni
ng
osci
llato
r,an
d re
quire
í no
ex
tern
al
cloc
k. T
he c
ount
ers
adva
nce
on n
egat
ive
edge
of
cloc
k. A
hig
h fig
nal
on t
he R
eset
inpu
t w
ill r
eset
the
cou
nter
to z
ero,
and
rese
t the
car
ry-
out
low
. A
low
dgr
ial
on t
he L
atch
,Ena
ble
inpu
t w
illla
tch
the
num
ber
in t
he c
ount
ers
¡nto
the
int
erna
l out
-pu
t la
tche
s. A
híg
h lig
nal
on D
ispl
ay S
elec
t in
put
wlll
sele
ct t
he n
umbe
r in
the
cou
nter
to b
e di
ipla
yed;
a lo
wle
vel
sign
a! o
n th
e D
ispl
ay S
elec
t w
ili s
elec
t th
e nu
mbe
rIn
the o
utp
ut
latc
h to
be
dís
play
ed.
The
MM
74C
925
is a
4-d
ecad
e co
unte
r an
d ha
s La
tch
Ena
ble,
Clo
ck a
nd R
eset
inp
uts.
The
M
M74
C92
6 is
üke
the
MM
74C
925
exce
pt t
ha
t it
has
a di
spla
y se
lect
and
a c
arry
-out
use
d fo
r ca
scad
íng
coun
ters
. T
he
carr
y-ou
t si
gnal
go
es
high
at
60
00,
goes
bac
k lo
w s
t 00
00.
The
MM
74C
927
is
like
the
MM
74C
926
exce
pt
the
seco
nd m
ost
sign
ifica
nt d
igit
divi
des
by 6
rat
her
than
10,
Thu
s, í
f th
e cl
ock
input
freq
uenc
y ¡s
10
Hz,
the
disp
lay
wou
ld r
ead
tent
hs o
f se
cond
s an
d m
inut
es (i.e
., 9:
59.9
).
The
MM
74C
928
is l
ike
the
MM
74C
926
exce
pt í
he m
osí
sign
ifica
nt
digi
t di
vide
s by
2
rath
er
than
10
and
the
carr
y-ou
t is
an
ov
erflo
w
¡ndí
cato
r w
hich
¡s
hig
h at
2000
, an
d it
goes
bac
k lo
w o
nly
whe
n th
e co
unte
r is
rese
t. T
hus,
this
is a
3 1
/2-d
igít
coun
ter.
Feat
ures
Wld
e su
pply
vol
tage
ran
geG
uara
ntee
d no
iie m
argí
nH
igh
noís
e im
mun
ityH
igh
segm
ent s
ourc
ing
curr
ent
3V t
o 6V IV
0-45
Vcc (t
yp.)
40 m
A@
VC
C-1
.6V
,VC
C-5
V•
Inte
rnal
mul
tiple
cír
cuitr
y
Des
ign
Co
nsi
der
atio
ns
Seg
men
t re
sist
ors
are
desi
rabl
e to
m
inim
íze
pow
erdi
ssip
atio
n an
d ch
ip h
eatin
g. T
he
DS
7549
2 se
rves
as
ago
ód
digi
t dr
iver
w
hen
¡t is
des
ired
to
driv
e br
íght
disp
lays
. W
hen
usin
g th
ís d
river
with
a
5V
supp
ly a
iro
om
tem
pera
ture
, th
e di
spla
y ca
n be
driv
en w
íthoüt
segm
ent
resi
stor
s to
ful
l ill
um
inatio
n.
The
user
mus
t use
' ca
utio
n in
thí
s m
ode
how
ever
, to
prev
ent o
verh
eatin
g of
the
deví
ce
by
usin
g to
o hi
gh
a su
pply
vol
tage
or
by
oper
atin
g at
hig
h am
bien
t te
mpe
ratu
res.
The
inpu
t p
rote
ctio
n ci
rcui
try
cons
ists
of
a se
ries
resi
stor
,an
d a
díod
e to
gr
ound
. Th
us in
put
sign
áis
exce
edin
gV
cc w
ill n
ot b
e cl
ampe
d. T
his
Inpu
t si
gnal
sho
uld
not b
eal
low
ed to
exc
eed
15V
.
Con
nect
ion
Dia
gram
Du
i|-ln
-Un
e P
acM
M74
C92
5M
M74
C92
6, M
M74
C92
7 in
d M
M74
C92
8
Func
tiona
l Des
crip
tio
nR
eset
—
Asy
nchr
onou
s, a
ctiv
e hí
gh
Dis
play
Sel
ect
— H
igh,
di
spla
ys
outp
ut
of
coun
ter
Low
, di
spls
ys
outp
ut
of
latc
h
Latc
h E
nabl
e —
Hig
h, f
low
thr
ough
con
ditío
nLo
w,
latc
h co
nditi
on
Clo
ck
— N
egat
tve
edge
sen
sitiv
o
Seg
men
t O
utpu
t —
Cur
rent
so
urci
ng
with
40
mA
@
VO
UT
= v
cc
- i.6
V(iy
p.)
Als
o,
sink
ca
pabi
lity
* 2
LT
TL
load
sD
igit
Out
put
— C
urre
nt
sour
cing
w
ith
1 m
A
@VO
UT
=
1-
75V
. A
lso,
sín
k ca
pa-
bility
- 2
LT
TL
load
sC
arry
-out
-
2
LTT
L
load
s.
See
car
ry-o
utw
avef
orm
s.
2-47
ÍS^
Q 'O i 00 to Q O
15] i'-i "|,p
_
CD
4D
66
BM
/CD
40
66
BC
Qu
ad B
ilate
ral S
witch
Gen
eral
Des
crip
tion
!
The
CD
4066
BM
/CD
4066
BC
is
a qn
ad b
ilate
ral
switc
hIn
tend
ed l
or I
he t
ran
smis
ión
or
rnul
tiple
xlng
o|
ana-
log
or
dig
ital
sign
áis.
U ¡
s pi
n-fo
r-ól
n co
mpa
tible
wít
hC
0401
6BM
/C04
016B
C,
but
has
a: m
uch
low
er "O
N"
resi
slan
ce,
and
"ON
" res
ísta
nos
!:• r
elát
ivel
y co
nsta
n!ov
er I
he I
nput
-slg
nal
rang
e.
Feat
ures
• '.v
ldes
uppl
y vo
ltage
ran
ge -
•"
3V
to1
5V
• 'H
igh
no
ise
lmm
un
íty
• .
• .'
0.45
VO
D (t
yp.)
• W
lde
rang
e of
díg
ita! a
nd
• '
±7.
5VP
EA
K
anal
og s
wltc
hing
• "O
N"
resi
stan
ce lo
riS
Vo
pa
rati
cn
. BO
Q•
Ma
tch
ed
"QÑ
" res
isla
nce
- •
¿RO
N =
5 Q
(typ
.)"ov
er 1
5 V
slg
nal i
nput
• "O
N" r
esis
tanc
e (la
t ov
er o
eaX
-lo-p
éak
sign
al ra
nge
• H
igh"O
N"/
!'OF
F"
"
. 65
dB(l
yp.)
outp
utvo
ltage
rallo
íf
f,, =
10k
Hz,
ñL
= lO
kQ••
•Hlg
hdeg
reel
lnea
rlty
0.
:% d
isto
rt!o
n(ty
p¡}
' •- .
0.
1 nA
(typ
.)VD
O" -
Vss
= 1
0 V
, TA= 2
5'C
.•
Ext
rem
ely
low
"O
FF
" /
switc
h le
akag
e '
• E
xtre
mel
y^ig
h co
ntro
l inp
ut Im
peda
nce
. 10
!!Si(t
yp.)
• Lo
wcr
ossl
alk
• ' '
-50
dB
(typ
.)be
Uve
en s
w'íc
hes
" '
@ í
|J=
0.9
MH
z,H
l.= lk
Q•
Ffe
auen
cyre
spon
se. s
witc
h "O
N"\
)
App
licat
ions
• A
nalo
g sl
gnal
sw
ltchl
ng/m
ultlp
laxl
ng••
Slg
nal g
atln
g•
Squ
elch
con
trol
.
- ..
• :•
Cho
pper
•
' '"
*'•
Mod
ulal
or/D
emod
ulat
or•
Cdm
mut
atln
g sw
itch
»
Olg
itai si
gnal
sw
itchl
ng/m
ultlp
lexl
ng
• C
MO
S lo
gic
Impl
em
enta
ron
' •
» A
nalo
g-to
-dig
ital/d
lglta
l-to-
anal
og c
onve
rsió
n
• D
lglla
l co
ntro
l o[
freq
uenc
y, Im
peda
nce,
pha
ss, a
nd
anal
og-s
igna
l-gai
n
Sch
emat
lc a
nd C
onne
ctio
ñ.D
iagr
ams
DuiM
n-L
ine
Rjc
kig
»
5-16
0
*'l •t •í 1 "f -? Vi •» "í y i .
. — '••Í
S¿.
Í¿^
•-
-v
.— '
VD
DS
up
ply
Vot»
9.i
. '.I:ji
v ;":.-«,
• "_ ,'-
'|Bí.S
V t
o+
18
V
-.
-"
VD
OS
up
Dly
Vóltag*
'-;';
' .
" "
.""•'
'V to
j5
y
Vip
J In
P"1
Volta
ge
*
--'•••
'•—
r
.'"
MJ.
5V t
rf'V
oo
';t0-5
V"
•.
-.V
|N I
npuvV
oltag*
• '-
- .'"/'.,,
'JV
to
VQ
Dfs
Sto
"»9«T
ttT
iM(iIü
ti R
ange
<
.:
. -6
5"*
C lo
-f 1
50°C
T
A Q
fwa
tin
g T
em
pera
tu te
fíiñ
'qe "
'
'r~
'''.~
-
¡>0F
a<:l<
a»!
Oiíi'o
atlo
n
. •
. ,:5
00
mW
'
'•
CD
406S
8M
*-
S5
"C t
o +
nS
*C
H t«
»d
Te
mo
e(i
Wft
{S
old
rrúig
, 10 tr
condíl-
. .'
300*0
C
d«066aC
-4
0*C
to
+S
5*C
:".
;^_
;-
. ..'
•;, •=
v--
.v>
-'t;N
'¿
''."
• .
,•••
••"
' ".
•
~.-
i .
.-
•'
• .
-'
•.
.,
-.'
'
DC
Elé
ctri
ca!
Ch
ara
cte
rist
ics
co-io
eeBM
(Not
a 2»
"~~P
ara
nu
ttr
IDO
Q
üíe
ic«ni
Dev
íce C
uueni
' ••
"'.C
,
' '•"' "
"
' '.•
Coñdltl
oni
VOD
• sv
:*
. ;
•VD
D \*
ov
: , '
VDD
-'l
5V
íf
' ' '.,
•'
.-55°C
Min
Max
0.25
. °-e
" 1,
0
2S
5C
.
Mln
T/P
'
0.0
1
~?
0.0
1.
0.0.
1
.v«<
0.35
C.£ 1.-0
12S
°C
Wn
Max
7.5 15 3o
:-r;
Uniti
M-
fA .«*
•
Sig
oal In
pu»
»nd O
üip
uti
. -
- '
.
• '
• ' '
•
RO
N
"ON
" R
esí
itan
cB
-
t
''•-.
.
¿R
OM
..¿
"O
N"
Re
ilsta
nca
:
. '
Bel
v.-e
en a
n'y
2o
f .
"
4 S
wíic
hes
' '
I|S
' In
put
or
Outp
ut
Leak
sg»;
Sw
iích
"OF
F''.
Co
ntr
ol
tnp
ot!
VIL
C
Lo
w L
íve
l In
pu
t'V
olta
ge
- '
- •
- ".
.
V|H
C
Hig
h L
eve}
Input
Vo
lta
ge
l|fj
Input
Cu
fre
nt
-.'
--,•-'
*"'
RL.l
okn»^lÍ25..
.'
Ve *
VOD.
V(¿
• Vg
s to
VDD
Vn
o'S
Vvb
o-io
v'
' .'•
VDD-
ISV
Ru.
a,0k
ntoy
jio^x
ss _
t
Ve
- VDD
. VI
S-'V
SSÍO
-VO
DVD
Q-.
IOV.
.
VO
D-
isv
Vc
-OV
|s»
IS
Vs'n
d O
V,
1
VQ
S-
OV
an
d 1
5V
'. .-
^t^
.
. .
2000*
• •
400 .
220 : • . -.
¿50
v
1
. 120
80 .-
'10 5
10.
1
.,
i 1
2500
SO
I
280
-ik
••
- * '
=5C
i
3500
550 '
320 '
.r
":' .
±500 ,.
•
1
, n p. n *
íí*- n'
•nA í
• .'
-•
-.
•*
- "
• .
- . -
í .
V,s
= V
SS
and
VD
D
} '•
VO
S "
Vo
oa
nd V
ss
'..
j .
VUD
- sv
-
V'O
Ó-
15V
4 '
- •"
'
= .
VQD-
SV
• •
••V
OD '
I°V
(ie
o n
ote
6]
- .
VDD
-ISV
VO
D-V
SS
- 15V
; '-
• :
*
, .;
. ;
3.5
7.0
11.0
;
.1.5 3.0
•4.
0
•
kl
3.5
'
7.0
'1.0
.
11
5t.5
ñ.
'5
2.7
5
5.5
8.2S
ilO-5
. '
3.0
JO
. 10. 1 • 'i1
*
3.5
. /.o
• 11.0 •::••
1.5
''•
' 3.
0 -'
J.O
~.1"°
1-
•
• V V
••:y "V
: -
'V • v
WA
•• "••
'^
"•^
--•;
": '
•.•-
'.""
"-
•=
V
^vS
"•;
•'/:
. ''-^,
¿-
:-
..
..
-.
. .
_ '
. .
" _
--'-••
.
. ••
••
-• .
"-.-;
. ;-
•'.•
'•
..
"-
' -
• '
" .
$.
'-
''
'-
..
'.•
• ..:
.
• •
-.
-.
..
" -'
• ••
:••-'
- -
DC
Ele
ctrica
l C
ha
ract
eri
stic
s 00
4066
80 .(N
ota 2
) -
.'. •
'•;.'.
- ;..
•
- P»
™».
, •
'
'DO
'.'*
Q
ute
ícerit
D«ví
cé C
urr
sn
t
•' .C
onditío
ni
. -
VDD
-SV
• '
VDD
* IQ
V •
' .
vpp-
'sv-
.
-40°
C
Min
'M.X
1.0
2.0
-4;
0
' 25°
C
Mín
Typ
0.01
'0.
0 r,
0.0
1
Max
1.0
.
2.0
4.0
85 C
Min
M.X
-
• 7
.5-
15 30
v-u ;
'Hrii
ti '
^A
ftA
.
•'
. '
'•
' -
••
-,
-:
.:•;
5,1
61
' •
• .
' .
• '
.-."
"'
' "-".-
• .'.
•.
'.
',
- .
' '*
' '
' .
'.
' •
;
- —
-L
- -
.—
.j ---...
'..-
".
.-..-•
»••••
: ' • ; ' • ' ' . ' ! .'"' • • : CD406GBM/CD4
Ul
oíN)
' ¿
S
• > J X N X. , . . , , N X r-
•S -5 TI- » • • • f- t-i r-
, . • . N r X
, •!:' "'-1* 7 K I0p^ íT°P'? 5" 79 5 - ' 2 - 5 I 5 § D S £ = 3 ^ o.2-iS * 3 - 5 2 ^ 3 - - S S - o c - o¡c «í c " j ¡ G e " ' * — m
. . |a - ó 1- -3. | = S I-" 1 § 1*°£ 2 S ' . ' f i S o - _ S o 2 o3 - 0 o £ ^ s - 3 y - « . - 2.5o 3 r- ° n p ^ w O *- < 3 — * c n - < í w < c - t* ? S 5 f rl ' f f r! .g -i
í|. ° a : " ÍSS- . f
i íW3i< -íJí< < < < S : D < < < S » < < < 3 <«•t jr-o'.' l5lf-n o o o Ür- o a o Q _ r - o o o r - nC C ^ k B c " « O O Q ^ j i O O O j j ^ O O O i i
^"°<1 "H S ? < g "? < -5 <<<ír?,
W. 'Su! u, w y, ui 0— Tp-M ^ M a o _ T>
I .< 1 < ? .. 2 -í- § a -^ r " •
¿ o •. . roo i- _ o ui tn
£ 3 ? — u i m — r o U U ), ' • - O O K 3 o o * J uiintn
•-^ ". S . « ' ' 2 2 2 ' 2 2 2 - 2 2 2,i y^'^ft 3: ; -. .i. I, .1.
..i - * •? g:-
' 1
f 1 ; .11— í I¡ * - 'if—'" " S- í =g S*— 3
• ' : S
- ', n " - ' 1 "Hr- S -HC ,|f_|| W^£ | IJ. m J
J í ' N '!) — Vi/i — • • £" ''1 — v
C'.. • ? ^ •? 1-? .$ , . £C í .' . r . £ 3 7
?; .s s •] 8 ' - í . '! i ;f .? - '- ? ' -3*1 ' i 1 3 - I d
^ A í- 5 t\' Ss- ./ s v 5 p i 4 ' i í s" 3r -ppr-. . i - v^ . í-: S - r J 1 ' ^
. • ' • * 1 M - • , J^- i- - • ¥ • f-• * A 3 i-í • J í
T '"""T.,1/.
Param
eterC
ondilio
n)
2a'
•u
f
C
5' i-
.
i
AC
E
lectr
ical
Ch
ara
CÍe
ris
licS
TA-2
5'C
, t, = t, =
20 n
s a
nd
Vg
s = O
Vu
nIa
sso
the
rwls
esp
ecIlie
d
;s-O
* ' • í S1tn
* „ t-J1 S "f- 1 2
a ;2 ^ £.
5- g í W*
f ÍU
r— °-i ^ W
os/ 3-"•. . «o
H
3ÍD
£0)
. 1- o"
I "
A: -i• M ~1
V J
) Lx— ;i f E
-=• < <z 5 F_ o n
« f 's"O 3- SS r- r-
5" =
<<< < < *c <<<o o o o o o o a oo o o o o o o a oV V 1 ' " ' ' " •
7,Mw < <. < < <v V " —
HOl
ET O cí>
= cua.
¿r o</> o
— ?J U
b
P .& H ru o o ín
— ^1 U
b
P rJ ui -j --J in Jo¿, ui . ui tn ui
O í. (J —
ío a b vi
b -
— . A. LJ — '' b b b úi
T= < < < < < <
sUHsfH
bso
lute
Má
ximu
m R
stln
gs" a
te iho
sam
ply
Itlat
the
devic'e
s sho
uld
be
opí
Ch
ara
cle
rlstlc
s" p
rovid
e c
ondllio
ns íc
S =
OV u
nle
ss olh
erw
ise specllle
d.
ese de
vlces s
hould
no
l be
con
ne
cled
all c
ase
s, Ih
ere Is a
pp
roxlm
ate
lyS
pF
oÍ3
sptíc
ilied.
3 is Iría v
olla
ge
at Ih
e in
/oul p
in a
nd V
c
ndílio
ns lo
r VIH
C'-
at V,c =
Vnn. In
c =
slan
da
rd -B se
rles Ir va
lúe
s be
yon
d w
nlc
n th
e s
ale
ly oí Ih
e d
evice
rate
d a
t Ih
ese
ílm
its. T
Me la
bia
s o
í "R
eco
mr a
ctua
l de
vice o
pe
raíio
n.
o c
lrculls
villh
Ihe
po
we
r "ON
".
pro
bé a
nd ¡Ig
capacila
ncein
Iheoulp
utjh
ow
e
3S is
Iha
vo
ltag
e a
l Ihe
ou
l/ín p
in. V
c Is th
e vo
H
b) V
iS = O
V, lO
L=sta
nd
ard
B se
rles loi_
.
Ü IB 3 f l
' : i III. I f j5 ' v = 3
3" , .— O n
S. ~ 5a • § -<a. ". S
P. 11
o n o5 S g
O TI W
lllo ir ~~ o 03 C S.
0 0 «» W B?
»• S ffS n 3» ro S
Co
ntro
l Inputi
• ,
.=• o .33;o 2.7
^1. . ífl t.^1; ri| . ' • ¡'
2 ?_ g n
< < < < = ! < < < < 3n o o n r - o o o o r~, o o n • o o o i •
<<o S < < < ? 3 '
oo
lf • " * í/ ^
1 i
1»[p N) Jn fO
Ij O ur (Jg g a H
indin
o p
«i»
iinduj
|»u6
¡s
;,
-''•e
:
:
•
:'.
h
.*«/.
c>
tn - z wo y n " ^ ;?o S ' ^ o . i . o ^ s S3 2. ^ w ^ " . x i a01 3 U _ M . " E f l c «
— c n ^ ¿ « ^ ' i ? ?= 3 c ^ ? "3? ^ gc 0 - 5 " o- " ™ ^ ~ o £§ 3 » ,« O 3 3 £) J j
1 . §. 3 f S ,jg«n — _ n a ' a <.
I. i t U-:a"•i = sí '• s
a. -TIS
J ' -^
•<•< o o o j c n l o ' n o _ 2 > | | a ^2, 11.0
"t ° " i " Ti - s IL ! •?-' -* " ^ ->• 0 ü *J ° b -<: ° «SS^ O-Q ll o c"** ° .< <-° ^~ w ^ "<~ ' ^-"^
"21 n C Ti 1 *" ^" 1 II o
^ • -sf 3^ V^~M '
"n" - b i
! ' í
( J 1 O O 3 C O C O C D O ) - JÍ O "b bi o b "ui b b 5 , <o w
tn
tn
y -y 7- 3 STT í - a - a T a - : ^ : ^ : < 7-- n ^ - n - n z z : ^ ? ¿
•i*• -o
1
•ea
.' 5'* 3
ifc
25'
i
2 r
x
-i K-< u•° n
f
5'
t/-
f °
C
f. P
ara
mo
tor.
•'• — "-•
•• ••" '
¡
oa
o"di
1
'•'€-z3
7
f
•cS
••• • ,. ' - p- nqqonbn'ViAjaa
6BM/CD4066BC
< 0
~ c"
= TS —3 -S S
. S 6 .2•
T¡ E .1 E c •= u c £
u ^ — -— -> n " 3 "
^ 9 , 0 ? C D S oS ° ' " C í ° - 2 0 -
.o °- c oto . y o
•— « _ Ofg -fi °
™ 1 1>§ s « 1S.-S'-aS "-S 2
f.O " ™
O e D-
!~1
«H^-'i 1—VyV—j|i
+5V-Powered Multi-Channel RS-232Drivers/fieceivers
MÁXIMUM RATINGS - MAX220/222/232A;233A;242/243Jjppl/Voílage (Vcc) -O.3V to +6V
-0-3V ¡o (VCC - 0.3V)
16-PinNarravSO (derate 8.70mW/'C above r70'C)16-Pin Wide SO (darate 9.52mWrC above -f 70'C)... 762mW18-Pin Wide SO (derate 9£2mWrC above *7D'C) 762mW20-Pin Wide SO (derate IQ.OOmWrC above ^70'C) ?16-Pin CERDIP (derate '
Tour ±isv-0.3V lo (VCC + 0.3V)
f/físcalver Outout Sbort Círcuíted lo SND . . . Continuou*Contuiuous Power Oissrpatíon (TA » +70"C)j^n Plasifc DIP (derale i0.53mWfC afaove 4.70'C) . B42mW]S-p'nPiasicDIP(oeraie n.1lmW/"Cabove+70'CÍ , 889mW20-pn Plaste DIP (derate 8,OOmW/"C above -f70*C) . , 440mW
ttoU i: inpu: voJtage maasured withToUT'n h¡gh-im pedánea «late, SHOTÍof Vcc -OV.
Operating TemoeratUfe Ranges:MAX2 __ AC _„. MAX2 „_ C __ O'C to +70'CWAX2._ AE_^, MAX2 _ E -40'C to -fflS'CMAX2 AW . W A X 2 _ _ W ........-5S*C to + 125'C
Storage Tempefature Range -65'C to -f 160'Cl_ead Temperature (soldering, 10 sec) +300'C
bgyonóoí tM dovice t
Mvarnm fatir^'or *ny otr*r conaitiara
F*rrri*nafV ó*n*Q* la ifM eWio»,'
i ruriyt cnty.
•'T*cí dívi» r»£*bi¡!ty.
ELECTRICAL CHARACTERISTICS- MAX220/222/232A/233A/242/243(VcC- +5V±10%,Cl-C4 -O.lftF.TA-TMiNtoTMAX, unlñss otherwise noiad.)
PARAWETEfl 1 CONDmONS UN TYP MAX I UNfTS
fez32 TRANSUTITERS
Outpul Vohage Swíng | Al transrpitter outouts baded with 3kn la GND
inpui Logic Threshold Low
tnput Logic Threshold High |
Logic PulI-Up/lnput Currenl
Outpul Leakage Curren!
Oa [a Bate
Tiansmítier Output Resístante
Output Shon -Circuit Currenl
SHDN - VCC
SHDR-QV
Vcc - 5.5V, SHDR - OV. Vcurr » ±15V
Vcc - 5HDR . OV. VOUT - ±i5V
Excepl WAX220, normaJ operation
MAX220
VGC-- V+ - v- - ov, VOUT - ±2V
VOÜT-OV
±5 ±8
U* 0.8
2 1.4
5 40
±0.01 ±1
±0.01 ±10
±0.01 ±10
200 116
22 20
300 10M
±7 ±22
V
V
V
jiA
HA
kb/t£fe0c
Ü
mARS-232RÉCEÍVEH3
RS-232 Input Vo«ag« Operating Range
RS-232 Input Threshold Low
RS-232 InpulThreshoíd High
RS-232 Inpot Hysleresis
RS-232 Input Resístance
HL/CWOS Outpu! Vollaga Low
TTL/CMOS Output Voltaga High
TTUCMOS Oufpul Snon-CircuitCurrent
TIUCMOS Outpul Leakaga Current
Except MAX243 R2iH
^ " w MAX2*3 R2|N (Ñola 2)
Except MAX243 R2jN
^ " " MAX243 R2JN (Note 2)
Except MAX243. Vcc - 5V, no hysL ¡n shdn.
MAX243
-
IOUT - 3.2rnA
IDUT - -i.omA
Sourcíng VouT • QND
Sfnkíng VOUT • Vcc
5RT3R - Vcc ex EN - Vcc. OV s VOUT í Vcc
±30
0.8 1.3
-3
1.8 2.4
-0.5 -0.1
0.2 0.5 1
1
3 5 7
0.2 0.4
3.5 VCC -0.2
-2 -10
10 30
±0.05 ¿10
V
V
V
V
WJ
V
V
mA
fiA
+5V-Powered Multi-Channel RS-232Drivers/ReceiversELECTRICAL CHARACTERISTICS - MAX220/222/232A/233A/242/243 (contlnued)(Vcc - +5?±iO%, C1-C4 * 0.1 jiF. TA = TMIN to TMAX. urHessotíierwi»enoied,)
PÁRAMETE*
ER Inpul TbreshoJd Low
EN InpurTrtfesnoIcí Hign
cofíomoNS MIN TYP UAJí
1.4 0.8
2.0 1 .4
uwreV
V
POWER SUPPLY
Operating Supply Voltage
Vcc Supply Curren!(SRDR * Vcc). Figures 5. 6. 9, 18
Shutdown Supply Current
SFÍDR Inpui Leakage Currenl
SRDRThresrtoídLcw
SRDRihreshoídHigh
Notoaa
3kfl toad both outpuls
MAX222J242
MAX220
MAX222/232A/233A/242/243
MAX220
MAX2Z2/Z3ZV233A/24 2/2^3
TA - +25'C
TA - O'C to +70'C
TA - -4Q'C lo -*-85"C
TA--55'Clo-)-125'C
4,5 5.5
• 0.5 2
4 10
12
15
L 0.1 10
2 50
2 50
35 100
±1
.1.4 0.8
2.0 1.4
V
mA
HA
HAV
VAC CHARACTEfllSTJCS
Transilíon Slew Rale!
TransmitterPropagation DelayTTL lo R$-232{Normal Oparation).Figure 1
1 Receiver Prop&gation Delay1 RS-232 to TTL (Normal Operalfon),figure 2
Receiver Propagal/on DelayRS-232 10 TTL{Shu!down), Figure 2
Receiver-Ouiput Enable Time, FTgtre 3
Fteceiver-Outpui Disable Time, Figure 3
Transminer-CMput Enable Ttme(SHDN goes hijjh). Figure 4
Transmitier-Outpul Dísable Time(SRDR goes low}. Figure d
Transmirter *• lo-PropagattonDelay Oifference (Normal Operation)
Recerver * lo • PropagationDefay Diff erence {Normal Operatíon)
CL^SOpFloSSOOpF.RL - 3W1 lo TicaVcc = 5V. TA - ^25'C.measüred /rom +3V to-3Vor-3Vto+3V
1PHLT
tPLKT
tPHLR
1PLHR
tPHLS
tPLHS
tenton
ter
tOT
IPHLT-IPLHT
tPHLR-tPLHR
MAX222/232A/233 A/242/243
MAX220
MAXJ222/232>V233A/242/243
MAX220
MAX222/232A'233A/242/243
MAX220
MAX222/232A/233A/242^43
MAX220
MAX222/232A/233A/242/243
MAX220
MAX242
MXO(242
MAX222/242
MAX222/242
MAX222^42. 0.1JIF caps(Includes cfwQe-pump start-up)
MAX222/242.0.1tiFcaps
MAX222J232A/233A/242J243
MAX220
MAX222/232A/233A/242^43
6 12 30
1.5 3 30
1.3 3.5
4 10
1.5 3.5
5 100,5 1
0.6 3
0.6 1
0.8 3
0.5 10
2.5 10
125 500
160 500
250
600
300
2000
100
WAX220 | 225
V is
\ÍS
H*
M5
nsns
J1S
ns
ns
ns
Not» 2: MAX243 R2our is guaranteed 10 be fcw when the R2iN ís Z OV or is floaiing.
3
VtttíVNOLMJDON- TRWJSWITTERtXJIPUIS
(EXCEPTUW220.UW211A)
+SV-Powered Multi-Channel RS-232Drivers/Receivers
Typlcal Oparatlng Charactorlstlcs
MAX220/222/232A/233A/242/243
AVAJLJOU oomir cuntan-n.BATAMTI
S 10 15 20 25
LOAOCÜftfi£NT(fnA)
«-TBtfEUTWOWmwWi-UAX222MAX242
+5V-Powered Multi-Channel RS-232Drivers/fíeceivers
f
ropvi
figureS
EW
cv EV* [2
C1- ¿3
C2» [7
C2- ¡T
v-[IT2DUT (T
R2N [T
. ^
"wlxizar"AMJC232M4^2X
D1P/SO
je] vccÍsl ENO
H} Tlctfl Cl
[3] ni»
í ñlOUT a
ñ] TJü
1 I2«
E] R2twl'
TTljCUOSiwurs
CAPACtTANCE fciF)
DEVtCE C1 C2 C3 C4 C5 m^rurKUAX220 4.7 4.7 10 10 4.7 DUTPUTS
UAX232 1.0 1.0 1.0 1.0 1.0
UAX232A 0.1 0.1 0.1 0.1 0.1
MAX22Q&32/232A Pin Ccfifiguration and Typícai Operating Circuit
TQPVIEW
OVE
(N.C.) Sí [7
cu [7
ci-[T
C2-[7
Y- [7
T20UT [T
•
D1P/SO
[i] SHON
Í3 Vcc
^ ^ TTLCUOS
I3J Ulan
Ül TSN¡oí «««. nucuosiwj rciuT OUTPUTS
1ÍJ
^J
r "10
r i:
9
*5VWPUT
C5^?• 16
Vrr
+5VKMW
C2t tWVTO-líV .,(2, WLTWEWVEHTEH
-5V
Tl« < r\f•A lx^
«X»l
T2w í px, 7?oui
Rlout Jx1 f11"
? S
Kour /i ^ fCK
GMO 4r
ili
.1- .>!=r .
6 -1W"~ZW
M 1RS-2EOUTPUTS
7
13 .
RS-232WPUTS
e
1
5
r. '2
.L
í 13
,0
1
cs^r ff «lowcmww
n Vcc v^'^ *5VT0.10V v*-
^ VOLTEE WtHia V"
¿f
^5 I20UT
Riour .xi inK
1 ^ 5 afi in ^/i " R2n
[N.C ) £Ñ > *
SNO 4, ^
-1S
? -1W
15 1RS-ZCOUTPUIS
írj
14 -.
«S-22i WUTS
9J
IB
-í2 Pin Confíguration and Typicai Operalíng Circuil
54LS/74LS373 LOGIC SYMBOL
DESCflIPTIONThe "373" ja an 8-Bft Transparent Latch with3-statfl bufíered oiitputs. Tile Ifltch outputafallow Ihe data Inouta «-h^n, (f<~ 'stcíí Simúidi¿ r«GH, and th'»y ar« stíW* wh«n ihe En-able ía LOW. T)ie 3-atats output bulfera arecqntfollBd by an acllve LOW Ouipuí EnablafOE) input. A HiGH on tha 5E input (orces theaíohl ouipuls to Ihe hfgh Impedanca "off"stat». When ÜH h LOW. (ha lalched ortrafisparent data appeara at the outpula,
FEATURES• 0-BIt tranaparent latch• 3-State oulout hi^ff—•-• O'ommon Lstch Enabía Input wllh
hy»t«r««ta• Common 3-ítate Output Enabl»
control• (ndep«nd«nit fatch arxJ 3-*taí« buff«r
operatíon• Sea "363" for MOS compatible output
DOc
0(£
Ou
Q, BZ D¡
Oí 0} Oí
04 IÍJ B, D,
Oí Di O» Or
6 1 |3 II 19 TI
PiN CONFIGURATION
ORDERING CODE fS«» Stctlon 9 for further Package and Orderlng InformatíanJ
PACKAQES
Plástic DIP
Coramic DIP
Flatpak
COMMEfiCIAL RANGESVccs5Vr3%;TA-0-C to -f/DX:
N7-ILS373N
N74LS373F
MIUTAFtr RANGESVCC=SVÍ 1Cf>i; TA— 55-C lo -t-135-C
S&JLS373f=
°o LX°o fT"i E«j E* Di03 d°> E<* H
|rT?J 07
13 °«
3] oc
Í3 os
3 °*13 °*7?] o.
INPLTT AND OUTPUT LOADING AND FAN-OUT TA6LE(a)
PfNS DESCRÍPTION
E Latch EnablB íactivs HíGH) input 'lH ("AJI(L CmAj
. DQ-O? Paralleí Data ínpuls '^, .
OG Ouíput Enabla (active LOW) inpuj j''H/ Al
'OL CmA)
54/74 54S/74S 54LS/7+LS
20
-0.4
20
-0.4
20
-0.4
~STMOTE
*. Th* klufwiJ numt)*ri kdiot* drtfWBnf pwime<iic vilu» for UürtBry/CanwTMxcial
í/il.
FUNCTJONAL DESCRIPTIONTh« "373" la Octal Tranaptrant Latch coup-Jed to eíght 3-atate ouiptrt buffer». The hvoseclions oí [he devlce ora cantrolled ind«-pendentty by Latch Enable (E) and OutputEnable (OE) control osles.
The data on the D ínputs trafislerred fo thel»tch outputs wtien tha Latch Enable (E) In-pul la HIGH, Tha latch rsmalna tranaparentto the data inputa whíle E la HIGH, andstores the data preaenl ona aelup time be-fora the HIGH-lo-LOW enable transitlon. Theenable oate íleo about 4OOmV of hyaíereaiabuih ín to help mínímíze problema that alo naland ground naba can cauae on the tatchlngop«r«tlon.
The 3-slate outpul bufíera are designad todrive hnavlly loaded 3-slate busea. MOSmemoriee, or MOS micfoproc»»sora. Tíieacb've LOW Output Enable (5S controla aH«¡oht 3-filate buííere Independen! oí thelalch operalion. When CIÉ ía LOW, the(atened or franaparent data appears at theoulputa. When OE ís HIGH, tha oülputa are ¡oth» hígh ¡mpedancB "o(l" álate, whichmeana they wlll nelther drive ñor load thebu*.
LOGIC D1AGRAM
MODE SELECT—FUNCTION TABLE- - - - - - • - •
OPERATING MODES
Enable & read reglster
Latch A read register
Latcb reslster Adísabíe outputs
INPUTS
DE
LL
LL
HH
E
HH
LL
LL
On
LH
1h
Ih
INTERHAL REGISTER
LH
LH
L
H
OUTPUTS
QO-O?
LH
LH
(Z)(2)
H = HíGHh - HGH vo«»oL ** LOW vod»a. (r..[I = LOW vofUg* tnrt ona tttua i'** prior lo lt>* WGH-f(ZJ - H¿gh ImpatíB/ie» "o«" alWs
luo Hm« pnorlo Tl HiGH-io-LQW «n«hli« trsns
-LOW *n<bl«
DC CHARACTERÍST1CS OVER OPERATING TEMPERATURE RANGEíb)
PAHAMETER
VOL Output LOW voitaoe
VOH Oulput HlGH voltage
IQS Output abort círcuit current
'ce Supply curranf
TEST CONDITIONS
VCG Mln
VOE = VILIQL = l2rnA
IQL = 2^mA
VCG = Min, VQE = VILIQH = S^e Fan Oul Table
VGC = Max. VOUT = ov
VCG * Ma*Mil
Com
54/74
Mln Man
54S/74S
Mln Max
54LS/74LS
Mln
2.4
-30
Max
0,4
0.5 <c>
-100
44
40
UMIT
V
V
V
mA
mA
mA
HOTESU. For ltn\Uf tíc cn<r«Cl
¡nakto b»ck co»»r fu»
.'¡.I
AC CHARACTERISTICS: TA=25°C (S«« S«cHon 4 (or T«*t ClrculU and Conditions)
PAR AM ÉTER
'PLH Propugalion delsy[PHL Latch Enable to outpul
tpLH Propaoatlon delaytpHL Data to output
tpZH Enable lima to HIGH leval
tp2i_ Enable lime to LOW leve!
tpHZDisable lime Irom HIGH leuel
tpLZDisable time (rom LOW level
TESTCOHDITIONS
Figure 1
Figure 4
Figure 2
Figura 3
Figure 2
Figure 2, CL = SpFÍd)
Figure 3
Figures, CL = 6pFÍd)
54/74
Mln Max
54S/74S
Mln Max
54LS/74LS
C(, = 45pFRL - 667£1
Mln M«x
3O40
18
32
20
28
45
22
24
22
UNiT
nfc
na
nana
na
n*
na
na
na
na
AC SETUP REOUIREMENTS: TA = 25°C (Soe Secüon 4 lor TBBÍ Circuit» and Condltlon»)
PARAMETER
lyy Latch Enable pulse widlh
(3 Setup time Data lo Latch Enable
ln Hold time Dala to Latch Enable
TEST COND1T1ONS
Figure 1
Figure 5
Figure 6
54/74
Mln Max
54S/74S
Mln Max
54LS/74LS
Mln
15
3.0
10
MaxUNIT
na
ns
na
d. m»si Htli ar« [of r«l»r*oc» only. TTiey r«pissenl m« osla^ i™ lo tww»nie« ln*t i
AC WAVEFORMS
LATCH EHABLE TO OUTPUT DELAYSAND LATCH ENABLE PULSE W1DTH
A
VM - 1.5V la 5</7<«n<i 5*3/7*3; VM » 1.3V lor £-»LS/7-*l.S
Floure 1
<ffi
a
vu - i.e
3-STATE ENABLE TIME TO HIGH LEVELAND DISABLE TIME FROM HIGH LEVEL
V 7f~
-H I--— 1 ,_.„./,» ^=t_.,,.
Figure 2
\C WAVEFORMS (
VM
3-STATE ENA8LE TIME TO LOW LEVELANO DJSABLE TIME FROM LOW LEVEL
:Vw - I.3V fer £*L5/7»LS
Figura 3
DATA SETUP AND HOLD TIMES
dic*l« *r>*n [fi* «pul ¡i
VM- I.6V|0,
> pr*O«Cl*OÍ9 OulDUI
PROPAGATIOM DELAf DATATO Q OUTPUTS
Figura 4
OPTICAL CHARACTERISTICS
ítem
»1/8 duty
1/11 duty
1/16 duty
LJquíd Crystal Orive Voltage(Hecommenoea vaiue;
Visual Angle Range
Contrast Ra.tío
Rise Time
Decay Time
üquid Crystal Orive Voltage(Recommended Valué}
Visual Angle Range
Contrast Ratio
Rise Time
Decay Time
Liquid Crystal Orive Voltage(Recommended Valué)
Visual AngJe Range
Contrast Ratio
Rise Time
Decay Time
Symbol
Veo —Ve el\lr\\
CR
rr
rd
Vcc— Ve e(VD)
di- 02
CR
rr
rd
Veo — Ve e(Vo)
01-82
CR
TT
rd
Test Condition
Ta~0 TC
Ta=25t;
Ta=50°C
CR=3
02~20\ 0 °
Vo=4.IV, 9=20°
Vo=4, IV, 0=20°
Ta- 0 -C
Ta-25°C
Ta=50°C
CR= 3
02 = 20°, #= 0'
Vo=4.5V, 5=20°
Vo=4.5V, 0=20°
Ta=0 TC
Ta=25°C
Ta-SOr
Cn= 3
02=20\ 0 °
Vo=4.5V, 0=20°
Vo=4.5V, 5=20'
Standard Valué
min.
T RJ.O
3.8.
3.6
30
10
—
—
4.3
4
3.3
25
8
—
—
4.7
4 . 4
4 . 1
20
6
—
—
' typ.
4.2
4 . 1
4
—
—
100
100
4.4
4.!
3.4
—
—
120
120
4.8
4.5
4.2
—
—
120
120
max.
4.6
4.5
4.3
—
—
200
200
4.6
4.3
3.6
—
—
240
240
4.9
4.6
4.3
—
—
240
240
Unit
V
v •V
deg.
mS
mS
V
V .iV
deg.
mS
mS
V
V
V
deg.
mS
mS
.0V± 5%, Ta=2S*C
Definition of ViewingAngle 6 and
3efinítÍon of Viewing Angles 62 and 61
CR
Viewing Directíon
i Défínition of Contrast- Ratio CR
e-i-Viewing Angle
Brightness ¡n non select signal
. C H = T' Brightness in select signal •
Viewing Angle Range
)DefinitÍon of Optícal Response Time
Non-Select Signa1
Driving VoltageRíse Time Decay Time
Those time that the brightness of lighting segment reaches 90%from 0% is rr and that reaches 10% from 100% is rd.
OPTREX
TIMINGCHART
ttem
Enable Cycle Time,
Enable Pulse Wídth, High LeveJ
Enablé Ríse and Decay Time
Address Setup Tlme,RS,R/W— E
Data Delay Time
Data Setup Tíme
Data Hold Time
Data Hold Time
Address Hold Time
Symbol
TcYcE
' PWEH
tEr.tEf
ÍAS
tDDR
tDSW
tH
ÍDHR
tAH
MeasuríngCocxlítion
Figs.U2
FÍgs.1,2
Figs.LZ
Figs.1,2
ng.2Fig.l
Fig. 1.
Fig.2
F¡gs.U2
Standard Valué
min.
1000
450
—
140
• —
195
10
20
10
typ.
—
—
—
—
—
—
—
—
—
max.
—
—
25
—
320
—
—
—
—
Unit
nS
nS
nS
nS
nS
nS
nS
nS
nS
=5.0V± 5%. Ta=25r
FIG.1 WRITE OPERATION FIG. 2 READ OPERATION
'VlHl
R/W N— i AS
/iKr
. PWKK -
'VlHl VlHl ^
VlLl Vll.l
tÜSW
-^
/V,L,
IAH!• H
: f vn ,IH
R/W
DBo~DBT VaiídData DBo-DB?
(Write Data from MPU to MODULE) (Readlng Da« (rom MODULE to MPU)
PIN ASSIGNMENT |
Pfn No.
1
2
3
4
5
6
7
S
9
10
11
12
13
14
Symbol
Vss
Vcc
Vee
RS
R/W
E
DBO
DBI
DB2
DB3
DBA
085
DB6
DB7
Level
—
—
—
H/L
H/L
HH--LH/L
H/L
H/L
H/L
H/L
H/L
H/L
H/L
Function
PowerSupply
OV(GND)
+ 5V
for Liquíd. Crystal Orive
Register H;Data InputSelect L:lnstruct¡on InputH:0ata Read (Module^MPU)UData Write (Module— MPU}
Enable Signa!
Data Bus Line
•In the data bus line, data transfer is performed two timesby the 4-bit or one time by the 8-bit iri order to interfacewith 4-bit or 8-bit MPU.
• In case interface data length is 4-bít The data ¡s transferredby using only four buses of DB4—DB7 and the buses ofDBO— DBS are not used. The data transfer to MPU iscompleted by transferring the data of 4-bits twice. Transferof upper four bits and low four bits ¡s performed in sequence.
•In case interface data length is 8-bit. Data transfer isperformed by using eight buses of DBO—DB7.
POWER SUPPLY RESET
The ¡nternal reset circuít will not be correctly operated,when the following power supply condition is not satisfied.In ibis case, please perforra initial settíng according tothe ¡nstrtiction.
• Iniíializing by InstrucííonIf the power supply conditions for correctly operating the iníernalreset circuit are not met, initialization by instruction is required.1 1-sRjttft. -follQ?.'ing,p:ocedurs íor ír.iíi—íz íir.?.-
ítem :,'.
Power Suppfy Ríse Time
Power Suppíy OFF Time
Symbol
trcc
toff
MeasuríngCondftion -
Standard VaJue
mln.
0.1
1
-typ.
-
max.
10
Unlt
mS
mS
Vcc
Vss-0.2V.
4.SV
i r c c toff
toff £ 1 mS
NoterThe ilem loff defines the time when the power supply Is otí, when the power
supply shuts down mementarily of repeats on-oíf state.
RESET FUNCT1ON
• Initializing by Internal Reset CircuitThe HD44780 automatically initializes (resets) when power is turnedon using íhe iníernal reset circuit. The following instructions areexecuted ¡n initiaÜzaíion.The busy flag (BF) is kept in busy stateuntil initialization ends. (BF=I) The busy staíe is lOms after Vccríses to 4.5V.(1)Display clear(2)Function ser
DL—1 : 8 bit long interface dataN=0 :1-|ine display F=0 : 5X7dot character font
(3)Display ON/OFF control0=0 : Display OFF C=0 : Cursor OFF B=0 : Blink OFF
(4)Entry mode setI/D=1 : +1(increment) S=0 : No shift
^k3te .' When cooditions In "Power Supply Conditíons Usíng Internal Reset Circuit"
are not met, the ¡nternal reset circuit with not opérate normally and initlalization
will not be performed. In thls case Initlalize by MPU accordlrtg to "Inítíallzlng byInstruction".
WM^,M. tSms al er Vcc ileí 10 4.5V.
RS fl/W OB? DGí 03a DB< 093 DB: DBi DBoO O ' O O I I * * * *
RS fl/W DS 7 DHo 08: DB« DBi OBi DBi DBoO O ' O O I I * * * *
RS fVW DB7 DBg DB5 DB< OBj DBj DB, DB(O O 0 0 1 I N FO O O O O O [ 1 1 I
O O O O D O O O O I0 0 0 0 0 0 0 1 H ) S
Wh«n interine* is 8 bits long.
BF canfXX b* crwcked beJcxe If»s instrocjion.Función sel (InleiUc* tí t b-t* l*>i)
«-».« Ihiri l.lmi
R5 R/W Da> DBs D9i OS. Dflj OS; DS| DBoo n o o i i * • • •«
WM Iiir m. t intn 100 t.
BF carmel b* checked belo-e luíFuncluín sel (Inleilace « t Wi Imitf
-- r 30H
BF carvxx be ch*cfced befa» ñu* iFunción leí (Inleifíce is 1 O1J kxn.J
-r 3o A/
BF can be checkad attef the lollowino inmcoons.Whwi BF U rxX cWcked. me waiting pnw Oer*»en¡füiructions ¡i lon er tfwi u>e nitcution irunucaontime. [See Tabto -M)Función S«( (Iniet lice is íbni >CKI¡. SuecAy ir>t nurtwroí diiptif tnas inri eh»'»CI«r lont) The niírotr D( Oso'*)'ln«i and char»cler Ion! carmol be ctan|ed íflen-»id».Oiipl» OFF/Oipüy ON/Enlr Moflí Sel
( Powe, ON 1
Wanr^^.S^aKerVccn^lo^V.
na R w DBÍ DB* oas DB»0 0 0 D 1 1
WM mor* tn»n 4.lí>».
RS R W DB.- D6« Dfls B40 0 0 0 i i
W*t1or mor* Uwi lOOjn.
RS R W DSí Da, DBi DB*0 0 0 0 i i
PS HW DB, OBf DBS DB^0 fl D 0 I 0
o o o o i no o N F •" D 0 0 0 0" 0 1 | | 1
0 0 0 0 0 00 0 0 - 0 D |
0 o o o o o0 0 o 1 L o s
Wh«n interfac» la 4bHs long.
canno( be ch«ckM beioe Incl-m itl (lnliifina- •» 8I"I> '
BF carmot be checheo belweFunción sel (lolulmu- u 8Iris
BF cannoi De checked belore Ih.» i
BF C*n be checked «ftef th« Io"OwinWhwn BF li not chocKnd. the waitino bnw timtnjctioíw ¡! kx>o«< tn«n Kw e"»cution itim*. (S« Table 4-1)Fuiclwn Esl [Sel oletUce tu ttt tb.li Vxi(.J Inlffftc*ii IbiU len(lfL Fundían Sel (Interfíee » ÍMí too|.Spedfy !he numoer D! dupl»^ Ine» <nd WiifáCleí IIXIL]T^e numoer OÍ ajpl*r Inés «nd cfiincler lonl c*rtMibe cínnjcd alleiwardi.D-ipl*/ OFF/D-spU^ ON/Eniry Mofle Sel
TEST CIRCUITOF MODULE
SW ON "L" level.SW OFF "H" level.
RS jr
(push-SW)
DBI -^
DB2
DB3 -i»
DB4 X
r
+5V
Series
EXAMPLE OF POWER SUPPLY
DMC Module
14 1312 . . 3 2
-OGND
-0+5V
In case of extended iemperature vereíon
1413 3 2 I
-OGND
-0+5V
-0-7V
*NOTEWhen the voltage o( Vea is different (rom the recommendéd voítage, the viewing angle may be changed.
Examples of Temperatura Compensation Circuits for Extended Temp Type.(Only for reference)
Rg. 1
(A) 1/8Duty—1/4Bias
Va:(B) 1/16Duty-1/5Bias
Vcco-
Thermístor:Rlh(l5'C]-l5[k-oKm]. B-' ,...Resislors ;Rp-3o[k-ohm).Rs-6.H[k.ohm). Rm-3.3[k-ohm]Transíwor :PNP TypcVcc:+Sv. Vss:0v (LogicSuply)Vi :-8[V](-7.8 [o -&.z(V])V*e<Vi[Vj. Ri-(Vt-V«)/S[k.phm]
Vcc:+5v. Vss-.OvVt :-II[V](-10.725 lo -I1.Z75[V]>
„. </Module«juiralentKL>\oad
ÍW30 fk-ofínj ~ ~~ i Nominal cuvaRs-6.8 fk-ohm] ) and availaWeRm-3.3 ¡h-ohmj
RWiC25'C)-i5[k-o(im]B=4200[K]
I i I , I ,_ I i I , 1
Ta[-C]
-20
-10
0
10
20
30
40
SO
60
70
Vo[V]
6.56
6.50
6.40
6.26
6.09
5.S8
5.67
547
5.29
5.15
'oIV]
PD-510 [k-ohoil ——— . MotJnal curvePs-a2 fk-ohm) and avajiattePm-3.9 [k-ohm] j
Numwk: curva
-40 -20 O 20 40 60 SO 100
TafC]
RttitsrO-IsCk íriin)a-4200[Kl
I 1 i 1 i 1 . 1—40 -20 0 20 40 60 80 100
INSTRUCTIONS
Instruction
Clear Display
Cursor At Home
Entry Mode Set
Díspiay On/Off .Control
Cursor/DisplayShift
Function Set
CGRAM Address .Set
DDRAM AddressSet
Busy Rag/Address Read '
CGRAM/DDRAMData Write
CGRAM/DDRAMData Read
Code
RS
0
0
0
0
0
0
0
0
1
1
R/W
0
0
0
0
0
6
0
i
0
,
DR7
0
0
0
0
0
0
I
BF
DR'6
0
0
0
0
0
0
DR5
0
0
0
0
0
I
DR4
0
0
0
. 0
I
DL
DR3
0
0
0
I
s/c
N
DR2
0
0
I
D
R/L
F
DR
1
0
I
I/D
C
*
*
nfl0
i
*
s
B
*
*
ADD
AC
WRITE DATA
READ DATA
• • - • . . - ' - - . ' - . ' .Description
Clears all display and returns the cursor toíhe home position (Address 0).
Returns the cursor' to the home position(Address 0). Also returns the display beingshifted to the original position. DDRAMcontents remain unchanged.
Sets the cursor move direction and specifiesor not to shift the display. These operationsare performed during data write and read.
Sets ON/OFF of all display (D) cursor ON/OFF (C), and blink of cursor positioncriaracter (B).
Moves the cursor and shifts the displaywiíhout changing DDRAM contents.
Sets interface dafa lengíh (DL) number ofdisplay lines (L) and character font (F).
Sets the CGRAM address. CGRAM datais sent and received after this setíing.
Sets the DDRAM address. DDRAM data¡s sent and received after this setting
Reads Busy flag (BF) indicáting internaloperation is being performed and readsaddress counter contents.
Writes data into DDRAM or CGRAM.
Reads data from DDRAM or CGRAM.
ExecuteTlme(max}(NOTE 1)
l.64mS
l.64mS
40,uS
S ^
40,3
40//S
40/^S
0/íS
40/^S
4Q,üS
7
°)
;' . ' " . . . . ' ' .; , Code ,"• . '"'• •;
I/D =1 IncrementI/D =0 DecrementS =1 Wlth display shift
S/C=1 Display shiftS/C=0 Cursor movementR/L = 1 Shift to the rightR/L=0 Shift to the leftDL =1 8-bitDL =0 4-bitN =1 1/16DutyN =0 1/8Duty, 1/HDutyF =1' SXlOdotsF =0 5X7dots
BF =1 Intemal operation is beingperformed
BF =0 Instruction acceptable
•'••' Description •;
DDRAM Display Data RAMCGRAM Characíer Generator RAM
ACG CGRAM AddressADD DDRAM Address Corresponds
to cursor address.AC Address Counter, used for
both DDRAM and CGRAMíK Invalid
- : Execute Time (rrvax.)
fcp or fosc=250kHz
However, when frequency changes,executton time also changes
Ex
When fcp or fosc=270kHz,?^n
4U¿íbX d/¿¡b
FONTTABLE 5 nDots
&*S7~r~~J^4-bit4-brt ^---— >_
XXXXOOOO
í,X X X X O O O I
X X X X O O I O
X X X X O O l l
X X X X O I O O
X X X X 0 1 0 1
•"
XXXX0110
xxxxo i i t
X X X X 1 0 0 0
• .
X X X X 1 0 0 I
•
- ,
X^XXXIOIO
14 • •
•' • • ''
{•' xxxxioi i<f.\V " XX XXI 100 '
1 . '. '
,--;.': xx xxi 101.; - . • • •
-," ,. ."xxx xi 110v. • . . x • ' -• •
; x xxxi 111,' - " • .
0000
CGRAM(1)
(2)
(3)
(4)
(5)
(6)
(~r\)
Í8)
(!)
(2)
(31
(4)
...
(5)
(6)
(1)
(8)
0010
••••
•
• •• •
•••••• ••••••• •
••••• •
*
• • ••••
*•• •• •• • •• ••• •
•••
•••••
•••••
•• • ••••• • ••
• •••••••••
•••
•••••
••••
•••••
0011
• ••• ••• • *• • •• •• ••
•• •••••
• ••
• ••
••
•• ••••
.»•••
•• •
• •
•
•• •••
••
••• •• •
• ••••
•••
• ••••
•
• •*•• •• •
• •• •• ••
•
••
•••••
• ••••
mmmmm
••••
••
•
'
•••• •
••
•
•
.0100• ••
•• • •• • •• • •• ••
• ••• •• •• •• ••••• •• •
• •• • •• •••• •• •• •••
• ••••
• ••• •• •
•• ••••
••
•
• ••
• •••• •• •• •••
•••
••••
• •
• ••
•••
• •••
• •• • ••• • •• • •• •• •
• •• •• • •• • •• ••• •• •
• ••: :• •• •• •
0101• •••
— "
• ••
••
• ••
• • •
••
• ••
•
• ••••
• • ••
• ••
•••
• •
• *••
••
••
•••••
• •• •
• ••••
••
• •••••••
•• •
• •
0110•
•
• •••
• •••• •• •••
••• ••• • •• •• •• •••
• ••••• •
•• • •
• ••
• •• ••••
• ••
•
• •• •••
• ••
•
•••
•
• •••• •
•• •• •• •• •
• ••••
•• ••
• • •• • •• • •• •
• ••• • •• •• •• •
• ••• •• •• •
01 1
• •••
• •••••
• • •• ••• •••
••
• ••• • ••
• •••• ••
••• ••••
• •• •• •• ••
: 3• •• •
• •• • •• • •• •
•
• •••••
•••••••
••
••
•••••••••
•••••••••
1010
• ••• •• ••
• ••
•
•
•
• •• •
••
• •
• •
• ••••• •
•
••
•• ••••• •
• •
•• ••••• •* ••
•••••
• ••••
• ••••
• •••
• • •• • ••
• •
1011
• ••••
• ••••
••
•
••
• • ••
«• ••
• •• •
•
•
• •
• •• •
• •
• • ••
• • ••
•
• •
•• •••
•
• •••••
•
• •• ••••• •• •
••
• ••• • ••
•• ••
• ••••••
•• •
• ••••• •• •••• ••
• •• •
••
• •
1100
•'•.i
• ••
• ••••
• • •
• ••••
•
••
• ••••
•
• ••
•
!
,:
••
• •
••••••••••••
•••••.••••
•• ••••
••••••••• • •• • ••
•••••••• •••
1101
• ••
• ••
•• •• ••••
•
• ••••• ••••
• ••
"
• ••
• ••••
;
...•••••
• •• •
-"
•• •
••• •
»••••• •• ••••••
•••••• •• ••••
•••
••••
•• ••
•»•• ••»•
11 10.
• •• • •• ••• •
• •••••••••••••
:"":•••••••• •*••: :
• •• •:
•••
••
••
••••
• •••• ••• •
••••• • •••••
••••••••••••••••
• •••• •• •• •• •• ••••• •• •• ••••
lili• •••• •• •• •••••••• •• ••• •• ••••••
••••• ••••••• ••••
• ••• • •• • •
• •
•••••••
• •• •
• ••••• ••
• •
• •• •• m• •••
••
«••
•• •••
••
• •••••• •••• •
• •
• ••••• ••••• •• •
•
• ••••
1110
• •• • •• ••_-*_
• •
• •••
• •••• •• •••
• ••• •• •••• •• ••••
• ••• •• •• •• »•
• •• ••
• •• •
•
• •• •
•
• ••••
• ••
•
•
•
• •
••••
• ••
• •
•• ••
• •• • •• •••
••
• •••
• ••:L..
•••• •••• •• •• •• •
• ••••• •• •• ••••
11
•••
••••••
•• ••••• ••
• ••• • ••• •
•• ••
• •• •
••••••••
• •• •
• ••• •• •• ••• •* •
n •o •B •
• ••••
•• •••
• ••••••
• •••••£!••
• •• •
**•••• • •• *•••• •• •
•mnmmm
1
RAM : Character pattern área can be rewriíten by program.
BIBLIOGRAFÍA
GONZÁLEZ G. , CABEZA M. Y E. MARTÍNEZ , Introducción a los
Microcontroladores de 16 bits (Familia - 96). McGraw-Hill, España, 1994.
BREY B., Los Microprocesadores Intel 8086/8088, 80186. 80286, 80386.
80486, Pretience Hall, 1994.
ODANT B., Micocontroladores 8051 y 8052. Paraninfo, España, 1995,
INTEL, 8XC196KC/8XC196KD User's Manual, Intel Corporation,
U.S.A.,1992.
Philips, ECG Semiconductora. Philips ECG Inc., U.S.A., 1981,
TOCCI R., Sistemas digitales.Principios y Aplicaciones., Prentice-HalI
Hispanoamericana S.A., México, 1993.
INTEL, Embedded Mícrocontrolíers. Intel Corporation, U.S.A.,1997.
BOYLESTAD R. Y NASHELSKY L, Electrónica y Teoría de Circuitos..
Prentice-Hall Hispanoamericana,S.A.,México, 1994
INTEL. 8XC196KC Quíck Reference. Intel Corporation, U.S.A.,1992.
INTEL, Commercial Application Specification Update. Inte! Corporation,
U.S.A.,1997
INTEL, 196 Microcontroller Family. Intel Corporation, U.S.A., 1992.
MARTÍNEZ, A., Microcontroladores (Seminario de Sistemas con
Microprocesadores), España, 1992, 69 Diapositivas.
Direcciones consultadas en Internet:
Intel www.lntel.com
Microcontrollers www.Microcontrollers.com
Tasking www.Tasking.com
Arrow www. Arrow, co m
Wyle www. Wyle.com