scrolling message display - project report - nov 15, 2011

Upload: arun-arya

Post on 14-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    1/71

    1

    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 seven-

    segment, 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 Dot-

    Matrix. 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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    2/71

    2

    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 subsidiary), NXP (formerly Philips Semiconductor), ST

    Microelectronics, Silicon Laboratories, Texas Instruments and CypressSemiconductor.

    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.

    Figure 2.1 A 8051 Microcontroller

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    3/71

    3

    2.2 FEATURES OF 8051

    o 8-bit data buso 16-bit address buso 32 general purpose registers each of 8 bitso ROM4K byteso RAM128 byteso 2 Timers (16-bit)o Four 8-bit portso 16-bit Program Counter

    2.3 BLOCK DIAGRAM OF 8051

    Interrupt

    Control

    CPU

    Oscillator

    On-Chip ROMfor Program

    Code

    On-Chip

    RAM

    Timer/Counter

    Timer 1

    Timer 0

    Serial PortI/O PortsBus Control

    External

    Interrupts

    RxD TxDP0 P1 P2P3

    Figure 2.2 Block Diagram of 8051

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    4/71

    4

    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.

    Figure 2.3 Basic Internal Architecture of 8051

    PORT

    1

    PORT

    2

    PORT

    0

    PORT

    31

    Timers, Counters,

    Interrupts, Serial Ports,

    SFRs

    CPU

    RAM EEPROM

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    5/71

    5

    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.

    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

    8051 Chip

    Internal

    RAM

    Special

    Function

    Registers

    Internal Code

    Memory

    (Optional)

    External Code

    Memory

    External

    RAM

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    6/71

    6

    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. Touse 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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    7/71

    7

    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/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    8/71

    8

    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 1017). 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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    9/71

    9

    Table 2.1: Special functions of Port 3 pins

    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.

    Port Pin IC Pin Number Alternate Functions

    P3.0 10 RxD (Serial Input Port)

    P3.1 11 TxD (Serial Output Port)

    P3.2 12 Int0 (External Interrupt 0)

    P3.3 13 Int1 (External Interrupt 1)

    P3.4 14 T0 (Timer 0 External input)

    P3.5 15 T1 (Timer 1 External Input)

    P3.6 16 WR (External Data Memory Write Strobe)

    P3.7 17 RD (External Data Memory Read Strobe)

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    10/71

    10

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    11/71

    11

    Table 3.1: SFR Map of AT89C52

    Special Function Registers

    F8H - - - - - - - - FFH

    F0H B* - - - - - - - F7H

    E8H - - - - - - - - EFH

    E0H A* - - - - - - - E7H

    D8H - - - - - - - - DFH

    D0H PSW* - - - - - - - D7H

    C8H - - - - - - - - CFH

    C0H - - - - - - - - C7H

    B8H IP* - - - - - - - BFH

    B0H P3* - - - - - - - B7H

    A8H IE* - - - - - - - AFH

    A0H P2* - - - - - - - A7H

    98H SCON* SBUF - - - - - - 9FH

    90H P1* - - - - - - - 97H

    88H TCON* TMOD TL0 TL1 TH0 TH1 - - 8FH

    80H P0* SP DPL DPH - - - PCON 87H

    Note: * indicates the SFRs which are Bit-Addressable

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    12/71

    12

    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 - P

    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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    13/71

    13

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

    RS1 RS0 Space in RAM

    0 0 Bank0 (00H - 07H)

    0 1 Bank1 (08H0FH)

    1 0 Bank2 (10H-17H)

    1 1 Bank3 (18H1FH)

    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.

    D15 D8 D7 D0

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

    DPH DPL

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    14/71

    14

    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 If Set If Reset

    EA Enables all Interrupt Requests Disables all Interrupt Requests

    ES Enables Serial Interrupt Disables Serial Interrupt

    ET1 Enables Timer 1 Interrupt Disables Timer 1 Interrupt

    EX1 Enables External Interrupt 1 Disables External Interrupt 1

    ET0 Enables Timer 0 Interrupt Disables Timer 0 Interrupt

    EX0 Enables External Interrupt 0 Disables External Interrupt 0

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    15/71

    15

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    16/71

    16

    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.

    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 1operates regardless of the logic state of the INT1 bit. C/T1 selects pulses to be

    TH 1/0 TL 1/0

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    17/71

    17

    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 M0 Mode of Operation

    0 0 13 Bit Timer

    0 1 16 Bit Timer

    1 0 8 Bit Auto-Reload

    1 1 Split Mode

    Table 3.5: Reset Values of various SFRs:

    SFR Reset Value SFR Reset value

    B 00000000 TCON 00000000

    A 00000000 TMOD 00000000

    PSW 00000000 TL0 00000000

    IP XX000000 TL1 00000000

    P3 11111111 TH0 00000000

    IE 0X000000 TH1 00000000

    P2 11111111 P0 11111111

    SCON 00000000 SP 00000111

    SBUF XXXXXXXX DPL 00000000

    P1 11111111 DPH 00000000

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    18/71

    18

    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 light-

    emitting diode is forwardbiased (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 colourof 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 foraviation

    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.

    http://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Lightinghttp://en.wikipedia.org/wiki/Visible_spectrumhttp://en.wikipedia.org/wiki/Ultraviolethttp://en.wikipedia.org/wiki/Infraredhttp://en.wikipedia.org/wiki/Semiconductor_diodehttp://en.wikipedia.org/wiki/Voltage_biashttp://en.wikipedia.org/wiki/Electronshttp://en.wikipedia.org/wiki/Carrier_generation_and_recombinationhttp://en.wikipedia.org/wiki/Electron_holehttp://en.wikipedia.org/wiki/Photonhttp://en.wikipedia.org/wiki/Electroluminescencehttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Energy_gaphttp://en.wikipedia.org/wiki/Led#Advantageshttp://en.wikipedia.org/wiki/Energy_conservationhttp://en.wikipedia.org/wiki/Energy_conservationhttp://en.wikipedia.org/wiki/Service_lifehttp://en.wikipedia.org/wiki/Thermal_management_of_high-power_LEDshttp://en.wikipedia.org/wiki/Fluorescent_lamphttp://en.wikipedia.org/wiki/Navigation_light#Aviation_navigation_lightshttp://en.wikipedia.org/wiki/Navigation_light#Aviation_navigation_lightshttp://en.wikipedia.org/wiki/Automotive_lighting#Light_emitting_diodes_.28LED.29http://en.wikipedia.org/wiki/LED#Indicators_and_signshttp://en.wikipedia.org/wiki/Traffic_signalhttp://en.wikipedia.org/wiki/Infraredhttp://en.wikipedia.org/wiki/Remote_controlhttp://en.wikipedia.org/wiki/Remote_controlhttp://en.wikipedia.org/wiki/Infraredhttp://en.wikipedia.org/wiki/Traffic_signalhttp://en.wikipedia.org/wiki/LED#Indicators_and_signshttp://en.wikipedia.org/wiki/Automotive_lighting#Light_emitting_diodes_.28LED.29http://en.wikipedia.org/wiki/Navigation_light#Aviation_navigation_lightshttp://en.wikipedia.org/wiki/Navigation_light#Aviation_navigation_lightshttp://en.wikipedia.org/wiki/Fluorescent_lamphttp://en.wikipedia.org/wiki/Thermal_management_of_high-power_LEDshttp://en.wikipedia.org/wiki/Service_lifehttp://en.wikipedia.org/wiki/Energy_conservationhttp://en.wikipedia.org/wiki/Energy_conservationhttp://en.wikipedia.org/wiki/Led#Advantageshttp://en.wikipedia.org/wiki/Energy_gaphttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Electroluminescencehttp://en.wikipedia.org/wiki/Photonhttp://en.wikipedia.org/wiki/Electron_holehttp://en.wikipedia.org/wiki/Carrier_generation_and_recombinationhttp://en.wikipedia.org/wiki/Electronshttp://en.wikipedia.org/wiki/Voltage_biashttp://en.wikipedia.org/wiki/Semiconductor_diodehttp://en.wikipedia.org/wiki/Infraredhttp://en.wikipedia.org/wiki/Ultraviolethttp://en.wikipedia.org/wiki/Visible_spectrumhttp://en.wikipedia.org/wiki/Lightinghttp://en.wikipedia.org/wiki/Semiconductor
  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    19/71

    19

    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.

    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%.

    First Digit Second Digit

    Multiplier

    Tolerance

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    20/71

    20

    Table 4.1: Resistance Colour Codes

    Colour 1st

    Digit 2nd

    Digit Multiplier Tolerance

    Black 0 0 10 -

    Brown 1 1 10 -

    Red 2 2 102 -

    Orange 3 3 10 -

    Yellow 4 4 10 -

    Green 5 5 105 -

    Blue 6 6 10 -

    Violet 7 7 10 -

    Grey 8 8 10 -

    White 9 9 10 -

    Gold - - 10- 5%

    Silver - - 10- 10%

    None - - - 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,

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    21/71

    21

    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 (thereverse 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.

    Figure 4.4 Electronic symbol and packaging of a diode

    2200uF/

    50V

    Anode Cathode

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    22/71

    22

    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 Output Frequency: 11.0592 MHzo Frequency Tolerance:30ppmo Load Capacitance:18pFo Frequency Stability: 0ppmo

    Operating Temperature Range:-40C to +85Co Crystal Mounting Type:SMDo No. of Pins: 2o Accuracy:30ppmo Temperature Stability: 50ppm

    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

    C2

    30pF

    C1

    30pF

    XTAL2

    XTAL1

    GND

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    23/71

    23

    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 Negative Voltage Regulators

    IC Number Output IC Number Output

    LM7805 5 Volts LM7905 -5 Volts

    LM7806 6 Volts LM7906 -6 Volts

    LM7809 9 Volts LM7909 -9 Volts

    LM7812 12 Volts LM7912 -12 Volts

    LM7824 24 Volts LM7924 -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 ofpackaging 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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    24/71

    24

    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 one-

    dimensional "bit array" stored in it, shifting in the data present at its input and shiftingout 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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    25/71

    25

    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.

    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 electricallyconnect electronic components using conductive pathways, tracks or signal traces

    14 813 12 11 10 9

    1 72 3 4 5 6

    VCC Q7 Q6 Q5 Q4 #MR CP

    A B Q0 Q1 Q2 Q3 GND

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    26/71

    26

    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 poly-

    tetra-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 copper-

    clad 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.

    oCleaning: The copper clad board is washed in order to remove dirt, dust, oxidegrease or any particle impurities from its surface.

    o Designing: The layout for the actual PCB is to be developed in dedicatedcomputer 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 onthe 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. Foretching, 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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    27/71

    27

    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 beexactly 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 theentire 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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    28/71

    28

    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 Transformero Rectifiero Input Filtero Voltage Regulatoro 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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    29/71

    29

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    30/71

    30

    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 Regulatorso 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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    31/71

    31

    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 arrangedin 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

    Transformer Bridge Rectifier Smoothing

    Voltage Regulator

    230 VoltAC

    Regulated DC

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    32/71

    32

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    33/71

    33

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    34/71

    34

    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 registersrespectively. 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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    35/71

    35

    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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    36/71

    36

    5.7 PROJECT COST

    Table 5.1: Cost of various components

    S. No. PARTS AND COMPONENTS COST (IN RS.)

    1. PCB 1200

    2. SOLDERING IRON AND SOLDER WIRE 200

    3. TRANSFORMER 100

    4. LM7805 20

    5. RESISTORS, CAPACITORS AND DIODES 60

    6. LED 200

    7. AT89C52 150

    8. SN741LS164N 600

    9. WIRES AND CONNECTORS 100

    10. GENERAL PURPOSE PCB 70

    11. OTHERS 500

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    37/71

    37

    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.

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    38/71

    38

    REFERENCES

    Referred Books

    1. Mohammed Ali Mazidi, The 8051 Microcontroller and Embedded SystemsUsing Assembly And C, 2ndEdition, Pearson Education, 2007

    2. Robertl L. Boylestad, Loius Nashelsky, Electronic Devices and CircuitTheory, 9thEdition, Pearson Education, 2007

    3. Owen Bishop, Electronics Circuits and Systems, 2nd Edition, Newnes, 20034. Paul Horowitz, Winfield Hill, The Art of Electronics, 2nd Edition, 20015. Loius E. Frenzel Jr., Crash Course in Electronics Technology, Howard W.

    Sama & Company, 1

    st

    Edition, 1989.

    Referred Websites

    1. www.wikipedia.org2. www.mikroe.com3. www.alldatasheet.com4. www.hackaday.com

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    39/71

    39

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    40/71

    40

    call o1

    call gap

    call m1

    call gap

    call e1 //WELCOME

    call gap

    call gap

    call t11

    call gap

    call o1 //TO

    call gap

    call gap

    call m1

    call gap

    call dot

    call gap

    call m1

    call gap

    call dot

    call gap //M M

    CALL gap

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    41/71

    41

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    42/71

    42

    call gap // ENGINEERING

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    43/71

    43

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    44/71

    44

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    45/71

    45

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    46/71

    46

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    47/71

    47

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    48/71

    48

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    49/71

    49

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    50/71

    50

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    51/71

    51

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    52/71

    52

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    53/71

    53

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    54/71

    54

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    55/71

    55

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    56/71

    56

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    57/71

    57

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    58/71

    58

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    59/71

    59

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    60/71

    60

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    61/71

    61

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    62/71

    62

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    63/71

    63

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    64/71

    64

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    65/71

    65

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    66/71

    66

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    67/71

    67

    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

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    68/71

    68

    APPENDIX (B)

    CODES FOR CHARACTERS AND SYMBOLS

    00H, 00H, 00H, 00H, 00H

    ! 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

    0 3EH, 41H, 41H, 41H, 3EH

    : 00H, 00H, 22H, 00H, 00H

    ; 00H, 40H, 32H, 00H, 00H

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    69/71

    69

    = 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

    A 7CH, 12H, 11H, 12H, 7CH

    B 7FH, 49H, 49H, 49H, 36H

    C 3EH, 41H, 41H, 41H, 22H

    D 7FH, 41H, 41H, 22H, 1CH

    E 7FH, 49H, 49H, 49H, 41H

    F 7FH, 09H, 09H, 09H, 01H

    G 3EH, 41H, 49H, 49H, 7AH

    H 7FH, 08H, 08H, 08H, 7FH

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    70/71

    70

    I 00H, 41H, 7FH, 41H, 00H

    J 20H, 40H, 41H, 3FH, 01H

    K 7FH, 08H, 14H, 22H, 41H

    L 7FH, 40H, 40H, 40H, 40H

    M 7FH, 02H, 0CH, 02H, 7FH

    N 7FH, 04H, 08H, 10H, 7FH

    O 3EH, 41H, 41H, 41H, 3EH

    P 7FH, 09H, 09H, 09H, 06H

    Q 3EH, 41H, 51H, 21H, 5EH

    R 7FH, 09H, 19H, 29H, 46H

    S 46H, 49H, 49H, 49H, 31H

    T 01H, 01H, 7FH, 01H, 01H

    U 3FH, 40H, 40H, 40H, 3FH

    V 1FH, 20H, 40H, 20H, 1FH

    W 3FH, 40H, 30H, 40H, 3FH

    X 63H, 14H, 08H, 14H, 63H

    Y 07H, 08H, 70H, 08H, 07H

    Z 61H, 51H, 49H, 45H, 43H

    1 00H, 42H, 0FFH, 40H, 00H

    2 42H, 61H, 51H, 49H, 46H

    3 49H, 49H, 49H, 49H, 36H

  • 7/29/2019 Scrolling Message Display - Project Report - Nov 15, 2011

    71/71

    4 07H, 08H, 08H, 08H, 77H

    5 4FH, 49H, 49H, 49H, 39H

    6 3EH, 49H, 49H, 49H, 32H

    7 41H, 21H, 11H, 09H, 07H

    8 3EH, 49H, 49H, 49H, 3EH

    9 06H, 09H, 09H, 09H, 7EH