You are on page 1of 71

Chapter 1: INTRODUCTION

Human beings require some information for every sort of work. The information may be visual or audible or as the case may be. Generally, written or visual information is much more convenient than the other counterparts. In the present world, there is a lot of information which needs to be displayed. May it be your laptop screen, a bank, an airport, your cell phone, or any other public place; the required information is to be presented in a suitable manner. The devices which are used for the purpose are called display devices. A display device is an output device for presentation of information in visual form. When the input information is supplied as an electrical signal, the display is called an electronic display. Some of the very common applications for electronic visual displays are television sets, computer monitors or cell phones. There are a variety of electronic displays available in the market. Some displays can show only digits or alphanumeric characters. They are called segment displays, because they are composed of several segments that switch on and off to give appearance of desired glyph. The segments are usually single LEDs or liquid crystals. They are mostly used in digital watches and pocket calculators etc. These may be sevensegment, fourteen-segment or sixteen-segment displays. Two dimensional displays that cover a full area (usually a rectangle) are also called video displays, since it's the main modality of presenting video. They are generally seen in television sets, computer monitors etc. The technologies behind these devices are LEDs, LCDs, TFTs, electroluminescent displays, plasma display panels, OLEDs, carbon nanotubes, nano-crystal displays etc. The display technology presented in the text uses a LED matrix for the purpose. An LED matrix is a collection of LEDs arranged in the form of a matrix. It consists of LEDs with their cathodes joined in the rows and the anodes joined in the rows (or vice versa). The different characters can be produced on the matrix by switching on the corresponding LEDs and switching off the rest. It is sometimes also called as a DotMatrix. They can be used easily to represent characters, numerals and special symbols. The model presented here uses these LED matrices to display a running text (from right to left). These devices can be easily seen in banks, railway stations, airports, sign boards, buses etc.

Chapter 2: INTEL 8051 MICROCONTROLLER

2.1 INTRODUCTION
Intel Corporation introduced an 8-bit microcontroller called MCS-51 in 1981. This microcontroller had 128 bytes of RAM, 4K bytes of on chip ROM, two timers, one serial port, and four ports, all on a single chip. The 8051 is an 8 bit processor, meaning that the CPU can work on only 8 bit data at a time. Data larger than 8 bits is broken into 8 bit pieces and then processed by CPU. It has four I/O 8 bit wide ports. The Intel MCS-51 is a Harvard architecture single chip microcontroller series which was developed by Intel in 1981 for use in embedded systems. Intel's original versions were popular in the 1980s and early 1990s, but has today largely been superseded by a vast range of faster and/or functionally enhanced 8051-compatible devices manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies (formerly Siemens AG), Maxim Integrated Products (via its Dallas Semiconductors Microelectronics, Semiconductor. Intel's original MCS-51 family was developed using NMOS technology, but later versions, identified by a letter C in their name (e.g., 80C51) used CMOS technology and were less power-hungry than their NMOS predecessors. This made them more suitable for battery-powered devices. subsidiary), Silicon NXP (formerly Texas Philips Semiconductor), and ST

Laboratories,

Instruments

Cypress

Figure 2.1 A 8051 Microcontroller

2.2 FEATURES OF 8051


o 8-bit data bus o 16-bit address bus o 32 general purpose registers each of 8 bits o ROM 4K bytes o RAM 128 bytes o 2 Timers (16-bit) o Four 8-bit ports o 16-bit Program Counter

2.3 BLOCK DIAGRAM OF 8051


External Interrupts

Timer/Counter Interrupt Control On-Chip ROM for Program Code On-Chip RAM Timer 0 Timer 1

CPU

Oscillator

Bus Control

I/O Ports

Serial Port

P0 P1 P2P3 Figure 2.2 Block Diagram of 8051


3

RxD

TxD

2.4 INTERNAL ARCHITECTURE OF 8051


The 8051 family is one of the most common microcontroller architectures used worldwide. 8051 based microcontrollers are offered in hundreds of variants from many different silicon manufacturers. The 8051 is based on an 8-bit CISC core with Harvard architecture. It's an 8-bit CPU, optimized for control applications with extensive Boolean processing (single-bit logic capabilities), 64K program and data memory address space and various on-chip peripherals. The 8051 microcontroller family offers developers a wide variety of high-integration and cost-effective solutions for virtually every basic embedded control application. From traffic control equipment to input devices and computer networking products, 8051 microcontrollers deliver high performance together with a choice of configurations and options matched to the special needs of each application. Whether it's low power operation, higher frequency performance, expanded on-chip RAM, or an application-specific requirement, there's a version of the 8051 microcontroller that's right for the job.

RAM

EEPROM

CPU

PORT31

Timers, Counters, Interrupts, Serial Ports, SFRs

Figure 2.3 Basic Internal Architecture of 8051

PORT 2

PORT 0

PORT1

2.5 MEMORY ORGANISATION IN 8051


The 8051 microcontroller has three general types of memory. They are On-Chip memory, External code memory and External RAM. On-Chip Memory refers to any memory (Code, RAM, or other) that physically exists on the microcontroller itself. External Code Memory is code (or program) memory that resides off-chip. This is often in the form of an external EPROM. External RAM is random access memory that resides off-chip. This is often in the form of standard static RAM or flash RAM.

8051 Chip Internal RAM Special Function Registers Internal Code Memory (Optional) External Code Memory External RAM

Figure 2.4 Memory Organisation Block Diagram of 8051

2.5.1 On-Chip Memory


The 8051s on-chip memory consists of 256 bytes. It is of generally two types viz. internal RAM and Special Function Registers Memory (SFRs).The first 128 bytes constitute the internal RAM. This Internal RAM is found on-chip on the 8051 so it is the fastest RAM available, and it is also the most flexible in terms of reading, writing, and modifying its contents. Internal RAM is volatile, so when the 8051 is reset this memory is cleared. The internal RAM is sub-divided as Register Banks (00H to 1FH), Bit addressable RAM (20H to 2FH), General Purpose RAM (30H to 7FH). Special
5

Function Registers (SFRs) are areas of memory that control specific functionality of the 8051 processor. All addresses above 80h are assigned to SFRs. Another SFR allows a program to read or write to the 8051s serial port. Other SFRs allow the user to set the serial baud rate, control and access timers, and configure the 8051s interrupt system. The memory space above 80H (80H to FFH) is allocated totally to SFRs.

