Real Time Clock Display.

SUPERVISOR APPROVER

"I I We admit that to have read this report and it has follow the scope
and quality in Partial Fulfillment Of Requirements For The Degree Of
Bachelor of Electronic Engineering (Industrial Electronic)"

Signature

Supervisor Name

Mr. Sani Irwan Bin Md Salim

Date

18 March 2005

© Universiti Teknikal Malaysia Melaka

REAL TIME CLOCK DISPLAY (PART 1)

HAHEI KUAI


This Report is submitted in Partial Fulfillment of Requirements for the Bachelor
Degree of Electronic Engineering (Industrial Electronic)

Faculty of Electronic Engineering & Computer Engineering
Kolej Universiti Teknikal Kebangsaan Malaysia

18 March 2005

© Universiti Teknikal Malaysia Melaka

Ill

ACKNOWLEDGMENT

I treat as valid this report is doing by myself except summary and quotation
in every part that I had clear source.

I would like to express our greatest gratitude and sincere thanks to my
supervisor, Mr. Sani lrwan Bin Md. Salim, for his valuable advice and assistance in

the supervision and consultation of this Final Year Project. In fact, he gave me
guidance when obstacles arise throughout this period of time. Once again, I thank

him for his tolerance and endeavors.

Thanks to Miss Toh Yen Yin, Mr. Hafizul, Mr. Lo Jin Kui and Miss Tan Lee
Chin who had help me a lot of my project in progress.

Signature

Writer Name

Ha Hei Kuai

Date

18 March 2005

© Universiti Teknikal Malaysia Melaka


IV

DECLARATION

This Final Year Project contains information pertaining of Real Time Clock
Display using LED Dot Matrix. This project comes under the subject BEKU4983
Project offered by Faculty of Electronic Engineering & Computer Engineering,
KUTKM. This documentation report aims to provide the reader about the overall
information techniques about this project. The focus of the project is on accuracy the
real time clock display in LED dot matrix.

I admired that this is an original my own work with the exception which I

.

have referenced them to explained sources.

© Universiti Teknikal Malaysia Melaka

v


ABSTRACT

Predominantly, the title of this project is Real Time Clock Display (Part I)
for design circuit and troubleshooting. The project is about the design of a Real Time
Clock I Timer circuit using microcontroller that would accept inputs from switches,
set and display the current time, set multiple timers to activate a particular device
connected to the circuit. This Application Note explains how to control the display of
characters on a 5x7 LED matrix display using the microcontroller PIC16F877 MCU.
A ten-unit 5x7 matrix display (350 LEDs) is controlled by microcontroller
PIC16F877 (40 pins).

The clock operates in either the 24-hour or 12-hour format with AM/PM
indicator. The RTC provided in this Application Note facilitate easy implementation
for displaying clock on a 5x7 LED matrix. It has a display which is 50 columns wide,
enabling 10 characters to be shown at any one time.

The characters in each message are stored in an EEPROM with one byte
corresponding to one column of dots. Storing the characters in this way rather than as
their ASCII codes has the advantage that, apart from being simpler to decode with

the electronics, any character or graphic needed can be easily formed. The circuit
runs from a 5V DC regulated supply and consumes around 300mA peak when at
LEDs are lit. The display clock is more accurate with using real-time clock, RTC and
control by PIC16F8 77.

© Universiti Teknikal Malaysia Melaka

Vl

ABSTRAK

Secara keseluruhannya, tajuk projek ini ialah Paparan Jam Dengan Masa
Yang Tepat (Bahagian I) untuk rekabentuk litar dan penyelesaian masalah. Projek ini
adalah berkenaan dengan rekabentuk jam dengan masa yang tepat / litar pengawasan
masa menggunakan mikro-pengawal yang boleh menerima input-input dar;pada
pembuka, set dan menunjukkan masa yang terkini, merangka pelbagai penetapan
masa untuk mengaktifkan pelan tertentu yang disambung kepada litar. Nota aplikasi
ini menerangkan cara untuk mengawal paparan aksara atas matriks LED 5x7 yang
ditunjukkan dengan


