SAB 80515/535 Timer 2 & A/D Guide
SAB 80515/535 Timer 2 & A/D Guide
Timer 2
PD2435
The SAB 80515 has three 16-bit Timer/Counters: Timer 0, Timer 1
and Timer 2. These Timers can be configured to operate either as The PD2435 is a CMOS 4-character 5x7 dot matrix alpha-
numeric programmable display with ROM to decode 128
Figure 2. Functional diagram of Timer 2 in reload mode ASCII alphanumeric characters and enough RAM to store
the display’s complete four digit ASCII message with soft-
ware programmable attributes. The CMOS IC incorporates
Input special interface control circuitry to allow the user to
clock TL2 TH2
control the module as a fully supported microprocessor
peripheral.
T2EX
P 1.5
Microprocessor Interface
The interface to the microprocessor is through the address
lines (A0-A2), the data bus (D0-D7), two chip select lines
Mode 1
(CE0, CE1), and (RD) and (WR) lines. The CE0 should be
Mode 0 Reload
held low and CE1 held high when executing a read or write
to a specific PD243X device. The read and write lines
CRCL CRCH TF 2 are both active low. A valid write will enable the data as
Low Byte High Byte
input lines.
Compare/Reload/Capture Register ≥1
Programming the PD2435
EXF 2 Timer 2
Interrupt There are five registers within the PD2435. Four of the reg-
Request isters are used to hold the ASCII code of the four display
EXEN 2
characters. The fifth register is the Control Word, which is
used to blink, blank, clear or dim the entire display to
change the presentation (attributes) of individual
characters.
14 Firmware Description
8 DISPLAY 128 CHAR.
MEMORY
CTL
ROM
Besides controlling speed of the moving message, there is a
REG
D0 – D7
(RAM)
1x8 8 48 x 80 provision to interrupt the moving message and roll it backwards
4x8
to the beginning of the message. The microcontroller reads the
4
code and the message to display from an EPROM 2716A inter-
15 faced to the ports P0 and P2 of the SAB 80535. A virtual image
1
7 OUTPUT
DECODE
CONTROL
of the message is created in the internal RAM of the SAB
&
CE0, CE1 MIX LOGIC 80535. Four display chips PD2435 are interfaced to the SAB
OUTPUT
A0 – A2 LATCH 80535 in a memory-mapped scheme and can be addressed as
RD, WR 5 1 external memory to the SAB 80535. The virtual image of the
20 message in internal RAM of the SAB 80535 is used to manipu-
late data to be displayed on the display chips. The internal RAM
used for the display can be viewed as an area divided into two
3 OSC
DISPLAY COLUMN
3 MULTI- DRIVERS portions:
LOGIC
CLK SEL PLEXER
1. For active display
XCK 3
RST 2. As a data buffer
The active display area is the replica of the data being displayed
20
ROW on the display chips. In this case the 16-digit display would need
DRIVERS
16 RAM locations which correspond to 16 digits currently being
7
displayed. The data buffer contains the rest of the message
DISPLAY
which is not being displayed. The message is shifted character
by character in the RAM area. When the message on the dis-
play moves from right to left, the RAM buffer acts in “First In
Application First Out” mode, and when the message on the display moves
The speed regulated moving message display is an example from left to right, the data to the display from the microcontrol-
where a digitized value of the controlling analog signal is used ler RAM buffer is supplied in the “Last In First Out” scheme.
to compute a reload value for the Timer 2. The Timer 2 is oper- Between display of every character there is a software delay
ated in mode 0 where this reload value becomes a starting which depends upon the level of the analog signal supplied to
point for the Timer to count up. On overflow the Timer automat- the ANO pin of the SAB 80535. The external interrupt 0 (at port
ically takes the restart value for counting from reload register P3.2) is used to interrupt the microcontroller to inform it that
CRC. While the Timer is counting up, a new reload value is the message needs to be scrolled backwards. On getting this
computed using the present A/D value. interrupt the software sets the flag bit 0 which remains set until
the message is scrolled back to the beginning of the message.
Hardware
The circuit used in this application has the advantage of requir- List of Components
ing a minimum of components. The single chip microcomputer Name Number
SAB 80535 operates in conjunction with four alphanumeric
programmable display chips PD 2435 to form a 16-digit long SAB 80535 1
display.
271 6A 1
The ASCll-coded data is transferred from the SAB 80535 to the
display ICs via the data port P0 and using the control signal WR PD2435 4
(P3.6) of the SAB 80535. The address pins from the ports P0 12 MHz Crystal 1
and P2 of the SAB 80535 are used to address the EPROM as
well as the display chips in a memory-mapped l/O scheme. The 74LS373 1
display chips are addressed as memory locations with the fol- 22 pF Capacitors 2
lowing addresses.
100 nF Capacitor 1
12 D7 VCC
13 D6
27 14 D5 RD 1
1K 15 D4 CLKSEL 3
P3.6 10 16 20
RESET VCC D3
+ 17 D2 PD2435
4.7 µF 18 D1 DISPLAY
24 19 D0
6 10
P2.2 43 19 A10
5
CEO GND
P2.1 42 22 A9
7
CE1
11
P2.0 41 23 A8
8
A2 WR
VCC A1 P3.6
9 A0
2716A
20 10 1
ALE 50 11 74LS373 PROM 12 D7 VCC
51 18 D7 Q7 19 A7 13
EA 17 16 14 D6
D6 Q6 A6 D5 RD 1
14 D5 Q5 15 A5 15 3
W1 D4 CLKSEL
VAREF 11 13 D4 Q4 12 A4 16 D3 20
W2 8 9 17
VAGND 12 7 D3 Q3 6
A3
18 D2 PD2435
D2 Q2 A2 D1 DISPLAY
C1 4 D1 Q1 5 A1 19
VBB 37 3 2 D0
80515/ D0 Q0 A0 6 CEO GND 10
100nF 5 CE1
80535 P0.7 59 17 D7 7 A2 11
58 16 8 WR
P0.6 D6 A1 P3.6
µC P0.5 57
56
15
14
D5 9 A0
P0.4 55 D4
P0.3 13 D3 12
54 11 D7 VCC
P0.2 D2 13
53 10 14 D6 1
P0.1 52 D1 D5 RD
P0.0 9 D0 15 3
D4 CLKSEL 20
16
20 OE D3
PSEN 49 17
D2 PD2435
GND 38 C2 18
D1 DISPLAY
39 22 PF GND CE 19
6 D0 10
12 18 CEO GND
12 MHz C1 5
40 22 PF 7 CE1 11
A2 WR
VCC 8 A1 P3.6
P2.4 P2.6 68 9 A0
P2.3 P2.5 P2.7
12 VCC
44 45 46 47 48 13 D7
14 D6 1
D5 RD 3
15 CLKSEL
16 D4 20
17 D3
18 D2 PD2435
19 D1 DISPLAY
6 D0 10
CEO GND
5
7 CE1 11
A2 WR
8 A1 P3.6
9 A0
Shift character
YES in RAM buffer
from bottom
to top up.
Start address of
message in
Read next Transfer Shift character Wait loop from
DPTR. Character interrupt
START character of character to character = 0? to display from the current
count in R5. flag set?
the message. the top of NO RAM buffer. value of the
Start address NO
RAM buffer. A/D converter.
of RAM buffer
in R0.
YES