2.5.2 External Code Memory


It is code (or program) memory that resides off-chip. This is often in the form of an external EPROM. Code memory is the memory that holds the actual 8051 program that is to be run. This memory is limited to 64K and comes in many shapes and sizes.

2.5.3 External RAM


It is a RAM memory that resides off-chip. This is often in the form of standard static RAM or flash RAM. External RAM is any random access memory which is found off-chip. Since the memory is off-chip it is not as flexible in terms of accessing, and is also slower. External RAM loses in speed and flexibility it gains in quantity, While Internal RAM is limited to 128 bytes, the 8051 supports External RAM up to 64K.

2.6 PIN DESCRIPTION OF 8051


I/O Ports: There are four ports P0, P1, P2 and P3 each use 8 pins, making them 8-bit ports. All the ports upon reset are configured as output, ready to be used as output ports. To use any of these ports as an input port, it must be programmed. Port 0 occupies a total of 8 pins (pins 32-39) .It can be used for input or output. To use the pins of port 0 as both input and output ports, each pin must be connected externally to a 10K ohm pull-up resistor. This is due to the fact that P2 is an open drain. Open drain is a term used for MOS chips in the same way that open collector is used for TTL chips. Port 0 is also designated as AD0-AD7, allowing it to be used for both address and data. When connecting an 8051 to an external memory, port 0 provides both address and data. The 8051 multiplexes address and data through port 0 to save pins. ALE pin indicates if P2 has address or data. When ALE = 0, it provides

data D0-D7, but when ALE =1 it has address and data with the help of a 74LS37 latch.

Figure 2.5 Pin Diagram of Intel 8051 Port 1 occupies a total of 8 pins (pins 1 - 8). It can be used as input or output. In contrast to port 0, this port does not need any pull-up resistors since it already has pull-up resistors internally. Upon reset, Port 1 is configured as an output port. Port 2 occupies a total of 8 pins (pins 21 - 28). It can be used as input or output. Just like P1, P2 does not need any pull-up resistors since it already has pull-up resistors internally. Upon reset, Port 2 is configured as an output port. As shown in pin
7

configuration 8051, port 2 is also designed as A8-A15, indicating the dual function. While Port 0 provides the lower 8 bits via A0-A7, it is the job of Port 2 to provide bits A8-A15 of the address.

Figure 2.6 External pull-up resistors connected at Port 0 Port 3 occupies a total of 8 pins (pins 10 17). It can be used as input or output port. P3 does not need any pull-up resistors, the same as P1 and P2 did not. Although port 3 is configured as an output port upon reset, it has the additional function of providing some extremely important signals such as interrupts.P3.0 and P3.1 are used for the Reception and Transmission of serial communication signals. P3.2 and P3.3 are set aside for external interrupts. P3.4 and P3.5 are used for timers 0 and 1. Finally P3.6 and P3.7 are used to provide the write (WR) and read (RD) signals of external memories. ALE/PROG: Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/ 6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory.

Table 2.1: Special functions of Port 3 pins Port Pin P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 IC Pin Number 10 11 12 13 14 15 16 17 Alternate Functions RxD (Serial Input Port) TxD (Serial Output Port) Int0 (External Interrupt 0) Int1 (External Interrupt 1) T0 (Timer 0 External input) T1 (Timer 1 External Input) WR (External Data Memory Write Strobe) RD (External Data Memory Read Strobe)

PSEN: Program Store Enable is the read strobe to external program memory. When the 8051 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP: It stands for External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during flash programming when 12-volt programming is selected. XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2: This pin is for output from the inverting oscillator amplifier. GND and VCC: These two pins are the power pins of the 8051 microcontroller. Pin 20 (GND) is to be connected to the ground terminal and pin 40 (VCC) is to be provided with DC voltage supply. RST: This stands for reset. This pin is employed to store back the initial condition of the microcontroller. Pin 9 is used for this reset purpose.
9

Chapter 3: SPECIAL FUNCTION REGISTERS OF 8051

3.1 Introduction to SFRs


The SFR registers are located within the internal memory in the address range 80H to FFH. Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. Each SFR has a very specific function. Each one has an address (within the range 80H to FFH) and a name which reflects the purpose of the SFR. Out of the 128 bytes allocated to the SFRs, only 21 SFRs have been defined in the standard 8051 architecture and the rest of space is unspecified. Some of the SFRs are bit addressable. SFRs are addressed just like internal RAM locations. The SFRs are set to their specified values when the system is being reset. Each SFR has a predefined value which is assigned to it after the system is reset.

3.2 A (ACCUMULATOR) REGISTER


This is a general-purpose register used for storing intermediate results obtained during any operation. Prior to executing an instruction upon any number or operand, it is necessary to store it in the accumulator first. All results obtained from arithmetical operations performed by the ALU are stored in the accumulator. Data to be moved from one register to another must go through the accumulator. In other words, the accumulator register is the most commonly used register and it is impossible to imagine a microcontroller without it. More than half instructions used by the 8051 microcontroller use somehow the accumulator.

D7 (MSB)

D6

D5

D4

D3

D2

D1

D0 (LSB)

Figure 3.1 Bit Pattern of Accumulator Register

10

Table 3.1: SFR Map of AT89C52

Special Function Registers F8H F0H E8H E0H D8H D0H C8H C0H B8H B0H A8H A0H 98H 90H 88H 80H B* A* PSW* IP* P3* IE* P2* SCON* P1* TCON* P0* SBUF TMOD SP TL0 DPL TL1 DPH TH0 TH1 PCON FFH F7H EFH E7H DFH D7H CFH C7H BFH B7H AFH A7H 9FH 97H 8FH 87H

Note: * indicates the SFRs which are Bit-Addressable

11

3.3 B REGISTER
Multiplication and division can be performed only upon numbers stored in the A and B registers. All other instructions in the program can use this register as a spare accumulator. It is important to note that during the process of writing a program, each register is called by its name so that their exact addresses are not of importance for the user. During compilation, their names will be automatically replaced by appropriate addresses.

3.4 PSW REGISTER


This is Program Status Word. It is one of the most important SFRs. It contains several status bits that reflect the current state of the CPU. Besides, this register contains Carry bit, Auxiliary Carry, two register bank select bits, Overflow flag, parity bit and user-definable status flag.

CY

AC

F0

RS1

RS0

OV