ュゥォイッMーセョァ。キャ@

PIC16F877 MCU. Sepuluh unit paparan

matriks 5x7 (350 LEDs) dikawal oleh mikro-pengawal PIC16F877 (40 pin).

Format jam ini beroperasi sama ada secara 24-jam atau 12-jam dengan
penunjuk AM/PM. RTC yang dibekalkan dalam nota aplikasi ini memudahkan
pelaksanaan untuk memaparkan jam atas matriks 5x7 LED. Ia mempunyai paparan
seluas 50 ruang , ini supaya membenarkan 10 aksara untuk dipaparkan pada suaru
masa.

Aksara dalam setiap mesej yang disimpan dalam satu EEPROM dengan satu
bit bertindak ke satu ruang titik. Penyimpanan aksara dengan cara ini kalau
dibandingkan dengan kod-kod ASCII mempunyai kelebihannya, selain daripada
mudah untuk dekod dengan elektronik, sebarang aksara atau grafik yang diperlukan
boleh dibentuk dengan mudah. Litar ini berfungsi daripada SV DC yang ditawarkan
dan menggunakan lebih kurang 300mA untuk mencapai puncaknya apabila LED
memanca.l. Jam paparan mi menjadi lebih tepat dengan meggunakan jam masa yang
sebenamya, RTC dan dikawal oleh PIC16F877.


© Universiti Teknikal Malaysia Melaka

V ll

TABLE O F CONTENT

CHAPTER

DESCRIPTION

PROJECT TITLE .................................................................................... .
SUPERVISOR APPROVER ....................................................................
ACKN'OWLEDGl\ilENT ...........................................................................
DECLARATION .......................................................................................
ABSTRACT ...............................................................................................
ABSTRAK .................................................................................................
TABLE OF CONTENT ............................................................................
LIST OFT ABLE ......................................................................................
LIST OF FIGU'RE ....................................................................................

LIST OF ABBREVIATION·.....................................................................
LIST OF APPENDIX ................................................................................

PAGE

ii
iii
iv
v
vi
vii
x
xi
xii
xiv

1

INTRODUCTION .......................................................................... 1
1.1

OBJECTIVES ................ ..................... ....................... ............. 2
1.2
PROJECT SPECIFICATION ....... ......................... ................ .. 3
1.3
REPORT ORGANIZATION ................................................... 3

2

LITERATURE REVIEW .............................................................. 5
2.1
PREVIOUS STUDIES & RESEARCH .................................. 5
2.2
RECENT RELEVANT PROJECT ...... ............ ........................ 6
2.2. 1 PCF8583 Real Time Clock.. ........................ .... .................... 6
2.2.2 ECPE-5 PIC Project Board ........................... ...... ............... 7
2.2.3 ZX81 Real Time Clock Project ........................................ .. . 9
2.2.4 PIC Project -Turn ON A LED... ........................................ 10

3


PROJECT l\llETHODOLOGY .....................................................
3 .1
PROCEDURES ....... ..... ....... ....................................................
3.2
3 .3
3.4
3
3.5

-1

14
14
METHODS ............................ .................................................... 15
THE PROCESS FLOW CHART ............................................ 15
THE BLOCK DIAGRAM OF PROJECT............................... 17
1 Operation of the Block Diagram ofProject ........ .... ...... .. .. .. 17
5X7 LED UOT MATRIX DISPLAY WIRING
SPECIFICATION .......... ..... ............................. ........................ 19


© Universiti Teknikal Malaysia Melaka

Vll l

4

COMPONENT DESCRIPTION ................................................... 20
4.1
4.2
4.3

MICROCONTROLLER .............. ...........................................
WHY USE A MlCROCONTROLLER? ............ .....................
DEVELOPMENT SYSTEM .. .................................................

