SlideShare a Scribd company logo
DEVELOPMENT OF AN EMBEDDED SYSTEM FOR LOW POWER
MESSAGE DISPLAY USING SCANNING TECHNIQUE
by
Mohammad Mohidur Rahman Khan
MASTER OF ENGINEERING IN INFORMA nON AND COMMUNICA nON
• TECHNOLOGY
111111111 1111111111111111111111 "'
#10~899#
Institute ofInformation and Communication Technology
BANGLADESH UNIVERSITY OF ENGINEERING AND TECHNOLOGY
August, 2008
The project titled "Development of an Embedded System for Low Power Message Display
Using Scanning Technique" submitted by Mohammad Mohidur Rahman Khan, Roll No.
M04053 118, Session April-2005 has been accepted as satisfactory in partial fulfillment of
the requirement for the degree of Master of Engineering (ICT) held on 19th August, 2008.
BOARD OF EXAMINERS
cW=--_I. Dr. Md. Liakot Ali
Assistant Pro fessor
Institute of Information and Communication Technology
BUET, Dhaka-1000.
v~
1/
2. Dr. S. M. Lutful Kabir
Professor and Director
Institute ofInformation and Communication Technology
BUET, Dhaka-1000.
3. Dr. Md. Abul Kashem Mia
Professor and Associate Director
Institute ofInformation and Communication Technology
BUET, Dhaka-1000.
II
Chairman
Member
Member
"
Candidate's Declaration
It is hereby declared that this project or any part of it has not been submitted
elsewhere for the award of any degree or diploma.
Mohammad Mohidur Rahman Khan
III
Dedicated
to
My Parents
IV
Table of Contents
Title
Board of Examiners
Candidate's Declaration
Table of Contents
List of Figures
List of Tables
Acknowledgement
Abstract
Chapter 1: Introduction
1.1 Overview
1.2 Background and present state of the problem
1.3 Objectives with specific aims and possible outcome
Chapter 2: Literature Review
2.1 Display System
2.2 Basic types of Electronic Display
2.2.1 Commonly Used Analog Electronic Display
2.2.2 Commonly Used Digital Electronic Display
2.3 MicrocontrolJer
2.4 Decoder
2.5 Shift Register
2.5.1 Types of shi/i register
2.6 Real Time Clock (RTC)
2.6.1 Purpose
2.6.2 Power Source
2.6.3 Timing
Chapter 3 Methodology
v
Page No.
II
III
V
VII
VIII
IX
X
1
2
3
3
3
3
4
7
8
8
9
11
11
II
12
13
3.1 Introduction
3.2 Analysis of the proposed system
3.3 Block Diagram of the system
3.4 Devices used for the proposed system
3.4.1 Atmel ATMEGA88 - 8 bit Microconlroller
3.4.2 BCD 10 7-segmenl latch/decoder/driver (CD4511 BE)
3.4.38 bil Serial-Input Parallel- Outpul Shift Register (74HCI64)
3.4.4 Real Time Clock (DS1307)
3.5 Softwares Used For the Proposed System
3.5.1 WinAVR
3.5.2 A VR Studio 5.0
3.5.3 Easy-PC 4.0
3.5.4 Circuit Maker 4.0
Chapter 4: Results and Discussions
4.1 Introduction
4.2 Schematic Design
4.3 Printed Circuit Board (PCB) Design
4.4 The Artview of the Proposed System
4.5 Result
Chapter 5: Conclusion
5.1 Conclusion
5.2 Suggestions for Future Works
References
Appendix A
vi
13
13
13
15
15
16
18
19
20
20
21
21
21
22
22
22
24
24
24
24
24
24
24
24
List of Figures
Title
Figure 2.1: Cathode Ray Tube (CRT) Display
Figure 2.2: Different Types of Light Emitting Diode (LED)
Figure 2.3: Seven Segment Display
Figure 2.4: Segments of a 7-Segment Display
Figure 2.5: Microcontroller
Figure 2.6: 4-Bit SIPO Shift Register
Figure 2.7: 4-Bit PI SO Shift Register
Figure 3.1: Block Diagram of the Proposed System
Figure 3.2: Pinning Diagram Atmega88
Figure 3.3: Pinning Diagram of 7-Segment Decoder
Figure 3.4: Logic Diagram of74HCI64
Figure 3.5: Pin Assignment of74HCI64
Figure 3.6: Pin Assignment Of OS 1307
Figure 3.7: DSI307 Address Map
Figure 3.8: OS 1307 Time Keeper Register
Figure 4.1: Schematic Diagram of the Proposed System
Figure 4.2 PCB Diagram of the Proposed System
Figure 4.3 The Artview of the Proposed System
VII
Page No.
4
4
6
6
7
10
II
14
16
17
18
18
19
19
20
24
26
27
List of Tables
Title
Table 3.1: Fuction Table of7-Segment Decoder
Table 3.2: Fuction Table of74hcl64
Table 3.3: DS1307 Square Wave Output Frequency
Table 4.1: Current Consumption of the System
viii
Page No
17
19
20
28
Acknowledgement
First of all I would like to thank the almighty Allah for giving me the opportunity to
conduct this project. I would like to express my sincere thanks to my project
supervisor, Dr. Md. Liakot Ali, for giving me the opportunity to conduct this
project. I am grateful to pursue my project under his supervision. Without his ever
helping personalities, this project would not have got the success.
I would like to convey my thanks to Professor Dr. S. M. Lutful Kabir, Director,
lICT, BUET. His motivation and inspiration gave me the courage to do this work.
I gratefully acknowledge the restless support and advice of my fellow classmate and
friend Md. Faruq Ahmed Jewel during the design and implementation phase of this
project. I want to convey my thanks to one of my very good friends Nowshad Ibne
Alam (Arnob) for giving his valuable time while I was buying the apparatus for my
project. My thanks also go to another very good friend Md. Sabbir Hasan for his
support during the documentation phase of the project. My special thanks to all the
teachers, students and staffs oflICT, BUET.
I would like to thanks all my friends for their continuous support and inspiration
throughout the whole period of this undertaking.
IX
Abstract
Electronic display is now the most conventional means of presenting information all over
the world. Due to its attractive brightness and simple operability, it is one of the most
popular medium of presenting different types of information to the mass people. The
display elements in an embedded system consume the major portion of the total power
required to run the whole system. When large amount of display elements are used power
dissipation issue becomes acute. In many cases special cooling arrangements like heat
sink, cool air circulation, fan etc. are used to keep the system workable. The demand of
low power consumption for embedded systems motivates to explore new approaches for
managing power. This project proposes an alternative approach to develop a low power
consuming embedded system for message display by introducing a new scanning
technique. In the proposed system a controller scans all the display units continuously to
ensure that only one unit is on at any given time. In this way power consumption will be
much lower than that of existing static display system. Here a 'Muslim Calendar'
containing date, time and prayer times for five salah has been developed as a test case.
Seven segment displays are used as display units.
x
1.1 Overview
Chapter 1
Introduction
Electronic display-we see it everywhere, in computers, watches, DVD players and many other
electronic devices to display numeric and some alphabetic characters. It is also used for
showing messages in digital calendars, billboards, shopping malls, airports, stadiums and
many other places. It is a commonly used and efficient way of displaying information. The
use of electronic displays for presentation of graphs, symbols, alphanumerics, and still or
video pictures has doubled every several years, in parallel with the rapid expansion of
microelectronics. Electronic displays have largely replaced traditional mechanical devices,
counters, galvanometers, and to a degree, hardcopy (paper) means for presenting information.
This change is due to the increased use of computers, microprocessors, inexpensive large-
scale integration (LSI) electronics, and digital mass memories.
Although electronic display is widely used, power consumption is still an important issue. In
an electronic circuit, the major part of the total power is consumed by the display elements. If
a large amount of display units are used in a system then the power requirement to run the
system will also increase proportionately. In that case extra cooling arrangements may be
required to keep the system workable. So the demands of low power consumption for
embedded systems are motivating new approaches to manage power dissipations issues.
1.2 Background and Present State of the Problem
A lot of research works have been done for displaying numeric digits of languages other than
English where the researchers used Seven Segment Display or some modification on it [1-3].
Display is one of the major power consumers in modern computer system [4]. Power
consumption is even more critical when multiple display units are used together for displaying
message. In some cases, it needs extra cooling arrangements for heat dissipation. Researchers
'.
have proposed plasma screen or organic light-emitting devices (OLEO) to reduce power
consumption for display element [5, 6]. So reducing the power consumption for display
element is an important research area.
1.3 Objectives with Specific Aims and Possible Outcome:
The major objectives of the project are as follows.
i) To study different types of display devices,
ii) To develop small prototypes on the bread-board,
iii) To design a Printed Circuit Board (PCB) and
iv) To implement the proposed system on the PCB.
Here as a test case a calendar will be developed where the following information will be
displayed using seven segment display.
a) Date,
b) Time and
c) Prayer times of five salah for any given date.
1.4 Organization of the Project
Chapter I of this report starts with impact of power consumption in the digital circuits by
display units followed by a brief background of power dissipation issues of electronic display,
objectives and organization of this report.
In Chapter 2 of this report, issues from all aspects in developing the proposed system have
been reviewed.
Detail methodology of the proposed system has been discussed elaborately in chapter 3.
In chapter 4 step by step design and development and obtained result of the proposed system
have been discussed.
In the final chapter (Chapter 5) conclusion and recommendation for future works has been
stated.
The project report ends with an appendix that contains the program code of the system.
2
Chapter 2
Literature Review
2.1 Display System
A display device is a device for presentation of information for visual reception, acquired,
stored, or transmitted in various forms. When the input information is supplied as an electrical
signal, the display is called "electronic display". An electronic component used to convert
electrical signals into visual imagery in real time suitable for direct interpretation by a human
operator. It serves as the visual interface between human and machine. The visual imagery is
processed, composed, and optimized for easy interpretation and minimum reading error.
2.2 Basic types of Electronic Display
There are two basic types of displays. They are:
• Analog Electronic Display
• Digital Electronic Display
The following subsections briefly describe different types of displays systems that are
commonly used.
2.2.1 Commonly Used Analog Electronic Display
The cathode ray tube (CRT) display is the most commonly used analog electronic display.
The cathode ray tube (CRT) is a vacuum tube containing an electron gun (a source of
electrons) and a fluorescent screen, with internal or external means to accelerate and deflect
the electron beam, used to form images in the form of light emitted from the fluorescent
screen. The image may represent electrical waveforms (oscilloscope), pictures (television,
computer monitor), radar targets and others.
The single electron beam can be processed in such a way as to display moving pictures in
natural colors.
3
1. Electron guns
2. Electron beams
3. Focusing coils
4. Deflection coils
5. Anode connection
6. Mask for separating beams for
red, green, and blue part of
displayed image
7. Phosphor layer with red, green,
and blue zones
8. Close-up of the phosphor-coated
inner side of the screen
Figure 2. I : Cathode Ray Tube (CRT) Display
2.2.2 Commollly Used Digital Electrollic Display
There are many examples of digital electronic displays. Among them light emitting diode
(LED), liquid crystal display (LCD) and seven segment display are most common.
a) Light Emitting Diode (LED)
A light-emitting diode is a semiconductor diode that emits incoherent narrow-spectrum light
when electrically biased in the forward direction of the p-n junction, as in the common LED
circuit. This effect is a form of electroluminescence.
Figure 2.2: Different types of Light Emitting Diode (LED)
An LED is usually a small area light source, often with optics added to the chip to shape its
radiation pattern. LEOs are often used as small indicator lights on electronic devices and
increasingly in higher power applications such as flashlights and area lighting. The color of
4
the emitted light depends on the composition and condition of the semiconducting material
used, and can be infrared, visible, or ultraviolet. LEOs can also be used as a regular household
light source. Besides lighting, interesting applications include sterilization of water and
disinfection of devices.
b) Liquid Crystal Display (LCD)
A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. A low-power flat-panel
display used in many laptop computers, calculators and digital watches, made up of a liquid
crystal that is sandwiched between layers of glass or plastic and becomes opaque when
electric current passes through it. The contrast between the opaque and transparent areas
forms visible characters.
LCD is a display technology that uses rod-shaped molecules (liquid crystals) that flow like
liquid and bend light. When not energized, the crystals direct light through two polarizing
filters, allowing a natural background color to show. When energized, they redirect the light
to be absorbed in one of the polarizers, causing the dark appearance of crossed polarizers to
show. The more the molecules are twisted, the better the contrast and viewing angle.
Because it takes less power to move molecules than to energize a light-emitting device, LCOs
replaced the light-emitting diodes (LEOs) in digital watches in the 1970s. LCOs were then
widely used for a myriad of monochrome displays and still are. In the 1990s, color LCD
screens caused sales of laptop computers to explode, and in 2003, more LCD monitors were
sold for desktop computers than CRTs.
c) Seven Segment Display
A common display found on digital watches and readouts that looks like a series of 8s. Each
digit is formed by selective illumination of up to seven separately addressable bars.
A seven segment display, as its name indicates, is composed of seven elements. Individually
on or off, they can be combined to produce simplified representations of the Hindu-Arabic
numerals. Often the seven segments are arranged in an oblique, or italic, arrangement, which
aids readability.
5
The seven segments are arranged as a rectangle of two vertical segments on each side with
one horizontal segment on the top and bottom. Additionally, the seventh segment bisects the
rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays
(for full alphanumerics); however, these have mostly been replaced by dot-matrix displays.
Figure 2.3: Seven Segment Display
The segments of a 7-segment display are referred to by the letters A to G, as shown bellow,
where the optional DP decimal point (an "eighth segment") is used for the display of non-
integer numbers.
Figure 2.4: Segments of a 7-segment display
6
2.3 Microcontroller
A microcontroller (also MCU or !!C) is a computer-on-a-chip, containing a processor,
memory, and input/output functions. It is a microprocessor emphasizing high integration, in
contrast to a general-purpose microprocessor (the kind used in a PC). In addition to the usual
arithmetic and logic elements of a general purpose microprocessor, the microcontroller
integrates additional elements such as read-write memory for data storage, read-only memory
for program storage, EEPROM for permanent data storage, peripheral devices, and
input/output interfaces. At clock speeds of as little as a few MHz or even lower,
microcontrollers often operate at very low speed compared to modern day microprocessors,
but this is adequate for typical applications. They consume relatively little power (milliwatts),
and will generally have the ability to sleep while waiting for an interesting peripheral event
such as a button press to wake them up again to do something. Power consumption while
sleeping may be just nanowatts, making them ideal for low power and long lasting battery
appl ications.
Microcontrollers are frequently used in automatically controlled products and devices, such as
automobile engine control systems, remote controls, office machines, appliances, power tools,
and toys. By reducing the size, cost, and power consumption compared to a design using a
separate microprocessor, memory, and input/output devices, microcontrollers make it
economical to electronically control many more processes.
Figure 2.5: Microcontroller
7
A microcontroller is a single integrated circuit, commonly with the following features:
• central processing unit - ranging from small and simple 4-bit processors to complex
32- or 64-bit processors
• discrete input and output bits, allowing control or detection of the logic state of an
individual package pin
• serial input/output such as serial ports (VARTs)
• other serial communications interfaces like FC, Serial Peripheral Interface and
Controller Area Network for system interconnect
• peripherals such as timers and watchdog
• volatile memory (RAM) for data storage
• ROM, EPROM, [EEPROM] or Flash memory for program and operating parameter
storage
• clock generator - often an oscillator for a quartz timing crystal, resonator or RC circuit
• many include analog-to-digital converters
2.4 Decoder
Decoder is a multiple-input, multiple-output logic circuit that converts coded inputs into
coded outputs, where the input and output codes are different. e.g. n-to-2n, BCD decoders.
Enable inputs must be on for the decoder to function, otherwise its outputs assume a single
"disabled" output code word. Decoding is necessary in applications such as data multiplexing,
7 segment display and memory address decoding.
The simplest decoder circuit would be an AND gate because the output of an AND gate is
"High" (I) only when all its inputs are "High".
2.5 Shift Register
In digital circuits a shift register is a group of flip flops set up in a linear fashion which have
their inputs and outputs connected together in such a way that the data is shifted down the line
when the circuit is activated.
8
2.5.1 Types of Shift Register
Shift registers can have a combination of serial and parallel inputs and outputs, including
serial-in, parallel-out (SIPO) and parallel-in, serial-out (PISO) types. There are also types that
have both serial and parallel input and types with serial and parallel output. There are also bi-
directional shift registers which allow you to vary the direction of the shift register. The serial
input and outputs of a register can also be connected together to create a circular shift register.
One could also create multi-dimensional shift registers, which can perform more complex
computation.
i) Serial-In, Serial-Out
aj Destructive readout:
These are the simplest kind of shift register. The data string is presented at 'Data In', and is
shifted right one stage each time 'Data Advance' is brought high. At each advance, the bit on
the far left (i.e. 'Data In') is shifted into the first flip-flop's output. The bit on the far right (Le.
'Data Out') is shifted out and lost.
The data are stored after each flip-flop on the 'Q' output, so there are four storage 'slots'
available in this arrangement, hence it is a 4-Bit Register. To give an idea of the shifting
pattern, imagine that the register holds 0000 (so all storage slots are empty). As 'Data In'
presents I, I,0, I,0,0,0,0 (in that order, with a pulse at 'Data Advance' each time. This is called
clocking or strobing) to the register, this is the result. The left hand column corresponds to the
left-most flip-flop's output pin, and so on.
So the serial output of the entire register is J J°J 0000. As one can see if we were to continue
to input data, we would get exactly what was put in, but offset by four 'Data Advance' cycles.
This arrangement is the hardware equivalent of a queue. Also, at any time, the whole register
can be set to zero by bringing the reset (R) pins high.
bj Non-destructive Readout
Non-destructive readout can be achieved using the configuration shown below. Another input
line is added - the Read/Write Control. When this is high (i.e. write) then the shift register
behaves as normal, advancing the input data one place for every clock cycle, and data can be
9
lost from the end of the register. However, when the R/W control is set low (i.e. read), any
data shifted out of the register at the right becomes the next input at the left, and is kept in the
system. Therefore, as long as the RlW control is set low, no data can be lost from the system.
ii. Serial-In, Parallel-Out
This configuration allows conversion from serial to parallel format. Data are input serially, as
described in the SISO section above. Once the data has been input, it may be either read off at
each output simultaneously, or it can be shifted out and replaced.
Data In o S Q
o
I o S Q
R Q
I o S Q
R Q
03
Io S Q
R Q
04
J
iii. Parallel-In, Serial-Out
Figure 2.6: 4-Bit SIPO Shift Register
This configuration has the data input on lines D I through D4 in parallel format. To write the
data to the register, the Write/Shift control line must be held LOW. To shift the data, the W/S
control line is brought HIGH and the registers are clocked. The arrangement now acts as a
SISO shift register, with D I as the Data Input. However, as long as the number of clock
cycles is not more than the length of the data-string, the Data Output, Q, will be the parallel
data read off in order.
10
01 0' 0' o.
--l>-r
Cio<ko~-------f 1.-- R_' __ f R
' f
Figure 2.7: 4-Bit PISO Shift Register
o $ Q C
R •
2.6 Real Time Clock (RTC)
A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit)
that keeps track of the current time. Although the term often refers to the devices in personal
computers, servers and embedded systems, RTCs are present in almost any electronic device
which needs to keep accurate time.
2.6.1 Purpose
Although keeping time can be done without an RTC, using one has benefits:
• Low power consumption (important when running from alternate power)
• Frees the main system for time-critical tasks
• Sometimes more accurate than other methods (although personal computer RTC's are
often inaccurate)
2.6.2 Power Source
RTCs often have an alternate source of power, so they can continue to keep time while the
primary source of power is off or unavailable. This alternate source of power is normally a
lithium battery in older systems, but some newer systems use a supercapacitor, because they
are rechargeable and can be soldered. The alternate power source can also supply power to
battery backed RAM.
11
2.6.3 Timing
Most RTCs use a crystal oscillator, but some use the power line frequency. In many cases the
oscillator's frequency is 32.768 kHz.This is the same frequency used in quartz clocks and
watches, and for the same reasons, namely that the frequency is exactly 215
cycles per second,
which is a convenient rate to use with simple binary counter circuits.
12
Chapter 3
Methodology
3.1 Introduction
In electronic circuits the issue of managing heat and power dissipation has become
increasingly significant. The display units are the major power consuming units of an
electronic circuit. Power consumption increases when the size or the number of display units
increases. Sometimes it requires extra cooling arrangements for large display units. Besides
one has to ensure that the Power Supply unit he/she uses for the circuit is good enough to
supply enough current to illuminate the display units.
3.2 Analysis of the Proposed System
This project concentrates on the power dissipation issues for display devices. A scanning
technique has been introduced in the proposed to minimize the power consumption for display
elements. The objective is to connect all the display elements in parallel with each other and
turning only one unit on at a time for a very short period and move to the next unit. If each
unit can be illuminated periodically in a very short span of time the human eye will see the
entire message as if all the units are turned on whereas only one unit is on at any given time.
Here seven segment displays are used as display units and as a test case a Muslim Calendar is
developed with 30 units of seven segment display. As the algorithm for illuminating display
units follow the scanning technique only one unit of seven segment display is turned on at any
given time. So theoretically the total power consumption for illuminating display units is
reduced by 30 times. Hence 30 units of seven segment displays can be illuminated by only the
power required by one unit.
3.3 Block Diagram of the system
The basic units of the proposed system can be divided into the following 7 Parts.
I. Microcontroller
2. Display elements
13
3. Display Decoder
4. Real Time Clock (RTC)
5. Shift Registers
6. Power Unit and
7. Switches
Display Elements
Switches
Figure 3.1: Block diagram of the proposed system
Here the microcontroller controls the input of the shift registers. The output of the shift
registers are connected to the common cathodes of 30 seven segment displays. The
microcontroller initializes all the output pins of the shift register at level 1 (sends logic 1 thirty
times in the input of the shift registers), making all the seven segment displays to be turned
14
off. At this point the microcontroller sends logic 0 once and logic I 29 times so that each
display receives the signal 0 sequentially while other displays receive signal I. In this process,
only one display is turned at a time and shifted sequentially.
The output pins of the display decoder are connected in parallel to all seven segment displays.
The Microcontroller sends appropriate input for the decoder when corresponding seven
segment display has logic 0 at its common cathode.
A real time clock is used to keep the date and time. The microcontroller reads time from the
RTC each minute and changes the display clock and date accordingly. The prayer time table
is loaded in the program memory of the microcontroller as an array of structure (see Appendix
A). The prayer times change with the change of day and month field of the date. There is a
battery connected to the RTC so that it can keep the time and date when the main power is not
available.
Three switches are used to set time and date. One switch is used to select which field of the
time and date is to be changed. Other two switches are used to count up and count down the
selected field. All these operation is controlled by the microcontroller.
3.4 Devices Used for the Proposed System
Some chips/devices have been used for the proposed system. Brief description on those
devices is given bellow.
3.4.1 Atmel ATMEGA88 - 8 bit Microcontroller
Here this specific microcontroller is used for its following special features .
• Advanced RISC Architecture
- 131 Powerful Instructions - Most Single Clock Cycle Execution
- 32 x 8 General Purpose Working Registers
- Fully Static Operation
- Up to 20 MIPS Throughput at 20 MHz
• High Endurance Non-volatile Memory segments
- 8K Bytes of In-System Self-programmable Flash program memory
15
-512 Bytes EEPROM
- IK Bytes Internal SRAM
• In-System Programming by On-chip Boot Program
• Peripheral Features
- Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
- One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
• Mode
- Master/Slave SPI Serial Interface
- Byte-oriented 2-wire Serial Interface (Philips 12C compatible)
- Interrupt and Wake-up on Pin Change
(PClNT14lRESET) PC6
(PCINT16/RXD) PDQ
(pcINT17/TXD) po,
(PCINT1811NTD) PD2
(PCINT1P/OC2S,.riNT1) P03
(PC1NT20lXCKfTO) P04
vcc
DND
(PCINT6IXTAllfTOSC t) PB/3
(PCINT7JXTAL2fTOSC2) PB7
(PCtNT21,'OCOBJT1) P05
(PCINT22'OCONAINO) Poe
(PCINT231AIN1) PD7
(PCINTOlCLKOIICP1) PBO
pe5 (AOC5lSCLJPC1NT13)
POt. (AOC4lSOAJPCINT12)
PC3 (ADC~?CINTll)
PC2 (AOC2iPCINTlD)
PCl (ADC1IPCINTD)
PeO (ADCQ;PCINT8)
GND
AREF
Avec
PBS (SClVPCINT5)
P84 (M1SO,'PCINT4)
PB3 (MOS"OC2A ?CINT3)
P82 ~'OC1B,IPC1NT2)
PBl (OC1AiPCINT1)
Figure 3.2: Pinning Diagram ATMEGA88
In this project Microcontroller acts as the main controlling unit. Along with the 7-segment
decoder and shift registers it controls the total scanning technique. It also reads time from an
external Real Time Clock (RTC) using the two wire serial interface. Pin Change interrupt of
the microcontroller is used to blink the LEOs used for showing time.
The Microcontroller has 8KB Flash program memory where the prayer times for one year is
saved as an array. This array is used to display the prayer times for any particular day of a
month.
3.4.2 BCD to 7-segment latch/decoder/driver (CD4511BE)
The CD4511BE is a BCD to 7-segment latch/decoder/driver with four address inputs (DA
to
DD), an active LOW latch enable input (EL), an active LOW ripple blanking input (BI), an
16
active LOW lamp test input (LT), and seven active HIGH n-p-n bipolar transistor segment
outputs (Oa to Og). When EL is LOW, the state of the segment outputs (Oa to Og) is
determined by the data on DA to DD. When EL goes HIGH, the last data present on DA to
DD are stored in the latches and the segment outputs remain stable. When LT is LOW, all the
segment outputs are HIGH independent of all other input conditions. With LT HIGH, a LOW
on BI forces all segment outputs LOW. The inputs LT and BI do not affect the latch circuit.
HEF4511 B
7273716.1
Figure 3.3: Pinning Diagram of7-Segment Decoder
Table 3.1: Fuction Table of7-Segment Decoder
INPUTS OUTPUTS
EL BI LT Do Dc DB DA 0. 0" 0. °d 0. 0, 0. DISPLAY
X X L X X X X H H H H H H H 8
X L H X X X X L L L L L L L blank
L H H L L L L H H H H H H L 0
L H H L L L H L H H L L L L 1
L H H L L H L H H L H H L H 2
L H H L L H H H H H H L L H 3
L H H L H L L L H H L L H H 4
L H H L H L H H L H H L H H 5
L H H L H H L L L H H H H H 6
L H H L H H H H H H L L L L 7
L H H H L L L H H H H H H H 8
L H H H L L H H H H L L H H 9
L H H H L H L L L L L L L L blank
L H H H L H H L L L L L L L blank
L H H H H L L L L L L L L L blank
L H H H H L H L L L L L L L blank
L H H H H H L L L L L L L L blank
L H H H H H H L L L L L L L blank
H H H X X X X .
17
3.4.3 8 bit Serial-Input Parallel- Output Shift Register (74HCI64)
The MC54174HC 164 is an 8-bit, serial-input to parallel-output shift register. Two serial data
inputs, A 1 and A2, are provided so that one input may be used as a data enable. In this project
A I and A2 pins are made short as no data enable is required. Data is entered on each rising
edge of the clock. The active-low asynchronous Reset overrides the Clock and Serial Data
inputs.
SERIALIAI 1
DATA 2
INPUTS IV.
CLOCK B
RESET 9
DATA
PIN 14 =Vee
PIN 1 ~GND
PARALLEl
DATA
OUTPUTS
Figure 3.4: Logic Diagram of74HC164
Al
1 •
14 VCC
A2 2 13 QH
QA 3 12 QG
QB 4 11 QF
QC 5 10 QE
QD 6 9 RESET
GND 7 8 CLOCK
Figure 3.5: Pin Assignment of74HCI64
18
Table 3.2: Fuction Table of74HCI64
Inputs Outputs
Reset Clock A1 A2 OA Os ... OH
L X X X L L ... L
H .... X X No Change
H f H D D QAn ... QGn
H f D H D QAn ... QGn
D = data input
QAn - QGn = data shifted from the preceding
stage on a rising edge at the clock input.
3.4.4 Real Time Clock (DSI307)
The OS 1307 Serial Real Time Clock is a low power, full BCD Clock/Calendar plus 56 bytes
of nonvolatile SRAM. Address and data are transferred serially via a 2-wire bi-directional
bus. The Clock/Calendar provides seconds, minutes, hours, day, date, month and year
information. The end of the month date is automatically adjusted for months with less than 31
days, including corrections for Leap Year. The clock operates in either the 24 hour or 12 hour
format with AM/PM indicator. The OS 1307 has a built-in power sense circuit which detects
power failures and automatically switches to the battery supply.
x, [lV , v",Xl 2 7 saW/OUT
v••, J l! sel
GND ~ 5 SOA
Figure 3.6: Pin Assignment of OS 1307
OOH
07H
08H
3FH
SECONDS
MINUTES
HOURS
DAY
DATE
J.1ONTH
YEAR
CONTROL
RAM
5th 8
Figure 3.7: OS 1307 Address Map
19
I ." I
CH
"~ "'ex><>s
, 10Wl"",Tn WltAlJES
, IX ~ "... HOUAS
" ""
• , • , , I D"
• , "om
"''''
• , • 1..I.:n. ..,,~
w'"'''' '''''
OUT I ' • ""'" .1.[ ••,[ .•••
01-12
Figure 3.8: OS 1307 Time Keeper Register
Table 3.3: OS 1307 Square Wave Output Frequency
RSI RSO SOW OUTPUT FREOUENCY
0 0 1Hz
0 1 4.096kHz
1 0 8.192kHz
1 1 32.76SkHz
3.5 Softwares Used for the Proposed System
The following softwares were used to develop the proposed system.
3.5.1 WinA VR
The WinAVR Library package provides a subset of the standard C library for Atmel AVR 8-
bit RISC microcontrollers. In addition, the library provides the basic startup code needed by
most applications.
In general, it has been WinAVR's goal to stick as best as possible to establish standards while
implementing this library. Commonly, this refers to the C library as described by the ANSI
X3.159-1989 and ISO/IEC 9899:1990 ("ANSI-C") standard, as well as parts of their
successor ISO/IEC 9899: 1999 ("C99"). Some additions have been inspired by other standards
like IEEE Std 1003.1-1988 ("POSIX.I"), while other extensions are purely AVR-specific
(like the entire program-space string interface).
20
Unless otherwise noted, functions of this library are not guaranteed to be reentrant. In
particular, any functions that store local state are known to be non-reentrant, as well as
functions that manipulate 10 registers like the EEPROM access routines. If these functions
are used within both standard and interrupt contexts undefined behavior will result.
3.5.2 AVR Studio 5.0
AVR Studio is an Integrated Development Environment (IDE) for writing and debugging
AVR applications in Windows 9x/MEINTI2000/XP/VIST A environments. AVR Studio
provides a project management tool, source file editor, simulator, assembler and front-end for
C/C++, programming, emulation and on-chip debugging.
AVR Studio supports the complete range of ATMEL AVR tools and each release will always
contain the latest updates for both the tools and support of new AVR devices.
AVR Studio 4 has a modular architecture which allows even more interaction with 3rd party
software vendors. GUI plug-ins and other modules can be written and hooked to the system.
3.5.3 Easy-PC 4.0
This software is a PCB designing tool for Windows. Easy-PC really is the latest generation of
PCB CAD with no other product currently as advanced or in-line with the Microsoft operating
systems - Windows 95/98 and NT. And because Easy-PC has been written using the latest
software techniques, object oriented code (C++) and under Windows NT as a true Windows
32 bit application, it can be easily enhanced to accommodate new demands in technology and
customer feedback.
3.5.4 Circuit Maker 4.0
CircuitMaker is a powerful, easy-to-use schematic capture and simulation tool in its class.
CircuitMaker provides the features of "high-end" design software at a fraction of the cost.
Using CircuitMaker's advanced schematic capabilities; one can design electronic circuits and
output netlists for TraxMaker and other PCB design tools and autorouters. One can also
perform fast, accurate simulations of digital, analog and mixed analog/digital circuits using
CircuitMaker's Berkeley SPICE3f5/XSpice-based simulator.
21
Chapter 4
Results and Discussions
4.1 Introduction
This chapter describes the schematic design and printed circuit board (PCB) design of the
proposed system. The Artview of the proposed system is also given here. At the end of this
chapter the implementation results of the proposed system are presented.
4.2 Schematic Design
Figure 4.1 shows the schematic design of the proposed project. The main part of the project is
the Atmel ATMEGA88 microcontroller. All other components are connected to it and
controlled by it. The four input pins (00-03) of the seven segment decoder (C045 I 1BE) are
connected to the first four pins of port B (PBO-PB3) of the microcontroller. These pins are
used to provide the appropriate data to be displayed by a particular seven segment display.
The seven output pins (a-g) of the display decoder are connected to all seven segment
displays' input pins (a-g) in parallel along with seven 100 nregisters.
Four shift registers (74HCI64) are used in this project. The input pins (Osa & Osb) of the first
shift register are made short and is connected to the second pin of the Port C (PC I) of the
microcontroller. The clock pin (CP) of the shift register is connected to the first pin of the Port
C (PCO) of the microcontroller. Each pair of input pins of the rest three shift registers are
made short just like the fist one and is connected to the last output pin (Q7) of the immediate
previous one. All the output pins of the shift registers are connected to the common cathode of
the seven segment displays sequentially.
The SOA and SCL pins of the Real Time Clock is connected to the fifth (PC4) and sixth
(PC5) pin of the Port C of the microcontroller. Two pull up registers are also connected to
these pins. The SQW pin of the RTC is connected to the fourth pin (PC3) of the Port C of the
22
microcontroller. A 3.2786 MHz crystal is connected to Xl and X2 pins of the RTC and a 3
volt battery is also connected to its Vb" and GND pin.
Three input switches are connected to the third fourth and fifth pin of Port D (PD2-PD4) of
the microcontroller. These three pins are made ground with three IOkO registers.
23
74LS164,
'Du 0
Dsb Q
Q
Q
Q
Q
Q
Q
74LS164
:Dsa 071
Dsb 06
Q'
Q'
g~1
"Q
~5VO.33k
DlSP96 DISPl
~rGnd
'"'
DlSPl
'"'
5V
'V
abed ••
'"'
sbede t<l.t [abed,
DlSP!.Q.......plSP2
'"'
DlSPl
Figure 4.1: Schematic diagram of the proposed system
24
4.3 Printed Circuit Board (PCB) Design
To design the PCB, a software named Easy PC has been used. Definitions of some
components were not found in the software. In those cases the components were made
manually by putting Pads according to their Pin configuration.
Fig. 4.2 shows the PCB diagram of the proposed project. It is a single layer PCB. The red
lines indicate the top copper routing of the Circuit Board. Some jumps have to be made to
make the circuit fully functional. In those cases some extra wire connection has been made.
25
E
"
~
'"
~
'"o
0-
e0-
"-5
'-o
4.4 The Artview of the Proposed System
After putting all the components on the circuit board and programming the microcontroller
the total system looks like as follows.
Figure 4.3 The Artview of the Proposed System
Here the first block of four (top left corner) seven segment displays shows time. First two
units of this block represent hour while second two represent minute. The second block of six
(top right corner) seven segment displays represents date where the first, second and third two
units of the block represent day, month and year respectively. The remaining five blocks of
four seven segment displays represent the prayer times of five salah; Fazr, Zurh, Asr, Maghrib
and Esha as labeled in the figure 4.3. Here each first two units of each block represent hour
and the remaining two units of each block represent minute.
27
There are three buttons: Mode, Up and Down. The Mode button selects which unit of time or
date is to be changed. Then the buttons Up and Down are used to count up or down
respectively to set the selected unit of time or date.
4.5 Result
Scanning technique is a power aware solution for message display. Here we have used 30
seven segment displays. But as scanning technique is applied, at any given time only one
seven segment display is on. So, theoritically the system should consume 1/
30
times less power
than it would take to make all the seven segment displays on at a time.
But following table shows the practical senario.
Table 4.1: Current and Power Consumption by the Display Elements
Current and Power Consumpiin for 30 Units of Seven Segment Displays
With Scanning Technique Without Scanning Technique
Curren Consumption 18mA 75mA
Power Comsumption 0.09 watt 0.375 watt
So, in practical the power consumption is not as less as 30 times of the total power needed.
But still it minimizes the power consumption to a considerable amount that is 76% less
power is required to run the display units of the system when the scanning technique is
applied.
Another important point is for the scanning technique only one Display Decoder is used. If
this technique is not applied then 30 Display Decoders should be used for 30 seven segment
display. Furthermore a microcontroller has limited number of pins. So, a commonly used
microcontroller may not be able to connect all the display decoders at a time due to its fixed
number of pins.
So, the solution enables a circuit to be operated in less power, less area hence less cost.
28
Chapter 5
Conclusion
5.1 Conclusion
Power management has a considerable importance in electronic circuits. In electronic
displays, power consumption increases with the size and number of the display units. This
project uses scanning technique to reduce power consumption. The embedded system
developed as a test case demonstrates a power aware solution using scanning technique. The
seven segment displays used as display units consume less power when scanning technique is
used. Since the algorithm allows only one display unit to be illuminated at any given time
rather than all the units receiving power, it consumes significant less power. The scanning
technique in the embedded circuit requires only one Display Decoder for all the display units.
Scanning technique can be used in numerous ways to minimize power consumption. Applying
it in other type of circuits can reduce power usage and reduce material cost as well.
5.2 Suggestions for Future Works
As stated, the project has 30 units of seven segment displays and by using scanning technique
the total power consumption is reduced by 30 times (theoretically). But a common question
may arise; will this technique work if the number of display units is increased by a significant
number (1000 or more)? In that case some flickering will be experienced. This is because
human eye can hold an image in the brain for only 1/10 of a second. So if the scanning
frequency is such that each display unit is illuminated for less than 1/10 of a second, flickering
will be observed, that is, power consumption factor will not be inversely proportionate to the
number of display units as stated earlier.
To remedy this, the scanning technique can be modified in such way that a group of display
units would be considered as a cluster. The total system can have number of clusters. The
scanning technique will be applied on these clusters so that each cluster will be turned on at
29
any given time. But in this case we need to use the same number of display decoders as
number of display units in a cluster.
In future, the modified scanning technique (clustering approach) can be incorporated in other
embedded systems with large number of display units. Some microcontrollers with built-in
scanning mechanism are available in the market. Future works can be done using those
microcontrollers. Furthermore in this project an extra facility could be incorporated. That is
there could be an option for vary the prayer time table for different Mazhabs.
30
References:
[I] Azad, M. A. K., Sharmeen, R., Ahmed, S. and Kamruzzaman, S. M., "A unique 10
Segment Display for Bangia Numerals" in proceedings of 8th International Conference on
Computer and Information Technology (fCCIT), 2005.
[2] Karri, R., and Orailoglu, A., "Standard Seven Segmented Display for Burmese Numerals"
in proceedings of Consumer Electronics, IEEE Transactions, vol-36, issue: 4, pp 959-96 I,
1990.
[3] Islam, R., Alam, M. G. R., and Uddin, M. N., "An 8-Segment Display for Simple and
Accurate Representation of Bangia Numerals" in proceedings of 4th International Conference
on Electrical and Computer Engineering ICECE , 2006.
[4] Moshnyaga, V.G. and Morikawa, E., "LCD Display Energy Reduction by User
Monitoring" in proceedings of IEEE International Conference, pp 94 - 97, 2005.
[5] Aerts, W. F., Verlaak, S. and Heremans P., "Design of an Organic pixel Addressing
Circuit for an Active-Matrix OLED Display", in proceedings of IEEE Transactions on
Electron Devices, vol-49, issue- I2, pp 2 I24-2 I30, 2002.
[6] Kimmel, J., Hautanen, L. and Levola, T., "Display technologies for portable
communication devices", in proceedings of the IEEE, vol-90, issue-4, pp 581-590, 2002.
31
Appendix A
/*Project Coding*/
#define F CPU 8000000UL
#include<util/delay.h>
#include<avr/io.h>
#include<avr/interrupt.h>
#include <avr/pgmspace.h>
//#include <compat/ina90.h>
#include "rtc.h"
#include "i2cmaster.h"
#define Ds1307
#define MONTH 13
#define DAY 32
#define WAQT 6
OxDO II device address of D81307, see datasheet
struct TimeTable
{
unsigned char hh,mm;
} ;
static struct TimeTable attribute ((progmem)) time [MONTH) [DAY] [WAQT]~ {
{
{{o.o}. {o.o}. {O.O}. {O.O}. {O.O}, {O.O}}.
{ {0. O}, {O. O}, {O. O}, {O. ° }.{O. ° }.{O. ° }}.
{{o.o}. {o.o}. {O.O}, {O.O}, {O.O}. {O.O}},
{{O.O}. {O.O}. (O.O). (O.O). {O.O}. (O.O}).
{{O.O}. {O.O}. {O.O}. {o.o}. {O.O}. {O.O}}.
({o.o), {O.O}, {O.O}, {O.O}. {O.O}, {O.O}}.
({O.O). {O.O}. {O.O}. {O.O}. {O.O}. {O.O}}.
{{O.O}. (O.O). {O.O}. {O.O}. {O.O}, {O.O}},
{{O.O). {O.O}. {o.o}. (o.o). {O.O}. {O.O}}.
( {O. °},{O, O}, {o. O}, {O, O}, {O. °},{O. °}},{{O.O), {o.o}, {O,O}. {O.O}. (O,O). {O,O}}.
{{O.O}. (O,O), {O,O), (O.O), {O.O}. {O.O}}.
{ {0. °},{O. °}.{O. O}, {O. O}, {O. ° },{O. °}},
{ {0. °}.{O. °}.{O. O}, {O. °}.{O. °},{O. °}}.
{(O.O). {O.O}, {O.O}. (O.O), {O.O}, {O.O}},
({O,O), {O.O}. {O.O}, {O.O}. {O.O}. {O.O}}.
({O.O), {O,O}. {O.O}. {O.O}. {O,O}. {O.O}},
{(O,O), {O,O}, (O.O). (O.O), {O.O}, {O.O}}.
{{O.O}, {O.O}. {O.O}, {O.O}, {O.O}. {O,O}},
{{O.O}. {O,O}. {O.O}. {O.O}. (O,O). (O.O}},
{ {0. O}, {O. °}.{O. °}.{O. °},{O. °},{O. °}}.{{O.O}, {O,O}. {O.O}, {O.O}, {O.O}. {O,O}}.
32
{{O,O), {O,O), (O,O), {O,O}, {O,O}, {O,O)),
{{O,O}, {O,O), {O,O}, (O,O), {O,O}, {O,O)),
{ {0, °},{O, °),{O, °},{O, 0), {O, °},(O, °)},{ ( 0, 0), {O, °},{O, °},(O, 0), {O, °},(O, 0) },
{{O,O), {O,O}, (O,O), (O,O), {O,O}, {O,O}},
{{O,O), (O,O), (O,O), {O,O), (O,O), {O,O}},
{{O,O), (O,O), (O,O), {O,O), (O,O), {O,O}},
{{O,O), (O,O), {O,O), {O,O}, (O,O), {O,O}},
{{O,O), (O,O), (O,O), {O,O}, (O,O), {O,O}},
({O,O), (O,O), {O,O}, {O,O}, {O,O}, {O,O}} },
{ {{O,O}, {O,O), (O,O), (O,O), {O,O}, (O,O)},
({O,O), {5,20), (12,2), (3,47), {5,23}, {6,44)},
{{O,O}, {5,21), {12,2}, {3,4S}, {5,24), (6,44)),
({O,O), (5,21), {12,3}, {3,4S), (5,24), (6,45}),
{{O,O), {5,21}, (12,3), (3,49), (5,25), (6,45}),
{(O,O), {5,22}, (12,4), (3,50), (5,26), (6,46}),
({O,O), (5,22), (12,4), (3,51), {5,26), (6,47}),
({O,O), {5,22}, (12,5), {3,51}, {5,27}, (6,47}),
({O,O), (5,22), (12,5), {3,52}, {5,2S}, {6,4S}},
{{O,O}, (5,23), {12,5), {3,53}, {5,2S}, {6,4S}},
{{O,O), (5,23), (12,6), {3,53}, {5,29}, {6,49)},
{{O,O), (5,23), {12,6}, {3,54}, (5,30), (6,50)),
( ( 0, °),(5, 23) , {12, 7 }, {3, 55), (5, 31 ) , {6, 50 ) ) ,
{{O,O}, {5,23}, (12, 7), (3,55), {5,31), (6,51}),
{ {O, O} , {5, 23} , {12, 7} , ( 3, 56) , (5, 32) , {6, 52} ) ,
{{O,O}, {5,24}, {12,S), (3,57), (5,33), {6,52}},
{{O,O}, {5,24}, (12,S), {3,5S), {5,33}, {6,53)},
{{O,O), {5,24}, {12,S}, {3,5S}, {5,34}, {6,53)},
({O,O), {5,24}, {12,9}, {3,59}, {5,35), (6,54)),
({O,O), (5,24), (12,9), (4,0), {5,36}, (6,55}),
{ ( 0, 0), {5, 24 ) , (12, 9) , ( 4 , 1 ) , (5, 36), {6, 55} },
{ ( 0, ° ),{5, 24 ), {12, 10), (4, 1 ) , {5, 37 }, {6, 56} },
{{O,O}, {5,24}, (12,10), (4,2), {5,3S}, (6,57)},
{{O,O}, (5,24), {12,10}, {4,3}, (5,3S), (6,57)),
{{O,O}, (5,23), {12,11}, {4,3}, (5,39), (6,5S)),
{{O,O), {5,23}, {12,11}, {4,4), (5,40), (6,5S)),
({O,O), {5,23}, {12,11}, {4,5), (5,41), {6,59}},
{(O,O), {5,23}, (12,11), (4,6), (5,41), (7,0)},
{ {0, °),{5, 23 }, (12, 11), ( 4, 6) , {5, 42 }, (7, °)),{(O,O), {5,23), (12,12), {4, 7}, {5,43), (7,1)),
{ {0, °},(5, 22 ) , {12, 12 ) , (4, S), {5, 43 }, {7 , 1 } ) ,
{{O,O), (5,22), {12,12}, {4,S), {5,44), (7,2}) ),
{ {{O,O), {O,O), {O,O}, {O,O}, (O,O), (O,O)),
{{O,O}, (5,22), {12,12), {4,9}, {5,45}, (7,2)),
{(O,O}, (5,22), (12,12), {4,10}, {5,45}, (7,3)),
{{O,O}, (5,21), (12,12), {4,10}, (5,46), (7,4}),
{ ( 0, °),(5, 21 ) , {12, 12 }, (4, 11), (5, 47 ) , {7, 4 } },
{{O,O), {5,21}, {12,13}, (4,11), (5,47), (7,5)},
{ {0, °},{5, 2 °},(12, 13) , (4, 12 ) , (5, 4 S ) , (7, 5) },
{{O,O), (5,20), {12,13}, {4,13}, {5,49}, {7,6}},
{ ( 0, 0) , {5, 19} , {12, 13 }, ( 4 , 13 }, {5, 49 }, {7 , 6} },
{{O,O), {5,19}, (12,13), {4,14}, {5,50}, {7,7}},
33
{ {0, °},{5, lS ) , {12, 13 }, {4, 14 ) , {5, 51 ) , (7, 7 ) },
{ {0, ° },{5, lS }, {12, 13) , {4 , 15) , (5, 51 ) , (7, S ) ),
({O,O), {5,17}, (12,13), {4,16}, {5,52}, (7,S)),
{{O,O), {5,l7}, (12,13), (4,16), {5,53}, (7,9}),
{ {O, 0) , (5, 16), {12, 13) , (4, 17), {5, 53) , {7 , 9} },
{{0, ° },{5, 16 }, {12, 13), {4, 17 ) , (5, 54 ) , {7, 10} },
{{O,O}, {5,15), {12,13}, {4,lS}, {5,54}, (7,lO)),
{{O,O), {5,15), {12,13), {4,lS}, {5,55}, (7,11)),
{{O,O), {5, 14), {12,13}, {4, 19), {5,55), {7,11}},
{ {0, ° ), {5, 13) , (12, 12 ) , {4, 19) , {5, 56} , {7, 12 } ),
{{O,O), {5,13), (12,12), {4,20), {5,57}, {7,12}},
{ {0, °},{5, 12 }, {12, 12 ) , (4, 2 °),{5, 57} , (7, 13 ) ) ,
{{O,O), {5,11}, {12,12}, (4,20), {5,5S}, {7,13)),
{{O,O), {5,11}, {12,12}, {4,21), {5,5S), (7,14)),
{{O,O), {5,lO}, {12,12), {4,21), {5,59), {7,14}},
{{o, 0) , (5, 9), {12, 12) , (4, 22) , {5, 59} , {7, 15} },
({O,O), {5,S), {12,12), (4,22), {6,O}, (7,15)),
{{O,O}, {5,S), {12,11}, {4,22}, {6,O}, {7,16}),
{ {0, ° },{5, 7 ) , ( 12, 11 ) , {4, 23), {6, 1 ) , {7 , 16} },
{ {0, °),{5, 6) , ( 12, 11 ) , {4 , 23) , ( 6, 1 ) , {7, 16} },
{{O,O}, {O,O}, {O,O}, {O,O), {O,O}, {O,O)),
{{O,O}, {O,O}, (O,O), {O,O), (0,0), (O,O)} ),
{ {{O,O), {O,O), (O,O), {O,O}, (O,O), {O,O}),
{ {0, °),{5, 6), {12, 11 ) , (4, 23 ) , {6, 1 }, (7, 16) ),
{{O,O), (5,5), {12,11), {4,24}, {6,2), (7,l7}),
{{O,O), {5,4), {12,11), {4,24}, {6,2), {7,17}},
{ {0, ° ),{5, 3) , {12, 10} , {4, 24 ) , {6, 3) , (7, lS ) },
{ {0, °},{5, 3) , (12, 10), {4, 25) , {6, 3} , (7, lS ) },
{{O,O), {5,2}, {12,lO), {4,25}, {6,3}, (7,19)),
{{O,O), {5,1), {12,lO}, {4,25}, {6,4), (7,19}),
{{O,O), (5,O), (12,9), {4,25), (6,4), {7,19}},
{(O,O), {4,59}, (12,9), {4,26), (6,5), (7,20)},
{{O,O}, {4,5S), {12,9}, (4,26), {6,5}, (7,20)),
{ {0, ° }, {4, 57 }, {l2, 9} , {4, 26), {6, 6} , {7 , 21 } ),
{{O,O), {4,56}, (12,S), {4,26}, {6,6), (7,21}),
{ {O, O}, {4, 55), (l2, S) , {4, 27) , ( 6, 7) , {7 , 22} },
{{O,O}, {4,54), {12,S}, (4,27), (6,7), {7,22}},
{{O,O}, {4,53), {12,S}, {4,27}, {6,7}, (7,23)),
{{O,O), {4,52), {12,7}, {4,27}, {6,S), (7,23}),
{ (0, O) , (4, 51), {12, 7 }, {4, 27), {6, S), {7 , 23} },
{{O,O}, {4,50), {12,7), {4,2S), (6,9), {7,24}},
{{o, °),{4, 4 9) , (12, 6) , {4, 2 S }, {6, 9} , (7, 24 ) ),
({O,O), {4,4S}, {12,6), {4,2S}, {6,9), {7,25)),
({O,O), {4,47}, {12,6), {4,2S), {6,lO), (7,25}),
{{O,O}, {4,46), {12,6}, {4,2S}, {6, 10}, {7,26}},
{{O,O), {4,45), {l2,5}, {4,29}, {6,11}, (7,26)),
{ {0, °),{4, 44 }, {l2, 5} , {4, 29 }, {6, 11 ) , (7, 26) ) ,
{ {0, °),{4, 43), {12, 5) , {4, 29), {6, 11), {7 , 27 } ) ,
{{O,O), {4,42), {12,4), {4,29), (6,12), {7,27}},
{{O,O), {4,41), (12,4), {4,29), {6,12}, (7,2S}),
{{O,O}, {4,40), {12,4}, (4,29), {6,13), (7,2S)},
{{O,O), {4,39), {12,3}, {4,29}, {6,13}, (7,29)),
{{O,O}, (4,3S), {J2,3}, {4,29), {6,13), {7,29)),
{{O,O}, {4,37}, {12,3), {4,29), {6,14), {7,30}} },
34
( ({O,O), {O,O}, {O,O). {O,O), (O,O). (O,O}),
{{O,O), {4,35}, (12,3), (4,30), {6,14}, {7,30}},
({O,O). (4,34). {12,2). {4,30}, {6,14}, P,3l)},
{{O,O}, {4,33}, (12,2). {4,30}, {6,15). P,3l}),
{{0, °},{4, 32 }, {12, 2 ) , {4 , 3 °), (6, 15) , P, 32) },
{{O,O). (4,3l). {12,1}, {4,30}, {6,16). P,32)),
({O,O), {4,30), (12,1). {4,30}, (6,16), (7,33}).
({O,O). {4,29). (12,1), {4,30}, {6,16). P,33)).
{{O,O), (4,2S). {12,l}, {4,30). {6,17), (7,34}),
{{O,O}, {4,27}, {12,0), (4,30), {6,17}, P,34)},
{{O,O), (4,26). {12,0}, {4,30}, {6,lS), (7,35}),
{{O, 0) , (4, 25). (12, 0) , {4, 30) , {6, IS} , P, 35} },
{{O,O}, {4,24}, (1l,59), {4,30}, {6,lS}, (7,36)),
{{O,O), {4,23), {1l,59). {4,3l), {6,19). {7,36}},
{{O,O). (4,22). {1l,59}, {4,3l}, (6,19). P,37)),
{{O,O}, {4,2l), (1l,59). {4,3l), (6,20). (7,37}),
{{O,O), {4,19}, {1l,5S). {4,3l}, {6,20}, P,3S)),
({O,O), (4,lS). {1l,5S}, {4,3l). {6,20), (7,39}),
{{O,O}, {4,17}, (ll,5S), {4,3l}, {6,2l), P,39)),
{{O,O}, {4,16), {1l,5S), {4,3l). {6,2l), P,40}),
{{O,O). {4,15}, (ll,5S), {4,3l}, {6,22}, P,40}),
{{O,O), {4, l4}, {1l,57}, {4,3l), {6,22). (7,4l)},
{{O,O}, {4,13}, {1l,57), {4,3l}, (6,23), P,42}},
{{O,O), {4,12}, {1l,57}, {4,3l}, {6,23), (7,42)},
({O,O). {4,ll}, (ll,57). {4,3l). {6,23}, P,43}},
{{O,O}, {4,10), {1l,57}, (4,3l). {6,24), {7,43}},
{{O,O}, {4,9}, {11,56), {4,3l}, {6,24}, {7,44)),
{{O,O}, {4,S), (1l,56). {4,3l}, (6,25), (7,45}),
{{O,O). (4,7). {1l,56}, {4,3l}, {6,25}, P,45)},
{{0, °},{4, 7 ) , {11 , 56} , {4 , 32). ( 6, 26) , {7 , 46} ) ,
{{O,O}, {4,6}, {1l,56), (4,32), {6,26}, P,47}).
{{O,O), (O,O). {O,O), (O,O), (O,O), {O,O}} },
{ {{O,O). {O,O}, (O,O), {O,O}, {O,O}, {O,O)},
({O,O), {4,5), {1l,56), {4,32), (6,27), (7,47}),
{{O,O}, {4,4}, {1l,56}, {4,32). {6,27}, P,4S)).
({O,O), (4,3). (1l,55). (4,32), (6,27), (7,49)},
({O,O). {4,2}, {1l,55), {4,32}, {6,2S), P,49)).
{{0, °),{4, 1 ) , {11 , 55} , {4, 32 }, ( 6, 2S) , P, 50} },
{{O,O}, (4,0). {1l,55), {4,32), {6,29). P,5l)).
{ {0, ° },{4, ° }, {11 , 55} , {4, 32 }, {6, 29) , P, 51} },
{{O,O}, {3,59}, {1l,55}, {4,32}, {6,30). P,52}),
{{O,O}, {3,5S). {1l,55). {4,32), (6,30), P,53}},
{{O,O}, {3,57}, {1l,55}, {4,33}, {6,3l}, {7,53}),
{( 0, °),{3, 56) , {ll, 55) , {4, 33) , (6, 31 ) , {7 , 54} ) ,
({O,O), {3,56), {1l,55), {4,33}, {6,32}, P,55}},
{ ( 0, °),{3, 55} , ( 11 , 55). (4, 33) , {6, 32). (7, 55) },
{{O,O}, {3,54), {1l,55), {4,33}, {6,33}, P,56}),
{{0, °},{3, 54} , ( 11 , 55) , (4, 33). {6, 33) , P, 57} },
({O,O), {3,53), {II, 55), {4,33}, {6,34}, {7,57)),
{{O,O). {3,52}, {1l,55}, (4,33), {6,34), {7,5S}},
{{O,O}, {3,52). {11,55}, {4,34}, {6,35}, P,59)),
{(O, 0) , {3, 51) , {11, 55} , (4, 34). {6, 35). {7 , 59} },
({O,O). (3,50). (ll,55). {4,34}, {6,36}, {S,O)},
{{O,O), (3,50), {1l,55}, {4,34}, {6,36). (S,l)},
35
{{O,O}, {3,49}, (1l,55), {4,34}, (G,37), {B,l}},
{{O,O}, {3,49}, {1l,55}, (4,34), {G,37}, (B,2}),
{(O,O), {3,4B}, {11,55}, {4,35}, (G,3B), {B,3}},
{{O,O}, {3,4B}, {1l,55}, (4,35), {G,3B}, {B,3}},
( (0, a) , {3, 47 } , (11, 55), {4, 35} , {G, 39) , (B, 4 ) },
{{O,O}, (3,47), {1l,5G), {4,35}, (G,39), {B,5)},
{ {0, a} , (3, 47 ) , {ll, 5 G) , (4, 35), {G, 39}, (B, 5) ) ,
{ {0, a }, {3, 4 G) , {11 , 5 G}, {4 , 35) , {G, 4 a }, {B, G) },
{(O,O), {3,4G}, (1l,5G), {4,3G}, (G,40), (B,G)},
{{O,O}, {3,4G}, {1l,5G}, {4,3G}, {G,41), (B,7}) },
{ {(O,O), (O,O), {O,O}, {O,O}, {O,O}, {O,O}},
((O,O), {3,45}, {1l,5G}, (4,3G), {G,41}, {B,B}},
{{O,O}, {3,45), {11,5G}, {4,3G}, {G,42}, {B,B)},
{{O,O}, (3,45), {1l,57}, {4,3G}, {G,42), {B,9}},
{{O,O}, {3,44}, (1l,57), {4,37), {G,43}, {B,9}},
{(O,O), {3,44}, {1l,57), {4,37}, (G,43), {B,10}},
{{O,O}, {3,44}, {1l,57}, {4,37}, {G,43}, {B,10}},
{(O,O), {3,44}, {11,57}, {4,37), {G,44}, (B,ll)},
{(O,O), (3,44), (11,57), {4,3B}, (G,44), {S,ll}},
{(O,O), {3,44), {1l,5S}, {4,3S), {G,45}, (S,12}),
( {0, a }, {3, 44}, (11, 5 S ) , {4 , 3 S }, (G, 45 ) , {S, 12 } },
{{O,O}, (3,44), {1l,5S}, (4,3S), {G,45}, (S,13}),
{{O,O}, {3,44}, {1l,5S}, {4,3S}, (G,4G), {S,13}},
{{O,O}, {3,44), {1l,5S}, (4,39), {G,4G}, {S,13}},
{{O,O}, (3,44), {1l,59}, {4,39}, {G,4G}, (S,14)),
({O,O), {3,44}, {1l,59), {4,39}, (G,47), {S,14}},
{{O,O}, {3,44}, (1l,59), {4,39}, {G,47}, (S,15}),
{{O,O}, {3,44}, {1l,59}, {4,40}, (G,47), {S,15}},
{ ( 0, 0), {3, 44 ) , {12, A}, {4 , 4 a }, {G, 47 }, (S, 15) },
( (0, 0), {3, 44), {12, a} , {4, 4 0), {G, 4S} , {S, 15} },
{{O,O}, {3,44}, {12,O}, {4,40}, {G,4S}, {S,lG}},
{{O,O), {3,44}, {12,O}, (4,40), {G,4S), {S,lG}},
{{O,O}, {3,45), {12,O}, {4,41}, {G,4S}, {S,lG}},
{{O,O}, {3,45}, {12,1}, (4,41), {G,49}, (S,lG}),
{{O,O}, {3,45}, (12,1), {4,41}, {G,49}, {S,17}},
{{O,O}, {3,45}, {12,1}, (4,41), (G,49), (S,17}),
{(O,O), {3,4G}, {12,1}, {4,41}, {G,49}, {S,17}},
{{a, a}, (3,4G), {12,1}, (4,42), {G,49}, (S,17}),
{(O,O), {3,4G}, {12,2}, {4,42}, {G,49}, {S,17}},
{{O,O}, (3,47), {12,2}, (4,42), (G,49), (S,17}),
{{O,O}, {3,47}, {12,2}, {4,42}, {G,49}, {S,17}},
{{O,O}, (O,O), {O,O}, {O,O}, {O,O}, {O,O}} },
( ({O,O), (O,O), (O,O), (0, a}, {a, a}, {O,O}},
((O,O), {3,47}, (12,2), {4,42}, {G,50}, {S,17}},
{{O,O}, {3,4S}, {12,2}, {4,43}, {G,50}, (S,17}),
( {a, a },{3, 4 S }, {12 , 3 }, (4, 43) , {G, 5 A}, {S, 17 } },
{{O,O}, (3,49), {12,3}, {4,43}, (G,50), {S,17}),
{ {0, a }, {3, 49}, {12, 3) , (4, 43) , {G, 5 A}, {S, 17 } },
{{a, a}, {3,50}, {12,3}, {4,43}, (G,50), {S,17}),
{{O,O}, {3,50}, {12,3), (4,43), {G,49}, {S,lG}},
{(O,O), {3,51}, {12,4}, {4,43}, {G,49}, (S,lG}),
{{O,O}, {3,51}, (12,4), {4,44}, (G,49), (S,lG}),
{{O,O}, {3,52), {12,4}, {4,44}, {G,49}, {S,lG)},
36
{ {0, ° ),{3, 52), {12, 4 ) , {4 , 44 ) , ( 6, 49) , (S, 15) },
({O,O), {3,53}, (12,4), {4,44}, {6,49}, (a,15)),
{ ( 0, °),(3, 53) , {12, 4 } , {4, 44 }, (6, 4 9) , {a, 15 } ) ,
{ {0, ° },{3, 54 }, (12, 4 ), ( 4 , 44 ) , {6, 49 }, {a, 14 } ),
{{O,o), (3,54), {12,4}, {4,44}, {6,4a}, (a,14)),
({O,O), {3,55), {12,5}, (4,44), (6,4S), (a,14}),
{{O,O}, {3,56}, (12,5), (4,44), {6,4a}, {a,13)),
{{O,O), {3,56}, (12,5), {4,44}, (6,4a), (a,13}),
({O,O), {3,57), (12,5), (4,44), {6,47}, {a,12}},
{ (O, 0), {3, 57} , {12, 5} , {4, 44}, {6, 47), (a, 12) ),
{ {0, °),{3, 5a) , ( 12, 5), {4, 44 }, ( 6, 47 ) , {a, 11 } ) ,
{{O,O}, (3,59), {12,5}, {4,44), {6,46), {a,l1}),
{{O,O}, (3,59), (12,5), {4,44}, (6,46), (S,10)),
{ (O, 0), {4, o}, {12, 5}, {4, 44} , (6, 45), {a, 10) },
{{O,O}, (4,1), {12,5), (4,44), {6,45}, (a,9)),
{{O,O), {4,1), {12,5}, {4,44}, (6,45), {a,a}},
{ {0, ° },{4, 2 ) , ( 12 , 5) , {4, 43 }, {6, 44 }, {a, S } ),
{{O,O), {4,2}, (12,5), (4,43), (6,44), (a,7)},
((O,O), {4,3}, {12,5}, {4,43}, (6,43), {a,6}),
{{O,O}, {4,4}, (12,5), {4,43}, {6,43}, (a,6)),
{{O,O}, {4,4), {12,5}, (4,43), (6,42), {a,S}} ),
{ {{O,O), {O,o), (O,O), {O,O}, {O,O}, (O,O)),
{{O,O), {4,5}, {12,5), (4,43), (6,42), (a,4}),
({O,O), (4,6), {12,5}, {4,42), {6,41), {a,3)),
{{O,O}, {4,6), (12,5), {4,42}, {6,40}, (a,3)},
{{O,O}, {4,7}, (12,5), (4,42), (6,40), {a,2}},
{ {0, °},(4, a), {12, 5} , {4, 42 }, {6, 39 }, {a, 1 ) ) ,
{{O,O), {4,a), (12,4), {4,41), (6,39), {a,o}},
{{O,O), (4,9), {12,4), (4,41), {6,3a}, {7,59)),
{{O,O}, {4,9), (12,4), {4,41), (6,37), (7,59}),
{{O,O), {4,10), (12,4), (4,41), {6,37}, {7,5a}),
({O,O), {4,llj, (12,4), {4,40}, (6,36), {7,57)),
{ {o, °},{4, 11 ) , {12, 4 } , {4, 4 ° }, {6, 35 }, {7, 56} ) ,
({O,O), (4,12), (12,4), (4,40), (6,34), {7,55)),
{{O,O), {4,13), {12,3}, {4,39}, {6,34}, {7,54}},
{{O,O}, {4,13}, (12,3), {4,39), (6,33), (7,53)},
{{O,O}, {4,14}, (12,3), (4,3a), (6,32), {7,52}},
{(O,o), {4,14}, {12,3}, {4,3a}, {6,31}, {7,51)),
({O,O), {4,15), {12,3), (4,37), (6,30), (7,50}),
({O,O), (4,15), {12,2}, {4,37}, {6,30}, {7,49)),
{{O,O}, {4,16), {12,2), (4,37), (6,29), (7,4a}),
{ ( 0, 0), {4, 17 ) , {12, 2 }, {4, 36 }, {6, 2 a} , {7, 47 ) },
{{O,O), {4,17), (12,2), (4,36), (6,27), (7,46)),
{{O,O), (4,la), (12,2), {4,35}, {6,26}, {7,45)},
({O,O), {4,la), {12,1}, (4,35), (6,25), {7,44}},
{{O,O}, {4,19}, {12,1}, {4,34}, {6,24}, {7,43)),
({O,O), (4,19), (12, 1), (4,33), (6,24), (7,42}),
{{O,O}, (4,20), {12,0}, {4,33}, {6,23), {7,41)},
({O,O), {4,20}, (12,0), {4,32}, (6,22), (7,40}),
({O,O), {4,21}, (12,0), (4,32), {6,21}, {7,39}},
{{O,O}, (4,21), {12,0), {4,31}, (6,20), (7,37}),
{ {0, ° },{4, 22 }, ( 11 , 59), (4, 31 ) , ( 6, 19) , {7, 36) },
({O,O), (4,22), (1l,59), {4,30}, {6,la}, {7,35)) },
37
{ {{O,O}, {O,o), {O,O}, {O,O}, (O,O), {O,O}},
{{O,O), {4,23), {ll,59}, (4,29), (6,17), {7,34}),
{ {0, °},{4, 23) , {11 , 5 B}, {4, 29) , {6, 16 }, {7, 33 } ) ,
{{O,O), (4,24), (1l,5B), {4,2B}, {6,15}, {7,32}),
{{O,O}, {4,24), {1l,5B}, (4,27), {6,14), (7,31)),
{{O,O}, {4,25}, {1l,57}, {4,27), (6,13), {7,30}},
({O,O), {4,25}, (ll,57), {4,26}, {6,12}, {7,29}},
{{O,O}, (4,25), (ll,57), {4,25}, {6,1l}, {7,27)),
{{O,O), (4,26), {11,56}, (4,25), (6,lO), (7,26)),
{{O,O), (4,26), {1l,56}, (4,24), {6,9), {7,25}},
{{O,O}, {4,27}, {1l,56}, (4,23), {6,B}, {7,24}},
({O,O), (4,27), {1l,55), {4,22}, (6,7), {7,23)},
({O,O), {4,2B}, {1l,55}, (4,22), {6,6), (7,22}),
{{O,O), (4,2B), {1l,55), {4,2l}, (6,5), {7,2l}},
{{O,O}, {4,2B), {1l,54}, {4,20}, (6,4), {7,20)),
{ {O, O}, {4, 29) , (ll, 54 ), {4, 19), {6, 3) , {7, 19} ) ,
{{O,O), {4,29), {1l,54), {4,19}, (6,2}, {7,17}},
{{O,O), {4,30}, {1l,53}, (4,lB), {6,l}, {7,16)},
{ {O, °),{4, 3 °},{11 , 53} , {4, 17 ) , {6, 0), {7, 15) ),
({O,O), {4,30}, {1l,53}, {4,16), {5,59), (7,14)),
({O,O), {4,3l), (1l,52), (4,15), (5,5B), {7,13}},
{{O,O}, {4,3l), {11,52), (4,15}, {5,57}, {7,12}},
{ {O, 0), (4, 32) , {ll, 51 }, (4, 14), {5, 56), (7 , 11) ) ,
({O,O), {4,32}, (ll,5l), {4,13), {5,55), {7,lO}),
{ {O, °},{4, 32 }, {ll, 51 ) , {4, 12 } , {5, 54} , {7, 9) ) ,
{{O,O), (4,33), {ll,50}, (4,1l), {5,53}, (7,B)),
{{O,O}, {4,33), {1l,50), {4,1l}, (5,5l), {7,7}),
{ {0, °),{4, 33) , {ll, 5 °),{4, 10} , {5, 5 °},{7 , 6) ),
{{O,O}, {4,34}, {1l,49), (4,9), (5,49), (7,4}},
{{O,O), (4,34), (ll,49), {4,B}, {5,4B}, {7,3)},
{ {O, O}, {4, 35) , {11, 49} , (4, 7), {5, 47), {7, 2} ) ,
{{O,O}, {O,O}, {O,O), {O,O), {O,O), {O,O)) },
{ {{O,O), {O,O},{O,O}, (O,O},{O,O),{O,O)},
({O,O), {4,35), {1l,4B}, (4,7), {5,46}, {7,1)),
{ (O, 0) , (4, 35) , {ll, 4B) , {4, 6) , (5, 45) , (7, O) ) ,
{{O,O), {4,36), {11,4B), {4,5}, {5,44}, {6,59}},
{{O,O), {4,36), {1l,47), {4,4}, {5,43}, {6,5B)},
{{O,O), {4,36), {1l,47}, {4,3}, {5,42), (6,57}),
{{O,O), {4,37}, {1l,47}, {4,2), {5,4l}, {6,56}},
{{O,O), {4,37), {1l,47), {4,2}, {5,40), {6,56)),
{ {O, °),{4, 37 }, (11, 46), {4, 1 ) , {5, 4 °},{6, 55 } },
{{O,O}, {4,3B), {1l,46}, {4,O}, {5,39}, {6,54)},
{{O,O}, (4,3B), (ll,46), {3,59), {5,3B), (6,53)),
{ {O, 0), {4, 39} , {11, 45} , {3, 5B} , {5, 37 }, {6, 52} },
{{O,O), {4,39}, {ll,45}, {3,5B), {5,36}, (6,5l)),
{{O,O}, {4,39}, {ll,45}, (3,57), {5,35), {6,50}},
{ {0, °I , {4, 4 °},(ll, 45), {3, 56) , (5, 34 ) , {6, 4 9} },
{{O,O}, {4,40), {1l,44), {3,55}, {5,33}, {6,4B}),
{{O,O), {4,40), {1l,44}, (3,55), {5,32), (6,4B)},
{{O,O), {4,4l}, {1l,44}, {3,54), {5,3l), {6,47}},
{{O,O}, {4,4l}, (ll,44), {3,53}, {5,30}, {6,46}),
({O,O), {4,42), {1l,44), (3,52), {5,30}, (6,45)},
{{O,O), {4,42), {11,43), {3,52}, {5,29}, (6,44)),
{{O,O}, (4,42), (1l,43), {3,5l), {5,2B), {6,44}},
38
)
/'
{{0, °},(4, 43) , {ll, 43 }, (3, 5 °),{5, 27 ) , {6, 43 }) ,
{{O,O), {4,43}, {1l,43}, {3,50}, {5,26}, {6,42)),
({O,O), {4,44), (ll,43), {3,49}, (5,26), (6,42)),
{{0, °),(4, 44 ) , {ll, 43 }, (3, 48), {5, 25) , {6, 41 }},
{(o, 0), {4, 45} , {11, 43} , {3, 47} , (5, 24 }, {6, 40) ),
({O,O), {4,45), (ll,42), (3,47}, (5,23), (6,40)),
{{0, °),(4, 45) , {ll, 42 }, (3, 46) , {5, 23) , ( 6, 39) },
{{0, ° },{4, 46 }, {ll, 42), {3, 46 }, {5, 22 }, {6, 38 }},
{{O,O}, {4,46}, (1l,42), (3,45), {5,21}, (6,38)),
({O,O), (4,47), {1l,42), {3,44}, (5,21), {6,37}} },
{ {{O,O),{O,O},{O,O),{O,O},{O,O},{O,O}},
{{O,O), (4,47), {1l,42}, {3,44), (5,20), {6,37)},
{{0, °},(4, 48 ) , {ll, 42 ) , {3, 43 }, {5, 19} , {6, 36 }},
({O,O), {4,48}, {1l,42}, (3,43), (5,19), {6,36)),
{{O,O), {4,49}, {1l,42}, (3,42), {5,18), {6,35}},
{{0, ° },(4, 49), (ll, 42 ) , {3, 42 }, {5, 18 }, {6, 35 }},
{{O,O), {4,50), {1l,42}, {3,41}, {5,17}, {6,34)),
{{O, O}, {4, 50) , {11, 42), {3, 41) , {5, 17), ( 6, 34 ) },
{{O,O}, {4,51}, (ll,42), {3,40}, {5,16}, {6,33}),
{{O,O), {4,51}, {ll,42}, (3,40), {5,16}, {6,33}),
{{0, °),{4, 52} , {ll, 42 }, {3, 39) , {5, 15) , ( 6, 33) },
{(O,O), (4,52), {1l,42), {3,39}, (5,15}, {6,32}},
{{O,O}, {4,53}, {1l,43}, (3,38), {5,14}, (6,32)),
{{O,O), (4,53), (11,43), {3,38), (5,14), {6,32}},
{{O,O}, (4,54), (1l,43), {3,38}, {5,14}, {6,32}},
{{O,O}, (4,54), {1l,43}, {3,37}, {5,13}, (6,31)},
{ {0, °},{4, 55} , (11, 43), (3, 37 ) , {5, 13} , {6, 31 }},
({O,O), (4,56), (1l,43), {3,37}, (5,13), (6,31)),
{{O,O}, (4,56), {1l,44), (3,37), (5,12), (6,31)},
{{O,O}, (4,57), {1l,44}, (3,36), {5,12), (6,31)},
{{O,O}, (4,57), (1l,44), {3,36), (5,12), {6,31}),
{(O,O), (4,58), (11,44), {3,36), {5,12), (6,30)),
{( 0, 0), {4, 58 }, {ll, 44 ) , {3, 36 }, (5, 11 ) , {6, 3 ° }),
((0,0), (4,59), (1l,45}, (3,36), {5,ll}, (6,30)),
( (0, 0) , (5, 0) , {11, 45} , (3, 35) , (5, ll) , (6, 30) },
( (0, 0) , {5, O}, ( 11, 45} , {3, 35} , {5, ll} , ( 6, 30) },
{(O, 0) , {5, 1 }, (ll, 46) , {3, 35), (5, 11) , {6, 30} ) ,
{{o, °},{5, 1 }, {ll, 46} , (3, 35) , (5, 11 }, {6, 3 °}},{{O,O}, {5,2}, {1l,46}, {3,35}, (5,1l), (6,30)),
({O,O), (5,3), (1l,47), {3,35), (5,1l), (6,31}),
({O,O), {5,3}, (ll, 47), (3,35), (5, ll}, {6,31}},
{{O,O}, {O,O}, {O,O}, (O,O}, (O,O), (O,O}) },
{ ({O,O), (O,O), (O,O}, (O,O}, {O,O}, (O,O}),
{{O,O), {5,4}, (11,47), (3,35}, (5,1l), {6,31}},
{{O,O}, {5,4}, (11,48), {3,35), {5,1l), {6,31)),
{ ( 0, °),(5, 5) , (11, 48 ) , {3, 35) , (5, 11 ) , {6, 31} },
{ (O, °),{5, 6} , {ll, 48 }, (3, 35) , {5, 11 }, (6, 31 ) },
{{O, °},{5, 6} , {11, 49} , (3, 36 }, {5, 11 ) , {6, 31 }) ,
({O,O), {5,7}, {1l,49}, {3,36), {5,12}, (6,32}),
{{0, °},{5, 7 ), {11 , 5 °},{3, 36 }, {5, 12} , {6, 32 ) },
{{0, ° },(5, 8 ) , ( 11 , 50) , (3, 36), {5, 12) , {6, 32 }) ,
{( 0, °),{5, 9), (11, 51 ) , {3, 36) , (5, 12 ) , (6, 33 ) ),
({O,O), {5,9), {1l,51}, (3,37), {5,12}, {6,33)),
39
{{O,O}, {5,10j, {1l,51}, {3,37), 15,13), {6,33)),
({O,O), 15,10}, {1l,52), {3,37}, 15,13}, (6,33)),
I {0, ° ),{5, 11 ) , {ll, 52 ) , I3, 37 }, {5, 13 }, (6, 34 ) ) ,
{{O,O), 15,11), {1l,53), 13,38}, {5,l4), 16,34)),
{{O,0) , 15, 12}, {ll, 53) , 13, 38}, (5, 14 ) , {6, 35) j ,
({O,O), {5,13), {1l,54}, 13,38}, (5,14), {6,35}),
{{0, ° },{5, 13 ) , {ll, 54} , {3, 39) , {5, 15 j , {6, 35 }},
{(O, 0) , {5, 14 }, {11, 55} , {3, 39) , 15, 15} , {6, 36} },
{10, O}, {5, 14 }, Ill, 55}, {3, 4O}, {5, 16} , {6,36} },
({O,O), 15,15}, 111,56), {3,40}, {5,16}, 16,37)),
{(O, 0) , {5, 15) , (ll, 56) , 13, 41}, {5, 17}, 16, 37) },
I 10, O}, {5, 16) , (11,57) , 13, 41) , (5, 17) , {6, 38} },
{{O,o}, (5, 16) , {11, 57}, (3, 42) , 15, 18) , {6, 38} },
{(o, 0) , {5, 17) , (11, 58) , {3, 42} , 15, 18} , {6,39} },
({O,O), {S,17}, (1l,58), {3,43}, 15,19}, (6,39)},
I 10, O}, {5, 18} , (11,59) , 13, 43} , {5, 19) , 16,4 0) },
{(O, 0) , {5, 18}, {1l,59} , 13, 44 }, (5, 20) , 16, 4O}},
{{O,O}, {5,19}, (12,0), (3,44), {5,20}, {6,41)},
({O,O), 15,19}, 112,0), 13,45}, {5,21}, (6,42)),
{{O,O}, {5, 19), {12,1}, {3,46}, (5,22), (6,42)),
{{O,O}, (5, 20), (12, 1), {3, 46}, {5, 22} , {6, 43} )
} };
unsigned char mask, j=O,
ssd(31] ={O, 1, 2, 3, 4, 5, 6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8, 9};
char count_sec, hour, min, min_min, sec, day, month, year, flag, prev_min,
read time;
unsigned char show_hour, show_min, show_day, show_month, show_year;
unsigned char int flag, int_count, intsegment, done;
volatile unsigned char count,dl,d2,d3,d4,dS,d6,HH,HL,MH,MLi/I,SH,SLi
void de 1 aY_ffis (unsigned int rns)
/* delay for a minimum of <rns> */
{
II we use a calibrated macro. This is more
II accurate and not so much compiler dependent
II as self made code.
while (ms) I
_de1ay_ms(1.000};
mS--i
void setupTimer1(}
II Normal port operation, OC1A and OC1B disconnected
II Leave bits COM1A1through COM1BOof TCCR1Aas default zero values
II presca1e CK/1024
{
TCCR1B 1- (1 « CS12) (1« CS10 )
TlFRl 1- (1 « TOV1); II clear the overflow flag
TlMSKl 1= (I « TOlEl ); II enable overflow interrupt
return;
40
ISR(PCINTl_vect)
(
unsigned char temp;
count sec++;
count_sec%~120;
if (count sec=~O)
(
temp~read_ds1307(1);
d2~temp & OxOF;
dl~(temp»4) & Ox07;
min=dl*lO+d2;
if (min=~O)
(
temp=read_ds1307(2);
d2~temp & OxOF;
dl=(temp»4) & Ox03;
hour~dl*lO+d2;
if (hour~~O )
(
temp~read_ds1307(4);
d2~temp & OxOF;
dl~(temp»4) & Ox03;
day=dl*lO+d2;
if (day~~l)
(
temp=read_ds1307(5);
d2~temp & OxOF;
dl~(temp»4) & OxOl;
month~dl*lO+d2;
if (month=~l)
(
temp~read_ds1307(6);
d2~temp & OxOF;
dl=(temp»4) & OxOF;
year~dl*lO+d2;
)
if(done) done--;
if lint_segment)
(
if(int segment~~l)
(
show_hour=!show_houri
show_min=show_day=show_month=show year=l;
)
else if(int_segrnent~=2)
{
4
show_min=!show_min;
show_hour=show_day=show_month=show year=l;
}
else if(int segment=~3}
{
show_day=!show_day;
show_hour=show_min=show_month=show_year=l;
}
else if(int segment~~4)
{
show_month= ! show_month;
show_hour=show_min=show_day=show_year=l;
}
else if(int_segment~~S)
{
show_year=!show_year;
show hour=show min=show_day=show_month=l;
}
PORTDI~(l«PDS);
}
if (! int segment)
{
if(flag) PORTD&~-(l«PDS);
else PORTDI=(l«PDS);
flag=! flag;
}
int main ()
{
unsigned char i,k,temp;
unsigned char
mask_mode~Ob00000100,mask_up=Ob00001000,mask_down~ObOO010000;
DDRB OxFF;
DDRC ~ Ob11111011;
DDRD &~ -(1 « PD2) ;IIPD2 as input
DDRD &~ -(1 « PD3);IIPD3 as input
DDRD &~ - (1 « PD4) ;IIPD4 as input
DDRD I~ (1 « PDS) ; IIPDS as output
int segment~O; II Do not blink any seven segment;
Show_hour=show_min=show_day=show_month=show_year=l;
PORTC I~ (1 « PC1);
for(i~0;i<32;i++)
(
IloutputToPin('C',O,O);
IloutputToPin('C',O,l);
PORTC &~ -(1 « PCO);
PORTC I~ (1 « PCO);
)
42
PCICR I~ Ox02;
PCMSKI ~ Ox04;
sei () ;
i2c_init();
start_ds1307();
liEnable Pin Change Interrupt Enable 1
IIPCINTIO pin selected for pin change interrupt
temp=OblOOlOOOO;
write_ds1307(7,temp);
min=read_ds1307(1);
hour~read_ds1307(2);
temp=hour:
d2~temp & OxOF;
dl~(temp»4) & Ox03;
ternp=min;
d4~temp & OxOF;
d3~(temp»4) & Ox07;
hour~dl*lO+d2;
min=d3*lO+d4;
day=read_ds1307(4);
d2~day & OxOF;
dl~(day»4) & Ox03;
day~dl*lO+d2;
month=read_ds1307(5);
d2_onth & OxOF;
dl=(month»4) & OxOl;
month~dl*lO+d2;
year=read_ds1307(6);
d2=year & OxOF;
dl=(year»4) & OxOF;
year=dl*lO+d2;
sec=read_ds1307(O);
d2~sec & OxOF;
dl=(sec»4) & Ox07;
sec=dl*10+d2:
count_sec=sec*2;
done~O;
flag~l;
while (1)
{
j~O;
43
pushed
hour clock
k~O;
temp~PIND;
if(((temp&mask_mode)~~mask_mode) && !done) IIMode btton is
(
int_flag~l;
//int_count=6;
done~2;
int_segment++:
if(int segment==6) II when all mode selects are done
{
int_segment=O:
lnt flag~O;
temp=min:
d2~temp%lO; II second digit of min
temp/~lO;
dl=temp%lO; II first digit of min
d2 I~ dl«4;
write_ds1307(1,d2);
temp=hour:
d2~temp%lO; II second digit of hour
temp/=lO;
dl~temp%lO; II first digit of hour
d2 I~ dl«4;
write_ds1307(2,d2);
write_ds1307 (2,read_ds1307 (2) & -(1«6) ); Iiset 24
temp~day;
d2=temp%lO; II second digit of day
temp/~lO;
dl~temp%lO; II first digit of day
d2 I~ dl«4;
write_ds1307(4,d2);
temp=month:
d2=temp%lO; II second digit of month
temp/~lO;
dl=temp%lO; II first digit of month
d2 I~ dl«4;
write_ds1307(5,d2);
temp=year;
d2=temp%lO; II second digit of year
temp/~lO;
dl=temp%lO; II first digit of year
d2 I~ .dl«4;
write_ds1307(6,d2);
temp~OxOO;
write_ds1307(O,temp); Ilsec~O;
count=O:
44
count_sec=O;
show_hour=show_min=show_day=show_month=show_year=!;
)
)
if (int_segment)
{
if(((temp&mask_up)==mask_up) && !done)
(
done=!;
if (int_segment~~l)
{
hour++;
show_hour=!;
hour%=24;
)
else if(int_segrnent~~2)
(
min++;
show_min=!;
min%=60;
)
else if(int_segrnent~~3)
{
day++;
show_day=l;
day~(day%3l)+1;
)
else if(int_segrnent~~4)
{
month++;
show_month~l;
month=rnonth%12+l;
}
else if(int_segrnent~~5}
(
year++;
show_year=!;
year%~lOO;
)
}
else if(((temp&mask_down)==rnask down) && !done)
{
done=!;
if (int_segment==l)
{
hour--;
show_hour=!;
if (hour==-l )
hour=23;
)
else if(int_segment~=2)
{
min--;
show_min=1;
if (min~~-l) min=59;
45
}
else if(int_segment~~3)
{
day--;
show_day~l;
if (day==O) day~3l;
}
else if(int segment~~4)
{
month--:
show_month=l:
if (month~~O) month~12;
)
else if(int_segment~~5)
{
year--:
show_year=l:
if (year==-l) year~99;
)
if (show_hour)
{
temp=hour;
ssd[l]~temp%lO;
temp/~lO;
ssd[O]=temp%lO;
)
else
{
ssd[O]=ssd[l]=lO; II Thurning the hour segments off
)
if (show_min)
(
temp=rnin:
ssd[3]~temp%10;
temp/~lO;
ssd[2]~temp%lO;
)
else
{
ssd[2]~ssd[3]~lO; II Thurning the minute segments off
)
if (show_day)
(
temp~day;
ssd[5)~temp%lO;
temp/=lO;
ssd[41~temp%lO;
)
else
{
ssd[4]=ssd[5]=lO; II Thurning the day segments off
)
if (show_month)
46
{
ternp=rnonthi
ssd I7)~temp%10;
temp/~10;
ssd(6)~temp%10;
)
else
{
ssd[6)~ssd(7J~10; II Thurning the month segments off
)
if (show_year)
{
temp=yeari
ssd(9J~temp%10;
temp/~10;
ssd[8]~temp%10;
)
else
(
ssd(8)=ssd[9]~10; II Thurning the year segments off
)
IIFazr;
temp~pgm_read_byte(&time[month) [day] [1].hh);
ssd (11J~temp% 10;
temp/~10;
ssd[10]~temp%10;
temp~pgm_read_byte{&timelmonth] [day) (1).rom);
ssd[13]~temp%10;
temp/=10;
ssd[12]=temp%10;
I IDuhr;
temp~pgm read_byte (&time(month] [day] [2].hh);
ssd[15]=temp%10;
temp/~10;
ssd [14]=temp% 10;
temp~pgm_read_byte(&time[month] [day] [2].rom);
ssd[17j=temp%10;
temp/~10;
ssd[16)=temp%10;
IIAsr;
temp=pgm_read_byte(&time[monthl [day] [3).hh);
ssd[191~temp%10;
temp/~10;
ssd[181~temp%10;
47
temp~pgm_read_byte(&time[month) [dayJ (3).mm);
ssd[2l)~temp%lO;
temp/~lO;
ssd[20J~temp%lO;
//Magrib;
temp~pgm_read_byte(&time[monthJ [dayJ [4J.hh);
ssd[23J~temp%lO;
temp/~lO;
ssd[22J~temp%lO;
temp~pgm_read_byte(&time[monthJ [day] (4).mm);
ssd[25J ~temp%10;
temp/~lO;
ssd[24J~temp%lO;
//Esha;
temp~pgm_read_byte(&time[month] [daYJ [5].hh);
ssd[27J~temp%lO;
temp/~lO;
ssd[26J~temp%lO;
temp~pgm_read_byte(&time[month] [dayJ [5J.mm);
ssd[29J~temp%lO;
temp/~lO;
ssd[28)~temp%lO;
for(i~O;i<30;i++)
{
PORTB~(lO);//making the seven segment off
if (j~~l)
PORTC I~ (1 « PC1);
else
PORTC &~ -(1 « PC1);
j~l;
PORTC &~ -(1 « PCO);
PORTC I~ (1 « PCO);
PORTB~ssd [k++J;
_delay_ms(O.l);
)
PORTB~lO;
)
48

More Related Content

Similar to Full thesis ESD msc

library get way management system
library get way management systemlibrary get way management system
library get way management system
Emaz Zee
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
VLSICS Design
 
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc ProcessorDesign and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
VLSICS Design
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
VLSICS Design
 
ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)
ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)
ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)Amit Mangukiya
 
Parallex - The Supercomputer
Parallex - The SupercomputerParallex - The Supercomputer
Parallex - The Supercomputer
Ankit Singh
 
F032031036
F032031036F032031036
F032031036inventy
 
Embedded system for traffic light control
Embedded system for traffic light controlEmbedded system for traffic light control
Embedded system for traffic light control
Madhu Prasad
 
Design of Mechatronics System
Design of Mechatronics SystemDesign of Mechatronics System
Design of Mechatronics System
Veerakumar S
 
Auto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsAuto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between Stations
Madhav Reddy Chintapalli
 
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITSSOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
vivatechijri
 
ProjectReport.docx project report pdf file
ProjectReport.docx project report pdf fileProjectReport.docx project report pdf file
ProjectReport.docx project report pdf file
komkar98230
 
ProjectReport.docx project documentation
ProjectReport.docx project documentationProjectReport.docx project documentation
ProjectReport.docx project documentation
komkar98230
 
Ignou MCA mini project report
Ignou MCA mini project reportIgnou MCA mini project report
Ignou MCA mini project report
Hitesh Jangid
 
Billing project
Billing projectBilling project
Report for-smart-trash-project
Report for-smart-trash-project Report for-smart-trash-project
Report for-smart-trash-project
Aimen Hajri
 

Similar to Full thesis ESD msc (20)

Report
ReportReport
Report
 
library get way management system
library get way management systemlibrary get way management system
library get way management system
 
combinepdf
combinepdfcombinepdf
combinepdf
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
 
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc ProcessorDesign and Analysis of A 32-bit Pipelined MIPS Risc Processor
Design and Analysis of A 32-bit Pipelined MIPS Risc Processor
 
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSORDESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
DESIGN AND ANALYSIS OF A 32-BIT PIPELINED MIPS RISC PROCESSOR
 
ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)
ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)
ONLINE E-WASTE COLLECTION SYSTEM project Report (Approved)
 
Parallex - The Supercomputer
Parallex - The SupercomputerParallex - The Supercomputer
Parallex - The Supercomputer
 
F032031036
F032031036F032031036
F032031036
 
Embedded system for traffic light control
Embedded system for traffic light controlEmbedded system for traffic light control
Embedded system for traffic light control
 
Design of Mechatronics System
Design of Mechatronics SystemDesign of Mechatronics System
Design of Mechatronics System
 
29
2929
29
 
Auto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsAuto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between Stations
 
publication1
publication1publication1
publication1
 
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITSSOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
 
ProjectReport.docx project report pdf file
ProjectReport.docx project report pdf fileProjectReport.docx project report pdf file
ProjectReport.docx project report pdf file
 
ProjectReport.docx project documentation
ProjectReport.docx project documentationProjectReport.docx project documentation
ProjectReport.docx project documentation
 
Ignou MCA mini project report
Ignou MCA mini project reportIgnou MCA mini project report
Ignou MCA mini project report
 
Billing project
Billing projectBilling project
Billing project
 
Report for-smart-trash-project
Report for-smart-trash-project Report for-smart-trash-project
Report for-smart-trash-project
 

More from LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.

লালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALL
লালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALLলালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALL
লালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALL
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
লালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALL
লালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALLলালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALL
লালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALL
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ ৩৬ নং আইন, ২০২৩,
ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ  ৩৬ নং আইন, ২০২৩, ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ  ৩৬ নং আইন, ২০২৩,
ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ ৩৬ নং আইন, ২০২৩,
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
The Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdf
The Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdfThe Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdf
The Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdf
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
DIGITAL COMMERCE LAWS & RULES 2021.docx
DIGITAL COMMERCE LAWS & RULES 2021.docxDIGITAL COMMERCE LAWS & RULES 2021.docx
বিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docx
বিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docxবিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docx
বিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docx
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
সুঃ প্রতিকার আইন ১৮৭৭ নোট.docx
সুঃ প্রতিকার আইন ১৮৭৭ নোট.docxসুঃ প্রতিকার আইন ১৮৭৭ নোট.docx
সুঃ প্রতিকার আইন ১৮৭৭ নোট.docx
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 

More from LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD. (20)

লালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALL
লালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALLলালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALL
লালমনিরহাট ৩ আসনের ভোট কেন্দ্র সমুহ - LALMONIRHAT 3 SADAR VOTE CENTER ALL
 
লালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALL
লালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALLলালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALL
লালমনিরহাট ৩ আসনের ওয়ার্ড সমূহ - LALMONIRHAT 3 WARD LIST ALL
 
ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ ৩৬ নং আইন, ২০২৩,
ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ  ৩৬ নং আইন, ২০২৩, ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ  ৩৬ নং আইন, ২০২৩,
ভূমি সংশ্লিষ্ট অপরাধ প্রতিকার ও প্রতিরোধ ৩৬ নং আইন, ২০২৩,
 
CrPC BARE ACT -1898 BANGLA.pdf
CrPC BARE ACT -1898  BANGLA.pdfCrPC BARE ACT -1898  BANGLA.pdf
CrPC BARE ACT -1898 BANGLA.pdf
 
CPC BARE ACT -1908 BANGLA.pdf
CPC BARE ACT -1908  BANGLA.pdfCPC BARE ACT -1908  BANGLA.pdf
CPC BARE ACT -1908 BANGLA.pdf
 
PC BARE ACT -1860 BANGLA.pdf
PC BARE ACT -1860  BANGLA.pdfPC BARE ACT -1860  BANGLA.pdf
PC BARE ACT -1860 BANGLA.pdf
 
SR BARE ACT -1877 BANGLA.pdf
SR BARE ACT -1877  BANGLA.pdfSR BARE ACT -1877  BANGLA.pdf
SR BARE ACT -1877 BANGLA.pdf
 
The Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdf
The Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdfThe Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdf
The Bangladesh Legal Practitioner_s and Bar Council Order, 1972.pdf
 
LA BARE ACT -1908 BANGLA.pdf
LA BARE ACT -1908  BANGLA.pdfLA BARE ACT -1908  BANGLA.pdf
LA BARE ACT -1908 BANGLA.pdf
 
EA BARE ACT -1872 BANGLA.pdf
EA BARE ACT -1872  BANGLA.pdfEA BARE ACT -1872  BANGLA.pdf
EA BARE ACT -1872 BANGLA.pdf
 
DIGITAL COMMERCE LAWS & RULES 2021.docx
DIGITAL COMMERCE LAWS & RULES 2021.docxDIGITAL COMMERCE LAWS & RULES 2021.docx
DIGITAL COMMERCE LAWS & RULES 2021.docx
 
Programming Your Home Automate with Arduino, Android, and Your Computer.pdf
Programming Your Home Automate with Arduino, Android, and Your Computer.pdfProgramming Your Home Automate with Arduino, Android, and Your Computer.pdf
Programming Your Home Automate with Arduino, Android, and Your Computer.pdf
 
Web site Review & Description by tanbircox.pdf
Web site Review & Description by tanbircox.pdfWeb site Review & Description by tanbircox.pdf
Web site Review & Description by tanbircox.pdf
 
Basic Electronics.pdf
Basic Electronics.pdfBasic Electronics.pdf
Basic Electronics.pdf
 
Circuit book_PP.pdf
Circuit book_PP.pdfCircuit book_PP.pdf
Circuit book_PP.pdf
 
Microcontroller.pdf
Microcontroller.pdfMicrocontroller.pdf
Microcontroller.pdf
 
Digital_electronics_dynamic.pdf
Digital_electronics_dynamic.pdfDigital_electronics_dynamic.pdf
Digital_electronics_dynamic.pdf
 
Project Electronics_Copy.pdf
Project Electronics_Copy.pdfProject Electronics_Copy.pdf
Project Electronics_Copy.pdf
 
বিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docx
বিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docxবিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docx
বিবিসি রুলেস ও অরডার, ১৯৭২ বেয়ার এক্ট -BBC BARE ACT.docx
 
সুঃ প্রতিকার আইন ১৮৭৭ নোট.docx
সুঃ প্রতিকার আইন ১৮৭৭ নোট.docxসুঃ প্রতিকার আইন ১৮৭৭ নোট.docx
সুঃ প্রতিকার আইন ১৮৭৭ নোট.docx
 

Recently uploaded

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 

Recently uploaded (20)

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 

Full thesis ESD msc

  • 1. DEVELOPMENT OF AN EMBEDDED SYSTEM FOR LOW POWER MESSAGE DISPLAY USING SCANNING TECHNIQUE by Mohammad Mohidur Rahman Khan MASTER OF ENGINEERING IN INFORMA nON AND COMMUNICA nON • TECHNOLOGY 111111111 1111111111111111111111 "' #10~899# Institute ofInformation and Communication Technology BANGLADESH UNIVERSITY OF ENGINEERING AND TECHNOLOGY August, 2008
  • 2. The project titled "Development of an Embedded System for Low Power Message Display Using Scanning Technique" submitted by Mohammad Mohidur Rahman Khan, Roll No. M04053 118, Session April-2005 has been accepted as satisfactory in partial fulfillment of the requirement for the degree of Master of Engineering (ICT) held on 19th August, 2008. BOARD OF EXAMINERS cW=--_I. Dr. Md. Liakot Ali Assistant Pro fessor Institute of Information and Communication Technology BUET, Dhaka-1000. v~ 1/ 2. Dr. S. M. Lutful Kabir Professor and Director Institute ofInformation and Communication Technology BUET, Dhaka-1000. 3. Dr. Md. Abul Kashem Mia Professor and Associate Director Institute ofInformation and Communication Technology BUET, Dhaka-1000. II Chairman Member Member "
  • 3. Candidate's Declaration It is hereby declared that this project or any part of it has not been submitted elsewhere for the award of any degree or diploma. Mohammad Mohidur Rahman Khan III
  • 5. Table of Contents Title Board of Examiners Candidate's Declaration Table of Contents List of Figures List of Tables Acknowledgement Abstract Chapter 1: Introduction 1.1 Overview 1.2 Background and present state of the problem 1.3 Objectives with specific aims and possible outcome Chapter 2: Literature Review 2.1 Display System 2.2 Basic types of Electronic Display 2.2.1 Commonly Used Analog Electronic Display 2.2.2 Commonly Used Digital Electronic Display 2.3 MicrocontrolJer 2.4 Decoder 2.5 Shift Register 2.5.1 Types of shi/i register 2.6 Real Time Clock (RTC) 2.6.1 Purpose 2.6.2 Power Source 2.6.3 Timing Chapter 3 Methodology v Page No. II III V VII VIII IX X 1 2 3 3 3 3 4 7 8 8 9 11 11 II 12 13
  • 6. 3.1 Introduction 3.2 Analysis of the proposed system 3.3 Block Diagram of the system 3.4 Devices used for the proposed system 3.4.1 Atmel ATMEGA88 - 8 bit Microconlroller 3.4.2 BCD 10 7-segmenl latch/decoder/driver (CD4511 BE) 3.4.38 bil Serial-Input Parallel- Outpul Shift Register (74HCI64) 3.4.4 Real Time Clock (DS1307) 3.5 Softwares Used For the Proposed System 3.5.1 WinAVR 3.5.2 A VR Studio 5.0 3.5.3 Easy-PC 4.0 3.5.4 Circuit Maker 4.0 Chapter 4: Results and Discussions 4.1 Introduction 4.2 Schematic Design 4.3 Printed Circuit Board (PCB) Design 4.4 The Artview of the Proposed System 4.5 Result Chapter 5: Conclusion 5.1 Conclusion 5.2 Suggestions for Future Works References Appendix A vi 13 13 13 15 15 16 18 19 20 20 21 21 21 22 22 22 24 24 24 24 24 24 24 24
  • 7. List of Figures Title Figure 2.1: Cathode Ray Tube (CRT) Display Figure 2.2: Different Types of Light Emitting Diode (LED) Figure 2.3: Seven Segment Display Figure 2.4: Segments of a 7-Segment Display Figure 2.5: Microcontroller Figure 2.6: 4-Bit SIPO Shift Register Figure 2.7: 4-Bit PI SO Shift Register Figure 3.1: Block Diagram of the Proposed System Figure 3.2: Pinning Diagram Atmega88 Figure 3.3: Pinning Diagram of 7-Segment Decoder Figure 3.4: Logic Diagram of74HCI64 Figure 3.5: Pin Assignment of74HCI64 Figure 3.6: Pin Assignment Of OS 1307 Figure 3.7: DSI307 Address Map Figure 3.8: OS 1307 Time Keeper Register Figure 4.1: Schematic Diagram of the Proposed System Figure 4.2 PCB Diagram of the Proposed System Figure 4.3 The Artview of the Proposed System VII Page No. 4 4 6 6 7 10 II 14 16 17 18 18 19 19 20 24 26 27
  • 8. List of Tables Title Table 3.1: Fuction Table of7-Segment Decoder Table 3.2: Fuction Table of74hcl64 Table 3.3: DS1307 Square Wave Output Frequency Table 4.1: Current Consumption of the System viii Page No 17 19 20 28
  • 9. Acknowledgement First of all I would like to thank the almighty Allah for giving me the opportunity to conduct this project. I would like to express my sincere thanks to my project supervisor, Dr. Md. Liakot Ali, for giving me the opportunity to conduct this project. I am grateful to pursue my project under his supervision. Without his ever helping personalities, this project would not have got the success. I would like to convey my thanks to Professor Dr. S. M. Lutful Kabir, Director, lICT, BUET. His motivation and inspiration gave me the courage to do this work. I gratefully acknowledge the restless support and advice of my fellow classmate and friend Md. Faruq Ahmed Jewel during the design and implementation phase of this project. I want to convey my thanks to one of my very good friends Nowshad Ibne Alam (Arnob) for giving his valuable time while I was buying the apparatus for my project. My thanks also go to another very good friend Md. Sabbir Hasan for his support during the documentation phase of the project. My special thanks to all the teachers, students and staffs oflICT, BUET. I would like to thanks all my friends for their continuous support and inspiration throughout the whole period of this undertaking. IX
  • 10. Abstract Electronic display is now the most conventional means of presenting information all over the world. Due to its attractive brightness and simple operability, it is one of the most popular medium of presenting different types of information to the mass people. The display elements in an embedded system consume the major portion of the total power required to run the whole system. When large amount of display elements are used power dissipation issue becomes acute. In many cases special cooling arrangements like heat sink, cool air circulation, fan etc. are used to keep the system workable. The demand of low power consumption for embedded systems motivates to explore new approaches for managing power. This project proposes an alternative approach to develop a low power consuming embedded system for message display by introducing a new scanning technique. In the proposed system a controller scans all the display units continuously to ensure that only one unit is on at any given time. In this way power consumption will be much lower than that of existing static display system. Here a 'Muslim Calendar' containing date, time and prayer times for five salah has been developed as a test case. Seven segment displays are used as display units. x
  • 11. 1.1 Overview Chapter 1 Introduction Electronic display-we see it everywhere, in computers, watches, DVD players and many other electronic devices to display numeric and some alphabetic characters. It is also used for showing messages in digital calendars, billboards, shopping malls, airports, stadiums and many other places. It is a commonly used and efficient way of displaying information. The use of electronic displays for presentation of graphs, symbols, alphanumerics, and still or video pictures has doubled every several years, in parallel with the rapid expansion of microelectronics. Electronic displays have largely replaced traditional mechanical devices, counters, galvanometers, and to a degree, hardcopy (paper) means for presenting information. This change is due to the increased use of computers, microprocessors, inexpensive large- scale integration (LSI) electronics, and digital mass memories. Although electronic display is widely used, power consumption is still an important issue. In an electronic circuit, the major part of the total power is consumed by the display elements. If a large amount of display units are used in a system then the power requirement to run the system will also increase proportionately. In that case extra cooling arrangements may be required to keep the system workable. So the demands of low power consumption for embedded systems are motivating new approaches to manage power dissipations issues. 1.2 Background and Present State of the Problem A lot of research works have been done for displaying numeric digits of languages other than English where the researchers used Seven Segment Display or some modification on it [1-3]. Display is one of the major power consumers in modern computer system [4]. Power consumption is even more critical when multiple display units are used together for displaying message. In some cases, it needs extra cooling arrangements for heat dissipation. Researchers
  • 12. '. have proposed plasma screen or organic light-emitting devices (OLEO) to reduce power consumption for display element [5, 6]. So reducing the power consumption for display element is an important research area. 1.3 Objectives with Specific Aims and Possible Outcome: The major objectives of the project are as follows. i) To study different types of display devices, ii) To develop small prototypes on the bread-board, iii) To design a Printed Circuit Board (PCB) and iv) To implement the proposed system on the PCB. Here as a test case a calendar will be developed where the following information will be displayed using seven segment display. a) Date, b) Time and c) Prayer times of five salah for any given date. 1.4 Organization of the Project Chapter I of this report starts with impact of power consumption in the digital circuits by display units followed by a brief background of power dissipation issues of electronic display, objectives and organization of this report. In Chapter 2 of this report, issues from all aspects in developing the proposed system have been reviewed. Detail methodology of the proposed system has been discussed elaborately in chapter 3. In chapter 4 step by step design and development and obtained result of the proposed system have been discussed. In the final chapter (Chapter 5) conclusion and recommendation for future works has been stated. The project report ends with an appendix that contains the program code of the system. 2
  • 13. Chapter 2 Literature Review 2.1 Display System A display device is a device for presentation of information for visual reception, acquired, stored, or transmitted in various forms. When the input information is supplied as an electrical signal, the display is called "electronic display". An electronic component used to convert electrical signals into visual imagery in real time suitable for direct interpretation by a human operator. It serves as the visual interface between human and machine. The visual imagery is processed, composed, and optimized for easy interpretation and minimum reading error. 2.2 Basic types of Electronic Display There are two basic types of displays. They are: • Analog Electronic Display • Digital Electronic Display The following subsections briefly describe different types of displays systems that are commonly used. 2.2.1 Commonly Used Analog Electronic Display The cathode ray tube (CRT) display is the most commonly used analog electronic display. The cathode ray tube (CRT) is a vacuum tube containing an electron gun (a source of electrons) and a fluorescent screen, with internal or external means to accelerate and deflect the electron beam, used to form images in the form of light emitted from the fluorescent screen. The image may represent electrical waveforms (oscilloscope), pictures (television, computer monitor), radar targets and others. The single electron beam can be processed in such a way as to display moving pictures in natural colors. 3
  • 14. 1. Electron guns 2. Electron beams 3. Focusing coils 4. Deflection coils 5. Anode connection 6. Mask for separating beams for red, green, and blue part of displayed image 7. Phosphor layer with red, green, and blue zones 8. Close-up of the phosphor-coated inner side of the screen Figure 2. I : Cathode Ray Tube (CRT) Display 2.2.2 Commollly Used Digital Electrollic Display There are many examples of digital electronic displays. Among them light emitting diode (LED), liquid crystal display (LCD) and seven segment display are most common. a) Light Emitting Diode (LED) A light-emitting diode is a semiconductor diode that emits incoherent narrow-spectrum light when electrically biased in the forward direction of the p-n junction, as in the common LED circuit. This effect is a form of electroluminescence. Figure 2.2: Different types of Light Emitting Diode (LED) An LED is usually a small area light source, often with optics added to the chip to shape its radiation pattern. LEOs are often used as small indicator lights on electronic devices and increasingly in higher power applications such as flashlights and area lighting. The color of 4
  • 15. the emitted light depends on the composition and condition of the semiconducting material used, and can be infrared, visible, or ultraviolet. LEOs can also be used as a regular household light source. Besides lighting, interesting applications include sterilization of water and disinfection of devices. b) Liquid Crystal Display (LCD) A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector. A low-power flat-panel display used in many laptop computers, calculators and digital watches, made up of a liquid crystal that is sandwiched between layers of glass or plastic and becomes opaque when electric current passes through it. The contrast between the opaque and transparent areas forms visible characters. LCD is a display technology that uses rod-shaped molecules (liquid crystals) that flow like liquid and bend light. When not energized, the crystals direct light through two polarizing filters, allowing a natural background color to show. When energized, they redirect the light to be absorbed in one of the polarizers, causing the dark appearance of crossed polarizers to show. The more the molecules are twisted, the better the contrast and viewing angle. Because it takes less power to move molecules than to energize a light-emitting device, LCOs replaced the light-emitting diodes (LEOs) in digital watches in the 1970s. LCOs were then widely used for a myriad of monochrome displays and still are. In the 1990s, color LCD screens caused sales of laptop computers to explode, and in 2003, more LCD monitors were sold for desktop computers than CRTs. c) Seven Segment Display A common display found on digital watches and readouts that looks like a series of 8s. Each digit is formed by selective illumination of up to seven separately addressable bars. A seven segment display, as its name indicates, is composed of seven elements. Individually on or off, they can be combined to produce simplified representations of the Hindu-Arabic numerals. Often the seven segments are arranged in an oblique, or italic, arrangement, which aids readability. 5
  • 16. The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top and bottom. Additionally, the seventh segment bisects the rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for full alphanumerics); however, these have mostly been replaced by dot-matrix displays. Figure 2.3: Seven Segment Display The segments of a 7-segment display are referred to by the letters A to G, as shown bellow, where the optional DP decimal point (an "eighth segment") is used for the display of non- integer numbers. Figure 2.4: Segments of a 7-segment display 6
  • 17. 2.3 Microcontroller A microcontroller (also MCU or !!C) is a computer-on-a-chip, containing a processor, memory, and input/output functions. It is a microprocessor emphasizing high integration, in contrast to a general-purpose microprocessor (the kind used in a PC). In addition to the usual arithmetic and logic elements of a general purpose microprocessor, the microcontroller integrates additional elements such as read-write memory for data storage, read-only memory for program storage, EEPROM for permanent data storage, peripheral devices, and input/output interfaces. At clock speeds of as little as a few MHz or even lower, microcontrollers often operate at very low speed compared to modern day microprocessors, but this is adequate for typical applications. They consume relatively little power (milliwatts), and will generally have the ability to sleep while waiting for an interesting peripheral event such as a button press to wake them up again to do something. Power consumption while sleeping may be just nanowatts, making them ideal for low power and long lasting battery appl ications. Microcontrollers are frequently used in automatically controlled products and devices, such as automobile engine control systems, remote controls, office machines, appliances, power tools, and toys. By reducing the size, cost, and power consumption compared to a design using a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to electronically control many more processes. Figure 2.5: Microcontroller 7
  • 18. A microcontroller is a single integrated circuit, commonly with the following features: • central processing unit - ranging from small and simple 4-bit processors to complex 32- or 64-bit processors • discrete input and output bits, allowing control or detection of the logic state of an individual package pin • serial input/output such as serial ports (VARTs) • other serial communications interfaces like FC, Serial Peripheral Interface and Controller Area Network for system interconnect • peripherals such as timers and watchdog • volatile memory (RAM) for data storage • ROM, EPROM, [EEPROM] or Flash memory for program and operating parameter storage • clock generator - often an oscillator for a quartz timing crystal, resonator or RC circuit • many include analog-to-digital converters 2.4 Decoder Decoder is a multiple-input, multiple-output logic circuit that converts coded inputs into coded outputs, where the input and output codes are different. e.g. n-to-2n, BCD decoders. Enable inputs must be on for the decoder to function, otherwise its outputs assume a single "disabled" output code word. Decoding is necessary in applications such as data multiplexing, 7 segment display and memory address decoding. The simplest decoder circuit would be an AND gate because the output of an AND gate is "High" (I) only when all its inputs are "High". 2.5 Shift Register In digital circuits a shift register is a group of flip flops set up in a linear fashion which have their inputs and outputs connected together in such a way that the data is shifted down the line when the circuit is activated. 8
  • 19. 2.5.1 Types of Shift Register Shift registers can have a combination of serial and parallel inputs and outputs, including serial-in, parallel-out (SIPO) and parallel-in, serial-out (PISO) types. There are also types that have both serial and parallel input and types with serial and parallel output. There are also bi- directional shift registers which allow you to vary the direction of the shift register. The serial input and outputs of a register can also be connected together to create a circular shift register. One could also create multi-dimensional shift registers, which can perform more complex computation. i) Serial-In, Serial-Out aj Destructive readout: These are the simplest kind of shift register. The data string is presented at 'Data In', and is shifted right one stage each time 'Data Advance' is brought high. At each advance, the bit on the far left (i.e. 'Data In') is shifted into the first flip-flop's output. The bit on the far right (Le. 'Data Out') is shifted out and lost. The data are stored after each flip-flop on the 'Q' output, so there are four storage 'slots' available in this arrangement, hence it is a 4-Bit Register. To give an idea of the shifting pattern, imagine that the register holds 0000 (so all storage slots are empty). As 'Data In' presents I, I,0, I,0,0,0,0 (in that order, with a pulse at 'Data Advance' each time. This is called clocking or strobing) to the register, this is the result. The left hand column corresponds to the left-most flip-flop's output pin, and so on. So the serial output of the entire register is J J°J 0000. As one can see if we were to continue to input data, we would get exactly what was put in, but offset by four 'Data Advance' cycles. This arrangement is the hardware equivalent of a queue. Also, at any time, the whole register can be set to zero by bringing the reset (R) pins high. bj Non-destructive Readout Non-destructive readout can be achieved using the configuration shown below. Another input line is added - the Read/Write Control. When this is high (i.e. write) then the shift register behaves as normal, advancing the input data one place for every clock cycle, and data can be 9
  • 20. lost from the end of the register. However, when the R/W control is set low (i.e. read), any data shifted out of the register at the right becomes the next input at the left, and is kept in the system. Therefore, as long as the RlW control is set low, no data can be lost from the system. ii. Serial-In, Parallel-Out This configuration allows conversion from serial to parallel format. Data are input serially, as described in the SISO section above. Once the data has been input, it may be either read off at each output simultaneously, or it can be shifted out and replaced. Data In o S Q o I o S Q R Q I o S Q R Q 03 Io S Q R Q 04 J iii. Parallel-In, Serial-Out Figure 2.6: 4-Bit SIPO Shift Register This configuration has the data input on lines D I through D4 in parallel format. To write the data to the register, the Write/Shift control line must be held LOW. To shift the data, the W/S control line is brought HIGH and the registers are clocked. The arrangement now acts as a SISO shift register, with D I as the Data Input. However, as long as the number of clock cycles is not more than the length of the data-string, the Data Output, Q, will be the parallel data read off in order. 10
  • 21. 01 0' 0' o. --l>-r Cio<ko~-------f 1.-- R_' __ f R ' f Figure 2.7: 4-Bit PISO Shift Register o $ Q C R • 2.6 Real Time Clock (RTC) A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit) that keeps track of the current time. Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device which needs to keep accurate time. 2.6.1 Purpose Although keeping time can be done without an RTC, using one has benefits: • Low power consumption (important when running from alternate power) • Frees the main system for time-critical tasks • Sometimes more accurate than other methods (although personal computer RTC's are often inaccurate) 2.6.2 Power Source RTCs often have an alternate source of power, so they can continue to keep time while the primary source of power is off or unavailable. This alternate source of power is normally a lithium battery in older systems, but some newer systems use a supercapacitor, because they are rechargeable and can be soldered. The alternate power source can also supply power to battery backed RAM. 11
  • 22. 2.6.3 Timing Most RTCs use a crystal oscillator, but some use the power line frequency. In many cases the oscillator's frequency is 32.768 kHz.This is the same frequency used in quartz clocks and watches, and for the same reasons, namely that the frequency is exactly 215 cycles per second, which is a convenient rate to use with simple binary counter circuits. 12
  • 23. Chapter 3 Methodology 3.1 Introduction In electronic circuits the issue of managing heat and power dissipation has become increasingly significant. The display units are the major power consuming units of an electronic circuit. Power consumption increases when the size or the number of display units increases. Sometimes it requires extra cooling arrangements for large display units. Besides one has to ensure that the Power Supply unit he/she uses for the circuit is good enough to supply enough current to illuminate the display units. 3.2 Analysis of the Proposed System This project concentrates on the power dissipation issues for display devices. A scanning technique has been introduced in the proposed to minimize the power consumption for display elements. The objective is to connect all the display elements in parallel with each other and turning only one unit on at a time for a very short period and move to the next unit. If each unit can be illuminated periodically in a very short span of time the human eye will see the entire message as if all the units are turned on whereas only one unit is on at any given time. Here seven segment displays are used as display units and as a test case a Muslim Calendar is developed with 30 units of seven segment display. As the algorithm for illuminating display units follow the scanning technique only one unit of seven segment display is turned on at any given time. So theoretically the total power consumption for illuminating display units is reduced by 30 times. Hence 30 units of seven segment displays can be illuminated by only the power required by one unit. 3.3 Block Diagram of the system The basic units of the proposed system can be divided into the following 7 Parts. I. Microcontroller 2. Display elements 13
  • 24. 3. Display Decoder 4. Real Time Clock (RTC) 5. Shift Registers 6. Power Unit and 7. Switches Display Elements Switches Figure 3.1: Block diagram of the proposed system Here the microcontroller controls the input of the shift registers. The output of the shift registers are connected to the common cathodes of 30 seven segment displays. The microcontroller initializes all the output pins of the shift register at level 1 (sends logic 1 thirty times in the input of the shift registers), making all the seven segment displays to be turned 14
  • 25. off. At this point the microcontroller sends logic 0 once and logic I 29 times so that each display receives the signal 0 sequentially while other displays receive signal I. In this process, only one display is turned at a time and shifted sequentially. The output pins of the display decoder are connected in parallel to all seven segment displays. The Microcontroller sends appropriate input for the decoder when corresponding seven segment display has logic 0 at its common cathode. A real time clock is used to keep the date and time. The microcontroller reads time from the RTC each minute and changes the display clock and date accordingly. The prayer time table is loaded in the program memory of the microcontroller as an array of structure (see Appendix A). The prayer times change with the change of day and month field of the date. There is a battery connected to the RTC so that it can keep the time and date when the main power is not available. Three switches are used to set time and date. One switch is used to select which field of the time and date is to be changed. Other two switches are used to count up and count down the selected field. All these operation is controlled by the microcontroller. 3.4 Devices Used for the Proposed System Some chips/devices have been used for the proposed system. Brief description on those devices is given bellow. 3.4.1 Atmel ATMEGA88 - 8 bit Microcontroller Here this specific microcontroller is used for its following special features . • Advanced RISC Architecture - 131 Powerful Instructions - Most Single Clock Cycle Execution - 32 x 8 General Purpose Working Registers - Fully Static Operation - Up to 20 MIPS Throughput at 20 MHz • High Endurance Non-volatile Memory segments - 8K Bytes of In-System Self-programmable Flash program memory 15
  • 26. -512 Bytes EEPROM - IK Bytes Internal SRAM • In-System Programming by On-chip Boot Program • Peripheral Features - Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode - One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture • Mode - Master/Slave SPI Serial Interface - Byte-oriented 2-wire Serial Interface (Philips 12C compatible) - Interrupt and Wake-up on Pin Change (PClNT14lRESET) PC6 (PCINT16/RXD) PDQ (pcINT17/TXD) po, (PCINT1811NTD) PD2 (PCINT1P/OC2S,.riNT1) P03 (PC1NT20lXCKfTO) P04 vcc DND (PCINT6IXTAllfTOSC t) PB/3 (PCINT7JXTAL2fTOSC2) PB7 (PCtNT21,'OCOBJT1) P05 (PCINT22'OCONAINO) Poe (PCINT231AIN1) PD7 (PCINTOlCLKOIICP1) PBO pe5 (AOC5lSCLJPC1NT13) POt. (AOC4lSOAJPCINT12) PC3 (ADC~?CINTll) PC2 (AOC2iPCINTlD) PCl (ADC1IPCINTD) PeO (ADCQ;PCINT8) GND AREF Avec PBS (SClVPCINT5) P84 (M1SO,'PCINT4) PB3 (MOS"OC2A ?CINT3) P82 ~'OC1B,IPC1NT2) PBl (OC1AiPCINT1) Figure 3.2: Pinning Diagram ATMEGA88 In this project Microcontroller acts as the main controlling unit. Along with the 7-segment decoder and shift registers it controls the total scanning technique. It also reads time from an external Real Time Clock (RTC) using the two wire serial interface. Pin Change interrupt of the microcontroller is used to blink the LEOs used for showing time. The Microcontroller has 8KB Flash program memory where the prayer times for one year is saved as an array. This array is used to display the prayer times for any particular day of a month. 3.4.2 BCD to 7-segment latch/decoder/driver (CD4511BE) The CD4511BE is a BCD to 7-segment latch/decoder/driver with four address inputs (DA to DD), an active LOW latch enable input (EL), an active LOW ripple blanking input (BI), an 16
  • 27. active LOW lamp test input (LT), and seven active HIGH n-p-n bipolar transistor segment outputs (Oa to Og). When EL is LOW, the state of the segment outputs (Oa to Og) is determined by the data on DA to DD. When EL goes HIGH, the last data present on DA to DD are stored in the latches and the segment outputs remain stable. When LT is LOW, all the segment outputs are HIGH independent of all other input conditions. With LT HIGH, a LOW on BI forces all segment outputs LOW. The inputs LT and BI do not affect the latch circuit. HEF4511 B 7273716.1 Figure 3.3: Pinning Diagram of7-Segment Decoder Table 3.1: Fuction Table of7-Segment Decoder INPUTS OUTPUTS EL BI LT Do Dc DB DA 0. 0" 0. °d 0. 0, 0. DISPLAY X X L X X X X H H H H H H H 8 X L H X X X X L L L L L L L blank L H H L L L L H H H H H H L 0 L H H L L L H L H H L L L L 1 L H H L L H L H H L H H L H 2 L H H L L H H H H H H L L H 3 L H H L H L L L H H L L H H 4 L H H L H L H H L H H L H H 5 L H H L H H L L L H H H H H 6 L H H L H H H H H H L L L L 7 L H H H L L L H H H H H H H 8 L H H H L L H H H H L L H H 9 L H H H L H L L L L L L L L blank L H H H L H H L L L L L L L blank L H H H H L L L L L L L L L blank L H H H H L H L L L L L L L blank L H H H H H L L L L L L L L blank L H H H H H H L L L L L L L blank H H H X X X X . 17
  • 28. 3.4.3 8 bit Serial-Input Parallel- Output Shift Register (74HCI64) The MC54174HC 164 is an 8-bit, serial-input to parallel-output shift register. Two serial data inputs, A 1 and A2, are provided so that one input may be used as a data enable. In this project A I and A2 pins are made short as no data enable is required. Data is entered on each rising edge of the clock. The active-low asynchronous Reset overrides the Clock and Serial Data inputs. SERIALIAI 1 DATA 2 INPUTS IV. CLOCK B RESET 9 DATA PIN 14 =Vee PIN 1 ~GND PARALLEl DATA OUTPUTS Figure 3.4: Logic Diagram of74HC164 Al 1 • 14 VCC A2 2 13 QH QA 3 12 QG QB 4 11 QF QC 5 10 QE QD 6 9 RESET GND 7 8 CLOCK Figure 3.5: Pin Assignment of74HCI64 18
  • 29. Table 3.2: Fuction Table of74HCI64 Inputs Outputs Reset Clock A1 A2 OA Os ... OH L X X X L L ... L H .... X X No Change H f H D D QAn ... QGn H f D H D QAn ... QGn D = data input QAn - QGn = data shifted from the preceding stage on a rising edge at the clock input. 3.4.4 Real Time Clock (DSI307) The OS 1307 Serial Real Time Clock is a low power, full BCD Clock/Calendar plus 56 bytes of nonvolatile SRAM. Address and data are transferred serially via a 2-wire bi-directional bus. The Clock/Calendar provides seconds, minutes, hours, day, date, month and year information. The end of the month date is automatically adjusted for months with less than 31 days, including corrections for Leap Year. The clock operates in either the 24 hour or 12 hour format with AM/PM indicator. The OS 1307 has a built-in power sense circuit which detects power failures and automatically switches to the battery supply. x, [lV , v",Xl 2 7 saW/OUT v••, J l! sel GND ~ 5 SOA Figure 3.6: Pin Assignment of OS 1307 OOH 07H 08H 3FH SECONDS MINUTES HOURS DAY DATE J.1ONTH YEAR CONTROL RAM 5th 8 Figure 3.7: OS 1307 Address Map 19
  • 30. I ." I CH "~ "'ex><>s , 10Wl"",Tn WltAlJES , IX ~ "... HOUAS " "" • , • , , I D" • , "om "'''' • , • 1..I.:n. ..,,~ w'"'''' ''''' OUT I ' • ""'" .1.[ ••,[ .••• 01-12 Figure 3.8: OS 1307 Time Keeper Register Table 3.3: OS 1307 Square Wave Output Frequency RSI RSO SOW OUTPUT FREOUENCY 0 0 1Hz 0 1 4.096kHz 1 0 8.192kHz 1 1 32.76SkHz 3.5 Softwares Used for the Proposed System The following softwares were used to develop the proposed system. 3.5.1 WinA VR The WinAVR Library package provides a subset of the standard C library for Atmel AVR 8- bit RISC microcontrollers. In addition, the library provides the basic startup code needed by most applications. In general, it has been WinAVR's goal to stick as best as possible to establish standards while implementing this library. Commonly, this refers to the C library as described by the ANSI X3.159-1989 and ISO/IEC 9899:1990 ("ANSI-C") standard, as well as parts of their successor ISO/IEC 9899: 1999 ("C99"). Some additions have been inspired by other standards like IEEE Std 1003.1-1988 ("POSIX.I"), while other extensions are purely AVR-specific (like the entire program-space string interface). 20
  • 31. Unless otherwise noted, functions of this library are not guaranteed to be reentrant. In particular, any functions that store local state are known to be non-reentrant, as well as functions that manipulate 10 registers like the EEPROM access routines. If these functions are used within both standard and interrupt contexts undefined behavior will result. 3.5.2 AVR Studio 5.0 AVR Studio is an Integrated Development Environment (IDE) for writing and debugging AVR applications in Windows 9x/MEINTI2000/XP/VIST A environments. AVR Studio provides a project management tool, source file editor, simulator, assembler and front-end for C/C++, programming, emulation and on-chip debugging. AVR Studio supports the complete range of ATMEL AVR tools and each release will always contain the latest updates for both the tools and support of new AVR devices. AVR Studio 4 has a modular architecture which allows even more interaction with 3rd party software vendors. GUI plug-ins and other modules can be written and hooked to the system. 3.5.3 Easy-PC 4.0 This software is a PCB designing tool for Windows. Easy-PC really is the latest generation of PCB CAD with no other product currently as advanced or in-line with the Microsoft operating systems - Windows 95/98 and NT. And because Easy-PC has been written using the latest software techniques, object oriented code (C++) and under Windows NT as a true Windows 32 bit application, it can be easily enhanced to accommodate new demands in technology and customer feedback. 3.5.4 Circuit Maker 4.0 CircuitMaker is a powerful, easy-to-use schematic capture and simulation tool in its class. CircuitMaker provides the features of "high-end" design software at a fraction of the cost. Using CircuitMaker's advanced schematic capabilities; one can design electronic circuits and output netlists for TraxMaker and other PCB design tools and autorouters. One can also perform fast, accurate simulations of digital, analog and mixed analog/digital circuits using CircuitMaker's Berkeley SPICE3f5/XSpice-based simulator. 21
  • 32. Chapter 4 Results and Discussions 4.1 Introduction This chapter describes the schematic design and printed circuit board (PCB) design of the proposed system. The Artview of the proposed system is also given here. At the end of this chapter the implementation results of the proposed system are presented. 4.2 Schematic Design Figure 4.1 shows the schematic design of the proposed project. The main part of the project is the Atmel ATMEGA88 microcontroller. All other components are connected to it and controlled by it. The four input pins (00-03) of the seven segment decoder (C045 I 1BE) are connected to the first four pins of port B (PBO-PB3) of the microcontroller. These pins are used to provide the appropriate data to be displayed by a particular seven segment display. The seven output pins (a-g) of the display decoder are connected to all seven segment displays' input pins (a-g) in parallel along with seven 100 nregisters. Four shift registers (74HCI64) are used in this project. The input pins (Osa & Osb) of the first shift register are made short and is connected to the second pin of the Port C (PC I) of the microcontroller. The clock pin (CP) of the shift register is connected to the first pin of the Port C (PCO) of the microcontroller. Each pair of input pins of the rest three shift registers are made short just like the fist one and is connected to the last output pin (Q7) of the immediate previous one. All the output pins of the shift registers are connected to the common cathode of the seven segment displays sequentially. The SOA and SCL pins of the Real Time Clock is connected to the fifth (PC4) and sixth (PC5) pin of the Port C of the microcontroller. Two pull up registers are also connected to these pins. The SQW pin of the RTC is connected to the fourth pin (PC3) of the Port C of the 22
  • 33. microcontroller. A 3.2786 MHz crystal is connected to Xl and X2 pins of the RTC and a 3 volt battery is also connected to its Vb" and GND pin. Three input switches are connected to the third fourth and fifth pin of Port D (PD2-PD4) of the microcontroller. These three pins are made ground with three IOkO registers. 23
  • 34. 74LS164, 'Du 0 Dsb Q Q Q Q Q Q Q 74LS164 :Dsa 071 Dsb 06 Q' Q' g~1 "Q ~5VO.33k DlSP96 DISPl ~rGnd '"' DlSPl '"' 5V 'V abed •• '"' sbede t<l.t [abed, DlSP!.Q.......plSP2 '"' DlSPl Figure 4.1: Schematic diagram of the proposed system 24
  • 35. 4.3 Printed Circuit Board (PCB) Design To design the PCB, a software named Easy PC has been used. Definitions of some components were not found in the software. In those cases the components were made manually by putting Pads according to their Pin configuration. Fig. 4.2 shows the PCB diagram of the proposed project. It is a single layer PCB. The red lines indicate the top copper routing of the Circuit Board. Some jumps have to be made to make the circuit fully functional. In those cases some extra wire connection has been made. 25
  • 37. 4.4 The Artview of the Proposed System After putting all the components on the circuit board and programming the microcontroller the total system looks like as follows. Figure 4.3 The Artview of the Proposed System Here the first block of four (top left corner) seven segment displays shows time. First two units of this block represent hour while second two represent minute. The second block of six (top right corner) seven segment displays represents date where the first, second and third two units of the block represent day, month and year respectively. The remaining five blocks of four seven segment displays represent the prayer times of five salah; Fazr, Zurh, Asr, Maghrib and Esha as labeled in the figure 4.3. Here each first two units of each block represent hour and the remaining two units of each block represent minute. 27
  • 38. There are three buttons: Mode, Up and Down. The Mode button selects which unit of time or date is to be changed. Then the buttons Up and Down are used to count up or down respectively to set the selected unit of time or date. 4.5 Result Scanning technique is a power aware solution for message display. Here we have used 30 seven segment displays. But as scanning technique is applied, at any given time only one seven segment display is on. So, theoritically the system should consume 1/ 30 times less power than it would take to make all the seven segment displays on at a time. But following table shows the practical senario. Table 4.1: Current and Power Consumption by the Display Elements Current and Power Consumpiin for 30 Units of Seven Segment Displays With Scanning Technique Without Scanning Technique Curren Consumption 18mA 75mA Power Comsumption 0.09 watt 0.375 watt So, in practical the power consumption is not as less as 30 times of the total power needed. But still it minimizes the power consumption to a considerable amount that is 76% less power is required to run the display units of the system when the scanning technique is applied. Another important point is for the scanning technique only one Display Decoder is used. If this technique is not applied then 30 Display Decoders should be used for 30 seven segment display. Furthermore a microcontroller has limited number of pins. So, a commonly used microcontroller may not be able to connect all the display decoders at a time due to its fixed number of pins. So, the solution enables a circuit to be operated in less power, less area hence less cost. 28
  • 39. Chapter 5 Conclusion 5.1 Conclusion Power management has a considerable importance in electronic circuits. In electronic displays, power consumption increases with the size and number of the display units. This project uses scanning technique to reduce power consumption. The embedded system developed as a test case demonstrates a power aware solution using scanning technique. The seven segment displays used as display units consume less power when scanning technique is used. Since the algorithm allows only one display unit to be illuminated at any given time rather than all the units receiving power, it consumes significant less power. The scanning technique in the embedded circuit requires only one Display Decoder for all the display units. Scanning technique can be used in numerous ways to minimize power consumption. Applying it in other type of circuits can reduce power usage and reduce material cost as well. 5.2 Suggestions for Future Works As stated, the project has 30 units of seven segment displays and by using scanning technique the total power consumption is reduced by 30 times (theoretically). But a common question may arise; will this technique work if the number of display units is increased by a significant number (1000 or more)? In that case some flickering will be experienced. This is because human eye can hold an image in the brain for only 1/10 of a second. So if the scanning frequency is such that each display unit is illuminated for less than 1/10 of a second, flickering will be observed, that is, power consumption factor will not be inversely proportionate to the number of display units as stated earlier. To remedy this, the scanning technique can be modified in such way that a group of display units would be considered as a cluster. The total system can have number of clusters. The scanning technique will be applied on these clusters so that each cluster will be turned on at 29
  • 40. any given time. But in this case we need to use the same number of display decoders as number of display units in a cluster. In future, the modified scanning technique (clustering approach) can be incorporated in other embedded systems with large number of display units. Some microcontrollers with built-in scanning mechanism are available in the market. Future works can be done using those microcontrollers. Furthermore in this project an extra facility could be incorporated. That is there could be an option for vary the prayer time table for different Mazhabs. 30
  • 41. References: [I] Azad, M. A. K., Sharmeen, R., Ahmed, S. and Kamruzzaman, S. M., "A unique 10 Segment Display for Bangia Numerals" in proceedings of 8th International Conference on Computer and Information Technology (fCCIT), 2005. [2] Karri, R., and Orailoglu, A., "Standard Seven Segmented Display for Burmese Numerals" in proceedings of Consumer Electronics, IEEE Transactions, vol-36, issue: 4, pp 959-96 I, 1990. [3] Islam, R., Alam, M. G. R., and Uddin, M. N., "An 8-Segment Display for Simple and Accurate Representation of Bangia Numerals" in proceedings of 4th International Conference on Electrical and Computer Engineering ICECE , 2006. [4] Moshnyaga, V.G. and Morikawa, E., "LCD Display Energy Reduction by User Monitoring" in proceedings of IEEE International Conference, pp 94 - 97, 2005. [5] Aerts, W. F., Verlaak, S. and Heremans P., "Design of an Organic pixel Addressing Circuit for an Active-Matrix OLED Display", in proceedings of IEEE Transactions on Electron Devices, vol-49, issue- I2, pp 2 I24-2 I30, 2002. [6] Kimmel, J., Hautanen, L. and Levola, T., "Display technologies for portable communication devices", in proceedings of the IEEE, vol-90, issue-4, pp 581-590, 2002. 31
  • 42. Appendix A /*Project Coding*/ #define F CPU 8000000UL #include<util/delay.h> #include<avr/io.h> #include<avr/interrupt.h> #include <avr/pgmspace.h> //#include <compat/ina90.h> #include "rtc.h" #include "i2cmaster.h" #define Ds1307 #define MONTH 13 #define DAY 32 #define WAQT 6 OxDO II device address of D81307, see datasheet struct TimeTable { unsigned char hh,mm; } ; static struct TimeTable attribute ((progmem)) time [MONTH) [DAY] [WAQT]~ { { {{o.o}. {o.o}. {O.O}. {O.O}. {O.O}, {O.O}}. { {0. O}, {O. O}, {O. O}, {O. ° }.{O. ° }.{O. ° }}. {{o.o}. {o.o}. {O.O}, {O.O}, {O.O}. {O.O}}, {{O.O}. {O.O}. (O.O). (O.O). {O.O}. (O.O}). {{O.O}. {O.O}. {O.O}. {o.o}. {O.O}. {O.O}}. ({o.o), {O.O}, {O.O}, {O.O}. {O.O}, {O.O}}. ({O.O). {O.O}. {O.O}. {O.O}. {O.O}. {O.O}}. {{O.O}. (O.O). {O.O}. {O.O}. {O.O}, {O.O}}, {{O.O). {O.O}. {o.o}. (o.o). {O.O}. {O.O}}. ( {O. °},{O, O}, {o. O}, {O, O}, {O. °},{O. °}},{{O.O), {o.o}, {O,O}. {O.O}. (O,O). {O,O}}. {{O.O}. (O,O), {O,O), (O.O), {O.O}. {O.O}}. { {0. °},{O. °}.{O. O}, {O. O}, {O. ° },{O. °}}, { {0. °}.{O. °}.{O. O}, {O. °}.{O. °},{O. °}}. {(O.O). {O.O}, {O.O}. (O.O), {O.O}, {O.O}}, ({O,O), {O.O}. {O.O}, {O.O}. {O.O}. {O.O}}. ({O.O), {O,O}. {O.O}. {O.O}. {O,O}. {O.O}}, {(O,O), {O,O}, (O.O). (O.O), {O.O}, {O.O}}. {{O.O}, {O.O}. {O.O}, {O.O}, {O.O}. {O,O}}, {{O.O}. {O,O}. {O.O}. {O.O}. (O,O). (O.O}}, { {0. O}, {O. °}.{O. °}.{O. °},{O. °},{O. °}}.{{O.O}, {O,O}. {O.O}, {O.O}, {O.O}. {O,O}}. 32
  • 43. {{O,O), {O,O), (O,O), {O,O}, {O,O}, {O,O)), {{O,O}, {O,O), {O,O}, (O,O), {O,O}, {O,O)), { {0, °},{O, °),{O, °},{O, 0), {O, °},(O, °)},{ ( 0, 0), {O, °},{O, °},(O, 0), {O, °},(O, 0) }, {{O,O), {O,O}, (O,O), (O,O), {O,O}, {O,O}}, {{O,O), (O,O), (O,O), {O,O), (O,O), {O,O}}, {{O,O), (O,O), (O,O), {O,O), (O,O), {O,O}}, {{O,O), (O,O), {O,O), {O,O}, (O,O), {O,O}}, {{O,O), (O,O), (O,O), {O,O}, (O,O), {O,O}}, ({O,O), (O,O), {O,O}, {O,O}, {O,O}, {O,O}} }, { {{O,O}, {O,O), (O,O), (O,O), {O,O}, (O,O)}, ({O,O), {5,20), (12,2), (3,47), {5,23}, {6,44)}, {{O,O}, {5,21), {12,2}, {3,4S}, {5,24), (6,44)), ({O,O), (5,21), {12,3}, {3,4S), (5,24), (6,45}), {{O,O), {5,21}, (12,3), (3,49), (5,25), (6,45}), {(O,O), {5,22}, (12,4), (3,50), (5,26), (6,46}), ({O,O), (5,22), (12,4), (3,51), {5,26), (6,47}), ({O,O), {5,22}, (12,5), {3,51}, {5,27}, (6,47}), ({O,O), (5,22), (12,5), {3,52}, {5,2S}, {6,4S}}, {{O,O}, (5,23), {12,5), {3,53}, {5,2S}, {6,4S}}, {{O,O), (5,23), (12,6), {3,53}, {5,29}, {6,49)}, {{O,O), (5,23), {12,6}, {3,54}, (5,30), (6,50)), ( ( 0, °),(5, 23) , {12, 7 }, {3, 55), (5, 31 ) , {6, 50 ) ) , {{O,O}, {5,23}, (12, 7), (3,55), {5,31), (6,51}), { {O, O} , {5, 23} , {12, 7} , ( 3, 56) , (5, 32) , {6, 52} ) , {{O,O}, {5,24}, {12,S), (3,57), (5,33), {6,52}}, {{O,O}, {5,24}, (12,S), {3,5S), {5,33}, {6,53)}, {{O,O), {5,24}, {12,S}, {3,5S}, {5,34}, {6,53)}, ({O,O), {5,24}, {12,9}, {3,59}, {5,35), (6,54)), ({O,O), (5,24), (12,9), (4,0), {5,36}, (6,55}), { ( 0, 0), {5, 24 ) , (12, 9) , ( 4 , 1 ) , (5, 36), {6, 55} }, { ( 0, ° ),{5, 24 ), {12, 10), (4, 1 ) , {5, 37 }, {6, 56} }, {{O,O}, {5,24}, (12,10), (4,2), {5,3S}, (6,57)}, {{O,O}, (5,24), {12,10}, {4,3}, (5,3S), (6,57)), {{O,O}, (5,23), {12,11}, {4,3}, (5,39), (6,5S)), {{O,O), {5,23}, {12,11}, {4,4), (5,40), (6,5S)), ({O,O), {5,23}, {12,11}, {4,5), (5,41), {6,59}}, {(O,O), {5,23}, (12,11), (4,6), (5,41), (7,0)}, { {0, °),{5, 23 }, (12, 11), ( 4, 6) , {5, 42 }, (7, °)),{(O,O), {5,23), (12,12), {4, 7}, {5,43), (7,1)), { {0, °},(5, 22 ) , {12, 12 ) , (4, S), {5, 43 }, {7 , 1 } ) , {{O,O), (5,22), {12,12}, {4,S), {5,44), (7,2}) ), { {{O,O), {O,O), {O,O}, {O,O}, (O,O), (O,O)), {{O,O}, (5,22), {12,12), {4,9}, {5,45}, (7,2)), {(O,O}, (5,22), (12,12), {4,10}, {5,45}, (7,3)), {{O,O}, (5,21), (12,12), {4,10}, (5,46), (7,4}), { ( 0, °),(5, 21 ) , {12, 12 }, (4, 11), (5, 47 ) , {7, 4 } }, {{O,O), {5,21}, {12,13}, (4,11), (5,47), (7,5)}, { {0, °},{5, 2 °},(12, 13) , (4, 12 ) , (5, 4 S ) , (7, 5) }, {{O,O), (5,20), {12,13}, {4,13}, {5,49}, {7,6}}, { ( 0, 0) , {5, 19} , {12, 13 }, ( 4 , 13 }, {5, 49 }, {7 , 6} }, {{O,O), {5,19}, (12,13), {4,14}, {5,50}, {7,7}}, 33
  • 44. { {0, °},{5, lS ) , {12, 13 }, {4, 14 ) , {5, 51 ) , (7, 7 ) }, { {0, ° },{5, lS }, {12, 13) , {4 , 15) , (5, 51 ) , (7, S ) ), ({O,O), {5,17}, (12,13), {4,16}, {5,52}, (7,S)), {{O,O), {5,l7}, (12,13), (4,16), {5,53}, (7,9}), { {O, 0) , (5, 16), {12, 13) , (4, 17), {5, 53) , {7 , 9} }, {{0, ° },{5, 16 }, {12, 13), {4, 17 ) , (5, 54 ) , {7, 10} }, {{O,O}, {5,15), {12,13}, {4,lS}, {5,54}, (7,lO)), {{O,O), {5,15), {12,13), {4,lS}, {5,55}, (7,11)), {{O,O), {5, 14), {12,13}, {4, 19), {5,55), {7,11}}, { {0, ° ), {5, 13) , (12, 12 ) , {4, 19) , {5, 56} , {7, 12 } ), {{O,O), {5,13), (12,12), {4,20), {5,57}, {7,12}}, { {0, °},{5, 12 }, {12, 12 ) , (4, 2 °),{5, 57} , (7, 13 ) ) , {{O,O), {5,11}, {12,12}, (4,20), {5,5S}, {7,13)), {{O,O), {5,11}, {12,12}, {4,21), {5,5S), (7,14)), {{O,O), {5,lO}, {12,12), {4,21), {5,59), {7,14}}, {{o, 0) , (5, 9), {12, 12) , (4, 22) , {5, 59} , {7, 15} }, ({O,O), {5,S), {12,12), (4,22), {6,O}, (7,15)), {{O,O}, {5,S), {12,11}, {4,22}, {6,O}, {7,16}), { {0, ° },{5, 7 ) , ( 12, 11 ) , {4, 23), {6, 1 ) , {7 , 16} }, { {0, °),{5, 6) , ( 12, 11 ) , {4 , 23) , ( 6, 1 ) , {7, 16} }, {{O,O}, {O,O}, {O,O}, {O,O), {O,O}, {O,O)), {{O,O}, {O,O}, (O,O), {O,O), (0,0), (O,O)} ), { {{O,O), {O,O), (O,O), {O,O}, (O,O), {O,O}), { {0, °),{5, 6), {12, 11 ) , (4, 23 ) , {6, 1 }, (7, 16) ), {{O,O), (5,5), {12,11), {4,24}, {6,2), (7,l7}), {{O,O), {5,4), {12,11), {4,24}, {6,2), {7,17}}, { {0, ° ),{5, 3) , {12, 10} , {4, 24 ) , {6, 3) , (7, lS ) }, { {0, °},{5, 3) , (12, 10), {4, 25) , {6, 3} , (7, lS ) }, {{O,O), {5,2}, {12,lO), {4,25}, {6,3}, (7,19)), {{O,O), {5,1), {12,lO}, {4,25}, {6,4), (7,19}), {{O,O), (5,O), (12,9), {4,25), (6,4), {7,19}}, {(O,O), {4,59}, (12,9), {4,26), (6,5), (7,20)}, {{O,O}, {4,5S), {12,9}, (4,26), {6,5}, (7,20)), { {0, ° }, {4, 57 }, {l2, 9} , {4, 26), {6, 6} , {7 , 21 } ), {{O,O), {4,56}, (12,S), {4,26}, {6,6), (7,21}), { {O, O}, {4, 55), (l2, S) , {4, 27) , ( 6, 7) , {7 , 22} }, {{O,O}, {4,54), {12,S}, (4,27), (6,7), {7,22}}, {{O,O}, {4,53), {12,S}, {4,27}, {6,7}, (7,23)), {{O,O), {4,52), {12,7}, {4,27}, {6,S), (7,23}), { (0, O) , (4, 51), {12, 7 }, {4, 27), {6, S), {7 , 23} }, {{O,O}, {4,50), {12,7), {4,2S), (6,9), {7,24}}, {{o, °),{4, 4 9) , (12, 6) , {4, 2 S }, {6, 9} , (7, 24 ) ), ({O,O), {4,4S}, {12,6), {4,2S}, {6,9), {7,25)), ({O,O), {4,47}, {12,6), {4,2S), {6,lO), (7,25}), {{O,O}, {4,46), {12,6}, {4,2S}, {6, 10}, {7,26}}, {{O,O), {4,45), {l2,5}, {4,29}, {6,11}, (7,26)), { {0, °),{4, 44 }, {l2, 5} , {4, 29 }, {6, 11 ) , (7, 26) ) , { {0, °),{4, 43), {12, 5) , {4, 29), {6, 11), {7 , 27 } ) , {{O,O), {4,42), {12,4), {4,29), (6,12), {7,27}}, {{O,O), {4,41), (12,4), {4,29), {6,12}, (7,2S}), {{O,O}, {4,40), {12,4}, (4,29), {6,13), (7,2S)}, {{O,O), {4,39), {12,3}, {4,29}, {6,13}, (7,29)), {{O,O}, (4,3S), {J2,3}, {4,29), {6,13), {7,29)), {{O,O}, {4,37}, {12,3), {4,29), {6,14), {7,30}} }, 34
  • 45. ( ({O,O), {O,O}, {O,O). {O,O), (O,O). (O,O}), {{O,O), {4,35}, (12,3), (4,30), {6,14}, {7,30}}, ({O,O). (4,34). {12,2). {4,30}, {6,14}, P,3l)}, {{O,O}, {4,33}, (12,2). {4,30}, {6,15). P,3l}), {{0, °},{4, 32 }, {12, 2 ) , {4 , 3 °), (6, 15) , P, 32) }, {{O,O). (4,3l). {12,1}, {4,30}, {6,16). P,32)), ({O,O), {4,30), (12,1). {4,30}, (6,16), (7,33}). ({O,O). {4,29). (12,1), {4,30}, {6,16). P,33)). {{O,O), (4,2S). {12,l}, {4,30). {6,17), (7,34}), {{O,O}, {4,27}, {12,0), (4,30), {6,17}, P,34)}, {{O,O), (4,26). {12,0}, {4,30}, {6,lS), (7,35}), {{O, 0) , (4, 25). (12, 0) , {4, 30) , {6, IS} , P, 35} }, {{O,O}, {4,24}, (1l,59), {4,30}, {6,lS}, (7,36)), {{O,O), {4,23), {1l,59). {4,3l), {6,19). {7,36}}, {{O,O). (4,22). {1l,59}, {4,3l}, (6,19). P,37)), {{O,O}, {4,2l), (1l,59). {4,3l), (6,20). (7,37}), {{O,O), {4,19}, {1l,5S). {4,3l}, {6,20}, P,3S)), ({O,O), (4,lS). {1l,5S}, {4,3l). {6,20), (7,39}), {{O,O}, {4,17}, (ll,5S), {4,3l}, {6,2l), P,39)), {{O,O}, {4,16), {1l,5S), {4,3l). {6,2l), P,40}), {{O,O). {4,15}, (ll,5S), {4,3l}, {6,22}, P,40}), {{O,O), {4, l4}, {1l,57}, {4,3l), {6,22). (7,4l)}, {{O,O}, {4,13}, {1l,57), {4,3l}, (6,23), P,42}}, {{O,O), {4,12}, {1l,57}, {4,3l}, {6,23), (7,42)}, ({O,O). {4,ll}, (ll,57). {4,3l). {6,23}, P,43}}, {{O,O}, {4,10), {1l,57}, (4,3l). {6,24), {7,43}}, {{O,O}, {4,9}, {11,56), {4,3l}, {6,24}, {7,44)), {{O,O}, {4,S), (1l,56). {4,3l}, (6,25), (7,45}), {{O,O). (4,7). {1l,56}, {4,3l}, {6,25}, P,45)}, {{0, °},{4, 7 ) , {11 , 56} , {4 , 32). ( 6, 26) , {7 , 46} ) , {{O,O}, {4,6}, {1l,56), (4,32), {6,26}, P,47}). {{O,O), (O,O). {O,O), (O,O), (O,O), {O,O}} }, { {{O,O). {O,O}, (O,O), {O,O}, {O,O}, {O,O)}, ({O,O), {4,5), {1l,56), {4,32), (6,27), (7,47}), {{O,O}, {4,4}, {1l,56}, {4,32). {6,27}, P,4S)). ({O,O), (4,3). (1l,55). (4,32), (6,27), (7,49)}, ({O,O). {4,2}, {1l,55), {4,32}, {6,2S), P,49)). {{0, °),{4, 1 ) , {11 , 55} , {4, 32 }, ( 6, 2S) , P, 50} }, {{O,O}, (4,0). {1l,55), {4,32), {6,29). P,5l)). { {0, ° },{4, ° }, {11 , 55} , {4, 32 }, {6, 29) , P, 51} }, {{O,O}, {3,59}, {1l,55}, {4,32}, {6,30). P,52}), {{O,O}, {3,5S). {1l,55). {4,32), (6,30), P,53}}, {{O,O}, {3,57}, {1l,55}, {4,33}, {6,3l}, {7,53}), {( 0, °),{3, 56) , {ll, 55) , {4, 33) , (6, 31 ) , {7 , 54} ) , ({O,O), {3,56), {1l,55), {4,33}, {6,32}, P,55}}, { ( 0, °),{3, 55} , ( 11 , 55). (4, 33) , {6, 32). (7, 55) }, {{O,O}, {3,54), {1l,55), {4,33}, {6,33}, P,56}), {{0, °},{3, 54} , ( 11 , 55) , (4, 33). {6, 33) , P, 57} }, ({O,O), {3,53), {II, 55), {4,33}, {6,34}, {7,57)), {{O,O). {3,52}, {1l,55}, (4,33), {6,34), {7,5S}}, {{O,O}, {3,52). {11,55}, {4,34}, {6,35}, P,59)), {(O, 0) , {3, 51) , {11, 55} , (4, 34). {6, 35). {7 , 59} }, ({O,O). (3,50). (ll,55). {4,34}, {6,36}, {S,O)}, {{O,O), (3,50), {1l,55}, {4,34}, {6,36). (S,l)}, 35
  • 46. {{O,O}, {3,49}, (1l,55), {4,34}, (G,37), {B,l}}, {{O,O}, {3,49}, {1l,55}, (4,34), {G,37}, (B,2}), {(O,O), {3,4B}, {11,55}, {4,35}, (G,3B), {B,3}}, {{O,O}, {3,4B}, {1l,55}, (4,35), {G,3B}, {B,3}}, ( (0, a) , {3, 47 } , (11, 55), {4, 35} , {G, 39) , (B, 4 ) }, {{O,O}, (3,47), {1l,5G), {4,35}, (G,39), {B,5)}, { {0, a} , (3, 47 ) , {ll, 5 G) , (4, 35), {G, 39}, (B, 5) ) , { {0, a }, {3, 4 G) , {11 , 5 G}, {4 , 35) , {G, 4 a }, {B, G) }, {(O,O), {3,4G}, (1l,5G), {4,3G}, (G,40), (B,G)}, {{O,O}, {3,4G}, {1l,5G}, {4,3G}, {G,41), (B,7}) }, { {(O,O), (O,O), {O,O}, {O,O}, {O,O}, {O,O}}, ((O,O), {3,45}, {1l,5G}, (4,3G), {G,41}, {B,B}}, {{O,O}, {3,45), {11,5G}, {4,3G}, {G,42}, {B,B)}, {{O,O}, (3,45), {1l,57}, {4,3G}, {G,42), {B,9}}, {{O,O}, {3,44}, (1l,57), {4,37), {G,43}, {B,9}}, {(O,O), {3,44}, {1l,57), {4,37}, (G,43), {B,10}}, {{O,O}, {3,44}, {1l,57}, {4,37}, {G,43}, {B,10}}, {(O,O), {3,44}, {11,57}, {4,37), {G,44}, (B,ll)}, {(O,O), (3,44), (11,57), {4,3B}, (G,44), {S,ll}}, {(O,O), {3,44), {1l,5S}, {4,3S), {G,45}, (S,12}), ( {0, a }, {3, 44}, (11, 5 S ) , {4 , 3 S }, (G, 45 ) , {S, 12 } }, {{O,O}, (3,44), {1l,5S}, (4,3S), {G,45}, (S,13}), {{O,O}, {3,44}, {1l,5S}, {4,3S}, (G,4G), {S,13}}, {{O,O}, {3,44), {1l,5S}, (4,39), {G,4G}, {S,13}}, {{O,O}, (3,44), {1l,59}, {4,39}, {G,4G}, (S,14)), ({O,O), {3,44}, {1l,59), {4,39}, (G,47), {S,14}}, {{O,O}, {3,44}, (1l,59), {4,39}, {G,47}, (S,15}), {{O,O}, {3,44}, {1l,59}, {4,40}, (G,47), {S,15}}, { ( 0, 0), {3, 44 ) , {12, A}, {4 , 4 a }, {G, 47 }, (S, 15) }, ( (0, 0), {3, 44), {12, a} , {4, 4 0), {G, 4S} , {S, 15} }, {{O,O}, {3,44}, {12,O}, {4,40}, {G,4S}, {S,lG}}, {{O,O), {3,44}, {12,O}, (4,40), {G,4S), {S,lG}}, {{O,O}, {3,45), {12,O}, {4,41}, {G,4S}, {S,lG}}, {{O,O}, {3,45}, {12,1}, (4,41), {G,49}, (S,lG}), {{O,O}, {3,45}, (12,1), {4,41}, {G,49}, {S,17}}, {{O,O}, {3,45}, {12,1}, (4,41), (G,49), (S,17}), {(O,O), {3,4G}, {12,1}, {4,41}, {G,49}, {S,17}}, {{a, a}, (3,4G), {12,1}, (4,42), {G,49}, (S,17}), {(O,O), {3,4G}, {12,2}, {4,42}, {G,49}, {S,17}}, {{O,O}, (3,47), {12,2}, (4,42), (G,49), (S,17}), {{O,O}, {3,47}, {12,2}, {4,42}, {G,49}, {S,17}}, {{O,O}, (O,O), {O,O}, {O,O}, {O,O}, {O,O}} }, ( ({O,O), (O,O), (O,O), (0, a}, {a, a}, {O,O}}, ((O,O), {3,47}, (12,2), {4,42}, {G,50}, {S,17}}, {{O,O}, {3,4S}, {12,2}, {4,43}, {G,50}, (S,17}), ( {a, a },{3, 4 S }, {12 , 3 }, (4, 43) , {G, 5 A}, {S, 17 } }, {{O,O}, (3,49), {12,3}, {4,43}, (G,50), {S,17}), { {0, a }, {3, 49}, {12, 3) , (4, 43) , {G, 5 A}, {S, 17 } }, {{a, a}, {3,50}, {12,3}, {4,43}, (G,50), {S,17}), {{O,O}, {3,50}, {12,3), (4,43), {G,49}, {S,lG}}, {(O,O), {3,51}, {12,4}, {4,43}, {G,49}, (S,lG}), {{O,O}, {3,51}, (12,4), {4,44}, (G,49), (S,lG}), {{O,O}, {3,52), {12,4}, {4,44}, {G,49}, {S,lG)}, 36
  • 47. { {0, ° ),{3, 52), {12, 4 ) , {4 , 44 ) , ( 6, 49) , (S, 15) }, ({O,O), {3,53}, (12,4), {4,44}, {6,49}, (a,15)), { ( 0, °),(3, 53) , {12, 4 } , {4, 44 }, (6, 4 9) , {a, 15 } ) , { {0, ° },{3, 54 }, (12, 4 ), ( 4 , 44 ) , {6, 49 }, {a, 14 } ), {{O,o), (3,54), {12,4}, {4,44}, {6,4a}, (a,14)), ({O,O), {3,55), {12,5}, (4,44), (6,4S), (a,14}), {{O,O}, {3,56}, (12,5), (4,44), {6,4a}, {a,13)), {{O,O), {3,56}, (12,5), {4,44}, (6,4a), (a,13}), ({O,O), {3,57), (12,5), (4,44), {6,47}, {a,12}}, { (O, 0), {3, 57} , {12, 5} , {4, 44}, {6, 47), (a, 12) ), { {0, °),{3, 5a) , ( 12, 5), {4, 44 }, ( 6, 47 ) , {a, 11 } ) , {{O,O}, (3,59), {12,5}, {4,44), {6,46), {a,l1}), {{O,O}, (3,59), (12,5), {4,44}, (6,46), (S,10)), { (O, 0), {4, o}, {12, 5}, {4, 44} , (6, 45), {a, 10) }, {{O,O}, (4,1), {12,5), (4,44), {6,45}, (a,9)), {{O,O), {4,1), {12,5}, {4,44}, (6,45), {a,a}}, { {0, ° },{4, 2 ) , ( 12 , 5) , {4, 43 }, {6, 44 }, {a, S } ), {{O,O), {4,2}, (12,5), (4,43), (6,44), (a,7)}, ((O,O), {4,3}, {12,5}, {4,43}, (6,43), {a,6}), {{O,O}, {4,4}, (12,5), {4,43}, {6,43}, (a,6)), {{O,O}, {4,4), {12,5}, (4,43), (6,42), {a,S}} ), { {{O,O), {O,o), (O,O), {O,O}, {O,O}, (O,O)), {{O,O), {4,5}, {12,5), (4,43), (6,42), (a,4}), ({O,O), (4,6), {12,5}, {4,42), {6,41), {a,3)), {{O,O}, {4,6), (12,5), {4,42}, {6,40}, (a,3)}, {{O,O}, {4,7}, (12,5), (4,42), (6,40), {a,2}}, { {0, °},(4, a), {12, 5} , {4, 42 }, {6, 39 }, {a, 1 ) ) , {{O,O), {4,a), (12,4), {4,41), (6,39), {a,o}}, {{O,O), (4,9), {12,4), (4,41), {6,3a}, {7,59)), {{O,O}, {4,9), (12,4), {4,41), (6,37), (7,59}), {{O,O), {4,10), (12,4), (4,41), {6,37}, {7,5a}), ({O,O), {4,llj, (12,4), {4,40}, (6,36), {7,57)), { {o, °},{4, 11 ) , {12, 4 } , {4, 4 ° }, {6, 35 }, {7, 56} ) , ({O,O), (4,12), (12,4), (4,40), (6,34), {7,55)), {{O,O), {4,13), {12,3}, {4,39}, {6,34}, {7,54}}, {{O,O}, {4,13}, (12,3), {4,39), (6,33), (7,53)}, {{O,O}, {4,14}, (12,3), (4,3a), (6,32), {7,52}}, {(O,o), {4,14}, {12,3}, {4,3a}, {6,31}, {7,51)), ({O,O), {4,15), {12,3), (4,37), (6,30), (7,50}), ({O,O), (4,15), {12,2}, {4,37}, {6,30}, {7,49)), {{O,O}, {4,16), {12,2), (4,37), (6,29), (7,4a}), { ( 0, 0), {4, 17 ) , {12, 2 }, {4, 36 }, {6, 2 a} , {7, 47 ) }, {{O,O), {4,17), (12,2), (4,36), (6,27), (7,46)), {{O,O), (4,la), (12,2), {4,35}, {6,26}, {7,45)}, ({O,O), {4,la), {12,1}, (4,35), (6,25), {7,44}}, {{O,O}, {4,19}, {12,1}, {4,34}, {6,24}, {7,43)), ({O,O), (4,19), (12, 1), (4,33), (6,24), (7,42}), {{O,O}, (4,20), {12,0}, {4,33}, {6,23), {7,41)}, ({O,O), {4,20}, (12,0), {4,32}, (6,22), (7,40}), ({O,O), {4,21}, (12,0), (4,32), {6,21}, {7,39}}, {{O,O}, (4,21), {12,0), {4,31}, (6,20), (7,37}), { {0, ° },{4, 22 }, ( 11 , 59), (4, 31 ) , ( 6, 19) , {7, 36) }, ({O,O), (4,22), (1l,59), {4,30}, {6,la}, {7,35)) }, 37
  • 48. { {{O,O}, {O,o), {O,O}, {O,O}, (O,O), {O,O}}, {{O,O), {4,23), {ll,59}, (4,29), (6,17), {7,34}), { {0, °},{4, 23) , {11 , 5 B}, {4, 29) , {6, 16 }, {7, 33 } ) , {{O,O), (4,24), (1l,5B), {4,2B}, {6,15}, {7,32}), {{O,O}, {4,24), {1l,5B}, (4,27), {6,14), (7,31)), {{O,O}, {4,25}, {1l,57}, {4,27), (6,13), {7,30}}, ({O,O), {4,25}, (ll,57), {4,26}, {6,12}, {7,29}}, {{O,O}, (4,25), (ll,57), {4,25}, {6,1l}, {7,27)), {{O,O), (4,26), {11,56}, (4,25), (6,lO), (7,26)), {{O,O), (4,26), {1l,56}, (4,24), {6,9), {7,25}}, {{O,O}, {4,27}, {1l,56}, (4,23), {6,B}, {7,24}}, ({O,O), (4,27), {1l,55), {4,22}, (6,7), {7,23)}, ({O,O), {4,2B}, {1l,55}, (4,22), {6,6), (7,22}), {{O,O), (4,2B), {1l,55), {4,2l}, (6,5), {7,2l}}, {{O,O}, {4,2B), {1l,54}, {4,20}, (6,4), {7,20)), { {O, O}, {4, 29) , (ll, 54 ), {4, 19), {6, 3) , {7, 19} ) , {{O,O), {4,29), {1l,54), {4,19}, (6,2}, {7,17}}, {{O,O), {4,30}, {1l,53}, (4,lB), {6,l}, {7,16)}, { {O, °),{4, 3 °},{11 , 53} , {4, 17 ) , {6, 0), {7, 15) ), ({O,O), {4,30}, {1l,53}, {4,16), {5,59), (7,14)), ({O,O), {4,3l), (1l,52), (4,15), (5,5B), {7,13}}, {{O,O}, {4,3l), {11,52), (4,15}, {5,57}, {7,12}}, { {O, 0), (4, 32) , {ll, 51 }, (4, 14), {5, 56), (7 , 11) ) , ({O,O), {4,32}, (ll,5l), {4,13), {5,55), {7,lO}), { {O, °},{4, 32 }, {ll, 51 ) , {4, 12 } , {5, 54} , {7, 9) ) , {{O,O), (4,33), {ll,50}, (4,1l), {5,53}, (7,B)), {{O,O}, {4,33), {1l,50), {4,1l}, (5,5l), {7,7}), { {0, °),{4, 33) , {ll, 5 °),{4, 10} , {5, 5 °},{7 , 6) ), {{O,O}, {4,34}, {1l,49), (4,9), (5,49), (7,4}}, {{O,O), (4,34), (ll,49), {4,B}, {5,4B}, {7,3)}, { {O, O}, {4, 35) , {11, 49} , (4, 7), {5, 47), {7, 2} ) , {{O,O}, {O,O}, {O,O), {O,O), {O,O), {O,O)) }, { {{O,O), {O,O},{O,O}, (O,O},{O,O),{O,O)}, ({O,O), {4,35), {1l,4B}, (4,7), {5,46}, {7,1)), { (O, 0) , (4, 35) , {ll, 4B) , {4, 6) , (5, 45) , (7, O) ) , {{O,O), {4,36), {11,4B), {4,5}, {5,44}, {6,59}}, {{O,O), {4,36), {1l,47), {4,4}, {5,43}, {6,5B)}, {{O,O), {4,36), {1l,47}, {4,3}, {5,42), (6,57}), {{O,O), {4,37}, {1l,47}, {4,2), {5,4l}, {6,56}}, {{O,O), {4,37), {1l,47), {4,2}, {5,40), {6,56)), { {O, °),{4, 37 }, (11, 46), {4, 1 ) , {5, 4 °},{6, 55 } }, {{O,O}, {4,3B), {1l,46}, {4,O}, {5,39}, {6,54)}, {{O,O}, (4,3B), (ll,46), {3,59), {5,3B), (6,53)), { {O, 0), {4, 39} , {11, 45} , {3, 5B} , {5, 37 }, {6, 52} }, {{O,O), {4,39}, {ll,45}, {3,5B), {5,36}, (6,5l)), {{O,O}, {4,39}, {ll,45}, (3,57), {5,35), {6,50}}, { {0, °I , {4, 4 °},(ll, 45), {3, 56) , (5, 34 ) , {6, 4 9} }, {{O,O}, {4,40), {1l,44), {3,55}, {5,33}, {6,4B}), {{O,O), {4,40), {1l,44}, (3,55), {5,32), (6,4B)}, {{O,O), {4,4l}, {1l,44}, {3,54), {5,3l), {6,47}}, {{O,O}, {4,4l}, (ll,44), {3,53}, {5,30}, {6,46}), ({O,O), {4,42), {1l,44), (3,52), {5,30}, (6,45)}, {{O,O), {4,42), {11,43), {3,52}, {5,29}, (6,44)), {{O,O}, (4,42), (1l,43), {3,5l), {5,2B), {6,44}}, 38 ) /'
  • 49. {{0, °},(4, 43) , {ll, 43 }, (3, 5 °),{5, 27 ) , {6, 43 }) , {{O,O), {4,43}, {1l,43}, {3,50}, {5,26}, {6,42)), ({O,O), {4,44), (ll,43), {3,49}, (5,26), (6,42)), {{0, °),(4, 44 ) , {ll, 43 }, (3, 48), {5, 25) , {6, 41 }}, {(o, 0), {4, 45} , {11, 43} , {3, 47} , (5, 24 }, {6, 40) ), ({O,O), {4,45), (ll,42), (3,47}, (5,23), (6,40)), {{0, °),(4, 45) , {ll, 42 }, (3, 46) , {5, 23) , ( 6, 39) }, {{0, ° },{4, 46 }, {ll, 42), {3, 46 }, {5, 22 }, {6, 38 }}, {{O,O}, {4,46}, (1l,42), (3,45), {5,21}, (6,38)), ({O,O), (4,47), {1l,42), {3,44}, (5,21), {6,37}} }, { {{O,O),{O,O},{O,O),{O,O},{O,O},{O,O}}, {{O,O), (4,47), {1l,42}, {3,44), (5,20), {6,37)}, {{0, °},(4, 48 ) , {ll, 42 ) , {3, 43 }, {5, 19} , {6, 36 }}, ({O,O), {4,48}, {1l,42}, (3,43), (5,19), {6,36)), {{O,O), {4,49}, {1l,42}, (3,42), {5,18), {6,35}}, {{0, ° },(4, 49), (ll, 42 ) , {3, 42 }, {5, 18 }, {6, 35 }}, {{O,O), {4,50), {1l,42}, {3,41}, {5,17}, {6,34)), {{O, O}, {4, 50) , {11, 42), {3, 41) , {5, 17), ( 6, 34 ) }, {{O,O}, {4,51}, (ll,42), {3,40}, {5,16}, {6,33}), {{O,O), {4,51}, {ll,42}, (3,40), {5,16}, {6,33}), {{0, °),{4, 52} , {ll, 42 }, {3, 39) , {5, 15) , ( 6, 33) }, {(O,O), (4,52), {1l,42), {3,39}, (5,15}, {6,32}}, {{O,O}, {4,53}, {1l,43}, (3,38), {5,14}, (6,32)), {{O,O), (4,53), (11,43), {3,38), (5,14), {6,32}}, {{O,O}, (4,54), (1l,43), {3,38}, {5,14}, {6,32}}, {{O,O}, (4,54), {1l,43}, {3,37}, {5,13}, (6,31)}, { {0, °},{4, 55} , (11, 43), (3, 37 ) , {5, 13} , {6, 31 }}, ({O,O), (4,56), (1l,43), {3,37}, (5,13), (6,31)), {{O,O}, (4,56), {1l,44), (3,37), (5,12), (6,31)}, {{O,O}, (4,57), {1l,44}, (3,36), {5,12), (6,31)}, {{O,O}, (4,57), (1l,44), {3,36), (5,12), {6,31}), {(O,O), (4,58), (11,44), {3,36), {5,12), (6,30)), {( 0, 0), {4, 58 }, {ll, 44 ) , {3, 36 }, (5, 11 ) , {6, 3 ° }), ((0,0), (4,59), (1l,45}, (3,36), {5,ll}, (6,30)), ( (0, 0) , (5, 0) , {11, 45} , (3, 35) , (5, ll) , (6, 30) }, ( (0, 0) , {5, O}, ( 11, 45} , {3, 35} , {5, ll} , ( 6, 30) }, {(O, 0) , {5, 1 }, (ll, 46) , {3, 35), (5, 11) , {6, 30} ) , {{o, °},{5, 1 }, {ll, 46} , (3, 35) , (5, 11 }, {6, 3 °}},{{O,O}, {5,2}, {1l,46}, {3,35}, (5,1l), (6,30)), ({O,O), (5,3), (1l,47), {3,35), (5,1l), (6,31}), ({O,O), {5,3}, (ll, 47), (3,35), (5, ll}, {6,31}}, {{O,O}, {O,O}, {O,O}, (O,O}, (O,O), (O,O}) }, { ({O,O), (O,O), (O,O}, (O,O}, {O,O}, (O,O}), {{O,O), {5,4}, (11,47), (3,35}, (5,1l), {6,31}}, {{O,O}, {5,4}, (11,48), {3,35), {5,1l), {6,31)), { ( 0, °),(5, 5) , (11, 48 ) , {3, 35) , (5, 11 ) , {6, 31} }, { (O, °),{5, 6} , {ll, 48 }, (3, 35) , {5, 11 }, (6, 31 ) }, {{O, °},{5, 6} , {11, 49} , (3, 36 }, {5, 11 ) , {6, 31 }) , ({O,O), {5,7}, {1l,49}, {3,36), {5,12}, (6,32}), {{0, °},{5, 7 ), {11 , 5 °},{3, 36 }, {5, 12} , {6, 32 ) }, {{0, ° },(5, 8 ) , ( 11 , 50) , (3, 36), {5, 12) , {6, 32 }) , {( 0, °),{5, 9), (11, 51 ) , {3, 36) , (5, 12 ) , (6, 33 ) ), ({O,O), {5,9), {1l,51}, (3,37), {5,12}, {6,33)), 39
  • 50. {{O,O}, {5,10j, {1l,51}, {3,37), 15,13), {6,33)), ({O,O), 15,10}, {1l,52), {3,37}, 15,13}, (6,33)), I {0, ° ),{5, 11 ) , {ll, 52 ) , I3, 37 }, {5, 13 }, (6, 34 ) ) , {{O,O), 15,11), {1l,53), 13,38}, {5,l4), 16,34)), {{O,0) , 15, 12}, {ll, 53) , 13, 38}, (5, 14 ) , {6, 35) j , ({O,O), {5,13), {1l,54}, 13,38}, (5,14), {6,35}), {{0, ° },{5, 13 ) , {ll, 54} , {3, 39) , {5, 15 j , {6, 35 }}, {(O, 0) , {5, 14 }, {11, 55} , {3, 39) , 15, 15} , {6, 36} }, {10, O}, {5, 14 }, Ill, 55}, {3, 4O}, {5, 16} , {6,36} }, ({O,O), 15,15}, 111,56), {3,40}, {5,16}, 16,37)), {(O, 0) , {5, 15) , (ll, 56) , 13, 41}, {5, 17}, 16, 37) }, I 10, O}, {5, 16) , (11,57) , 13, 41) , (5, 17) , {6, 38} }, {{O,o}, (5, 16) , {11, 57}, (3, 42) , 15, 18) , {6, 38} }, {(o, 0) , {5, 17) , (11, 58) , {3, 42} , 15, 18} , {6,39} }, ({O,O), {S,17}, (1l,58), {3,43}, 15,19}, (6,39)}, I 10, O}, {5, 18} , (11,59) , 13, 43} , {5, 19) , 16,4 0) }, {(O, 0) , {5, 18}, {1l,59} , 13, 44 }, (5, 20) , 16, 4O}}, {{O,O}, {5,19}, (12,0), (3,44), {5,20}, {6,41)}, ({O,O), 15,19}, 112,0), 13,45}, {5,21}, (6,42)), {{O,O}, {5, 19), {12,1}, {3,46}, (5,22), (6,42)), {{O,O}, (5, 20), (12, 1), {3, 46}, {5, 22} , {6, 43} ) } }; unsigned char mask, j=O, ssd(31] ={O, 1, 2, 3, 4, 5, 6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8, 9}; char count_sec, hour, min, min_min, sec, day, month, year, flag, prev_min, read time; unsigned char show_hour, show_min, show_day, show_month, show_year; unsigned char int flag, int_count, intsegment, done; volatile unsigned char count,dl,d2,d3,d4,dS,d6,HH,HL,MH,MLi/I,SH,SLi void de 1 aY_ffis (unsigned int rns) /* delay for a minimum of <rns> */ { II we use a calibrated macro. This is more II accurate and not so much compiler dependent II as self made code. while (ms) I _de1ay_ms(1.000}; mS--i void setupTimer1(} II Normal port operation, OC1A and OC1B disconnected II Leave bits COM1A1through COM1BOof TCCR1Aas default zero values II presca1e CK/1024 { TCCR1B 1- (1 « CS12) (1« CS10 ) TlFRl 1- (1 « TOV1); II clear the overflow flag TlMSKl 1= (I « TOlEl ); II enable overflow interrupt return; 40
  • 51. ISR(PCINTl_vect) ( unsigned char temp; count sec++; count_sec%~120; if (count sec=~O) ( temp~read_ds1307(1); d2~temp & OxOF; dl~(temp»4) & Ox07; min=dl*lO+d2; if (min=~O) ( temp=read_ds1307(2); d2~temp & OxOF; dl=(temp»4) & Ox03; hour~dl*lO+d2; if (hour~~O ) ( temp~read_ds1307(4); d2~temp & OxOF; dl~(temp»4) & Ox03; day=dl*lO+d2; if (day~~l) ( temp=read_ds1307(5); d2~temp & OxOF; dl~(temp»4) & OxOl; month~dl*lO+d2; if (month=~l) ( temp~read_ds1307(6); d2~temp & OxOF; dl=(temp»4) & OxOF; year~dl*lO+d2; ) if(done) done--; if lint_segment) ( if(int segment~~l) ( show_hour=!show_houri show_min=show_day=show_month=show year=l; ) else if(int_segrnent~=2) { 4
  • 52. show_min=!show_min; show_hour=show_day=show_month=show year=l; } else if(int segment=~3} { show_day=!show_day; show_hour=show_min=show_month=show_year=l; } else if(int segment~~4) { show_month= ! show_month; show_hour=show_min=show_day=show_year=l; } else if(int_segment~~S) { show_year=!show_year; show hour=show min=show_day=show_month=l; } PORTDI~(l«PDS); } if (! int segment) { if(flag) PORTD&~-(l«PDS); else PORTDI=(l«PDS); flag=! flag; } int main () { unsigned char i,k,temp; unsigned char mask_mode~Ob00000100,mask_up=Ob00001000,mask_down~ObOO010000; DDRB OxFF; DDRC ~ Ob11111011; DDRD &~ -(1 « PD2) ;IIPD2 as input DDRD &~ -(1 « PD3);IIPD3 as input DDRD &~ - (1 « PD4) ;IIPD4 as input DDRD I~ (1 « PDS) ; IIPDS as output int segment~O; II Do not blink any seven segment; Show_hour=show_min=show_day=show_month=show_year=l; PORTC I~ (1 « PC1); for(i~0;i<32;i++) ( IloutputToPin('C',O,O); IloutputToPin('C',O,l); PORTC &~ -(1 « PCO); PORTC I~ (1 « PCO); ) 42
  • 53. PCICR I~ Ox02; PCMSKI ~ Ox04; sei () ; i2c_init(); start_ds1307(); liEnable Pin Change Interrupt Enable 1 IIPCINTIO pin selected for pin change interrupt temp=OblOOlOOOO; write_ds1307(7,temp); min=read_ds1307(1); hour~read_ds1307(2); temp=hour: d2~temp & OxOF; dl~(temp»4) & Ox03; ternp=min; d4~temp & OxOF; d3~(temp»4) & Ox07; hour~dl*lO+d2; min=d3*lO+d4; day=read_ds1307(4); d2~day & OxOF; dl~(day»4) & Ox03; day~dl*lO+d2; month=read_ds1307(5); d2_onth & OxOF; dl=(month»4) & OxOl; month~dl*lO+d2; year=read_ds1307(6); d2=year & OxOF; dl=(year»4) & OxOF; year=dl*lO+d2; sec=read_ds1307(O); d2~sec & OxOF; dl=(sec»4) & Ox07; sec=dl*10+d2: count_sec=sec*2; done~O; flag~l; while (1) { j~O; 43
  • 54. pushed hour clock k~O; temp~PIND; if(((temp&mask_mode)~~mask_mode) && !done) IIMode btton is ( int_flag~l; //int_count=6; done~2; int_segment++: if(int segment==6) II when all mode selects are done { int_segment=O: lnt flag~O; temp=min: d2~temp%lO; II second digit of min temp/~lO; dl=temp%lO; II first digit of min d2 I~ dl«4; write_ds1307(1,d2); temp=hour: d2~temp%lO; II second digit of hour temp/=lO; dl~temp%lO; II first digit of hour d2 I~ dl«4; write_ds1307(2,d2); write_ds1307 (2,read_ds1307 (2) & -(1«6) ); Iiset 24 temp~day; d2=temp%lO; II second digit of day temp/~lO; dl~temp%lO; II first digit of day d2 I~ dl«4; write_ds1307(4,d2); temp=month: d2=temp%lO; II second digit of month temp/~lO; dl=temp%lO; II first digit of month d2 I~ dl«4; write_ds1307(5,d2); temp=year; d2=temp%lO; II second digit of year temp/~lO; dl=temp%lO; II first digit of year d2 I~ .dl«4; write_ds1307(6,d2); temp~OxOO; write_ds1307(O,temp); Ilsec~O; count=O: 44
  • 55. count_sec=O; show_hour=show_min=show_day=show_month=show_year=!; ) ) if (int_segment) { if(((temp&mask_up)==mask_up) && !done) ( done=!; if (int_segment~~l) { hour++; show_hour=!; hour%=24; ) else if(int_segrnent~~2) ( min++; show_min=!; min%=60; ) else if(int_segrnent~~3) { day++; show_day=l; day~(day%3l)+1; ) else if(int_segrnent~~4) { month++; show_month~l; month=rnonth%12+l; } else if(int_segrnent~~5} ( year++; show_year=!; year%~lOO; ) } else if(((temp&mask_down)==rnask down) && !done) { done=!; if (int_segment==l) { hour--; show_hour=!; if (hour==-l ) hour=23; ) else if(int_segment~=2) { min--; show_min=1; if (min~~-l) min=59; 45
  • 56. } else if(int_segment~~3) { day--; show_day~l; if (day==O) day~3l; } else if(int segment~~4) { month--: show_month=l: if (month~~O) month~12; ) else if(int_segment~~5) { year--: show_year=l: if (year==-l) year~99; ) if (show_hour) { temp=hour; ssd[l]~temp%lO; temp/~lO; ssd[O]=temp%lO; ) else { ssd[O]=ssd[l]=lO; II Thurning the hour segments off ) if (show_min) ( temp=rnin: ssd[3]~temp%10; temp/~lO; ssd[2]~temp%lO; ) else { ssd[2]~ssd[3]~lO; II Thurning the minute segments off ) if (show_day) ( temp~day; ssd[5)~temp%lO; temp/=lO; ssd[41~temp%lO; ) else { ssd[4]=ssd[5]=lO; II Thurning the day segments off ) if (show_month) 46
  • 57. { ternp=rnonthi ssd I7)~temp%10; temp/~10; ssd(6)~temp%10; ) else { ssd[6)~ssd(7J~10; II Thurning the month segments off ) if (show_year) { temp=yeari ssd(9J~temp%10; temp/~10; ssd[8]~temp%10; ) else ( ssd(8)=ssd[9]~10; II Thurning the year segments off ) IIFazr; temp~pgm_read_byte(&time[month) [day] [1].hh); ssd (11J~temp% 10; temp/~10; ssd[10]~temp%10; temp~pgm_read_byte{&timelmonth] [day) (1).rom); ssd[13]~temp%10; temp/=10; ssd[12]=temp%10; I IDuhr; temp~pgm read_byte (&time(month] [day] [2].hh); ssd[15]=temp%10; temp/~10; ssd [14]=temp% 10; temp~pgm_read_byte(&time[month] [day] [2].rom); ssd[17j=temp%10; temp/~10; ssd[16)=temp%10; IIAsr; temp=pgm_read_byte(&time[monthl [day] [3).hh); ssd[191~temp%10; temp/~10; ssd[181~temp%10; 47
  • 58. temp~pgm_read_byte(&time[month) [dayJ (3).mm); ssd[2l)~temp%lO; temp/~lO; ssd[20J~temp%lO; //Magrib; temp~pgm_read_byte(&time[monthJ [dayJ [4J.hh); ssd[23J~temp%lO; temp/~lO; ssd[22J~temp%lO; temp~pgm_read_byte(&time[monthJ [day] (4).mm); ssd[25J ~temp%10; temp/~lO; ssd[24J~temp%lO; //Esha; temp~pgm_read_byte(&time[month] [daYJ [5].hh); ssd[27J~temp%lO; temp/~lO; ssd[26J~temp%lO; temp~pgm_read_byte(&time[month] [dayJ [5J.mm); ssd[29J~temp%lO; temp/~lO; ssd[28)~temp%lO; for(i~O;i<30;i++) { PORTB~(lO);//making the seven segment off if (j~~l) PORTC I~ (1 « PC1); else PORTC &~ -(1 « PC1); j~l; PORTC &~ -(1 « PCO); PORTC I~ (1 « PCO); PORTB~ssd [k++J; _delay_ms(O.l); ) PORTB~lO; ) 48