Figure 3.2 Bit Pattern of PSW register P (Parity Bit): If a number stored in the accumulator is even then this bit will be automatically set to 1, otherwise it will be cleared (0). It is mainly used during data transmit and receive via serial communication. Bit 1: This bit is intended to be used in the future versions of microcontrollers. OV: Overflow occurs when the result of an arithmetical operation is larger than 255 and cannot be stored in one register. Overflow condition causes the OV bit to be set to 1; otherwise it will be cleared. RS0, RS1: These are register bank select bits. These two bits are used to select one of four register banks of RAM. By setting and clearing these bits, registers R0-R7 are stored in one of four banks of RAM.

12

Table 3.2: Combinations of RS1 and RS0 for register bank selection

RS1 0 0 1 1

RS0 0 1 0 1

Space in RAM Bank0 (00H - 07H) Bank1 (08H 0FH) Bank2 (10H-17H) Bank3 (18H 1FH)

F0: This is Flag 0 and is a general-purpose bit available for use. AC: Auxiliary Carry Flag is used for BCD operations only. CY: Carry Flag is the auxiliary bit used for all arithmetical operations and shift instructions.

3.5 DPTR
This is data pointer register. DPTR register is not a true one because it doesn't physically exist. It consists of two separate registers: DPH and DPL. For this reason it may be treated as a 16-bit register or as two independent 8-bit registers. Their 16 bits are primarily used for external memory addressing. Besides, the DPTR register is usually used for storing data and intermediate results.
DPH DPL

D15

D8

D7

D0

Figure 3.3 Bit Pattern of Data Pointer Register (16 bits)

13

3.6 SP Register
This is stack pointer register. A value stored in the stack pointer points to the first free stack address and permits stack availability. Stack pushes increment the value in the stack pointer by 1. Likewise, stack pops decrement its value by 1. Upon any reset and power-on, the value 7 (00000111) is stored in the Stack Pointer, which means that the space of RAM reserved for the stack starts at this location. If another value is written to this register, the entire stack is moved to the new memory location.

3.7 IE (Interrupt Enable) Register


This is also an 8-bit register and is used for enabling and disabling of the interrupts in the microcontroller. The interrupts may be generated by timers (T1 and T0), external interrupts or serial interrupts.

EA

ET2

ES

ET1

EX1

ET0

EX0

Figure 3.4 Bit Pattern of Interrupt Enable (IE) Register Table 3.3: Functions of various bits of IE register

Bit Name EA ES ET1 EX1 ET0 EX0

If Set Enables all Interrupt Requests Enables Serial Interrupt Enables Timer 1 Interrupt Enables External Interrupt 1 Enables Timer 0 Interrupt Enables External Interrupt 0

If Reset Disables all Interrupt Requests Disables Serial Interrupt Disables Timer 1 Interrupt Disables External Interrupt 1 Disables Timer 0 Interrupt Disables External Interrupt 0

14

3.8 IP (INTERRUPT PRIORITY) REGISTER


It is not possible to foreseen when an interrupt request will arrive. If several interrupts are enabled, it may happen that while one of them is in progress, another one is requested. In order that the microcontroller knows whether to continue operation or meet a new interrupt request, there is a priority list instructing it what to do.

PT2

PS

PT1

PX1

PT0

PX0

Figure 3.5 Bit Pattern of Interrupt Priority (IP) Register The priority list offers 3 levels of interrupt priority i.e. Reset; the absolute master; when a reset request arrives, everything is stopped and the microcontroller restarts. Interrupt priority 1 can be disabled by Reset only. Interrupt priority 0 can be disabled by both Reset and interrupt priority 1.

3.9 INPUT/OUTPUT REGISTERS


If neither external memory nor serial communication system are used then 4 ports within total of 32 input/output pins are available for connection to peripheral environment. Each bit within these ports affects the state and performance of appropriate pin of the microcontroller. Thus, bit logic state is reflected on appropriate pin as a voltage (0 or 5 V) and vice versa, voltage on a pin reflects the state of appropriate port bit. If a bit is cleared, the appropriate pin will be configured as output, while if it is set, the appropriate pin will be configured as input. Upon reset and power-on, all port bits are set, which means that all appropriate pins will be configured as inputs.

PX7

PX.6

PX.5

PX.4

PX.3

PX.2

PX.1

PX.0

Figure 3.6 Bit Pattern of Port (P0, P1, P2, P3) SFRs

15

3.10 TIMERS AND COUNTERS


The microcontroller oscillator uses quartz crystal for its operation. As the frequency of this oscillator is precisely defined and very stable, pulses it generates are always of the same width, which makes them ideal for time measurement. In order to measure time between two events it is sufficient to count up pulses coming from this oscillator. That is exactly what the timer does. If the timer is properly programmed, the value stored in its register will be incremented (or decremented) with each coming pulse. 3.10.1 Timers in 8051 The 8051 microcontroller has 2 timers/counters called T0 and T1. They can be used for generating clock pulses to be used in serial communication, also called Baud Rate. The timers T0 and T1 are both 16 bits wide. Each timer is accessed as two separate registers of lower byte and higher byte. Both the timers (T1 and T0) use a common register TMOD that control their operation and operating modes.
TH 1/0 TL 1/0

D15

D8

D7

D0

Figure 3.7 Timer 1/0 3.10.2 TMOD Register The TMOD register selects the operational mode of the timers T0 and T1. As seen in figure below, the low 4 bits (0 - 3) refer to the timer 0, while the high 4 bits (4 - 7) refer to the timer 1. There are 4 operational modes and each of them is described herein.

GATE1

C/T1

T1M1

T1MO

GATE2

C/T0

T0M1

T0M0

Figure 3.8 Bit Pattern of TMOD Register GATE1 enables and disables Timer 1 by means of a signal brought to the INT1 pin (P3.3). For GATE1 set, Timer 1 operates only if the INT1 bit is set else, Timer 1 operates regardless of the logic state of the INT1 bit. C/T1 selects pulses to be
16

counted up by the timer/counter. If set, Timer counts pulses brought to the T1 pin (P3.5), else Timer counts pulses from internal oscillator. GATE0 enables and disables Timer 0 using a signal brought to the INT0 pin (P3.2). For GATE0 set, Timer 0 operates only if the INT0 bit is set, else Timer 0 operates regardless of the logic state of the INT0 bit. C/T0 selects pulses to be counted up by the timer/counter 0. If set, Timer counts pulses brought to the T0 pin (P3.4), else Timer counts pulses from internal oscillator. The various modes of operation of these timers are as described in the table below. The bits T1M1 and T1M0 select the operational mode for Timer 1 and the bits T0M1 and T0M) select the modes for Timer 0. Table 3.4: Modes of operation of timers 1/0 defined in TMOD register