4.3.1
4.3.2
4.3.3
4.3.4
4.3.5
4.4

PIC16F877 Programmer Hardware Features....................
PIC16F877 Programmer Software Features......................
Data and Pin Diagram ofPJC16F877 ................................
Memory Organization....................... .. ...................... ..........
Program Memory Organiza tion .... ................ ......................

22
22
23
24
24

REAL TIME CHIP, RTC ...... .. .... .... ............................ .............

25

Component Characteristics........................... .....................
Pin Assignment....................................................................
SDA - Serial Data ................................. ..............................
SCL - Serial Clock..............................................................
Operation .................................................. .... ..... ........ ........ .
Data Transfer ........................................ ........... .... ...... ....... ..
Control Register.............. ...................................... ..............
The RTC and RAM Registers............ ..................................

26
27
27
27
28
29
30
30

THE EEPROM .................... ........................ ..... .......................

31

Serial Data (SDA) .. .. .. .. .. .. .. ... .. .. .. .. .. ... ... .. ... .. .. .. .. .. .. .. .. .. .. .. .. .
Serial Clock (SCL) ..............................................................
Function Description .......... ...... .. ........................................
EEPROM Libr.ary ...............................................................
Flash Memory Library .. ................. .............. .......................

32
32
32
33
33

4.4.1
4.4.2
4.4.3
4.4.4
4.4.5
4.4.6
4.4. 7
4.4.8
4.5

4.5.1
4.5. 2
4.5.3
4.5.4
4.5. 5
5

CIRCUIT DESCRIPTION ............................................................ 35
5.1

RTC DISPLAY CIRCUIT DESCRIPTION .......... ..................

35

RTC, EEPROM, Crystal, and Switch Circuit......................
I2C Library.........................................................................
Display Clock In 5x7 LED Dot Matrix...............................
Counter Circuit .. .. .. .. .. .. ... .. .. .. ... .. .. .... .. .. .. .. .. .. .. .. .. .. .. ... .. .. .. .. ..
Ti.ming Diagram of Counter.............................. .......... ........

35
37
38
39
43

TIME & DATE MODE.................. .........................................
TIME CLOCK SETTING.......................................................

44
44

5.1.1
5.1.2
5. 1.3
5. 1.4
5.1.5
5.2
5.3

6

20
21
21

OUTPUT RESULT ......................................................................... 45
6.1
6.2
6.3
6.4

SYNCHRONIZED CLOCK .... ..................... ................ ..........
INITIALIZATIONS ............ .... ........................ ........................
TRANSISTOR DRIVERS .. ....................................................
THE LED 5x7 DOT MATRIX DISPLAY..............................

45
46
46
47

6.4.1 LEDResistors .....................................................................
6.4.2 LED Matrix Construction........................................ ...........
6.4.3 Interfacing the LED Matrix to MCU Hardware ...... ... ...... ..

47
48
49

OUTPUT OF SCANNING................................................. ....

51

6.5

© Universiti Teknikal Malaysia Melaka

tX

7

DISCUSSION & CONCLUSION .................................................
7.1
PROBLEM ANALYSIS / TROUBLESHOOTING. ...............
7.2
REAL-TIME VS VIRTUAL TIME........................................
7.3
FUTURE IMPROVEMENT...................................................
7.4
CONCLUSION .......................................................................

52
52
53
54
55

REFERENCES.......................................................................................... 57
APPENDIX ................................................................................................ 58

© Universiti Teknikal Malaysia Melaka

x

LIST OF TABLE

NO

TITLE

4.1
6.1
7 .1

Data Of Microcontroller PIC l 6F877 ...............................................
Data in Dot Matrix .. .... ..... ..... ... .. ... .... ..... .................. ... ..... ........ .. .. ....
Real-Time VS Virtual Time ........... ........... ............................. ..........

© Universiti Teknikal Malaysia Melaka

PAGE

23
51
53

XI

LIST OF FIGURE

NO

