ROM or 2 Mbits SRAM
SED15X(KSX), MC141X and HD66410
·
series LCD driver compatible interface
option
46 bytes message buffer
·
One 16-bit timer and one 8-bit timer
·
General Description
The HT9580 is a high performance pager controller which can be used for Chinese Pager
system applications. The HT9580 4-in-1 Character Pager Controller combines a POCSAG decoder with a M6502 microprocessor core, 2
Mbits Character ROM and 256 Kbits SRAM to
provide both high decoder performance and excellent system flexibility. The decoder utilizes a
2-bit random error correction algorithm and
Internal 2Hz or 1Hz RTC or Real Time
·
Clock option
Single buzzer generator output (BZ) with
·
duty cycle control
low current HALT mode operation
·
16-bit watchdog timer
·
Built-in data filter (16-times over-sampling )
·
and bit clock recovery
Advanced synchronization algorithm
·
2-bit random and (optional) 4-bit burst er
·
ror correction for address and message
Up to 6 user addresses and 6 user frames,
·
independently programmable
3 RF power-on timing control pins
·
and Received data inversion (optional)
Built in SPI circuit
·
Out-of-range condition indicator
·
One internal 8-bit D/A converter
·
Battery fail and battery low detection
·
80-pin LQFP package
·
therefore provides excellent decoder sensitivity. The controller contains a full function
pager decoder at a 512, 1200, 2400 bps data
rates. Using an M6502 core takes advantage of
a flexible external control interface, LCD driver
chips and abundant programming resources
from worldwide providers. The internal SPI
would communicate with SPI of FLEX
speed pager decoder.
2LCD_CS1
3LCD_CS0
4LCD_CLOLCD driver clock output
5LCD_A0OLCD driver data/command select control
6LCD_RWOLCD Driver Read/Write signal output
7LCD_EOLCD driver enable clock control
15~8D0~D7I/O8-bit, tristate, bidirectional I/O data bus.
16R/W
17SRAM_CE
18MASK_CE
19OE
20PSENO
21~24RA17~RA14OExtended address bus pins
26P_MODEI
27, 57, 78 VSS
43~28A0~A15O
44TMR1ISchmitt trigger input for timer1 counter with pull-high resisor.
45~52PB0~PB7I/O
53~54PC0~PC1I/O
55BZOBuzzer non-inverting BZ output
Positive power supply
¾
OLCD driver chip select control (for slave LCD driver)
OLCD driver chip select control (for master LCD driver)
ORead/Write signal output
SRAM chip Enable. This signal is generated from the HT9580 to
O
provide read or write timing for external SRAM devices. (See Ap
plication Circuit)
Mask ROM Chip Enable. This signal is generated from the
O
HT9580 to provide read timing for external Mask ROM devices.
(See Application Circuit)
Mask ROM or SRAM Output Enable. This signal is generated
O
from the HT9580 to provide read timing for external Mask ROM
and SRAM devices. (See Application Circuit)
Program Store Enable. This pin is used to connect the OE
pins of the external 44 Kbytes program ROM when the
²MODE_P² internal pad is connected to VSS. (See note)
Internal or external program ROM selection without pull-high resistor. If the pin connects to VDD, the internal program ROM will
be fetched (normal type), otherwise the external program ROM
will be fetched when the pin connects to VSS (Romless).
Negative power supply
¾
Address bus pins. This is used for memory and I/O exchanges on
the data bus.
General Input/Output Port B. The input cell structures can be se
lected as CMOS or CMOS with pull-high resistors.
General Input/Output Port C. The input cell structures can be se
lected as CMOS or CMOS with pull-high resistors.
and CE
-
-
-
4April 28, 2000
Preliminary
Pin No.Pin NameI/ODescription
BALIBattery voltage detector input with pull-high resistor.
SPI slave ready ¾ This slave ready pin is a Schmitt trigger input
58
59BAF
60DA_OUTOD/A converter output. This pin is an 8-bit D/A analog output
61RSSII
62
63
64
65
66TS
72~67PA0~PA5I/O
73RESETISchmitt trigger reset input, active low.
74TSC
75TS1
77
76
80
79
SRDY
DII
MISOI
BS3OPLL power control enable, CMOS output
MOSIO
BS2ORF quick charge control enable, CMOS output
SCKI/O
BS1OPager receiver power control enable output, CMOS output
SS
OSC1
OSC2
X1
X2
with pull-high resistor. When the slave initiates the SPI transfer,
I
a high to low transition activates an interrupt. When the master
initiates the SPI transfer, a high to low transition trigger the
master to start the transfer.
IBattery fail indication input, active low.
RSSI output from IF circuit. This pin should be pulled high or low
externally when this pin is not used.
POCSAG code input serial data. CMOS input with pull-high re
sistor.
SPI master-in-slave-out ¾ this is the data input with pull-high
resistor for SPI communications.
SPI master-out-slave-in ¾ this is the data output for SPI commu
nications.
SPI serial clock ¾ the SCK signal is used to synchronize the data
transfer. If HT9580 is in the master mode, the SCK is output
clock. Otherwise, SCK is input clock if HT9580 is in the slave
mode.
SPI slave select ¾ this signal is used to enable the SPI slave for
O
transfer.
IDecoder test mode input pin, active low with pull-high resistor.
General Input/Output Port A. These ports can be programmed to
have a wake-up capability for applications in keyboard operations
or as normal I/O. Also the input cell structures are all Schmitt
trigger types and can be selected between CMOS or CMOS with
pull-high resistors.
mC test mode input pin, active low with internal pull-high resis
I
tor. The test circuit will be activated when this pin pulls low.
Decoder test mode input pin, active low with pull-high resistor.
I
The internal test mode will be activated when this pin pulls low.
IOOSC1 and OSC2 are connected to an RC network to form a main
clock oscillator
IOX1 and X2 are connected to a crystal to form an internal low power
clock oscillator (32.768kHz, 76.8kHz, or 153.6kHz)
HT9580
-
-
-
5April 28, 2000
Absolute Maximum Ratings
Preliminary
HT9580
Supply Voltage ..............................-0.3V to 3.6V
Input Voltage .................V
Current Drain Per Pin Excluding V
-0.5V to VDD+0.5V
SS
and VSS............................................................................10mA
DD
Storage Temperature.................-55°Cto150°C
Operating Temperature ..............-30°Cto85°C
Note: These are stress ratings only. Stresses exceeding the range specified under ²Absolute Maxi
mum Ratings² may cause substantial damage tothe device.Functional operation of this de
vice at other conditions beyond those listed in the specification is not implied and prolonged
exposure to extreme conditions may affect device reliability.
There are two clock source input pins on the
chip, the main clock and the pager decoder in
put clock. The main clock is generated by an RC
network. The system clock may be the OSC in
put or the X1-clock depending on bit
²CLK_SEL². The pager decoder input clock co
mes from two external pins, X1 and X2. The fre
quency of the sub-clock will be double that of
the X1, X2 input clock. The OSC1 main clock
will be generated from an RC network that
needs an external resistor (see Application Cir
cuit). The system clock may be X1-clock, DF or
RC clock. If no higher frequency (RC) is needed,
the external resistor between OSC1 and OSC2
can be removed. The system clock can be
switched by bit ²CLK_SEL².If²CLK_SEL²=0
(POR State), the system clock will be X1-clock.
In other cases, with ²CLK_SEL²=1, the OSC in
put clock will be the system clock. The clock
switching function will assist software programmers to change the mC system clock within an adequate time if necessary. The
OSC1
OSC_MOD
0: R C
1 : D F
OSC
C ontrol
OSC
Input
HALT
Main
Clock
Frequency
Sub-clock
²OSC_MOD² bit selects the OSC input clock to
be either RC or DF. If ²OSC_MOD² is set to
²low² then the RC configuration is selected, oth
erwise the DF application is selected. The pro
grammer should note that the condition of
²CLK_SEL², ²HALT² and ²OSC_MOD² assures
that the system clock is working properly. It is
recommended that the OSC clock source is ei
ther DF or RC. If DF and RC are necessary, it is
required to switch the system clock to X1-clock
before switching between DF and RC. Then
switch the system clock back to the OSC input
by using bit CLK_SEL if the switching action of
DF and RC is complete. Before enter HALT
mode, the system clock must select X1-clock.
The HT9580 will generate two RTC frequen
cies, 1Hz and 2Hz respectively, determined by
bit RTC. If the bit is logic low, the 1Hz RTC fre
-
quency will be selected, otherwise the 2Hz RTC
frequency will be selected. The RTC counter is
enabled/disabled by bit RTCEN and can be
masked or not masked as determined by the bit
RTCMSK of the interrupt control register
SST
D oubler
DF
X1-clock
10-bit R ipple
C ounter
SST Control
X1
-
-
-
-
-
X1-clock
X1-clock
C lock S e lect
CLK_SEL
C ounter
S ystem C lock
0: X 1-clock
1: O SC Input
1H z & Tim e O ut
2H z & Tim e O ut
RTC block diagram
10April 28, 2000
RTC Tim e Out
RTC
Preliminary
(0005H). If the RTC counter is enabled, the
RTC counter will start to count. The RTC coun
ter source clock is the X1-clock, so the X1 clock
setting via by SPF12, SPF13 and SPF14 should
be correct.
In order to guarantee that the system clock has
started and stabilized, the SST (System
Start-up Timer) provides an extra delay of 1024
system clock pulse when the system is powered
up.
10
Select 2Hz as the
RTC
RTC
The low power oscillator of the pager decoder
input clock should be crystal type. The decoder
subsystem low power oscillator, on the other
hand, is of a crystal type which is designed with
a power on start-up function to reduce the sta
bilization time of the oscillator. This start-up
function is enabled by bit ²LPM² which is ini
tially set high at power on reset, and should be
cleared to low so as to enable the low-power os
cillator function. The oscillator configuration is
running in the low power mode.
The system clock oscillator can be enabled/dis
abled by the register bit, ²HALT². The system
clock circuit is powered down, when the bit is
set to high. On the other hand, the system clock
Select 1Hz as the
RTC
V
DD
-
100k
W
50k
W
50k
W
100k
W
VSS
L o w p o w e r o s c illa to r fu n c t io n
LPM
(Low power m ode control)
X2
H T 9580
X1
low power oscillator
circuit is powered up, when the bit is low. When
this bit is set high, the CPU is also stopped.
-
When this bit is cleared low, the CPU core re
turns to its normal operation. After this is set
sub-clock divided by 8. The counter is seg
mented as a 9-bit prescaler and a 7-bit user pro
grammable counter. The input clock is first
divided by 512 (9-stage) to get the nominal
time-out period. The output of the 9-bit
pre-scaler can then be divided by a 7-bit pro
grammable counter to generate the longer
watchdog time-out depending on the user¢sre
quirements. The 7-bit programmable counter is
controlled by 3 register bits, WS0~2. The
watchdog timer is enabled/disabled by a control
bit WDTEN. To prevent the overflow of this
Register
Name
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
-
be executed before the timer overflows. The
clear-WDT operation is to write any number to
the register, CLRWDT (0002H). When the
watchdog timer overflows (checked by bit 3 of
0006H ²WDTOVFG²), the program counter is
-
set to FFFC H and FFFD H to read the program
start vector. The definitions of the control bits
are listed below.
-
10
WDTEN
Enable the
watchdog timer
Disable the
watchdog timer
watchdog timer, a clear-WDT operation should
11April 28, 2000
State on
POR
Preliminary
HT9580
The WDT 7-bit counter is programmed by bits
WS0~WS2. The division ratio for the counter is
listed in the table.
WS2WS1WS0
Division
Ratio
0001:1
0011:2
0101:4
0111:8
1001:16
The other pair ²TMR0_PR0² and ²TMR0_PR1²
are used to select the prescaler ratio for timer0.
The definition is shown in the table.
The buzzer generator is composed of a 16-bit
PFD counter and aduty cycle control. The counter value is set by two registers, namely BZ-H
and BZ-L. The source for this generator may be
the system clock or the X1-clock. The buzzer
generator is enabled/disabled by the register
bit ²MGEN² in the configuration regis
ter(0000H). When this bit is set high, the
buzzer generator is activated. There is another
bit in the configuration register(0000H) which
controls the buzzer output volume, bit
²MDUT². If the bit is logic high, the output of
the BZ will be modulated by the X1-clock. The
clock source of the buzzer is selected by bit
²BZ_CLK². When BZ_CLK=0, the clock source
is the system clock. On the other hand, when
BZ_CLK=1, the value of the selector will be the
X1-clock.
The truth table for enabling/disabling the
buzzer generator is shown in the table.
10
MGEN
12April 28, 2000
Enable the
buzzer generator
Disable the
buzzer generator
Preliminary
HT9580
When BZ-L and BZ-H are all 00H, the tone gen
erator is disabled and BZ is high. The value of
the frequency divider, ranges from 2
(BZ-L=01H, BZ-H=00H)~65536 (BZ-L=FFH,
BZ-H=FFH). Writing to BZ-L only writes the
data into a low byte buffer, while writing to
BZ-H will write the high byte data and the con
tents of the low byte buffer into the PFD coun
ter.
When the buzzer generator is disabled by
clearing the ²MGEN² bit in the configuration
register (0000H), the BZ pin remains at its last
state. If the BZ pin is low, the BZ transistor in
System C lock
X1-clock
BZ_C LK=0
BZ_C LK=1
BZ_C LK
MDUT=0
MDUT=1
the application circuits is always active. There
fore it is recommended that both BZ-L and
BZ-H be cleared and that the ²MGEN² bit in the
configuration register (0000H) also be cleared,
when it is desired to disable or stop the buzzer.
The output of the 16-bit PFD counter is divided
by 2 to generate a BZ output with or without
modulation. For example, if the desired output
of BZ is 1.6kHz with modulation and the fre
quency source is X1-clock (76.8kHz), then the
value of 16-bit PFD counter is set to BZ-L=17H,
BZ-H=00H and ²MDUT² is set high.
There are two interrupts for the HT9580: a
Non-Mask Interrupt (NMI) and a generic interrupt request (IRQ). The data ready interrupt
and battery fail interrupt share the NMI call lo
cation. Which interrupt occurred can be deter
mined by checking bit BF_FG and the data
ready interrupt bit DR_FG or SPI complete flag
SPIFG (in SPI-CONFIG register). DR_FG is
the data ready interrupt indication bit. When a
valid call is detected, data begins to transfer.
Either one call is terminated or a message
buffer is full or one batch is over but the mes
sage is not terminated, the data ready inter
rupt will occur and DR_FG is set high. The
DR_FG bit should be cleared low by the mC soft
ware after a data ready condition has occurred.
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
A battery fail condition is triggered by a high to
low transition on pin BAF
and will set the bat-
tery fail interrupt request flag BF_FG to logic
-
high. For details, refer to the POCSAG Decoder
-
section. The sources for the IRQ are timer 0
overflow, timer 1 overflow, out-of-range status
changes and RTC time out. The four interrupt
sources all could be masked, but the four corre
sponding interrupt flags will still be set when
the interrupt conditions are met. All the four
flags are readable/writeable. When an inter
-
rupt condition is met, a flag will be set. If an in
-
terrupt routine is performed, the software
should check which flag is set to high then de
termine what kind of interrupt source occurred.
The WDTOVFG is the flag for the watchdog
13April 28, 2000
State on
POR
-
-
-
-
Preliminary
HT9580
timer overflow and RTC_FG is an indicator for
the RTC time out interrupt request flag. The
OR_FG will be set high when an out-of-range
status from low to high or high to low transition
occurrs. Those flags such as TM0OVFG,
TM1OVFG, BF_FG, DR_FG, OR_FG and
RTC_FG should be cleared by the software af
ter they are activated.
10
RTCEN
RTCMSK
TM0IMSK
TM1IMSK
ORMSK
RTC counter is
enabled
RTCinterrupt
is masked
Timer 0 overflow
interrupt is
masked
Timer 1
overflow
interrupt is
masked
Out-of-range
interrupt is
masked
RTC counter is
disabled
RTC interrupt is
not masked
Timer0overflow
interruptisnot
masked
Timer 1
overflow
interrupt is not
masked
Out-of-range
interrupt is not
masked
D ata R eady
SPI Reqst
TM 0/1IM S K
TM 0/1O VFG
RTC_FG
RTCM SK
OR_FG
ORMSK
B a tte ry F a il
-
TM0OVFG
TM1OVFG
WDTOVFG
BF_FG
DR_FG
OR_FG
RTC_FG
NMI
M 6502
Core
IR Q
10
Timer 0
overflows
Timer 1
overflows
Watchdog
timer has
overflown
Battery fail
request
Data ready
request
Out-of-range
request
RTC interrupt
request
No timer 0
overflow
No timer 1
overflow
No watchdog
timer overflow
No battery fail
request
No data ready
request
No out-of-range
request
No RTC
interrupt
request
Block diagram of NMI and IRQ
14April 28, 2000
Preliminary
HT9580
IR Q
TM 0IM SK
TM 1IM SK
TM 0OV FG
TM 1OV FG
tim e r 0
overflow
S
M asked by
TM 0OV FG
tim e r 1
overflow
S
Timer0 and Timer1 timing diagram
Reset conditions
The HT9580 will reset the whole chip when the
following conditions are met:
·
Power On
·
The external RESET pin is held low for at
least 1 ms
·
The WDT overflows
The input is used to reset the mC. Reset must be
held low at least 1 ms after VDD reaches operating voltage from a power down. A positive
tim e r 0
overflow
S
C leared by softw areC leare d by softw are
overflow
M asked by
TM 0IM SK
tim e r 1
S
tim e r 0
overflow
S
M asked by
TM 1OV FG
tim e r 0
overflow
S
C leared by softw areC leare d by softw areC leared by softw are
tim e
transition on the chip reset will then cause an
initialization sequence to begin. After the sys
tem is operating, a low on this line of at least 1
ms in duration will cause mC activity. When a
positive edge is detected, there is an initialization sequence lasting 8-clock cycles. Then the
interrupt mask flag is set, the decimal mode is
cleared and the program counter is loaded with
the restart vector from locations FFFC (low
byte) and FFFD (high byte). This is the start location for program control. This input should be
high during normal operation.
-
15April 28, 2000
5000H
FFFAH
FFFBH
FFFCH
Preliminary
Program R O M Space
D ata R eady & Battery Fail Service
R outine Vector Low B yte
D ata R eady & Battery Fail Service
R outine Vector H igh Byte
In addition to the watchdog timer, the HT9580
provides two timers: an 8-bit timer (timer 0) and
one 16-bit timer (timer 1). Those two timers are
controlled and configured by the register TMRC.
Both timers are programmable up-count coun
ters whose clocks may be derived from the
X1-clock (32.768kHz, 76.8kHz or 153.6kHz). To
program the timers, TMR0, TMR1L, and
TMR1H should be written with a start value.
When the timers are enabled, they will count-up
from the start value. If the timers overflow, cor
responding interrupts will be generated. When
the timers are disabled, the counter contents
will not be reset. To reset the counter contents,
the software should write the start value again.
Since timer1 is a 16-bit counter, it is important
to note the method of writing data to both
TMR1L and TMR1H. Writing to TMR1L only
writes the data into a low byte buffer, while writing to TMR1H will simultaneously write the
high byte data and the contents of the low byte
Labels (TMRC0
and TMRC1)
TMR0EN,
TMR1EN
TMR0EDG,
TMR1EDG
TMR0CLK4
TMR1CLK5
TMR1MOD7
BitsFunction
01Enable/disable timer counting
(0=disable; 1=enable)
23Define the TMR0 and TMR1 active edge
(0=active on low to high; 1=active on high to low)
buffer into the Timer Counter preload register
(16-bit). Note that the Timer counter preload
register contents are changed by a TMR1H
write operation while writing to TMR1L does
not change the contents of the preload register.
Reading TMR1H will also latch the contents of
TMR1L into the byte buffer to avoid false timing
problem. Reading TMR1L returns the contents
of the low byte buffer. In other words, the low
byte of the timer counter cannot be read directly.
It must first read TMR1H to latch the low byte
contents of the timer counter into the buffer.
TMRC is the timer counter control register,
which defines the timer counter options. The
timer1 clock source can be selected from either
the internal clock or an external input clock by bit
TMR1MOD of the TMRC register. The
timer0/timer1 can also select its clock source by
bits TMR0CLK/TMR1CLK. TMRC as shown in
the table.
The HT9580 has three general purpose I/O
ports. The I/O cell structures are configurable.
Details are shown in the table.
Port A
Port A is a general-purpose I/O port. The PAC
register controls the data directions for port A.
When set as input data type, this port has
wake-up capability and the input cell struc
tures are schmitt trigger types. While in a
²HALT² condition, a falling edge signal on Port
A can wake-up the mC. In addition, the input
cell structures can be configured as pull-high or
non-pull-high. When set as an output datatype,
the output structures are CMOS outputs.
10
PA
The pin output
logic high
The pin output
logic low
PACAs input pinAs output pin
PAWUE
PAIM
The pin has
wake-up
capability
CMOS input
structure
with pull-high
resistor
The pin has no
wake-up
capability
CMOS input
structure without pull-high
resistor
Port B
Port B is a general-purpose I/O port controlled
by the PBC register. The PBIM register con
trols the input cell structures: normal CMOS
inputs or CMOS inputs with pull-high resis
tors.
10
-
PB
Pin output
logic high
Pin output
logic low
PBCInput pinOutput pin
PBIM
CMOS input
structure with
pull-high
resistor
CMOS input
structure without
pull-high resistor
Port C
This is a general-purpose I/O port contolled by
the PCC register. The PCIM register controls
the input cell structures: normal CMOS inputs
or CMOS inputs with pull-high resistors.
The Mask ROM bank point register can switch
between the internal 2 Mbits Mask ROM or an
external up to 2 Mbits MaskROM space. The selection table isbased on the following table. The
space size of each Mask ROM bank is 8 Kbytes.
The bits BP_MODM1 and BP_MODM0 define
whether internal or external MaskROM devices
are used. (BP_MODM1, BP_MODM0)=(0, 1), selects the internal Mask ROM device.
BP_MODM1 BP_MODM0 M_BP5 M_BP4 M_BP3 M_BP2 M_BP1 M_BP0 BP ValueMemory Area
Register
Name
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
(BP_MODM1, BP_MODM0)=(1, 0), selects the
external Mask ROM device. The internal Mask
ROM can switch from bank 0 to bank 31 and the
external Mask ROM can switch from bank 0 to
bnak 31 by software programming. In addition,
the address range of the internal/external Mask
ROMwillallrange from 1000H to2FFFH.
The Mask ROM bank point register selection
table is shown in the table.
00XXXXXXX
010000000
01
0101111131
0110000032
01
0111111163
100000000
10
1001111131
¯¯
¯¯
¯¯¯
Reserved
Internal 2 Mbits Mask ROM (low 8 Kbytes)
Internal 2 Mbits Mask ROM (High 8
Kbytes)
Reserved
Reserved
Reserved
External 2Mbits Mask ROM (low 8Kbytes)
External 2 Mbits Mask ROM (High 8
Kbytes)
¯
State on
POR
20April 28, 2000
Preliminary
HT9580
If the internal 2 Mbits mask ROM is placed as
shown in the figure and the software program
mer obtains a start address from CNS (Taiwan)
code or a GB (China) code, A0~A17. The follow
ing steps will map from the start address to the
bank point register, then the hardware address
decode circuit will point to the real 2 Mbits
space. (If the internal mask ROM is selected.)
·
Step 1
The formula obtains A0~A18 from the re
ceived GB or CNS code. If it is in the lower 2
Mbits space, A18=0. Otherwise, A18=1 if it is
in reserved space.
·
Step 2
Set (BP_MODM1, BP_MODM0)=(0, 1)
·
Step 3
Assign correct ²M_BP0²~²M_BP5² as shown:
¨
A13®M_BP0
¨
A14®M_BP1
¨
A15®M_BP2
¨
A16®M_BP3
¨
A17®M_BP4
¨
A18®M_BP5 (the bit will be 0 at this condi
tion)
·
Step 4
Adding $1000 H to A12~A0 to get new HEX
value $B
3B2B1B0
H.
0
0
A120A110A100A90A80A70A60A50A40A30A20A10A0
0000
0 0 RA13RA12A11A10A9A8A7A6A5A4A3A2A1A0
1
00000H
-
-
·
-
Step 5
The following example will load 32 bytes con
CNS Pattern
(G B Pattern)
(A 1 8 = "0 ")
Reserved
(A 1 8 = "1 ")
3FFFFH
40000H
7FFFFH
tinuous (one Chinese word) pattern from the
internal mask ROM and store them to the
start address $C
The SRAM bank point register can switch to ei
ther external 256 Kbytes or internal 32 Kbytes
SRAM space. The selection table is based on the
following table. The space size of each SRAM
bank is 8 Kbytes. Bits BP_MODS1 and
BP_MODS0 define whether internal or exter
nal SRAM devices are used. (BP_MODS1,
BP_MODS0)=(0, 1), is for internal SRAM de
BP_MODS1 BP_MODS0 S_BP5 S_BP4 S_BP3 S_BP2 S_BP1 S_BP0 BP ValueMemory Area
00XXXXXXX
010000000
01
010000113
010001004
01
0111111163
100000000
10
1001111131
¯¯¯
¯¯
¯¯¯
vices. (BP_MODS1, BP_MODS0)=(1, 0), is for
external SRAM devices. The internal SRAM
would switch from bank 0 to bank 3 and the ex
ternal SRAM would switch from bank 0 to bank
31 by software programming. In addition, the
address range of the internal/external SRAM
The LCD control and command registers are
used for LCD driver interface. There are three
kinds of LCD driver chips available for the
HT9580. These LCD drivers are SED15X(KSX)
series, Motorola LCD driver chip MC141X se
ries and HD66410 respectively according to the
following ²LCD-CHIP0² and ²LCD-CHIP1² bit
table settings. The combination of the
LCD_CMD and LCD-CTRL registers can con
trol the SED15X(KSX), MC141X series or
HD66410 LCD drivers. Bits LCD-CS0/1 of the
LCD-CTRL register corresponds to the chip select pin of the LCD driver. The bit ²LCD-CS0² is
used to control the master LCD driver chip
while ²LCD-CS1² is for the slave LCD driver
-
chip. Both bits are active low. The bit
²CLK_MOD² is used to enable or disable the
pin out of LCD_CL. If the bit is set low, the
clock output of pin LCD_CL will be disabled,
-
otherwise the LCD_CL clock will be set accord
ing to the following Truth Table.
22April 28, 2000
-
Preliminary
²LCD-CHIP0² and ²LCD-CHIP1² Truth Table
LCD-CHIP0=²0²LCD-CHIP0=²1²
LCD-CHIP1=²0²
LCD-CHIP1=²1²
²LCD_CL² Truth Table
LCD-CHIP1=²0²
LCD-CHIP1=²1²
The following is a comparison table of the HT9580 pin description between the SED15X (KSX) series
and the MC141X series LCD driver.
HT9580
(Pin)
LCD_A0A0
LCD_CS0 CS
LCD_CS1 CS
D0~D7D0~D7
LCD_EEEnable clock inputCS
LCD_RW R/W
LCD_CLCL
SED15X(KSX) series LCD driver is
selected
HD66410 LCD driver is selectedN/A
LCD-CHIP0=²0²LCD-CHIP0=²1²
LCD_CL: 2 kHz output
LCD_CL: 10.9kHz outputN/A
SED15X(KSX) SeriesMC141X Series
Data/command select input.
A0=0: Display control data on
D0~D7
A0=1: Display data on D0~D7
(Master)
(Slave)
Active low chip select input.
(Master)
Active low chip select input.
(Slave)
8-bit, tristate, bidirectional I/O
bus.
Read/write inputR/W
External clock input.
(2kHz output from HT9580)
MC141X series LCD driver is selected
LCD_CL: If ²LCD-CLK²=0, 32 kHz output
If ²LCD-CLK²=1, X1-clock output
This inputpin acknowledges
valid dataon D0~D7.If high
D/C
CE (Master)
CE (Slave)
D0~D7
OSC2
then D0~D7 contains dis
play data, if low D0~D7 con
tainscommand data.
When high, enables the
control pins on the driver.
(Master)
When high, enables the
control pins on the driver.
(Slave)
Bidirectional bus for
data/command transfer.
This pin is normal low
clock input. Data on
D0~D7 is latched at the
falling edge of CS.
To read the display data
RAM or the internal sta
tus, pull this pin high.
The pin low indicates a
write operation.
Oscillator input for external
clock is used. (32kHz or
X1-clock output from
HT9580 as determined by
the ²LCD-CLK²).
HT9580
-
-
-
23April 28, 2000
Preliminary
LCD Driver
HT9580
LC D _A0
LC D _C S 0 (M aster)
D0~D7
H T9580
LC D _E
LCD_RW
LCD_CL
5
3
2
15~8
7
6
4
A0
CS (Master)
C S (S lave)LC D _C S 1 (S lave)
D0~D7
SE D 15X (KS X )
E
R/W
CL
Master
Slave
T h e a p p lic a tio n c irc u it w h e n b it " L C D -C H IP 1 " = 0 a n d " L C D -C H IP 0 " = 0
LC D D river
LCD_A0
LC D _C S 0 (M aster)
LC D _C S 1 (S lave)
H T 9580
D0~D7
LCD_E
LCD_RW
LCD_CL
5
3
2
15~8
7
6
4
D/C
CE (M aster)
C E (S lave)
D0~D7
M C141X
CS
R/W
OSC2
Master
Slave
The application circuit w hen bit "LC D -CH IP 1" = 0 and "LC D -C H IP 0" = 1
24April 28, 2000
Preliminary
LCD Driver
LCD_A0
LC D _C S 0 (M aster)
H T9580
D0~D7
LCD_E
LCD_RW
LCD_CL
5
3
2
15~8
7
6
4
RS
CS (M aster)
C S (S lave)LC D _C S 1 (S lave)
D0~D7
H D 66410
RD
WR
CR
The application circuit w hen bit "LC D -C H IP 1" = 1 and "LC D -C H IP0" = 0
LCD Driver Chip SelectionApplicationNote
SEDX(EPSON) series LCD
driver at 68 family MPU appli
LCD-CHIP0="0"
LCD-CHIP1="0"
cation mode.
KSX(SAMSUNG) series LCD
driver at 68 family MPU appli
cation mode.
LCD-CHIP0="1"
LCD-CHIP1="0"
MC14X(MOTOROLA) series
LCD driver.
HD66410(HITACHI) series
LCD driver.
SEDX(EPSON) series LCD
LCD-CHIP0="0"
LCD-CHIP1="1"
driver at 80 family MPU
application mode.
KSX(SAMSUNG) series LCD
driver at 80 family MPU appli-
cation.
LCD-CHIP0="1"
LCD-CHIP1="1"
N/A
Master
RESET is low active
-
Pin options set as 68 family
MPU application mode.
Slave
RESET is high active
Pin options set as 80 family
MPU application mode.
HT9580
Power down operation - HALT
The HALT mode is initiated by setting the con
figuration register bit HALT high and results in
the following ...
The system clock turns off, the low power pager
sub-clock, LCD driver, pager decoder and RTC
all keep running.
The contents of the on-chip RAM and of the reg
ister remain unchanged.
As the WDT and the WDT prescaler depend on
software control, the WDT will continue to
count when the ²HALT² bit is set high.
All the I/O ports remain in their original status.
25April 28, 2000
-
Preliminary
HT9580
D/A registers
Address
002FHD/A-LDA7DA6DA5DA4DA3DA2DA1DA00000 0000
0030HD/A-HXXXXXD/A_PDRSSIBATuuuu u1uu
Register
Name
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
State on
POR
The system can quit the HALT mode by an ex
ternal reset, an interrupt, an external falling
edge signal on port A or an RTC time out.
The HT9580 has one internal 8-bit D/A con
verter which can measure the battery voltage
and the RSSI input signal from the IF of the RF
circuit. The DA0~DA7 is the digital input of the
D/A converter and the analog outputs to the pin
named DA_OUT. Bit BAT of the DA-H register
(0030H) is the output of the comparator. Its in
put at the ²-² terminal is from the D/A output
and the ²+² terminal comes from the input pin
V
DD
D/A_PD
VDD (D/A)DA7
VSS
BAF
-
. The bit RSSI of DA-H register (0030H) is
the output of another comparator. Its input at
²-² terminal is from the D/A output and ²+² ter
minal comes from the input pin RSSI. The soft
ware can detect the battery voltage and the
RSSI signal by writing to the bits DA0 ~DA7
(002FH) and reading the bits BAT, RSSI (0030H).
Bit ²D/A_PD² is used for the D/A power down
control. If this bit islogic high, the D/Awill be in
-
the power down mode. Otherwise, the D/A is in
the normal condition. For details see the follow
ing figure.
RSSI
BAT
DA6
DA5
DA4
DA3
DA2
DA1
DA0
2R
R
2R
R
2R
R
2R
R
2R
R
2R
R
2R
R
2R
2R
RSSI
BAT
DA_OUT
-
-
-
The configuration of the 8-bit D /A converter and pow er dow n control
The buffer status register will relay to the mC
the status of the message buffer when the data
ready request interrupt occurred. The
²MSG_END² bit will be set high when the data
(including address codeword and message code
word) is at the end of this data ready interrupt
call. The valid data length of the message buffer
is determined by bit count_0 to count_5. If
²MSG_END² is low, the data length is more
0040H
0041H
0042H
0053H
0054H
0055H
006D H
Address C odew ord
M essage C odew ord 1
M essage C odew ord 2
M essage C odew ord 19
M essage C odew ord 20
than 46 or data is not at the end, the mC should
wait for the next data ready interrupt until the
bit ²MSG_END² is set high. Example 1: if the
data read from 0031H is ²95H² when a new
-
data ready interrupt occurred, it means the to
tal data length is 21 including the address code
word in this call and the message is terminated
(bit ²MSG_END² =1). The figure below illus
trates example 1.
M essage B uffer
N/A
N/A
-
-
-
B it7 B it6 B it5 B it4 B it3 B it2 B it1 B it0
00101011
Example 1
27April 28, 2000
0031H
Preliminary
HT9580
Example 2: if the data read from 0031H is
²2EH² when a new data ready interrupt oc
curred, that means thedata length of this call is
more than 46 and the next data ready interrupt
will occur. If the next interrupt occurs and the
contents of 0031H is ²85H², the result are
M essage B uffer
0040H
0041H
0042H
006C H
006D H006D H
B it7 B it6 B it5 B it4 B it3 B it2 B it1 B it0
Address C odew ord
M essage C odew ord 1
M essage C odew ord 2
M essage C odew ord 44
M essage C odew ord 45
01010101
0031H
shown in the following figure. The programmer
should note that the information on the mes
sage buffer must be read out before the next
continuous codeword arrives. Otherwise the
data on the message will be overwritten.
M essage B uffer
M essage C odew ord 46
0040H
M essage C odew ord 47
0041H
M essage C odew ord 48
0042H
M essage C odew ord 49
0043H
M essage C odew ord 50
0044H
0045H
B it7 B it6 B it5 B it4 B it3 B it2 B it1 B it0
0001
1010
N/A
N/A
0031H
-
1st D ata R eady Interrupt
Example 2
The data ready interrupt will generate when
message is terminated, synchronization code
POCSAG DATA
Structure
NMI
DR_FG
M essage B uffer
(46 bytes)
Fram e5
DI
Fram e6Fram e7Fram e0F ram e1F ram e2
The timing chart of message buffer
2nd D ata R eady Interrupt
word is received or buffer is full. The following
figure will show the typical operation.
S/M: Slave/master mode selection
When S/M is "0", HT9580 is in the master
mode. Otherwise, HT9580 is in the slave
mode.
01
S/M
·
LEN0, LEN1: Data length
Master mode
(SCK is output)
Slave mode
(SCK is input)
The LEN0 and LEN1 will determine the data
length between exchange.
LEN1LEN0Data Length (Bit)
004
018
1016
1132
·
REQST: SPI request (read only)
When FLEX
TM
decoder wants to exchange
data with HT9580, the REQST will have low
pulse.
·
SPIFG: SPI complete flag
0 (clear): Data transfer to external device has
been completed.
1 (set): No valid completion of data transfer.
The bit is cleared by hardware and set
by software.
·
CLK_EDG: Data sampling edge
The CLK_EDG will determine the valid
MISO and MOSI sampling edge of SCK clock.
01
CLK_EDGRising edgeFalling edge
·
SPI_EN: The SPI enable
01
When the SPI cir
cuit is disabled, the
SPI_EN
POCSAG decoder
I/O pins will be en
abled
·
START: The data exchange start or not
The SPI cir
cuit and SPI
I/O pins will
be enabled
01
Data
STARTNo data exchange
exchange
start
When the bit is set by software, the SPI data
exchange will start. After the first bit data exchange is completed, the START bit will clear
to low again by hardware.
-
29April 28, 2000
Preliminary
HT9580
SPI SPEED register (write only)
Address
0033HSPI-SPEEDSP7SP6SP5SP4SP3SP2SP1SP00000 0000
Register
Name
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
State on
POR
The register will determine the SCK clock frequency of SPI. When SPEED register are 00H, the SCK
clock output is high. The value of the frequency divider, ranging from 1 (SPEED=01H)~255
(SPEED=FFH). If SPEED=00H, the SCK output will be disabled.
X1-clock
8-bit S P E E D C ounter
SPI Control
SCK
SPI
SPI output buffer register (write only)
Address
0034HSPI-OUT3D7D6D5D4D3D2D1D00000 0000
0035HSPI-OUT2D7D6D5D4D3D2D1D00000 0000
0036HSPI-OUT1D7D6D5D4D3D2D1D00000 0000
0037HSPI-OUT0D7D6D5D4D3D2D1D00000 0000
Register
Name
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
State on
POR
The SPI-OUT3~0 are used when transmitting data on the serial bus. Only valid datawrite to the reg
ister SPI-OUT3~0 and "START" initiating will begin the SPI data transmission from HT9580 to
TM
FLEX
decoder. After completion of the 4-byte data transfer, the "SPIFG" status bit will be set and
the internal signal ²REQST² will generate a falling edge signal for NMI. The bit7 of SPI-OUT3 is
MSB and bit0 of SPI-OUT0 is LSB.
SPIFG
REQST
(N M I)
REQST
(register)
START
(register)
(from H T 9580)
(from decoder)
SCK
MOSI
MISO
Logic H igh
SPI-OU T3~0
SPI-IN 3~0
MSB
MSB
2
2
1
1
LSB
LSB
-
SS (to decoder)
SRDY
(from decoder)
SPI packet exchange initiated by the H T 9580
30April 28, 2000
Preliminary
HT9580
SPI input buffer register (read only)
Address
0038HSPI-IN3D7D6D5D4D3D2D1D00000 0000
0039HSPI-IN2D7D6D5D4D3D2D1D00000 0000
003AHSPI-IN1D7D6D5D4D3D2D1D00000 0000
003BHSPI-IN0D7D6D5D4D3D2D1D00000 0000
Register
Name
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
State on
POR
The SPI-IN3~0 are used when receiving data on the serial bus. When SPI transmits only valid data
writes to the register SPI-OUT3~0, "START" will initiate the SPI data transmission from HT9580 to
TM
FLEX
decoder. After completion of the 4-byte data transfer, the "SPIFG" status bit will be set and
the internal signal "REQST" will generate a falling edge signal for NMI. The bit7 of SPI-IN3 is MSB
and bit0 of SPI-IN0 is LSB.
SPIFG
REQST
(N M I)
REQST
(register)
START
(register)
SCK
MISO
(from decoder)
MOSI
(from H T 9580)
SS (to decoder)
SRDY
(from decoder)
S P I-IN 3 ~ 0
SPI-OU T3~0
MSB
MSB
2
2
1
1
LSB
LSB
SPI packet exchange initiated by the H T 9580
31April 28, 2000
Preliminary
HT9580
The POCSAG paging code
A transmission using the ²CCIR Radio paging
Code No.1² (POCSAG code) is generated in ac
PREAM BLE
1 0 1 0 .........1 0 1 0 1 0 1 0 1 0
Bit Num ber 1
A ddress codew ord
M essage codew ord
Id le c o d e w o rd
S y n c h c o d e w o rd
BATCH1BATCH2LAST BATCH
Synch CWCW
FRAM E0 FR AM E1FRAM E7
2 to 1920/2122 to 31
18 A ddress B its
0
1
0
0
20 M essage Bits
POCSAG code structure
The transmission is started by sending a pre
amble, consisting of at least 576 continuously
alternating bits (10101010...). The preamble is
followed by an arbitrary number of batch
blocks. Only complete batches are transmitted.
Each batch comprises 17 code-words of 32 bits
each. The first code-word is a synchronization
code-word with fixed pattern. The sync word is
followed by 8 frames (0~7) of 2 code-words each,
containing message information. A code-word
in a frame can either be an address, message or
idle code-word.
Idle code-words also have fixed patterns and
are used to fill empty frames or separate messages.
cordance with the following rules (see the fol
lowing Figure).
-
CWCWCW CW
32
2 F unction
31 Idle code Bit pattern
31 S ynch code Bit pattern
Address code-words are identified by an MSB of
-
Bits
10 C R C bits
10 C R C bits
P
P
logic 0 and are coded as shown in the POCSAG
code structure figure. A user address or RIC
(Receiver Identity Code) consists of 21 bits.
Only the upper 18 bits are encoded in the address code-word (bits 2 to 19). The lower 3 bits
designate the frame number in which the address is transmitted.
Four different call types can be distinguished
on each user address. The call type is determined by two functional bits in the address
code-word (bits 20 and 21). The POCSAG standard recommends the use (in Taiwan) of combinations of data formats and function bits, as
shown in the following table. Other combina
tions will be set by SPF16~SPF19.
-
-
Bit 20 (MSB)Bit 21 (LSB)Call TypeData Format
00Numeric4-bit package
01Alert only
10Alert only
¾
¾
11Alpha-numeric7-bit package
Data formats and function bits
32April 28, 2000
Preliminary
HT9580
Alert-only calls consist of a single address
code-word. Numeric and alphanumeric calls
have message code-words following the address.
Message code-words are identified by an MSB
of logic 1. The message information is stored in
a 20-bit field (bits 2 to 21). The data format is
determined by the call type: 4 bits per digit for
numeric message and 7 bits per (ASCII) charac
ter for alphanumeric messages. Each
code-word is protected against transmission er
rors by 10 CRC check bits (bit 22 to 31) and an
even parity bit (bit 32).
This permits correction of a maximum of 2 ran
dom errors or up to 4 errors in a burst of 4 bits
(a 4-bit burst error) per code-word.
·
Error correction
ItemDescription
Address
code-word
Message
code-word
two random errors, or 4-bit
burst errors (optional)
two random errors, or 4-bit
burst errors (optional)
Error correction
In the HT9580, error correction methods have
been implemented as shown in the table above.
Random error correction is the default for
both address and message code-word. In another method, burst error correction can be
switched by SPF programming. Up to 4 erroneous bits in a 4-bit burst can be corrected.
The error type detected for each code-word is
identified in the message data output to the
microcontroller, allowing rejection of calls with
too many errors.
·
Operating states
¨
ON status
¨
STANDBY status
The operating state is determined by control
address (0019H) bit 0 and monitored by bit 3
of address (0019H).
Truth table for decoder operating status
ON InputOperating Status
0On state
1STANDBY state
·
On status
In the ON status, the decoder pulses the re
ceiver, quick charge and PLL enable outputs
(respectively BS1, BS2 and BS3) according to
the code structure and the synchronization
algorithm. Data received serially at the data
input (DI) is processed for call receipt.
-
·
STB status
-
In the STB status the decoder will neither ac
tivate the receiver, quick charge or PLL en
-
able outputs, nor process any data at the data
input. The crystal oscillator remains active to
-
permit communication with the microcontroller.
·
Battery saving
Current consumption is reduced by switching
the STB internal decoder sections whenever
the receiver is not enabled. To further increase
battery efficiency, reception and decoding of an
address code-word is stopped as soon as the un
corrected address field differs by more than
3-bits from the enabled RICs. If the next
code-word has to be received again, the receiver
is re-enabled, thus observing the programmed
establishment times t
·
Data reception and buffer
BS1,tBS2
and t
BS3
.
Reception of a valid paging call is signaled to
the microcontroller by means of an interrupt
signal. The received address and message
code-word can then be read via a 46 bytes
message buffer (from 0040H to 006DH) fordecoder data message. If the mC did not read the
previous message within one code-word time
from the message buffer, the message buffer
data will be overwritten.
·
Bit rates
The HT9580 can be configured for data rates
of 512, 1200 or 2400 bit/s by SPF program
ming. These data rates are derived from
32.768kHz, 76.8kHz or 153.6kHz oscillator
frequencies.
·
Input data processing
The input data is noise filtered by means of a
digital filter. Data is sampled at 16 times the
data rate and averaged by majority decision.
33April 28, 2000
Preliminary
HT9580
The filtered data is used to synchronize an in
ternal clock generator by monitoring transi
tions. The recovered clock phase can be
adjusted in steps of 1/8, 3/32, 1/16, or 1/32 bit
period per received bit.
All step size are used when bit synchroniza
tion has not been achieved, the smallest when
a valid data sequence has been detected.
·
Erroneous code-words
Upon receipt of erroneous uncorrectable
code-words, call termination occurs according
to the conditions given below:
SPF08 SPF09Description
Any two consecutive
code-words or the
0X
code-word directly following
the address code-word in
error
10Any single code-word in error
11
Any two consecutive
code-words in error
·
-
-
Message receiving mode
The receiving message mode (numeric or al
pha-numeric) depends on bits SPF16~SPF19.
If one of these bits from SPF16~SPF19 is
cleared to low, the decoder will be in numeric
-
package receiving mode. Otherwise, the de
coder is in the alphanumeric receiving mode.
An example is shown below:
SPF16=0
SPF17=0
SPF18=1
SPF19=1
Function Bits
Bit 20 (MSB) Bit 21 (LSB)
00
01
10
11
Message Re
ceiving Format
Numeric (4-bit)
Numeric (4-bit)
Alphanumeric
(7-bit)
Alphanumeric
(7-bit)
The decoder data output format is deter
mined by the value SPF16~SPF19. When it is
logic low, the 4-bit (numeric) package will be
selected. Otherwise, the 7-bit (alphanumeric)
package is selected. The following tables illus
trate the above two different conditions.
Message code-word on the message buffer (numeric receiving mode)
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Error Flag000D3D2D1D0
-
-
-
-
-
Message code-word on the message buffer (alphanumeric receiving mode)
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Error FlagD6D5D4D3D2D1D0
·
Synch word indication
The synch word recognized by the HT9580 is
the standard POCSAG synchronization
code-word as shown in the following table.
BitNo.0123456789101112131415
Bit 0111110011010010
Bit No.16171819202122232425262728293031
Bit 0001010111011000
34April 28, 2000
Preliminary
·
Idle word indication
The idle word recognized by the HT9580 is a
standard POCSAG idle code-word as shown
in the following table.
HT9580
BitNo.0123456789101112131415
Bit 0111101010001001
Bit No.16171819202122232425262728293031
Bit 1100000110010111
·
Error indication
After error correction, any code-word contain
ing more than 2-bit random errors or 4-bit
burst errors (option) in the address or mes
sage code-word may be indicated from the er
ror flag position.
·
Decoder and mC interface
The HT9580 has two mC interface available.
Bit 4Bit 5
DR_FG
(0006 H )
BF_FG
(0006 H )
Bit 7 Bit 6 Bit 5 Bit 4 B it 3 B it 2 B it 1 B it 0
BL ORRES ON
-
-
-
One is the pager control address (0019H),
which controls the operation and configura
tion of the decoder. The other is the pager
message buffer address (from 0040H to
006DH), which receives the message data of
calls in the parallel mode. The data ready
(DR_FG) and battery fail (BF_FG) interrupt
flags are in the interrupt flag register
(0006H).
0019 H
STB
-
Bit 0
C(NMI)
m
C PA7
m
(W ake up)
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
M essage Buffer
(46 B ytes)
PO C SA G Decoder
D ecoder D ata O utput
D ata R eady Interrupt
SPI REQ ST
1
Pager S ystem C LK
D ebounce
Circuit
VIL=0.9V
=1.0V
V
IH
DI
BAL
RF
BS1
CKT.
BS2
BS3
RSSI
B A F ( B a tte r y F a il In te r ru p t)
Note: The valueof 0019H-bit3 STB is set whendecoder enters the standby mode andcleared when de
coder enters the ON
The value of 0006H-bit4 BF_FG is dependent on the BAF
The value of 0019H-bit5 OR
The value of 0019H-bit6 BL
mode.
pin ststus.
is always changed by an out of range signal.
is cleared 0" by the decoder Battery low signal and set 1" when
the mC sets this bit high.
The value of 0006H-bit5 DR_FG is set 1" by the decoder Data-Ready interrupt signal and
cleared ²0² when the mC clears DR_FG.
35April 28, 2000
-
Preliminary
HT9580
The decoder control address (0019H) contains a
battery low flag (BL
decoder standby flag (STB), a decoder software
reset (RES
(ON
the interrupt flag register (0006H). It not only
records the status information but controls the
operation of the decoder.
If the flag status of the battery fail (BF_FG)
changes from ²0² to ²1², the following condi
tions occur.
¨
The pager controller generates an interrupt
if thevalue of the data ready interrupt is ²0².
¨
The pager controller does not generate any
interrupt and no data is transmitted to it if
the value of the data ready interrupt is ²1².
INT flag register (0006H)
SymbolBitR/WDescription
BF_FG4R
DR_FG5R/W
), and a decoder on/off control bit
). The data ready and battery fail flag are in
), an out of range flag (OR),
-
Battery fail indication bit
Once the decoder detects that the battery fail condition occurred,
the BF_FG will go high.
Data ready interrupt indication bit
When a valid call is detected, data transfers to the message
buffer. The DR_FG bit goes high when the message is terminated
within 46 bytes, one batch is at the end during the message receiving or the data buffer is full if the data length is more than 46
bytes. The mC software should read the data on the message
buffer within one POCSAG message codeword (32-bit) time. The
mC software has to clear the DR_FG bit low.
On the other hand, if the status of the battery
fail flag (BF_FG) changes from ²1² to ²0², the
internal node PA.7 of the pager controller will
supply a wake-up function. After the decoder
asserts the data ready request, the data ready
interrupt is generated and the DR_FG bit (bit
5 of 0006H) isset high; then the data ready in
terrupt subroutine runs to process the call
data on the message buffer and resets the
DR_FG bit low.
The functional bits (ON
bits ( STB, OR
all used to control the status of the decoder
which is operated through the pager control
address as described in the following table.
-
, RES) and indication
,BL, BF_FG and DR_FG) are
Decoder control register (0019H)
SymbolBitR/WDescription
On/Off control bit
or STANDBY state of the decoder
bit low and then high after the pager
ON
RES
0R/W
1R/W
This bit selects the ON
0: ON state
1: STANDBY RES
If SPI circuit is enabled, it would be better if this bit is set high to
reduce power consumption.
Resets the decoder core output
The mC has to set the RES
controller is turned on.
The reset status must be released before writing data to the de
coder configuration RAM.
36April 28, 2000
-
Preliminary
SymbolBitR/WDescription
Standby indication bit
STB3R
OR
BL
5R
6R/W
When the value of the ON
STANDBY state. The STANDBY state allows the mC to execute
the configuration RAM setting.
Out-of-range indication bit
Whenever the decoder detects an out-of-range hold time, that is
selected by the configuration registers SPF06 and SPF07. The
out-of-range indication may be tested for an out-of-range condi
tion whenever the interface enable of the decoder is active; other
wise OR
detection of valid data transmission.
If the out-of-range indication bit changes the status from high to
low or low to high, an interrupt will be generated and the
out-of-range hold-off time-out counter starts to count.
The bit is not valid when the SPI circuit is enabled.
Battery low indication bit
The battery low indication is periodically tested for a battery low
condition. If the decoder encounters a battery low condition, the
battery low indication bit is cleared low. The mC can only set the
BL
The bit is not valid when the SPI circuit is enabled.
is normally low. The out-of-range indication is set high by
bit high. Attempting to clear this bit has no effect.
bit is 1, the system goes into the
HT9580
-
-
·
User address format
A user address in the POCSAG code consists
of 21 bits. Three of the 21 bits are coded in the
frame number and are therefore not explicitly
transmitted. In the decoder, the addresses A,
B, C, D, E and F can use six different frames
respectively. Every address has to be explicitly enabled by resetting the associated enable bit.
Test mode
The test mode of the decoder is selected by set
ting the TS
mode, the RF control outputs BS1 and BS3 are
constantly set high, but BS2is set low. After the
TS
pin is set high the decoder exits the test
mode.
·
Message data transfer
The decoder outputs a deformatted address
word and message words upon receipt of a valid
call. The message data to be transferred is or
ganized into 8-bit words and transferred to the
message buffer address (0040H to 006DH). The
data ready interrupt flag will be set high when
000RIC A
001RIC B
010RIC C
011RIC D
100RIC E
101RIC F
11 0
11 1
pin low at any time. In the test
Bit1: bit20 of the address code-word
Bit2: If this bit is ²1², the address word is valid, oterwise the address word is not valid.
Bit3: 1 for a duplicate code-word
Bit7: 1 if an address code-word is received in the data fail mode
¾
¾
-
-
the received data (including address code
word and message codeword) length is ter
minated within 46 bytes, one batch is over
or if the 46 bytes data buffer is full if data
length is more than 46 bytes. If the data in
the message buffer is terminated, the
²MSG_END² (0031H) bit will set high.
The address word indicates call address,
functional bit setting, and decoder flags. The
message code-words are received and con
catenated to a valid call address word. The
message words are derived from un-cor
rected message code-words.
·
Interrupt indication
The HT9580 provides an internal data ready
interrupt and a battery fail interrupt. The internal data ready interrupt and battery fail
interrupt share the NMI location. Which interrupt occurred can be determined by checking the battery fail interrupt bit (BF_FG; bit 4
of 0006H) and the data ready interrupt bit
(DR_FG; bit 5 of 0006H). Both interrupt bits
are active high.
-
-
-
-
38April 28, 2000
Preliminary
·
Out-of-range indication
The out-of-range condition occurs when the
time interval defined by SPF06, SPF07 is un
able to receive sync code words. If sync code
words are detected, the timer counter defined
by SPF06, SPF07 will reset. This signal will
be seen as a loss of RF signal indication and
the power on reset is in an out-of-range condi
tion until the sync code word is detected.
·
Duplicate call suppression
The HT9580 provides a duplicate call sup
pression with time-out facility, to identify du
plicate call reception. In the display pager
mode, duplicate call indication is achieved
only via the mC interface. A call is assumed to
be a duplicate if its latest address and func
tion bit setting is equal to the previous re
ceived call within the time interval defined by
SPF06, SPF07.
·
Receiver, Quick charge and PLL signal control
Pager receiver, quick charge circuit, and RF
PLL circuit can be controlled independently
via enable outputs BS1, BS2, and BS3 respec
tively. Their operating period are optimized
according to the synchronization mode of the
decoder. Each enable signal has its own programmable establishment time.
HT9580
Receiver Establishment
Time T
512 bps1200/2400 bps SPF00 SPF01
BS1
7.81ms53.33ms00
15.63ms6.67ms01
-
31.25ms13.33ms10
62.50ms26.67ms11
-
-
Quick Charge
Adjustment Time T
BS2
512 bps1200/2400 bps SPF02 SPF03
7.81ms1.67ms00
-
-
15.63ms6.67ms01
15.63ms11.67ms10
19.53ms13.33ms11
PLL Establishment Time
T
BS3
-
512 bps1200/2400 bps SPF04 SPF05
0ms0ms00
31.25ms26.67ms01
46.87ms40.00ms10
62.50ms53.33ms11
Option
Option
Option
R.F. timing chart
Data In
BS1
BS2
BS3
Data Bits
T
BS1
T
BS2
T
BS3
39April 28, 2000
Preliminary
HT9580
Decoder configuration RAM
The decoder contains a 21-byte RAM to store six
user addresses, six frame numbers, and specially
programmed function bits (SPF00~SPF19) for
the decoder application configuration. The data
Address
001AHENA
001BHA07A08A09A10A11A12A13A14
001CHA15A16A17FA2FA1FA0XX
001DHENB
001EHB07B08B09B10B11B12B13B14
001FHB15B16B17FB2FB1FB0XX
0020HENC
0021HC07C08C09C10C11C12C13C14
0022HC15C16C17FC2FC1FC0XX
0023HEND
0024HD07D08D09D10D11D12D13D14
0025HD15D16D17FD2FD1FD0XX
0026HENE
0027HE07E08E09E10E11E12E13E14
0028HE15E16E17FE2FE1FE0XX
0029HENF
002AHF07F08F09F10F11F12F13F14
002BHF15F16F17FF2FF1FF0XX
002CHSPF00SPF01SPF02SPF03SPF04SPF05SPF06SPF07
002DHSPF08SPF09SPF10SPF11SPF12SPF13SPF14SPF15
002EHSPF16SPF17SPF18SPF19XXXX
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
A00A01A02A03A04A05A06
B00B01B02B03B04B05B06
C00C01C02C03C04C05C06
D00D01D02D03D04D05D06
E00E01E02E03E04E05E06
F00F01F02F03F04F05F06
memory is mapped to the address
001AH~002EH.
The configuration memory mapping table is
shown below.
Bit Definition
40April 28, 2000
Preliminary
HT9580
Description of the special programmed
function bits (SPFn)
The following featurescan be selected by appro
priate programming of the specially pro
grammed function bits:
·
SPF00~SPF01
Receiver (BS1) establishment time (for the
The HT9580 is a high performance pager con
troller specifically designed for use in new gen
eration radio pagers. It is based on the M6502
core. The 6502 Microprocessor offers complete
hardware and software capability with existing
6500 series of products aswell as significant en
hancements.
Instruction register and decoder
Instructions fetched from memory are gated
onto the internal bus. These instructions are
latched into the instruction register then de
coded, along with timing and interrupt signals,
to generate control signals for the various regis
ters.
Timing control unit
The timing control unit keeps track of the in
struction cycle being monitored. The unit is set
to 0 each time an instruction fetch is executed
and is advanced at the beginning of each input
clock pulse for as many cycles as required to
complete the instruction. Each data transfer
between registers depends upon decoding the
contents of both the Instruction Register and
the Timing Control Unit. There are three major
clocks in the mC as follows:
·
Phase 2 In (PHI2 (IN))
This signal is from the OSC1 input pin of
HT9580. The PHI1 (OUT) and PHI2 (OUT)
are derived from this signal.
·
Phase 2 Out (PHI2 (OUT))
This signal is generated from PHI2 (IN).
PHI2 (IN) provides the system timing. There
is a slight delay from PHI2 (IN).
·
Phase 1 Out (PHI1 (OUT))
Inverted PHI2 (OUT) signal. There is a slight
delay from PHIN2 (IN).
Read/write
This signal is normally in a high state indicat
ing that the mC is reading data from the data
bus memory. In the low state the data bus has
-
-
valid data from the mC to be stored at the ad
dressed memory location.
ParameterDescription
-
-
-
-
t
cyc
t
ad
t
ah
t
dis
t
dih
t
dod
t
doh
t
denbd
t
wed
t
syd
t
syh
t
vd
t
vh
t
sos
t
soh
t
rds
t
rdh
t
ress
t
resh
Clock cycle time (min)
Address delay time
Address hold time
Read data in setup time
Read data in hold time
Write data out delay time
Write data out hold time
DATAEN delay time
WE_N delay time
SYNC delay time
SYNC hold time
VPB delay time
VPB hold time
SOB_N setup time
SOB_N hold time
RDY setup time
RDY hold time
RES_N setup time
RES_N hold time
Timing parameter annotations
Arithmetic and logic unit
All arithmetic and logic operations take place
within the ALU including incrementing and
decrementing internal registers (except for the
program counter). The ALU has no internal
memory and is used only to perform logical and
-
transient numerical operations.
HT9580
-
42April 28, 2000
Preliminary
t
cyc
HT9580
CLK
ADD R
DATAI
DATAO
DATAEN
WE_N
SYNC,
VPB
RDY,
RES_N
SOB_N
t
ad
R D AddressW R Address
t
dis
READ
t
dih
t
, t
syd
vd
t
, t
syh
vh
t
, t
, t
rd s
re ss
sos
t
t
t
t
ah
dod
t
wed
rd h
denbd
, t
re sh
WRITE
t
, t
soh
doh
M6502 read and write cycle
Accumulator
The Accumulator is a general purpose 8-bit register which stores the results of most arithmetic and logic operations. In addition, the
accumulator usually contains one of the two
data words used in these operations.
Index register
There are two 8-bit Index Register (X and Y)
which may be used to count program steps or to
provide an index value to be used in generating
an effective address. When executing an in
struction which specifies indexed addressing,
the mC fetches the opcode and the base address,
and modifies the address by adding the index
register to it prior to performing the desired op
eration. Pre- or post-indexing of indirect ad
dresses is possible.
Processor status register
The 8-bit processor status register contains
seven status flags. Some of the flags are controlled by the program, others may be controlled both by the program and the mC. The
HT9580 instruction set contains a number of
conditional branch instructions which are de
signed to allow testing of these flags.
Program counter
The 16-bit program counter register provides
-
the addresses which step the mC through se
quential program instructions. Each time the
HT9580 fetches an instruction from the pro
gram memory, the lower byte of the program
-
counter (PCL) is placed on the low-order bits of
-
the address bus and the higher byte of the pro
gram counter (PCH) is placed on the high-order
43April 28, 2000
-
-
-
-
Preliminary
HT9580
8 bits. The counter is incremented each time an
instruction or data is fetched from the program
memory.
Stack pointer
The stack pointer is an 8-bit register which is
used to control the addressing of the vari
able-length stack. The stack pointer is auto
matically incremented and decremented under
control of the microprocessor to perform stack
manipulations under direction of either the
program or interrupt (NMI and IRQ). The stack
allows simple implementation of nested sub
routines and multiple level interrupts. The
stack pointer is initialized by the user¢s soft
ware.
70
70
70
158
PCH
15
0 0 0 0 0 0 0 1
70
70
Status register
NVEBD I ZC
Note: C: Carry1=true
Z: Zero 1=true
-
-
I: IRQ
D: Decimal mode 1=true
1=disable
B: BRK command 1=BRK, 0=IRQ
E: Expansion bit (reserved)
V: Overflow 1=true
-
N: Negative 1=negative
-
AA ccum u la tor A
YIndex R egister Y
XIndex R egister X
PC LP rogram C ounter PC
SS ta c k P o in te r
The w idth of the corresponding registers
44April 28, 2000
Preliminary
Interrupt System
The HT9580 is capable of directly addressing
64 Kbytes of memory. The address space has
special significance within certain addressing
modes, as follows:
Reset and interrupt vectors
The reset and interrupt vectors use the major
ity of the fixed addresses between FFFA and
FFFF.
Stack
The stack may use memory from 01D0 to 01FF.
The effective address of stack and stackrelative
addressing modes will always be within this
range.
Interrupt request - IRQ
This CMOS compatible signal requests that an
interrupt sequence begin within the mC. The
IRQ is sampled during PHI2 operation; if the
interrupt flag in the processor status register is
0, the current instruction is completed and the
interrupt sequence begins during PHI1. The
program counter and processor status register
are stored in the stack. The mC will then set the
interrupt mask flag high so that no further interrupts may occur. At the end of this cycle, the
PCL will be loaded from address FFFE, and
PCH from location FFFF, transferring program
control to the memory vector located at these
addresses. The IRQ signal going low causes 3
bytes of information to be pushed onto the stack
before jumping to the interrupt handler. The
first byte is the high byte in the program coun
ter. The second byte is the program counter low
byte. The third byte is the status register value.
These values are used to return the processor to
its original state prior to the IRQ interrupt.
Non-maskable interrupt - NMI
A negative-going edge on this input requests
that a non-maskable interrupt sequence be
generated within the mC. The NMI is sampled
during PHI2; the current instruction is com
pleted and the interrupt sequence begins dur
ing PHI1. The Program Counter is loaded with
the interrupt vector from locations FFFA (low
byte) and FFFB (high byte), thereby transfer
ring program control to the non-maskable in
terrupt routine. The NMI is generated from
data ready interrupt or battery fail interrupt
flag (0006H). However, it should be noted that
this is an edge-sensitive input. As a result, an
-
other interrupt will occur if there is another
negative-going transition and the program has
not returned. Also, no interrupt will occur if
NMI is low and a negative-going edge has not
occurred since the last non-maskable interrupt.
The NMI signal going low causes 3 bytes of in
formation to be pushed onto the stack before
jumping to the interrupt handler. The first byte
is the high byte in the program counter. The
second byte is the program counter low byte.
The third byte is the status register value.
These values are used to return to its original
state prior to NMI interrupt.
Data address space
The mC internal address bus consistsof A0~A15
forming a 16-bit address bus for memory and
I/O exchanges on the data bus. The output of
each address line is CMOS compatible. The Address output pins of HT9580 (A0~A15) derive
from mC internal address pins A0~A15. The extended address pins (RA14~RA18) are the combination of bank point registers (0015H,
0016H) and internal address. The extended address pins are used to access internal/external
SRAM or Mask ROM (Character ROM).
The data lines constitute 8-bit bidirectional
-
data bus for use during exchanges between the
mC and peripherals. The outputs are
three-state buffers capable of driving CMOS
load. The Program Address and Data Address
space is continuous throughout the 64 Kbyte
address space. Words, arrays, records, or any
data structures may span the 64 Kbytes ad
dress space. The following addressing mode de
scriptions provide additional detail as to how
effective addresses are calculated. Fifteen ad
-
dressing modes are available for the HT9580 as
-
illustrated on the next page.
HT9580
-
-
-
-
-
-
-
45April 28, 2000
Preliminary
HT9580
Addressing modes
The M6502 supports fifteen (15) addressing
modes, shown in table below. In interpreting
this table you should note that:
·
The byte following a 2 byte opcode = IAL (typ.)
·
The 2 bytes following a 3 byte opcode = BAL
and BAH (typ.)
·
Standard assembly notation is used
ModeDescription
IMP
ACC
IMM
ZPG
ZPX
ZPY
ABS
ABX
ABY
ABI
AIX
IND
IMPLIED: The data is implied in the opcode (example: CLC)
ACCUMULATOR: The accumulator is used as the source data. (data=AREG)
IMMEDIATE: The byte following the opcode is the data. (data=IAL)
ZERO PAGE: The first 256 RAM locations (0000H~00FFH) are used for fast access
and small code size. The upper 8-bit of the address are always zero. [data=(00, IAL)]
ZERO PAGE INDIRECT X: The X register is added to the byte following the opcode to
give a new zero page address. Note that the upper 8-bit of the address are always zero.
[data=(00, IAL+X)]
ZERO PAGE INDIRECT Y: The Y register is added to the byte following the opcode to
give a new zero page address. Note that the upper 8-bit of the address are always zero.
Only the LDX and the STX opcodes use this mode. [data=(00, IAL+Y)]
ABSOLUTE: The two bytes following the opcode give the absolute address of the data.
[data=(BAH, BAL)]
ABSOLUTE X: The X register is added to the two bytes following the opcode to produce
a new 16-bit address. {data=[(BAH, BAL)]+X}
ABSOLUTE Y: The Y register is added to the two bytes following the opcode to produce
a new 16-bit address. {data=[(BAH, BAL)]+Y}
ABSOLUTE INDIRECT: The two bytes following the opcode are used as a pointer to
memory. Only the JMP opcode uses this mode. [data=(BAH, BAL)]
INDEXED ABSOLUTE INDIRECT X: The two bytes following the opcode are added to
the X register to yield a new 16-bit address. The contents of this address and the fol
lowing one are used as an indirect address. Only the JMP opcode uses this mode.
{data=[(BAH, BAL+X+1), (BAH, BAL+X)]}
INDIRECT: The byte following the opcode is used as a pointer to the zero page. The
contents of this address and the following one are used as the address to finally access
the data. {data=[(IAL+1), (IAL)]}
·
·
A number in parenthesis indicates that the
contents of the location pointed to by the
number are to be used. For example (12H) in
dicates the contents of address 12H.
A comma in the addressis used to indicate the
high and low byte of an address. For example
(01H, AAH) indicates the contents of address
01AAH.
-
-
46April 28, 2000
Preliminary
ModeDescription
INDIRECT X: The byte following the opcode is added to the X register to produce a new
zero page address. The contents of this address and the following one are used as the
INX
INY
REL
address to finally access the data. Note that when the X register is added to the byte
following the opcode, the upper byte of the address is always zero. {data=[(00,
IAL+X+1), (00, IAL+X)]}
INDIRECT Y: The byte following the opcode is a zero page address. The contents of
this location and the next one produce a 16-bit address which is then added to the Y
register to finally obtain the data. {data=<[(00, IAL+1), (00, IAL)]+Y>}
RELATIVE: The byte following the opcode is added in 2's complement fashion to the
PC. The byte is sign extended. Used by branching instructions.
HT9580
47April 28, 2000
Preliminary
Application Circuits
OSC1, OSC2 require an external resistor
VDD (1 .5 V )
HT9580
LCD Display
Holtek
Pager
+
-
H T93LC 46
470mH
+
22mF
LCD Driver
EEPRO M
Schottky D iode
R H 5R 302
V
DD
VSS
SW 1
SW 2
SW 3
LX
CS
SK
DO
V
100k
0.1mF
DC/DC
VSS
MasterSlave
DI
DD
W
OUT
49
46
47
48
44
66
72
71
70
73
3V
+
22mF
1, 25, 56
LC D _E
D0~D7
LC D _R W
RESET
LC D _C S0 (M aster)
LC D _C S1 (Slave)
LC D _C L
LC D _A 0
PB4
PB1
PB2
PB3
PB0
PB5~PB7
PA3~PA5
TM R 1
TS
PA0
PA1
PA2
RESET
VDD
H T 9580
BS1
BS2
BS3
BAL
RSSI
BAF
BZ
DA_OUT
X2
X1
OSC1
OSC2
P_M OD E
D0~D7
A0~A15
PSEN
DI
1 .5 V
65
64
63
62
58
61
59
55
60
79
80
77
76
26
20
R eceiver
76.8kH z
V
DD
D0~D7
A0~A15
CE
OE
VDD
RF
VSS
510
W
0.1mF
Norm al Type
Rom less
H T27LC 512
Program R O M
1 .5 V
0.1mF
B uzze r
1k
W
Lam p
1 .5 V
680
Motor
53
PC0
54
PC1
1 .5 V
W
M
A0~A13
RA14~RA17
D0~D7D0~D7
MASK_CE
SRAM _CE
VSS
27, 57, 78
A0~A17
18
ROM CE
17
RAMCE
16
R/W
OE
WE
19
OE
Note: The external m em ory is optional
M askR A M
48April 28, 2000
Preliminary
HT9580
OSC1, OSC2 do not require a resistor. The OSC1 clock comes from an internal pad ²DF² only
VDD ( 1 .5 V )
Schottky Diode
H
470
LCD Display
Holtek
Pager
+
-
H T93LC 46
1k
W
Lam p
+
1 .5 V
m
22
F
m
R H 5R 302
LCD Driver
EEPRO M
VSS
SW 1
SW 2
SW 3
680
W
Motor
V
DD
LX
DC/DC
MasterSlave
CS
SK
DI
DO
V
DD
100k
0.1mF
M
VSS
1 .5 V
W
OUT
49
46
47
48
44
66
72
71
70
73
53
54
LC D _E
D0~D7
LC D _R W
RESET
LC D _C S0 (M aster)
LC D _C S1 (Slave)
LC D _C L
LC D _A 0
PB4
PB1
PB2
PB3
PB0
PB5~PB7
PA3~PA5
TM R 1
TS
PA0
PA1
PA2
RESET
PC0
PC1
+
22mF
3V
1, 25, 56
VDD
H T 9580
RA14~RA17
VSS
27, 57, 78
65
BS1
64
BS2
63
BS3
62
DI
58
BAL
61
RSSI
59
BAF
55
BZ
DA_OUT
P_M ODE
MASK_CE
SRAM _CE
60
79
X2
80
X1
DF 153.6kHz
OSC1
OSC2
26
D0~D7
A0~A15
20
PSEN
A0~A13
D0~D7D0~D7
18
17
16
R/W
19
OE
N o te : T h e e x te rn a l m e m o r y is o p tio n a l
R eceiver
76.8kH z
V
DD
D0~D7
A0~A15
CE
OE
A0~A17
ROM CE
RAMCE
WE
OE
1 .5 V
VDD
RF
VSS
510
W
0.1
F
m
Norm al Type
Rom less
H T27LC 512
Program R O M
M a skR A M
1 .5 V
0.1
B uzze r
F
m
49April 28, 2000
The SPI application circuits
VDD (1 .5 V )
Preliminary
HT9580
LC D D isplay
Holtek
Pager
+
-
H T93LC 46
470mH
+
22mF
LCD Driver
EEPRO M
Schottky Diode
R H 5R 302
V
DD
VSS
SW 1
SW 2
SW 3
LX
CS
SK
DO
V
100k
0.1mF
DC/DC
VSS
MasterSlave
DI
DD
W
OUT
49
46
47
48
44
66
72
71
70
73
3V
+
22mF
1 , 2 5 , 5 6
LC D _E
D0~D7
LC D _R W
RESET
LC D _C S0 (M aster)
LC D _C S1 (Slave)
LC D _C L
LC D _A 0
PB4
PB1
PB2
PB3
PB0
PB5~PB7
PA3~PA5
TM R 1
TS
PA0
PA1
PA2
RESET
VDD
H T 9580
SS
SCK
MOSI
MISO
SRDY
RSSI
BAF
BZ
DA_OUT
X2
X1
OSC1
OSC2
P_M ODE
D0~D7
A0~A15
PSEN
1 .5 V
1 .5 V
VDD
R eceiver
VSS
0.1mF
B uzze r
RF
65
64
63
62
58
61
59
55
60
79
76.8kH z
80
77
76
26
D0~D7
A0~A15
20
CE
OE
Flex
Decoder
510
W
0.1mF
V
DD
Norm al Type
Rom less
TM
H T27LC 512
Program R O M
1k
W
Lam p
1 .5 V
680
Motor
53
PC0
54
PC1
1 .5 V
W
M
A0~A13
R A 14~R A 17
D0~D7D0~D7
MASK_CE
SRAM _CE
VSS
27, 57, 78
A0~A17
18
ROM CE
17
RAMCE
16
R/W
OE
WE
19
OE
Note: The external m em ory is optional
M a skR A M
50April 28, 2000
Preliminary
HT9580
Detailed Instruction Operation
The table below provides a brief description of each opcode.
The first column lists the name or the assembler mnemonic for the instruction.
The second column lists the opcode in hexadecimal.
The third column lists the address mode for the instruction.
The flags column indicates which of the 8-bit of flags are updated by the instruction.
Legend:
-®No change
+
6
7
The number of bytes column gives the number of bytes for the opcode.
The number of cycles column gives the number of clock cycles for the opcode. (A+b indicates one addi
tional cycle when a branch is taken within the same page, or 2 cycles if the branch is to a different
page.)
The last column are the description or brief descriptions of the opcode.
The operator notation is as follows:
=>assignment
+
-2¢s complement subtract
|Bitwise OR
&Bitwise AND
^Bitwise exclusive OR
!
<<Left rotate
>>Right rotate
<Left shift
>Right shift
AAccumulator
CCarry flag
XX index register
YY index register
SStack pointer
MMemory
® Updated
® From memory bit 6
® From memory bit 7
2¢s complement add
Bitwise invert (one¢s complement)
-
51April 28, 2000
Preliminary
HT9580
NameOpcode
ADC69IMM ++----++ 22 A+M+C=>A, C Add with carry
ADC65ZPG ++----++23 A+M+C=>A, C Add with carry
ADC75ZPX ++----++ 24 A+M+C=>A, C Add with carry
ADC6DABS ++----++34 A+M+C=>A, C Add with carry
ADC7DABX ++----++34 A+M+C=>A, C Add with carry
ADC79ABY ++----++ 34 A+M+C=>A, C Add with carry
ADC72IND ++----++ 25 A+M+C=>A, C Add with carry
ADC61IDX ++----++ 26 A+M+C=>A, C Add with carry
ADC71IDY ++----++ 25 A+M+C=>A, C Add with carry
AND29IMM +-----+-22 A&M=>AAND A with M
AND25ZPG +-----+-23 A&M=>AAND A with M
AND35ZPX +-----+-24 A&M=>AAND A with M
AND2DABS +-----+-34 A&M=>AAND A with M
AND3DABX +-----+-34 A&M=>AAND A with M
AND39ABY +-----+-34 A&M=>AAND A with M
AND32IND +-----+-25 A&M=>AAND A with M
AND21IDX +-----+-26 A&M=>AAND A with M
AND31IDY +-----+-25 A&M=>AAND A with M
ASL0AACC +-----++ 12 A<1=>A shift left 1, C<-7, 0<-zero
ASL06ZPG +-----++25 M<1=>M shift left 1, C<-7, 0<-zero
ASL16ZPX +-----++ 26 M<1=>M shift left 1, C<-7, 0<-zero
ASL0EABS +-----++ 36 M<1=>M shift left 1, C<-7, 0<-zero
ASL1EABX +-----++37 M<1=>M shift left 1, C<-7, 0<-zero
LSR4AACC 0-----++12 M<=M>1 shift right 1, zero ->7, 0->C
LSR46ZPG 0-----++ 25 M<=M>1 shift right 1, zero ->7, 0->C
LSR56ZPX 0-----++26 M<=M>1 shift right 1, zero ->7, 0->C
LSR4EABS 0-----++36 M<=M>1 shift right 1, zero ->7, 0->C
LSR5EABX 0-----++ 37 M<=M>1 shift right 1, zero ->7, 0->C
NOPEAIMP --------12 Nooperation
ORA09IMM +-----+-22 A<=A|M
ORA05ZPG +-----+-23 A<=A|M
ORA15ZPX +-----+-24 A<=A|M
ORA0DABS +-----+-34 A<=A|M
ORA1DABX +-----+-34 A<=A|M
ORA19ABY +-----+-34 A<=A|M
ORA12IND +-----+-25 A<=A|M
ORA01INX +-----+-26 A<=A|M
ORA11INY +-----+-25 A<=A|M
PHA48IMP --------13 Push A on stack
PHP08IMP --------13 Push status on stack
PHXDAIMP --------13 Push X on stack
PHY5AIMP --------13 Push Y on stack
PLA68IMP +-----+-13 Pull A from stack
PLP28IMPFrom Stack13Pull status from stack
PLXFAIMP +-----+-13 Pull X from stack
PLY7AIMP +-----+-13 Pull Y from stack
RMB007ZPG--------24 M(0) <=0 (RMW)
RMB117ZPG--------24 M(1) <=0 (RMW)
Addr
Mode
NVEBD I Z C
Flags
No.
Bytes
No.
Cyc.
Description
55April 28, 2000
Preliminary
HT9580
NameOpcode
RMB227ZPG--------24 M(2) <=0 (RMW)
RMB337ZPG--------24 M(3) <=0 (RMW)
RMB447ZPG--------24 M(4) <=0 (RMW)
RMB557ZPG--------24 M(5) <=0 (RMW)
RMB667ZPG--------24 M(6) <=0 (RMW)
RMB777ZPG--------24 M(7) <=0 (RMW)
ROL2AACC +-----++ 12 M<=M<<1, rotate left 1, c<-7, 0<-C
ROL26ZPG +-----++25 M<=M<<1, rotate left 1, c<-7, 0<-C
ROL36ZPX +-----++ 26 M<=M<<1, rotate left 1, c<-7, 0<-C
ROL2EABS +-----++ 36 M<=M<<1, rotate left 1, c<-7, 0<-C
ROL3EABX +-----++37 M<=M<<1, rotate left 1, c<-7, 0<-C
ROR6AACC +-----++12 M<=M<<1, rotate right 1, c<-7, 0<-C
ROR66ZPG +-----++ 25 M<=M<<1, rotate right 1, c<-7, 0<-C
ROR76ZPX +-----++26 M<=M<<1, rotate right 1, c<-7, 0<-C
ROR6EABS +-----++ 36 M<=M<<1, rotate right 1, c<-7, 0<-C
ROR7EABX +-----++ 37 M<=M<<1, rotate right 1, c<-7, 0<-C
RTI40IMPFrom Stack15PC<=from stack, B=0
RTS60IMP --------15 PC<=from stack
SBCE9IMM ++----++22 A<=A-M-C (C is a borrow)
SBCE5ZPG ++----++ 23 A<=A-M-C (C is a borrow)
SBCF5ZPX ++----++ 24 A<=A-M-C (C is a borrow)
SBCEDABS ++----++ 34 A<=A-M-C (C is a borrow)
SBCFDABX ++----++ 34 A<=A-M-C (C is a borrow)
SBCF9ABY ++----++ 34 A<=A-M-C (C is a borrow)
SBCF2IND ++----++ 35 A<=A-M-C (C is a borrow)
SBCE1INX ++----++ 36 A<=A-M-C (C is a borrow)
SBCF1INY ++----++35 A<=A-M-C (C is a borrow)
SEC38IMP -------1 12 C<=1
SEDF8IMP- - - - 1 - - -12D<=1
SEI78IMP -----1--12 I<=1
SMB087ZPG--------24 M(0) <=1 (RMW)
SMB197ZPG--------24 M(1) <=1 (RMW)
SMB2A7ZPG--------24 M(2) <=1 (RMW)
SMB3B7ZPG--------24 M(3) <=1 (RMW)
SMB4C7ZPG--------24 M(4) <=1 (RMW)
SMB5D7ZPG--------24 M(5) <=1 (RMW)
Addr
Mode
NVEBD I Z C
Flags
No.
Bytes
No.
Cyc.
Description
56April 28, 2000
Preliminary
HT9580
NameOpcode
SMB6E7ZPG--------24 M(6) <=1 (RMW)
SMB7F7ZPG--------24 M(7) <=1 (RMW)
STA85ZPG --------23 M<=A
STA95ZPX --------24 M<=A
STA8DABS --------34 M<=A
STA9DABX --------34 M<=A
STA99ABY --------34 M<=A
STA81INX --------26 M<=A
STA91INY --------25 M<=A
STX86ZPG --------23 M<=X
STX96ZPY --------24 M<=X
STX8EABS --------34 M<=X
STY84ZPG --------23 M<=Y
STY94ZPX --------24 M<=Y
STY8CABS --------34 M<=Y
STZ64ZPG --------23 M<=0
STZ74ZPX --------24 M<=0
STZ9CABS --------34 M<=0
STZ9EABX --------35 M<=0
TAXAAIMP +-----+-12 X<=A
TAYA8IMP +-----+-12 Y<=A
TRB14ZPG ------+-25 M<=!A&M, Z=A&M
TRB1CABS ------+-36 M<=!A&M, Z=A&M
TSB04ZPG ------+-26 M<=A|M, Z=A&M
TSB0CABS ------+-37 M<=A|M, Z=A&M
TSXBAIMP +-----+-12 X<=S
TXA8AIMP +-----+-12 A<=X
TXS9AIMP --------12 S<=X
TYA98IMP +-----+-12 A<=Y
Addr
Mode
NVEBD I Z C
Flags
No.
Bytes
No.
Cyc.
Description
57April 28, 2000
Preliminary
Opcode Matrix
The table below shows the matrix of M6502 opcodes:
LSB
MSB
0123456789ABCDEF
BRK
imp
BPL
rel
JSR
abs
BMI
rel
RTI
imp
BVC
rel
RTS
imp
BVS
rel
BRA
rel
BCC
rel
LDY
imm
BCS
rel
CPY
imm
BNE
rel
CPX
imm
BEQ
rel
ORA
inx
ORA
iny
AND
inx
AND
iny
EOR
inx
EOR
iny
ADC
inx
ADC
iny
STA
inx
STA
iny
LDA
inx
LDA
iny
CMP
inx
CMP
iny
SBC
inx
SBC
iny
ORA
ind
AND
ind
EOR
ind
ADC
ind
STA
ind
LDX
imm
LDA
ind
CMP
ind
SBC
ind
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
TSB
zpg
TRB
zpg
BIT
zpg
BIT
zpx
STZ
zpg
STZ
zpx
STY
zpg
STY
zpx
LDY
zpg
LDY
zpx
CPY
zpg
CPX
zpg
ORA
zpg
ORA
zpx
AND
zpg
AND
zpx
EOR
zpg
EOR
zpx
ADC
zpg
ADC
zpx
STA
zpg
STA
zpx
LDA
zpg
LDA
zpx
CMP
zpg
CMP
zpx
SBC
zpg
SBC
zpx
ASL
zpg
ASL
zpx
ROL
zpg
ROL
zpx
LSR
zpg
LSR
zpx
ROR
zpg
ROR
zpx
STX
zpg
STX
zpy
LDX
zpg
LDX
zpy
DEC
zpg
DEC
zpx
INC
zpg
INC
zpx
RB0
zpg
RB1
zpg
RB2
zpg
RB3
zpg
RB4
zpg
RB5
zpg
RB6
zpg
RB7
zpg
SB0
zpg
SB1
zpg
SB2
zpg
SB3
zpg
SB4
zpg
SB5
zpg
SB6
zpg
SB7
zpg
PHP
imp
CLC
imp
PLP
imp
SEC
imp
PHA
imp
CLI
imp
PLA
imp
SEI
imp
DEY
imp
TYA
imp
TAY
imp
CLV
imp
INY
imp
CLD
imp
INX
imp
SED
imp
ORA
imm
ORA
aby
AND
imm
AND
aby
EOR
imm
EOR
aby
ADC
imm
ADC
aby
BIT
imm
STA
aby
LDA
imm
LDA
aby
CMP
imm
CMP
aby
SBC
imm
SBC
aby
ASL
acc
INC
acc
ROL
acc
DEC
acc
LSR
acc
PHY
imp
ROR
acc
PLY
imp
TXA
imp
TXS
imp
TAX
imp
TSX
imp
DEX
imp
PHX
imp
NOP
imp
PLX
imp
TSB
abs
TRB
abs
BIT
abs
BIT
abx
JMP
abs
JMP
abi
JMP
aix
STY
abs
STZ
abs
LDY
abs
LDY
abx
CPY
abs
CPX
abs
ORA
abs
ORA
abx
AND
abs
AND
abx
EOR
abs
EOR
abx
ADC
abs
ADC
abx
STA
abs
STA
abx
LDA
abs
LDA
abx
CMP
abs
CMP
abx
SBC
abs
SBC
abx
HT9580
ASL
BR0
abs
zpg
ASL
BR1
abx
zpg
ROL
BR2
abs
zpg
ROL
BR3
abx
zpg
LSR
BR4
abs
zpg
LSR
BR5
abx
zpg
ROR
BR6
abs
zpg
ROR
BR7
abx
zpg
STX
BS0
abs
zpg
STZ
BS1
abx
zpg
LDX
BS2
abs
zpg
LDX
BS3
aby
zpg
DEC
BS4
abs
zpg
DEC
BS5
abx
zpg
INC
BS6
abs
zpg
INC
BS7
abx
zpg
58April 28, 2000
Preliminary
HT9580
Application Note
The LCD_CTRL and LCD_CMD registers are used to control the LCD Drivers. The following exam
ple shows how to initiate the ²MC141803² LCD driver.
The following bit settings are used for the LCD_CTRL register.
; ************
; * LCD CONTROL *
; ************
chip1SET 7
chip0SET 6; select SED15X (KSX)/MC141X series LCD driver 0:SED, 1:MC
clkSET5; LCD clock output selection
cmodSET4; enable/disable LCD_CL
cs1SET3; control master LCD driver chip select
cs0SET2; control slave LCD driver chip select
a0SET1; Data/Command select 1:display data on D0~D7
rwSET0; LCD Read/Write input 0:WRITE 1:READ
LCDCTEQU 17h; LCD Control register
LCDCM EQU 18h; LCD Command register
; select HD66410 series LCD driver 1:HD; chip0 don¢t care
; Just for MC141X series
;Data/Command select 0:display control data on D0~D7
-
The following three macros define three different modes including ²LCD COMMAND WRITE²,
²LCD DATA WRITE² and ²LCD DATA READ² modes.
; ***************************
; LCDM COMMAND MODE
; LCD_A0=0 command mode
; LCD_WRB=0 write mode
; COMMAND store to ACC
; ***************************
LCD_CMACRO
RMBa0, LCDCT
RMBrw, LCDCT
STALCDCM
SMBrw, LCDCT
ENDM
59April 28, 2000
; ***************************
; LCDM WRITE MODE
; LCD_A0=1 data mode
; LCD_WRB=0 write mode
; DATA store to ACC
; ***************************
LCD_WMACRO
SMBa0, LCDCT
RMBrw, LCDCT
STALCDCM
RMBa0, LCDCT
SMBrw, LCDCT
ENDM
; ***************************
; LCDM READ MODE
; LCD_A0=1 data mode
: LCD_WRB=1 read mode
; DATA store to ACC
; ***************************
LCD_RMACRO
SMBa0, LCDCT
SMBrw, LCDCT
LDALCDCM
RMBa0, LCDCT
ENDM
Preliminary
HT9580
60April 28, 2000
Preliminary
The following subroutine will initiate the ²MC141803² LCD driver.
; ***************************
; * initial LCDM *
; ***************************
INI_LCDM:
LDA #01011001B; MC141X series LCD driver
STALCDCT; enable LCD_CL, LCD_CL=32kHz
; LCD_CS0 (master) enable
LDA #76H; normal operation
LCD_C
LDA #7BH; set external clock
LCD_C; feed clock in OSC2 from LCD_CL
LDA #7FH; set oscillator enable
LCD_C
LDA #2BH; set DC/DC converter on
LCD_C
LDA #2DH; set internal regulator on
LCD_C
LDA #31H; set internal contrast control on
LCD_C
LDA #2FH; set internal voltage divider on
LCD_C
LDA #33H; set 50kHz to get frame frequency
LCD_C
LDA #29H; set display on
LCD_C
LDA #36H; master clear GDDRAM
LCD_C
LDA #0H; dummy write data
LCD_W
LDA #04H; change to page 5 if want to clear icon line
LCD_C
LDA #37H; master clear icons
LCD_C
LDA #0H; dummy write data
LCD_W
LDA #3DH; set display with icon line
HT9580
61April 28, 2000
Preliminary
LCD_C
LDA #0; set page 0
LCD_C
LDA #23H; set col0 to seg119
LCD_C
LDA #83H; set GDDRAM column address 3
LCD_C
RTS
HT9580
62April 28, 2000
Preliminary
HT9580
Holtek Semiconductor Inc. (Headquarters)
No.3 Creation Rd. II, Science-based Industrial Park, Hsinchu, Taiwan, R.O.C.
Tel: 886-3-563-1999
Fax: 886-3-563-1189
Holtek Semiconductor Inc. (Taipei Office)
5F, No.576, Sec.7 Chung Hsiao E. Rd., Taipei, Taiwan, R.O.C.
Tel: 886-2-2782-9635
Fax: 886-2-2782-9636
Fax: 886-2-2782-7128 (International sales hotline)
Holtek Semiconductor (Hong Kong) Ltd.
RM.711, Tower 2, Cheung Sha Wan Plaza, 833 Cheung Sha Wan Rd., Kowloon, Hong Kong
Tel: 852-2-745-8288
Fax: 852-2-742-8657
Copyright ã 2000 by HOLTEK SEMICONDUCTOR INC.
The information appearing in this Data Sheet is believed to be accurate at the time of publication. However, Holtek
assumes noresponsibility arising from the use of the specifications described. The applications mentioned herein are
used solely for the purpose of illustration and Holtek makes no warranty or representation that such applications
will be suitable without further modification, nor recommends the use of its products for application that may pres
ent a risk to human life due to malfunction or otherwise. Holtek reserves the right to alter its products without prior
notification. For the most up-to-date information, please visit our web site at http://www.holtek.com.tw.
63April 28, 2000
-
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.