M1 0 0 1 1

M0 0 1 0 1

Mode of Operation 13 Bit Timer 16 Bit Timer 8 Bit Auto-Reload Split Mode

Table 3.5: Reset Values of various SFRs: SFR B A PSW IP P3 IE P2 SCON SBUF P1 Reset Value 00000000 00000000 00000000 XX000000 11111111 0X000000 11111111 00000000 XXXXXXXX 11111111
17

SFR TCON TMOD TL0 TL1 TH0 TH1 P0 SP DPL DPH

Reset value 00000000 00000000 00000000 00000000 00000000 00000000 11111111 00000111 00000000 00000000

Chapter 4: COMPONENTS DESCRIPTION

4.1 LED
A light-emitting diode (LED) is a semiconductor light source. They are used as indicator lamps in many devices and are increasingly used for other lighting. Early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness. When a lightemitting diode is forward biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the colour of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. LEDs are often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern.

Figure 4.1 Electronic symbol of an LED LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, and faster switching. However, LEDs which are powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output. Light-emitting diodes are used in applications as diverse as replacements for aviation lighting, automotive lighting (particularly brake lamps, turn signals and indicators) as well as in traffic signals. LEDs have allowed new text, video displays, and sensors to be developed, while their high switching rates are also useful in advanced communications technology. Infrared LEDs are also used in the remote control units of many commercial products including televisions, DVD players, and other domestic appliances.

18

4.2 RESISTOR
A linear resistor is a linear, passive two-terminal electrical component that implements electrical resistance as a circuit element. The current through a resistor is in direct proportion to the voltage across the resistor's terminals. Thus, the ratio of the voltage applied across a resistor's terminals to the intensity of current through the circuit is called resistance. The commercially available resistors vary in their peak power dissipation capability. The most common versions available are 0.25W, 0.5W, 1W and 2W.Resistors are common elements of electrical networks and electronic circuits and are ubiquitous in most electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-chrome). Resistors are also available in SIP (Single Inline Package) forms, wherein a number of individual resistors are packed in one case with their one terminal common and the other terminals as open.
First Digit Second Digit

Multiplier Tolerance

Figure 4.2 General appearance of an electrical resistor The resistors available in the market have coloured bands printed on them. The value of a resistor can be easily calculated by using these bands. The colour of first band indicates the first digit; second band indicates the second digit; third band indicates the multiplier value and the fourth band indicates the tolerance value of the resistor. The values for various colours are as shown in the table. For example, if the colour bands are in the order yellow, violet, red and gold; it shows that the resistors value is 4.7 K with a tolerance value of 5%.

19

Table 4.1: Resistance Colour Codes Colour Black Brown Red Orange Yellow Green Blue Violet Grey White Gold Silver None 1st Digit 0 1 2 3 4 5 6 7 8 9 2nd Digit 0 1 2 3 4 5 6 7 8 9 Multiplier 100 101 102 103 104 105 106 107 108 109 10-1 10-2 Tolerance 5% 10% 20%

4.3 Capacitor
A capacitor is a passive two-terminal electrical component used to store energy in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric. When there is a potential difference (voltage) across the conductors, a static electric field develops across the dielectric (insulator), causing positive charge to collect on one plate and negative charge on the other plate. Energy is stored in the electrostatic field. Capacitors are widely used in electronic circuits for blocking direct current while allowing alternating current to pass, in filter networks, in the resonant circuits and for many other purposes. An ideal capacitor is characterized by a constant value, capacitance,
20

measured in farads. This is the ratio of the electric charge on each conductor to the potential difference between them. Capacitors are of two types: Electrolytic Capacitors and Non-electrolytic capacitors. Non-electrolytic capacitors may be ceramic, paper, polystyrene, glass capacitors etc.

Figure 4.3 Typical shape (cylindrical) of an electrolytic capacitor