TITLE

2.1
2.2
3 .1
3.2
3.3
3.4

Display Output Of The PCF8583 Real Time Clock ................ ........ .
LED Display Circuit ....................................... ............ ............. .........
The Process Flow Chart ..... ... .... ... .... ... ... .. ... ....... ..... .... .. .. ... ... ...... .. ...
The Block Diagram Of Project.........................................................
ELM-2004EWA5x7 LED Dot Matrix Display........ ........................
ELM-2004EWA 5x7 LED Dot Matrix Display Wiring
Specification ................ ............. ... ........................................ .... .........
40 Pin PDIP ......................................................................................
PIC16F877A Program Memory Map and Stack..............................
Real-Time Clock Pin·Assignment ....................................................
Block Diagram of Real-Time Clock.... .............................................
The RTC and RAM registers .............. ............................ ..................
RTC, EEPROM, Crystal And Switch Circuit ...................................
Interface 24LC256 to PIC ........................ ........................................
Display Clock In 5x7 LED Dot Matrix ....... .......... ........ ...................
Counter Circuit ........................ ............. ............................................
Counter ... ..........................................................................................
One Dot Matrix Circuit by Using Proteus ........................................
Counter 401 7 ....................................................................................
Timing Diagram Of Counter ................................. ......... ...... ............
Display In Dot Matrix ......................................................................
Transistor Driver..............................................................................
LED Matrix with Common Anode Arrangement .................. ....... ...
Illustration of the Characters A and B ................... ............ ...............
Output of Scanning From Left to the Right .....................................

4.1
4.2
4.3
4.4
4.5
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
6.1
6.2
6.3
6.4
6.5

© Universiti Teknikal Malaysia Melaka

PAGE

7
12
16
17
19
19
23
25
27
28
31
35
37
38
39
39
40
42
43
45
46
50
50
51

XII

LIST OF ABBREVIATION

PCB

-

Printed Circuit Board

LED

-

Light Emitting Diode

MCU

-

Microcontroller Unit

PIC

Peripheral Interface Controller
Programmable Integrated Circuit

EEPROM

-

Electrically Erasable Programmable Read Only Memory

RTC

-

Real Time Clock

IC

-

iョエセァイ。・、@

PICC

-

Peripheral Interface Controller Card

BCD

-

Binary-Coded Decimal

DAC

-

Digital To Analog Converter

ADC

-

Analog To Digital Converter

UART

-

Universal Asynchronous Receiver-Transmitter

CPU

-

Central Processing Unit

ROM

-

Read-Only Memory

I/O

-

Input I Output

SPI

-

Serial Peripheral Interface

RISC

-

Reduced Instruction Set Code

Hz

-

Hertz

MHz

-

MegaHertz

DC

-

Direct Current

RAM

-

Random-Access Memory

pv,, 1\11

-

Pulse Width Modulation

SSP

-

Synchronous Serial Port

12C

-

Inter-Integrated Circuit

Circuit

© Universiti Teknikal Malaysia Melaka

Xl ll

Universal Synchronous I Asynchronous

USART

Receiver I Transmitter
SCI

-

Serial Communications Interface

PSP

-

Parallel Slave Port

RD

-

Read

WR

-

Write

cs

-

Case Series

BOR

-

Brown-out Reset

SRAM

-

Static Random Access Memory

HC

-

High Capacity
Complementary Metal-Oxide Semiconductor

CMOS

(transistor type)
PLL

-

Phase-Locked Loop

TTL

-

Transistor-Transistor Logic

VDC

-

Volts Direct Current

DIP

-

Du!il lnline Package

WWVB

NIST longwave (60 Kilohertz) Standard Time Signal
(Radio station callsign)

ASCII

-

American Standard Code for Information Interchange

SCL

-

Serial Clock

SDA

-

Serial Data

GPIO

-

General Purpose Input/Output

LCD

-

Liquid Crystal Display (display technology)

IEEE

-

