n Built-in 6502 8-bit CPU
n 2 MHz CPU operation frequency
n 4K bytes of ROM
n 128 bytes of SRAM
n One 8-bit programmable base timer with 1 - 256 µsec
interval
n 29 programmable bi-directional I/O pins
n 3 LED direct sink pins with internal serial resistors
n Mask optional for built-in RC oscillator with an
external resistor or external ceramic resonator
applied
n Mask optional for DATA/CLK driving capability
n Watch-dog timer
n Built-in power-on reset
n Built-in low voltage reset
n CMOS technology for low power consumption
n Available in 40 pin DIP package and 40 pad CHIP
FORM
General Description
NT6868C is a single chip micro-controller for keyboard
applications. It incorporates a 6502 8-bit CPU core, 4K
bytes of ROM and 128 bytes of RAM used as working
RAM and stack area. It also includes 29 programmable
bi-directional I/O pins and one 8-bit pre-loadable base
timer.
Additionally, it includes a built-in low voltage reset, a
4MHz RC oscillator that only requires an externally
applied or a 4MHz ceramic resonator, and a watch-dog
timer that has a resistor preventing system standstill.
Pin ConfigurationPad Configuration
P
P
P
P
1
1
5
4
R
V
D
/
D
O
S
C
O
P
1
3
NT6868CH
40393837
O
S
C
I
GND
NC
DATA
CLK
P30
P31
P32
P33
P34
RESET
P00
P01
P02
P03
P05
P06
P07
P10
P11
1
2
3
4
5
6
7
8
NT6868C
9
10
11
12
13
14
15
1625
17
18
19
20
1
1
7
6
OSCI
40
R/OSCO
39
V
DD
38
LED2
37
LED1
36
LED0
35
P27
34
P26
33
P25
32
31
P24
P23
30
P22
29
P21
28
27
P20
P17P04
26
P16
24
P15
23
P14
22
P13
P12
21
P20
P21
P22
P23
P24
P25
P26
P27
LED0
LED1
26 25 24 23 22 21 20 19 18 17
27
28
29
30
31
32
33
34
35
36
L
E
D
2
P
P
P
P
1
0
NCD
P
0
0
7
6
16
P05
15
P04
14
P03
13
P02
12
P01
11
P00
10
RESET
9
P34
8
P33
7
P32
P31
6 5 4 3 2
C
P
A
L
3
T
K
0
A
1
1
2
1
1
G
N
D
1V2.0
Page 2
Block Diagram
TIMING GENERATOR
(RC OSC/Ceramic Resonator: 4MHz)
4K BYTES
ROM
NT6868C
CLK
DATA
LED0
LED1
128 BYTES
SRAM + STACK
WATCH DOG
TIMER
BASE TIMER
I/O PORTS
RESET
VDD
GND
6502
CPU
INT. CONTROLLER
POWER-ON RESET/
LOW VOLTAGE RESET
Pin and Pad Descriptions
Pin No.Pad No.DesignationI/ODescription
11GNDPGround pin
22NC-No connection, recommended to connect V DD or floating
33DATAI/OI/O, 10KΩ pull-up resistor for communication
44CLKI/OI/O, 10KΩ pull-up resistor for communication
LED2
P00 - P07
P10 - P17
P20 - P27
P30 - P34
5 - 9,
11 - 34
1010
35 - 3735 - 37LED0 -
5 - 9,
11 - 34
P30 - P34,
P00 - P27
RESET
I/OBi-directional I/O pins
I
RESET signal input pin with internal pull-up resistor; Active low
OLED direct sink pins
LED2
3838
V
DD
PPower supply
3939R/OSCOI47KΩ resistor connected for RC OSC or 4MHz ceramic resonator
connection
4040OSCI-No connection for RC OSC connection; for 4MHz ceramic resonator
* Under the constraint of the maximum frequency variation, (∆F/F)
be selected while pins 39 and 40 are connected to a ceramic resonator. If (∆F/F)
, ≤±1%, code 3, 7 (ceramic resonator option) must
max
, ≤±10%, code 1, 5 (RC OSC option),
max
then it is recommended to be selected. Also, connect pin 39 a 47KΩ resistor with, ≤±1% accuracy to V DD while pin 40 is
floating.
2
Page 3
Functional Description
6502 CPU
6502 is an 8-bit CPU. Please refer to 6502 data sheet for more details.
70
ACCUMULATOR A
70
INDEX REGISTER X
70
INDEX REGISTER Y
0000
009F
00C0
00CF
SRAM
UNUSED
SYSTEM REGISTERS
NT6868C
STACK PTR
150
PROGRAM COUNTER PC
70
S
70
S VB D I Z C
STACK POINTER SP
STATUS REGISTER P
CARRY
ZERO
INTERRUPT MASK
DECIMAL MODE
BREAK
OVERFOLW
SIGN
EC00
FFFA
FFFB
FFFC
FFFD
FFFE
FFFF
UNUSED
USER ROM
NMI-L
NMI-H
RST-L
RST-H
IRQ-L
IRQ-H
Figure 1. 6502 CPU Registers and Status FlagsFigure 2. NT6868C Memory Map
The built-in ROM program code, executed by the 6502
CPU, has a capacity of 4K X 8 bits and is addressed
from F000H to FFFFH.
128 X 8 SRAM
The built-in SRAM is used for general purpose data
memory and for the stack area. SRAM is addressed from
0000H to 007FH. The user can allocate stack area in the
SRAM by setting the stack pointer register (S). Since
6502C’s default stack pointer is 01FFH, it must be
mapped to 007FH. Mapping from 01XX to 00XX is done
internally by setting the S register to 7FH via software
programming.
For example :
LDX #$7F
TXS
Power-On Reset
The built-in power-on reset circuit can generate a 150ms
pulse to reset the entire chip. The beginning of the
150ms pulse occurs at 60% of VDD when powered on.
power
VDD
60%
The start of 150ms pulse
t
4
Page 5
Timing Generation
NT6868C
This block generates the system timing and control
signal supplied to the CPU and on-chip peripherals.
There are two types of system clock sources: a built-in
RC oscillator or an external ceramic resonator. Both of
them are mask optional and generate a 4MHz system
clock. They also generate 2MHz for the CPU, and 1 MHz
for the base timer. The following shows the relationship
of code type number with oscillation type.
OscillatorCode Number
RC OSC1, 5
External Resistor3, 7
The following table provides the relationship between
the external resistor and the RC OSC frequency. (This is
for reference only)
External Resistor (KΩ)RC OSC Frequency (MHz)
394.7
434.44
474
563.68
Base Timer
The base timer is an 8-bit counter with a 1MHz clock source. The base timer can be enabled/disabled by the CPU. After a
reset, the base timer is disabled and cleared. The base timer can be preset by writing BT7 - BT0 to the BT register at any
time. When enabled, the base timer starts counting from the preset value. When the value reaches FFH, it generates a
timer interrupt only if the timer interrupt is enabled. When it reaches the maximum value of FFH, the base timer will wrap
around and begin counting at 00H. The timer interval can be programmed from 1 - 256 µsec. The base timer can be
enabled by writing a '0' to 'ENBT' in the TCON (Timer Control) register. The ENBT is a level trigger.
Base timer structure:
8-Bit timer
1µs
BT Pre-loaded Data:
Addr.Bit76543210R/W
$00C0BTBT7BT6BT5BT4BT3BT2BT1BT0(W)
Timer Control Register:
$00C1TCON-------
BT7BT6BT5BT4BT2BT2BT1BT0
ENBT
TMRINT
(W)
INT. Controller
When a BASE TIMER overflow occurs, it will set the IRQTMR flag. The IRQTMR flag cannot be directly accessed by the
software. Once set by an interrupt source, it remains HIGH unless cleared by writing '1' to the corresponding bit in
CLRIRQX ($00C2H). This register is cleared to '0' on initialization by a system reset.
When an interrupt occurs, the CPU will jump to $FFFEH & $FFFFH to execute the interrupt service routine. When a BASE
TIMER interrupt occurs and enters the interrupt service routine, the IRQTMR flag must be cleared by the software.
Interrupt Control Register:
Addr.Bit76543210R/W
$00C2CLRIRQX-------CLRIRQTMR(W)
5
Page 6
NT6868C
I/O Ports
The NT6868C has 31 pins dedicated to input and output. These pins are grouped into 6 ports as follows:
PORT 0 (P00 - P07):
Port 0 is an 8-bit bi-directional CMOS I/O port that is internally pulled HIGH by PMOS. Each pin of port 0 can be bit
programmed as an input or output pin under the software control. When programmed as output, data is latched to the port
data register and output to the pin. Port 0 pins with ''1'' written to them are pulled HIGH by the internal PMOS pull-ups, and
are used as input in that state. These input signals can then be read. The port output will be HIGH after reset.
PORT 1 ( P10 - P17 ) : These functions are the same as PORT 0.
PORT 2 ( P20 - P27) : These functions s are the same as PORT 0.
PORT 3 ( P30 - P34) : These functions are the same as PORT 0.
CLK & DATA: These two pins have the same structure as I/O ports.
There are 3 LED direct sink pins which require no external serial resistors. The address is mapped to address $00C9.
Addr.Bit76543210R/W
$00C9LED-----LED2LED1LED0(W)
WREN
DB
RST
LED [ 0 ]
L
Q
D
SD
WREN
DB
RST
L
Q
D
SD
VDD
LED [ 1:2 ]
LED0 Port StructureLED1, LED2 Port Structures
Watch-Dog Timer
NT6868C implements a watch-dog timer, which protects programs against system standstill. The clock of the watch-dog
timer is derived from the on-chip RC oscillator. The watch-dog timer interval is about 0.175 of a second. The timer must
be cleared within every 0.175 second during normal operation; otherwise, it will overflow and cause a system reset. The
watch-dog timer is cleared and enabled after a system reset. It cannot be disabled by the software. The user can clear the
watch-dog timer by writing #55H to CLRWDT ($00CAH) register.
For example:
LDA#$55
STA$00CA
Addr.Bit76543210R/W
$00CACLRWDT01010101(W)
Low Voltage Reset (LVR) Circuit
The NT6868C will check on the voltage level of the power supply. When the voltage level of power supply is below a
threshold of 3.0V (Typical), the LVRC will issue a reset output to the chip until the power voltage level is above a threshold
voltage of 3.0V (Typical) again. As soon as the power voltage reaches 3.0V (Typical), the entire chip will be reset for about
150ms.
RESET
NT6868C can also be externally reset through the RESET pin. A reset is initiated when the signal at the RESET pin is
held LOW for at least 10 system clocks. As soon as the RESET signal goes high, the NT6868C begins to reset for about
150ms. The following shows the definition of the RESET input at LOW pulse width.
VDD
20%VDD20%VDD
Trstb
VDD
7
Page 8
NT6868C
Absolute Maximum Ratings*
DC Supply Voltage . . . . . . . . . . . . . . -0.3V to +7.0V
*Comments
Stresses above those listed under "Absolute Maximum
Ratings" may cause permanent damage to this device.
Input/Output Voltage . . . . . . GND -0.2V to VDD + 0.2V
Operating Ambient Temperature . . . . . . 0° C to +70°C
Storage Temperature . . . . . . . . . . . . . -55 °C to +125°C
Operating Voltage (VDD) . . . . . . . . . .+4.5V to 5.5V
DC Electrical Characteristics (V
= 5V, GND = 0V, TA = 25°C, F
DD
These are stress ratings only. Functional operation of
this device at these or any other conditions above those
indicated in the operational sections of this specification
is not implied or intended. Exposure to the absolute
maximum rating conditions for extended periods may
affect device reliability.
= 4MHz, unless otherwise specified)
OSC
SymbolParameterMin.Typ.Max.UnitConditions
I
CC
V
IH
V
IL
V
OH1
V
OH2
Power Supply Current20mANo load
Input High Voltage2V
Input Low Voltage0.8V
Output High Voltage (Port 0, 1, 2, 3)2.4V
Output High Voltage (CLK, DATA)2.4V
IOH = -100µA
IOH = -400µA, Note 1
V
OH3
V
OL1
V
OL2
V
OL3
Output High Voltage (CLK, DATA)2.4V
Output Low Voltage (PORT 0, 1, 2)0.4V
Output Low Voltage (PORT 3)0.4V
Output Low Voltage (CLK, DATA)0.4V
IOH = -800µA, Note 2
IOL = 4mA
IOL = 5mA
IOL = 10mA
∆F/FInitial Frequency Variation 1+/-10%For RC OSC option