4.4 DIODE
In electronics, a diode is a type of two-terminal electronic component with a nonlinear currentvoltage characteristic. A semiconductor diode is a crystalline piece of semiconductor material connected to two electrical terminals. The most common function of a diode is to allow an electric current to pass in one direction (called the diode's forward direction), while blocking current in the opposite direction (the reverse direction). Thus, the diode can be thought of as an electronic version of a check valve. This unidirectional behaviour is called rectification, and is used to convert alternating current to direct current, and to extract modulation from radio signals in radio receivers.

Anode

2200uF/ 50V

Cathode

Figure 4.4 Electronic symbol and packaging of a diode

21

4.5 CRYSTAL
The crystal used in a typical 8051 system is of frequency 11.0592 Mega Hertz. For 8051 system, we have to use two non-electrolytic capacitor of value 30pF in conjunction with the crystal as shown in the figure. Some of the salient features of the crystal are as listed below:
o o o o o o o o o

Output Frequency: 11.0592 MHz Frequency Tolerance:30ppm Load Capacitance:18pF Frequency Stability: 0ppm Operating Temperature Range:-40C to +85C Crystal Mounting Type:SMD No. of Pins: 2 Accuracy:30ppm Temperature Stability: 50ppm
C2 XTAL2 30pF C1 XTAL1 30pF GND

Figure 4.5 Typical arrangement for oscillator circuitry in an 8051 system

4.6 LM7805
The LM78XX series of three terminal positive regulators are available in the TO-220 package and with several fixed output voltages, making them useful in a wide range of applications.For ICs within the family, the xx is replaced with two digits, indicating the output voltage (for example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). Each type employs internal current limiting, thermal shut down and safe
22

operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents. Table 4.2: List of various Fixed Voltage Regulator ICs Positive Voltage Regulators IC Number LM7805 LM7806 LM7809 LM7812 LM7824 Output 5 Volts 6 Volts 9 Volts 12 Volts 24 Volts Negative Voltage Regulators IC Number LM7905 LM7906 LM7909 LM7912 LM7924 Output -5 Volts -6 Volts -9 Volts -12 Volts -24 Volts

4.7 AT89C52 MICROCONTROLLER


The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 8K bytes of flash programmable and erasable read only memory. The device is manufactured using Atmels high-density non-volatile memory technology and is compatible with the industry-standard 80C51 and 80C52 instruction set and pin out. The on-chip flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. It is available in a variety of packaging case viz. Dual Inline Package (DIP) having 40 pins; Plastic Leaded Chip Carrier (PLCC) having 44 pins; Thin Quad Flat Pack (TQFP) having 44 pins. The AT89C52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full-duplex serial port, on-chip oscillator, programmable serial channel, three level program memory lock, and clock circuitry. By combining a versatile 8-bit CPU with flash on a monolithic chip, the Atmel AT89C52 is a powerful
23

microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. The first 128 bytes of the internal RAM is allocated to the special function registers as in standard 8051. But the number of SFRs in AT89C52 is greater than in standard 8051 architecture. There are a total of 27 special function registers in AT89C52. The additional six SFRs are T2CON, T2MOD, TL2, TH2, RCAP2L and RCAP2H.The registers TL2 and TH2 comprise the Timer 2 whereas the registers T2MOD and T2CON contain the control and the status bits for the timer 2. The register pair (RCAP2H, RCAP2L)is the Capture/Reload register for timer 2 in 16-bit capture mode or 16-bit auto-reload mode.

4.8 SHIFT REGISTER (74164)


In digital circuits, a shift register is a cascade of flip flops, sharing the same clock, which has the output of any one but the last flip-flop connected to the "data" input of the next one in the chain, resulting in a circuit that shifts by one position the onedimensional "bit array" stored in it, shifting in the data present at its input and shifting out the last bit in the array, when enabled to do so by a transition of the clock input. Shift registers can have both parallel and serial inputs and outputs. These are often configured as serial-in parallel-out (SIPO) or as parallel-in serial-out (PISO). 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 shifting in both directions i.e. left to right or right to left. The serial input and last output of a shift register can also be connected together to create a circular shift register. One of the most common uses of a shift register is to convert between serial and parallel interfaces. This is useful as many circuits work on groups of bits in parallel, but serial interfaces are simpler to construct. Shift registers can be used as simple delay circuits. The shift register used in the model is Motorolas SN74LS164N. It is a high speed 8 bit Serial-In Parallel-Out (SIPO) Shift Register. It is available as a 14 pin IC in DIP (Dual Inline Package) case. Serial data is entered through a 2-Input AND gate synchronous with the LOW to HIGH transition of the clock. The device features an
24

asynchronous Master Reset which clears the register setting all outputs LOW independent of the clock. It utilizes the schottky diode clamped process to achieve high speeds and is fully compatible with all Motorola TTL products. The pin diagram of the IC is as shown below.

VCC
14

Q7
13

Q6
12

Q5
11

Q4
10

#MR
9

CP
8

Q0

Q1

Q2

Q3

GND

Figure 4.6 Pin Diagram of SN74LS164N The SN74LS164N is an edge-triggered 8-bit shift register with serial data entry and an output from each of the eight stages. Data is entered serially through one of two inputs (A or B); either of these inputs can be used as an active HIGH Enable for data entry through the other input. An unused input must be tied HIGH, or both inputs connected together. Each low-to-high transition on the clock (CP) input shifts data one place to the right and enters into Q0 the logical AND of the two data inputs, that existed before the rising clock edge. A LOW level on the Master Reset (MR) input overrides all other inputs and clears the register asynchronously, forcing all Q outputs to low state.

4.9 PRINTED CIRCUIT BOARD 4.9.1 Introduction


A printed circuit board, or PCB, is used to mechanically support and electrically connect electronic components using conductive pathways, tracks or signal traces
25

etched from copper sheets laminated onto a non-conductive substrate. It is also referred to as printed wiring board (PWB) or etched wiring board. Printed circuit boards are used in virtually all but the simplest commercially produced electronic devices. Conducting layers are typically made of thin copper foil. Insulating layers dielectrics are typically laminated together with epoxy resin prepeg. The board is typically coated with a solder mask that is green in colour. Some of these dielectrics are polytetra-fluoro-ethylene (Teflon), FR-1, FR-4, CEM-1 and CEM-3. Well known prepreg materials used in the PCB industry are FR-2, FR-3, FR-4, FR-5, FR-6, G-10, CEM-1, CEM-2, CEM-3, CEM-4, and CEM-5. The board with copper on it is called copperclad laminate. Copper foil thickness can be specified in ounces per square foot or micrometres.

4.9.2 Printing Process


There are a number of sequential steps to print a circuit board which is briefly explained as follows. o Cleaning: The copper clad board is washed in order to remove dirt, dust, oxide grease or any particle impurities from its surface. o Designing: The layout for the actual PCB is to be developed in dedicated computer software. The layout takes care of all the dimensions of the components and wiring. o Printing: Once the layout has been developed in the software, take the print on the butter paper using a laser printer. Then press the butter paper against the copper board and hold it firmly. Then a hot iron is to be pressed over it a number of times so that the pattern over the paper is completely transferred on to the copper board. o Etching: For etching of the plates take a utensil and wash it properly. For etching, take water in the utensil, just enough to complete immerse the board. Add 230 grams of ferric chloride carefully without splashing and place the PCB inside the utensil. Place the plate in utensil with the copper side up such that the copper side is completely immersed in solution. After sometime the

26

copper side etches and the base material could not thus, the etching process is completed. o Drilling: When the PCB dries, drilling needs to be done. The holes should be exactly placed so that the component fix exactly in the holes without any bending of leads. For the drilling of holes, place it on the proper position. Always ensure that the copper lines passage near the holes. o Washing: The paint of pattern is removed by rubbing it with rag to see the entire copper pattern. Now wash the PCB in water. The PCB is complete after this step.

4.9.3 Advantages of PCBs:


o Reduced wiring error. o Easier component mounting. o Cost is less. o More reliable. o Reduced size and weight.

27

CHAPTER 5: DETAILED DESCRIPTION OF THE PROJECT

5.1 POWER SUPPLY UNIT


Every electronic system requires a suitable power supply to perform its operation. If the power supply is not available to the system, it is not going to work by any means. It is just like as we humans need energy (taken by food) to do our work, an electronic system needs a power supply to perform its task. The specification of a power supply depends on the power requirement of the system and this requirement is determined by its rating of the system. The main components used in supply system are: o Transformer o Rectifier o Input Filter o Voltage Regulator o Output Indication

5.1.1 Transformer
The main source of power supply is a transformer. Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC. The input coil is called the primary coil and the output coil is called the secondary coil. There is no electrical connection between the two coils; instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core. Transformers are of two types: Step-Up and Step-Down. Step-up transformers increase the applied voltage whereas step-down transformers reduce the applied voltage. The ratio of the number of turns on each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer has a large number of turns on its primary coil which is connected to the high voltage mains supply, and a small number of turns on its secondary coil to give a low output voltage. The maximum output power of a power supply is dependent on maximum output power of the transformer. We determine power from its current and voltage rating. e.g.: if there is a transformer of 12V, 500mA then maximum power delivered by transformer is

28

6Watt. It means we can drive a load from this transformer up to 6w. A step down transformer is to be used in a power supply since we generally require either 5 volts or 12 volts for electronic systems.

Figure 5.1 Electrical Symbol of a Step-Down Transformer

5.1.2 Rectifier
It is a circuit arrangement which is used to convert AC to DC. Every electronic circuit requires a rectifier circuit. Generally a bridge rectifier is employed in electronic circuits in which four diodes are used.

Figure 5.2 Typical arrangement for a Bridge Rectifier

5.1.3 Input Filter


After rectification, we obtain DC power from AC; but it is a pulsating DC as it has AC ripples in it. In order to reduce these ripples we use filters. To reduce low frequency ripples we use electrolytic capacitors. The voltage rating of the capacitor must be double from incoming DC supply.

Figure 5.3 Smoothed DC Output


29

The process of removing ripples is also called as smoothing. Smoothing is performed by a large value electrolytic capacitor (as mentioned above) connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.

5.1.4 Voltage Regulator


Voltage regulator is a device which provides constant output voltage for a varying input voltage. They are of two types: o Fixed Voltage Regulators o Adjustable Voltage Regulators Fixed voltage regulators have a fixed value at the output terminal when a varying input is applied. These can be 78XX or 79XX. The 78XX series represent positive fixed voltage regulators and the 79XX series represent the negative fixed voltage regulators. The last two digits represent the output voltage value. On the other hand, adjustable voltage regulators provide the feature of adjusting their output voltage by changing some external resistance values.

Figure 5.4 Circuit Symbol of a Regulator

Figure 5.5 7805 Voltage Regulator

5.1.5 Output Indication


Generally an LED is used to indicate that the output voltage. The LED is connected between the regulator output and the ground terminals. If the LED glows, it means that the circuit is working.

30

Transformer
230 Volt AC

Bridge Rectifier

Smoothing

Regulated DC

Voltage Regulator

Figure 5.6 Block Diagram of a Power Supply

Figure 5.7 Circuit Diagram of a Power Supply

5.2 PRINTED CIRCUIT BOARD


The circuit boards for the model have been printed by using chemical etching process. First of all, a layout of the LED matrix is made on the dedicated software program. The layout of the matrix is as shown in figure. It consists of spaces for LEDs arranged in the form of a rectangular matrix. Each character that will be formed on the matrix will require certain number of rows and columns. The cathodes of all the LEDs are to be connected together to ground terminal. Then the layout for the circuit board has been prepared on the same software program. It is also shown in the figure below. The chemical used for the etching purpose was ferric chloride powder (aqueous solution). The copper clad board was printed with the layout printed on a butter paper

31

and then etched with ferric chloride. The tracks remained on to the board and the rest of copper was removed due to etching process.

Figure 5.8 Layout for LED Matrix

Figure 5.9 Layout for Circuit Board

5.3 DISPLAY UNIT


The heart of the model is its display unit i.e. the LED Matrix. The information to be shown is displayed on this matrix itself. Each character which is to be displayed can be formed by glowing appropriate LEDs and turning off the rest. The size of the
32

character can vary according to the design. The character size may be 7*5 or 8*5 or 8*8 and so on. Generally the matrix is made by connecting the cathodes in rows and anodes in columns (or vice versa). In this model, a slightly different approach is employed. All the cathodes have been made common and are connected to ground. The anode terminals are left open and are to be connected to the signal pins.

Figure 5.10 Two 7*5 LED matrices placed together Now the main problem in the display unit is how to make the characters on the matrix. This is explained by the following figure. Suppose we have to print A on the matrix as shown. Suppose the display is 8*5 and the anodes are connected in rows and the cathodes are connected in columns. Now in order to make an LED glow, we have to identify the corresponding row and column and then send a high signal to the anode and a low signal to the cathode. This will make the LED forward bias, and the LED will glow. This was the case for a single LED. If we have to print an entire character; as in the model; then we have to provide the suitable signals to the complete column at a one time and then to the next column and so on. This process should be so fast that the eye
33

cannot observe the flickering of the LEDs.Now for letter A, we will have to transmit the signal at column 1 as 01111110 as shown; at second column as 00010001 ans so on. So, the complete code for letter A would be 7EH,11H,11H,11H,7EH. The time period for shifting of values from one column to another should be fast enough so as to be notiiced by the eyes. Likewise letter A, all the other characters, numerals and special symbols can be displayed on the matrix.

Figure 5.11 Formation of letter A on the Matrix

5.4 CIRCUIT DESCRIPTION


The microcontroller (AT89C52) has been provided the clock through a crystal oscillator (frequency is 11.0592 MHz) and two 33pF capacitors. The reset circuitry consists of a 10uF/25V capacitor and a 10K resistance. The pins P3.6 (16) and P3.7 (17) are used for providing clear to the controller and clock to the shift registers respectively. Next is the Port 2. The pins of port 2 are directly connected to the inputs of shift registers as shown in the figure. The clock input of the shift registers are connected to pin P3.7 of the controller as it is providing the clock to the shift registers. The outputs of the shift registers are connected to the anodes of the LEDs. The cathodes of all the LEDs are common and connected to ground. Each shift register controls an entire row and hence seven shift registers are required to display a single character. This can be observed from the figure as well that seven shift registers have been used for one character.
34

5.5 CIRCUIT DIAGRAM

Figure 5.12 Basic Circuit Diagram of the model

5.6 OPERATING PROCEDURE


The operating principle of this circuit lies in the basic idea of shift registers. As some serial data is given to the shift registers, with each incoming clock, the data is shifted outwards. The data enters at the input pin of the register through the controller and with each incoming clock, the serial data travels from QA to QH. Data is provided to these registers through port 2 of the microcontroller. As the data is available at the input of shift registers, this data is displayed on the LED matrix in the first column at the next clock transition. Then at the next clock, new data is available at the input while the previous data is shifted in each register and hence displayed on the second column while the fresh data is displayed at the first column. Likewise, a complete character can be displayed on the board in five clock cycles. In this way, the data will be shifted from right to left and will appear as if it is moving from left to right.

35

5.7 PROJECT COST


Table 5.1: Cost of various components S. No. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. PARTS AND COMPONENTS PCB SOLDERING IRON AND SOLDER WIRE TRANSFORMER LM7805 RESISTORS, CAPACITORS AND DIODES LED AT89C52 SN741LS164N WIRES AND CONNECTORS GENERAL PURPOSE PCB OTHERS COST (IN RS.) 1200 200 100 20 60 200 150 600 100 70 500

36

CONCLUSION AND FUTURE SCOPE

The concept of displaying a scrolling message on LED matrices has emerged as a very great tool for conveying useful information at public places. May it be a bank, an airport or a railway station, retail showrooms, cinema halls and hospitals etc. It can be employed at every place where some information needs to be displayed. The message is easy to read as it moves at a reasonable speed. Moreover the language to be displayed on the board is not restricted to English only. The message can be displayed in any language; the program needs to be written accordingly. The present model is a static one, i.e. if a new message is to be displayed; the programming needs to be changed. This model can be further extended for dynamic messages i.e. the user just types the desired message using a standard QWERTY keyboard and the message will be show on the display. This can be achieved by interfacing a keyboard and an external flash memory unit (for storing the typed message) with the microcontroller. The typed message will be first stored in the memory and then the microcontroller will fetch the data from the memory itself.

37

REFERENCES
Referred Books 1. Mohammed Ali Mazidi, The 8051 Microcontroller and Embedded Systems Using Assembly And C, 2ndEdition, Pearson Education, 2007 2. Robertl L. Boylestad, Loius Nashelsky, Electronic Devices and Circuit Theory, 9thEdition, Pearson Education, 2007 3. Owen Bishop, Electronics Circuits and Systems, 2nd Edition, Newnes, 2003 4. Paul Horowitz, Winfield Hill, The Art of Electronics, 2nd Edition, 2001 5. Loius E. Frenzel Jr., Crash Course in Electronics Technology, Howard W. Sama & Company, 1st Edition, 1989.

Referred Websites 1. www.wikipedia.org 2. www.mikroe.com 3. www.alldatasheet.com 4. www.hackaday.com

38

APPENDIX (A) SOURCE CODE


org 000 clr a mov p3,a mov p2,a setb p3.6 main: mov p2,#00h call tran call delay44 call j call s call r call w1 call gap call e1 call gap call l1 call gap call c1 call gap

39

call o1 call gap call m1 call gap call e1 call gap call gap call t11 call gap call o1 call gap call gap call m1 call gap call dot call gap call m1 call gap call dot call gap CALL gap //M M //TO //WELCOME

40

call e1 call gap call n1 call gap call g1 call gap call i1 call gap call n1 call gap call e1 call gap call e1 call gap call r11 call gap call i1 call gap call n1 call gap call g1

41

call gap call gap call C1 call gap call O1 call gap call L1 call gap call L1 call gap call E1 call gap call G1 call gap call E1 call gap call J call s call r call gap call gap

// ENGINEERING

42

call gap call gap call gap call gap call gap call gap jmp main

w1:

clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#20h mov p2,a call tran call delay44 mov a,#10h mov p2,a call tran call delay44

43

mov a,#20h mov p2,a call tran call delay44 clr a mov a,#0ffh mov p2,a call tran call delay44 ret H1: clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#08h mov p2,a call tran call delay44 mov a,#08h mov p2,a

44

call tran call delay44 mov a,#08h mov p2,a call tran call delay44 clr a mov a,#0ffh mov p2,a call tran call delay44 ret B1: clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#49h mov p2,a call tran call delay44

45

mov a,#49h mov p2,a call tran call delay44 mov a,#49h mov p2,a call tran call delay44 clr a mov a,#36h mov p2,a call tran call delay44 ret e1: clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#49h mov p2,a

46

call tran call delay44 mov a,#49h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 ret GAP: clr a mov a,#70h mov p2,a call tran call delay44 mov a,#70h mov p2,a call tran call delay44 mov a,#70h

47

mov p2,a call tran call delay44 ret a1: clr a mov a,#7eh mov p2,a call tran call delay44 mov a,#11h mov p2,a call tran call delay44 mov a,#11h mov p2,a call tran call delay44 mov a,#11h mov p2,a call tran call delay44

48

clr a mov a,#7eh mov p2,a call tran call delay44 ret l1: clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#40h mov p2,a call tran call delay44 mov a,#40h mov p2,a call tran call delay44 mov a,#40h mov p2,a

49

call tran call delay44 ret c1: clr a mov a,#3eh mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 clr a

50

mov a,#22h mov p2,a call tran call delay44 ret N1: clr a mov a,#0FFh mov p2,a call tran call delay44 mov a,#04h mov p2,a call tran call delay44 mov a,#08h mov p2,a call tran call delay44 mov a,#10h mov p2,a call tran

51

call delay44 clr a mov a,#0FFh mov p2,a call tran call delay44 ret I1: clr a mov a,#41h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#0FFh mov p2,a call tran call delay44 mov a,#41h

52

mov p2,a call tran call delay44 clr a mov a,#41h mov p2,a call tran call delay44 ret o1: clr a mov a,#3eh mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran

53

call delay44 mov a,#41h mov p2,a call tran call delay44 clr a mov a,#3eh mov p2,a call tran call delay44 ret m1: clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#02h mov p2,a call tran call delay44 mov a,#04h

54

mov p2,a call tran call delay44 mov a,#02h mov p2,a call tran call delay44 clr a mov a,#0ffh mov p2,a call tran call delay44 ret t11: clr a mov a,#01h mov p2,a call tran call delay44 mov a,#01h mov p2,a call tran

55

call delay44 mov a,#0ffh mov p2,a call tran call delay44 mov a,#01h mov p2,a call tran call delay44 clr a mov a,#01h mov p2,a call tran call delay44 ret s1: clr a mov a,#26h mov p2,a call tran call delay44 mov a,#49h

56

mov p2,a call tran call delay44 mov a,#49h mov p2,a call tran call delay44 mov a,#49h mov p2,a call tran call delay44 clr a mov a,#32h mov p2,a call tran call delay44 ret G1: clr a mov a,#3Eh mov p2,a call tran

57

call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#51h mov p2,a call tran call delay44 mov a,#51h mov p2,a call tran call delay44 clr a mov a,#32h mov p2,a call tran call delay44 ret d1: clr a mov a,#0ffh

58

mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 mov a,#41h mov p2,a call tran call delay44 clr a mov a,#3eh mov p2,a call tran call delay44 ret

59

p11:

clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#09h mov p2,a call tran call delay44 mov a,#09h mov p2,a call tran call delay44 mov a,#09h mov p2,a call tran call delay44 clr a mov a,#06h mov p2,a call tran

60

call delay44 ret R11: clr a mov a,#0ffh mov p2,a call tran call delay44 mov a,#09h mov p2,a call tran call delay44 mov a,#19h mov p2,a call tran call delay44 mov a,#29h mov p2,a call tran call delay44 clr a mov a,#46h

61

mov p2,a call tran call delay44 ret y1: clr a mov a,#01h mov p2,a call tran call delay44 mov a,#02h mov p2,a call tran call delay44 mov a,#0fch mov p2,a call tran call delay44 mov a,#02h mov p2,a call tran call delay44

62

clr a mov a,#01h mov p2,a call tran call delay44 ret DOT: clr a mov p2,a call tran call delay44 clr a mov p2,a call tran call delay44 ret J: mov p2,#08h call tran call delay44 mov p2,#14h call tran call delay44

63

mov p2,#36h call tran call delay44 mov p2,#49h call tran call delay44 mov p2,#36h call tran call delay44 mov p2,#14h call tran call delay44 mov p2,#08h call tran call delay44 call gap RET s: mov p2,#79h call tran call delay44 mov p2,#09h

64

call tran call delay44 mov p2,#09h call tran call delay44 mov p2,#0ffh call tran call delay44 mov p2,#48h call tran call delay44 mov p2,#48h call tran call delay44 mov p2,#4fh call tran call delay44 call gap RET r: mov p2,#63h call tran

65

call delay44 mov p2,#55h call tran call delay44 mov p2,#2ah call tran call delay44 mov p2,#1ch call tran call delay44 mov p2,#2ah call tran call delay44 mov p2,#55h call tran call delay44 mov p2,#63h call tran call delay44 call gap RET

66

tran: clr p3.7 clr p3.0 mov r3,#14 g: djnz r3,g setb p3.7 setb p3.0 ret delay44: MOV R5,#0fH INLO2: MOV R0,#0F0H INLO1: MOV R1,#05H DJNZ R1,$ DJNZ R0,INLO1 DJNZ R5,INLO2 RET END

67

APPENDIX (B) CODES FOR CHARACTERS AND SYMBOLS


00H, 00H, 00H, 00H, 00H ! " # $ % & ' < > * + , . / 0 : ; 00H, 00H, 5FH, 00H, 00H 04H, 02H, 05H, 02H, 01H 14H, 7FH, 14H, 7FH, 14H 26H, 49H, 7FH, 49H, 32H 22H, 10H, 08H, 04H, 22H 00H, 36H, 49H, 36H, 28H 04H, 02H, 01H, 00H, 00H 08H, 14H, 22H, 41H, 00H 00H, 41H, 22H, 14H, 08H 2AH, 1CH, 08H, 1CH, 2AH 08H, 08H, 3EH, 08H, 08H 00H, 58H, 38H, 00H, 00H 08H, 08H, 08H, 08H, 08H 40H, 00H, 00H, 00H, 00H 20H, 10H, 08H, 04H, 02H 3EH, 41H, 41H, 41H, 3EH 00H, 00H, 22H, 00H, 00H 00H, 40H, 32H, 00H, 00H

68

= ? @ [ \ ] ^ _ ` { | } ~ A B C D E F G H

14H, 14H, 14H, 14H, 14H 06H, 01H, 51H, 09H, 06H 3EH, 4DH, 53H, 1DH, 1EH 7FH, 41H, 41H, 41H, 00H 02H, 04H, 08H, 10H, 40H 00H, 41H, 41H, 41H, 7FH 04H, 02H, 01H, 02H, 04H 40H, 40H, 40H, 40H, 40H 01H, 02H, 04H, 00H, 00H 77H, 49H, 41H, 41H, 00H 00H, 00H, 77H, 00H, 00H 00H, 41H, 41H, 49H, 77H 04H, 02H, 04H, 02H, 00H 7CH, 12H, 11H, 12H, 7CH 7FH, 49H, 49H, 49H, 36H 3EH, 41H, 41H, 41H, 22H 7FH, 41H, 41H, 22H, 1CH 7FH, 49H, 49H, 49H, 41H 7FH, 09H, 09H, 09H, 01H 3EH, 41H, 49H, 49H, 7AH 7FH, 08H, 08H, 08H, 7FH

69

I J K L M N O P Q R S T U V W X Y Z 1 2 3

00H, 41H, 7FH, 41H, 00H 20H, 40H, 41H, 3FH, 01H 7FH, 08H, 14H, 22H, 41H 7FH, 40H, 40H, 40H, 40H 7FH, 02H, 0CH, 02H, 7FH 7FH, 04H, 08H, 10H, 7FH 3EH, 41H, 41H, 41H, 3EH 7FH, 09H, 09H, 09H, 06H 3EH, 41H, 51H, 21H, 5EH 7FH, 09H, 19H, 29H, 46H 46H, 49H, 49H, 49H, 31H 01H, 01H, 7FH, 01H, 01H 3FH, 40H, 40H, 40H, 3FH 1FH, 20H, 40H, 20H, 1FH 3FH, 40H, 30H, 40H, 3FH 63H, 14H, 08H, 14H, 63H 07H, 08H, 70H, 08H, 07H 61H, 51H, 49H, 45H, 43H 00H, 42H, 0FFH, 40H, 00H 42H, 61H, 51H, 49H, 46H 49H, 49H, 49H, 49H, 36H

70

4 5 6 7 8 9

07H, 08H, 08H, 08H, 77H 4FH, 49H, 49H, 49H, 39H 3EH, 49H, 49H, 49H, 32H 41H, 21H, 11H, 09H, 07H 3EH, 49H, 49H, 49H, 3EH 06H, 09H, 09H, 09H, 7EH

71

You might also like