Institute of Electrical & Electronics Engineers

© Universiti Teknikal Malaysia Melaka

Xi V

LIST OF APPENDIX

NO

TITLE

A
B
C
D

CIRCUIT DIAGRAM......................................................................
PRODUCT ....................... ............ ......................... ...........................
DATASHEET PIC16F877 ................................................................
DATASHEET RTC1307 ......... ............................................... ...........

© Universiti Teknikal Malaysia Melaka

PAGE
58
60
62
75

CHAPTER 1

INTRODUCTION

This project is a real .time clock display on ten 5x7 LED dot matrix. It has
the PIC16F877 MCU interfacing with the Dallas DS1307, a time keeping chip. This
project only designs circuit and troubleshooting. The character is generated with a
PIC chip EEPROM. This project has adapting RTC chip into PIC circuit to generate
the input for display. This real time clock is build using PIC16F877 MCU for control
and display and RTC for clock. The output device is shown in LED dot matrix
display that can be used efficiently to accommodate the functionality of PIC.

The DS 1307 chip stores the current date and time in registers of seconds,
minutes, and hours, days, months and years. The interface allows the l 6F877 to read
the time keeping registers, as well as writing to any of them for changing the time.
The time will be displayed on a dot matrix displays.

Th · ..:leek can ·.··.: set to correct time using the switches and buttons. The
hardware is just a collection displays and components to input and output results into
and out of software to and from the real world.

© Universiti Teknikal Malaysia Melaka

2
In real time clock, the accuracy of the clock is dependent upon the accuracy
of the crystal and the accuracy of the match between the capacitive load of the
oscillator circuit and the capacitive load for which the crystal was trimmed.

In hardware project its need for real time clock or delay source. Such devices
as clocks, timers, etc. are impossible to produce without knowledge of exact time.
The goal of this project is to create interrupt driven real time clock for Microchip
PIC 16F877 microcontroller to be used in various applications.

1.1

OBJECTIVES

1) To design circuit for Real Time Clock Display.
2) To troubleshoot the hardware part.
3) To apply the programmable to IC PIC.
4) To learn the functional and application of LED dot matrix display.
5) To learn the functional and characteristic of PIC16F8 77 and apply to
circuit RTC .

© Universiti Teknikal Malaysia Melaka

3

1.2

PROJECT SPECIFICATION

The Installation Assistant will consist of several parts, it includes :

1.3

1)

A microcontroller

2)

A real-time clock

3)

Dot matrix

4)

Counter

5)

Crystal

REPORT ORGANIZATION

This report is divided into several chapters. They are:
1)

Introduction

2)

Literature Review

3)

Project Methodology

4)

Microcontroller & Real-time Chip

5)

Design And Explanation Of Circuit

6)

K.eal tゥュ・セ@

7)

Conclusion

ᄋ M^ セォ@

Display

© Universiti Teknikal Malaysia Melaka

4

The first chapter is introduction that introduce about the project title. Beside
that, the objectives of the project have been comprised.

The second chapter that is the literature review about the project title. In
literature review, it includes some research on the existing implementation of the
Real-time Clock display in LCD. Moreover, explore on different areas including the
invention of real-time clock, virtue clock, and digital clock.

The third section is about the project methodology. In this chapter, the
methods and the project flow chart has been explained in clearly.

The fourth chapter is about the component of microcontroller and real-time
chip. In this chapter, the functional of microcontroller and real-time chip have been
explained clear. Each part of these components also has been explained.

For the fifth section, the objectives of this project are comprised. By this, the
circuit is designed by using rnicrocontroller with RTC to display in dot matrix. After
this, the circuit is explanation in each part of the project.

The following chapter is about the real-time clock display. In this chapter,
the functional of the EEPROM and the LED 5x7 dot matrix display. Beside that, the
differences of the real-time and virtue time have been explained.

The last chapter is the conclusion for the whole project. From this chapter, it
includes the conclusion and also the further improvement that can be made in future.

© Universiti Teknikal Malaysia Melaka

CHAPTER2

LITERATURE REVIEW

2.1

PREVIOUS STUDIES & RESEARCH

Predictability for Real-Time Clock, many hardware and software features
rely heavily on the availability of precise timing information. The application of
these features in distributed systems therefore necessitates the synchronous operation
of all its clocks. Even if these clocks are initialized with the same time, since
physical clocks drift, due to changes in physical conditions like temperature, sooner
or later, individual clocks will indicate different times.

The discrete clock is an event-driven clock advanced, whenever the scheduler
starts serving a packet, by the time needed to serve this packet. The arrival time of
any packet is determined by the value of the discrete clock at that instant. Let the
vcuiable ,:: ienotes th;:; '. i:;crete clock. dt. i is the value of the discrete clock at instant i.
Let C denotes the channel capacity. At the start of serving a packet with length l at
instant i, the discrete clock is advanced as

© Universiti Teknikal Malaysia Melaka

6

I dt.i = dt.i + UC
The discrete clock is related to the real-time clock. This relation is illustrated
in the following Lemma.

The LED dot matrix display described in this paper belongs to a new
generation of dot matrix displays, as the visual light emitted from the display
contains audio messages. It has long been realized that visible light has the potential
to be modulated and used as a communication channel with high entropy.

This application makes use of free space as a communication medium, and
the receiver is required to be in LOS with the transmitter. It should be noted that the
transmitter provides easy エ。イァセ@

for the line-of-sight reception by the receiver. This is

because the LEDs, being on all times, are also indicators of the locations of the
transmitter. This development can lead to many new applications in the industry.
With diverse commercial and industrial applications, the experimental results in this
paper have demonstrated that the proposed idea is totally feasible.

2.2

RECENT RELEVANT PROJECT

2.2.1

PCF8583 Real Time Clock

This project is a simple demonstration of reading date and time from
PCF8583 RTC

Hr・。ャMtゥ

セ@
r1 n,..1r\ Th P サG| セ ー@
r:i n hP. 11.;e:d with any MCU that has
\&) Universiti Teknikal Malaysia Melaka

":'

MSSP module at port C. Date and time are printed at LCD. The PIC micruce;nt dlcr
l 6F877 A has driven the RTC in this project. This project displays on a 2x 1S LCD.
Time and date are retained up to 10 years with a small 3Y lithium batterj. r.:

キカイセ]^@

with the MPLAB compiler and limited to 2K for the PIC16F877 but this is sufficient
for this projects.

Beside that, this project can use the MPLAB IDE to write a program.
Programming of the PIC was done with IC-Prog on a PIC-prograrnmer built from
Electronique pratique.

The designer used the PCB layout then to create in boa:d.

Real-time clock (RTC) counts seconds, minutes, hours, date of the month 1 mor.t.1-i,
day of the week, and year. The output of PCF8583 real time clock as below
.. .
Beside that, this project can use the MPLAB IDE to write a program.
Programming of the PIC was done with IC-Prog on a PIC-prograrnmer built from

.

Electronique pratique.



J,

•• ••

, ....

The designer used the PCB layout then to create in board.

Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month,
day of the week, and year. The output of PCF8583 real time clock as below

Figure 2.1 : Display Output of the PCF8583 Real Time Clock

2.2.2

EC PE-5 PIC Project Board

The PIC Projec©
t Roard includes a sub-section with dot matrix displays,
C Universiti Teknikal Malaysia Melaka

)

I)

switches and a potentiometer. This sub-section was designed to support a BCD ciock
project envisioned. The ECPE-5 PIC Project Board is a self-contained computer that
includes a power supply, dot-matrix displays, discreet LED's, push-button switch
input, digital to analog converter (DAC), digital thermometer, and a potentiometer
for analog control.

The project board is based on the Microchip I 6F877 RISC microprocessor.
The processor includes on-chip VO ports, 1Obit, ADC, timers, UART, and oscillator.
The CPU section consists of the Microchip PIC l 6F877 PIC microproct::;sor,
oscillator, reset circuit, and reverse voltage protection. The dot matrix display section
of the project board can be configured with one large, or two small 5x7 dot ュ。エイゥセ@
LED displays.

The PIC Project Board includes some simple VO devices for testing and
experimental use. These include discrete LEDs, switches, and a potentiometer. The
ECPE-5 PIC Project Board includes a simple +5v power supply composed of a full
wave rectifier and a fixed voltage linear regulator. The power supply components can
be omitted. PICI 6F877 is a dual output digital to analog converter (DAC) with 8-bit
resolution. The interface to the DAC is a synchronous serial interface which can be
driven by the SPI interface built into the PICI6F877.

The temperature sensor is also a serial VO device. It uses a I-wire interface
rather than an SPI interface. The I-Wire interface uses a single wire driven by
open-collector devices as a bi-directional bus. The PIC l 6F877 has a very limited
number of open-collector (or more correctly, open-drain) signals.

© Universiti Teknikal Malaysia Melaka

9

2.2.3

ZX81 Real Time Clock Project

Real Time Clock (RTC) project recently built and tested on a ZX8 l but
should be compatible with the Spectrum and other Z80 machines. Cost and
simplicity are the main reasons for choosing the DALLAS DS1287. These RTC
modules were used on some 286 AT motherboards which can often be had for free
and contain other useful parts for ZX8 l projects.

The DS1287 is functionally equivalent to the more common MC146818 but
integrates all external components including crystal and battery in a single 24 pin
DIP module. Check the date code on the unit to determine the remaining life of the
internal lithium battery, which is normally good for l 0 years or more. An internal
flag can also be used to verify a good battery.

The DS1287 is designed to work with multiplexed address/data bus MPU's
like the 6805 or the 8088. The data book shows an example of a 68000 application
but there are no Z80 application examples given. This may be the reason it is seldom
used in Z80 designs although the interface is straight forward. Rather than
multiplexing the data and address are used two separate IO addresses: one for the
address port and one for the data port.

TI·.. : DS 1287/Z?. セ@ '. nterface programmer model is a block of 80 bytes, each
of which can be selected by writing a byte address (0 to 79 decimal) to the address
port and reading or writing data for that byte through the data port. The 74HC 138
decodes IO addresses lF,

'.if: __
セ@

FF ::mv two of which (except FF) can be assigned to
Universiti Teknikal Malaysia Melaka

9

2.2.3

ZX81 Real Time Clock Project

Real Time Clock (RTC) project recently built and tested on a ZX81 but
should be compatible with the Spectrum and other Z80 machines. Cost and
simplicity are the main reasons for choosing the DALLAS DS1287. These RTC
modules were used on some 286 AT motherboards which can often be had for free
and contain other useful parts for ZX81 projects.

The DS1287 is functionally equivalent to the more common MC146818 but
integrates all external components including crystal and battery in a single 24 pin
DIP module. Check the date code on the unit to determine the remaining life of the
internal lithium battery, which is normally good for 10 years or more. An internal
flag can also be used to verify a good battery.

The DS 1287 is designed to work with multiplexed address/data bus MPU's
like the 6805 or the 8088. The data book shows an example of a 68000 application
but there are no Z80 application examples given. This may be the reason it is seldom
used in Z80 designs although the interface is straight forward. Rather than
multiplexing the data and address are used two separate IO addresses: one for the
address port and one for the data port.

Tr·c

dsQRXW

O zセ

セ@

'. nterface programmer model is a block of 80 bytes, each

of which can be selected by writing a byte address (0 to 79 decimal) to the address
port and reading or writing data for that byte through the data port. The 74HC138
decodes IO addresses 1F, 1.f. .... FF anv two of which (except FF) can be assigned to
セ@

Universiti Teknikal Malaysia Melaka