Professional Documents
Culture Documents
uiopasdfghjklzxcvbnmqwertyuiopasd
fghjklzxcvbnmqwertyuiopasdfghjklzx
cvbnmqwertyuiopasdfghjklzxcvbnmq
LED MOVING MESSAGE DISPLAY
wertyuiopasdfghjklzxcvbnmqwertyui
www.BEProjectReport.com
opasdfghjklzxcvbnmqwertyuiopasdfg
hjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopasdfg
hjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopasdfg
hjklzxcvbnmrtyuiopasdfghjklzxcvbn
mqwertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyuiopas
VISIT US, CHOOSE THE PROJECT YOU LIKE AND
CLICK THE DOWNLOAD BUTTON
CHAPTER 1
INTRODUCTION
WHAT IS MOVING MESSAGE DISPLAY
The scrolling message display will allow the user to type in any alphanumeric message and see it
displayed through an array of red LEDs (Light Emitting Diodes). A block diagram illustrating this
process is depicted.
This project will be an embedded system, so the display will be able to scroll messages anywhere
there is a wall outlet. It will be dependent on a PC for user input. Messages can be created and saved
on the displays microcomputer by use of a terminal program on a PC. The PC and microcomputer
will communicate via serial port. After the message is created and saved, the display can be detached
from the PC and then plugged in elsewhere to scroll the message. The array of LEDs will be
configured together on a single board called a module.
The circuit board was designed with the microcontroller located on the back of the circuit board
leaving just the display and reset button on the front. Your message is hard coded into code space
within the microcontroller..
www.BEProjectReport.com
Page 2
WHAT DO WE NEED?
www.BEProjectReport.com
Page 3
CHAPTER 2
MICROCONTROLLER
www.BEProjectReport.com
Page 4
A single accumulator (W), the use of which (as source operand) is implied (i.e. is not encoded in the
opcode)
All RAM locations function as registers as both source and/or destination of math and other functions.
A hardware stack for storing return addresses
A fairly small amount of addressable data space (typically 256 bytes), extended through banking
Data space mapped CPU, port, and peripheral registers
The program counter is also mapped into the data space and writable (this is used to implement
indirect jumps).
Unlike most other CPUs, there is no distinction between memory space and register
space because the RAM serves the job of both memory and registers, and the RAM is usually just
referred to as the register file or simply as the registers.
Data space (RAM)
PICs have a set of registers that function as general purpose RAM. Special purpose
control registers for on-chip hardware resources are also mapped into the data space. The
addressability of memory varies depending on device series, and all PIC devices have some banking
mechanism to extend the addressing to additional memory. Later series of devices feature move
instructions which can cover the whole addressable space, independent of the selected bank. In
earlier devices (i.e., the baseline and mid-range cores), any register move had to be achieved via the
accumulator.
To implement indirect addressing, a "file select register" (FSR) and "indirect register"
(INDF) are used: A register number is written to the FSR, after which reads from or writes to INDF
will actually be to or from the register pointed to by FSR. Later devices extended this concept with
post- and pre- increment/decrement for greater efficiency in accessing sequentially stored data. This
also allows FSR to be treated almost like a stack pointer (SP).
External data memory is not directly addressable except in some high pin count PIC18 devices.
Code space
All PICs feature Harvard architecture, so the code space and the data space are separate.
PIC code space is generally implemented as EPROM, ROM, or flash ROM.
In general, external code memory is not directly addressable due to the lack of an external
memory interface. The exceptions are PIC17 and select high pin count PIC18 devices.
Word size
The word size of PICs can be a source of confusion. All PICs handle (and address) data in 8-bit
chunks, so they should be called 8-bit microcontrollers. However, the unit of addressability of the
code space is not generally the same as the data space. For example, PICs in the baseline and midrange families have program memory addressable in the same wordsize as the instruction width, ie.
www.BEProjectReport.com
Page 5
12 or 14 bits respectively. In contrast, in the PIC18 series, the program memory is addressed in 8-bit
increments (bytes), which differs from the instruction width of 16 bits.
In order to be clear, the program memory capacity is usually stated in number of (single word)
instructions, rather than in bytes.
Stacks
PICs have a hardware call stack, which is used to save return addresses. The hardware stack is not
software accessible on earlier devices, but this changed with the 18 series devices.
Hardware support for a general purpose parameter stack was lacking in early series, but this greatly
improved in the 18 series, making the 18 series architecture more friendly to high level language
compilers.
Instruction set
A PIC's instructions vary from about 35 instructions for the low-end PICs to over 80
instructions for the high-end PICs. The instruction set includes instructions to perform a variety of
operations on registers directly, the accumulator and a literal constant or the accumulator and a
register, as well as for conditional execution, and program branching.
Some operations, such as bit setting and testing, can be performed on any numbered register,
but bi-operand arithmetic operations always involve W; writing the result back to either W or the
other operand register. To load a constant, it is necessary to load it into W before it can be moved
into another register. On the older cores, all register moves needed to pass through W, but this
changed on the "high end" cores.
PIC cores have skip instructions which are used for conditional execution and branching. The
skip instructions are: 'skip if bit set', and, 'skip if bit not set'. Because cores before PIC18 had only
unconditional branch instructions, conditional jumps are implemented by a conditional skip (with the
opposite condition) followed by an unconditional branch. Skips are also of utility for conditional
execution of any immediate single following instruction.
The PIC architecture has no (or very meager) hardware support for automatically saving
processor state when servicing interrupts. The 18 series improved this situation by implementing
shadow registers which save several important registers during an interrupt.
In general, PIC instructions fall into 5 classes:
1. Operation on W with 8-bit immediate ("literal") operand. E.g. movlw (move literal to W),
andlw (AND literal with W). One instruction peculiar to the PIC is retlw, load immediate into
W and return, which is used with computed branches to produce lookup tables.
www.BEProjectReport.com
Page 6
2. Operation with W and indexed register. The result can be written to either the W register (e.g.
addwf reg,w). or the selected register (e.g. addwf reg,f).
3. Bit operations. These take a register number and a bit number, and perform one of 4 actions:
set or clear a bit, and test and skip on set/clear. The latter are used to perform conditional
branches. The usual ALU status flags are available in a numbered register so operations such
as "branch on carry clear" are possible.
4. Control transfers. Other than the skip instructions previously mentioned, there are only two:
goto and call.
5. A few miscellaneous zero-operand instructions, such as return from subroutine, and sleep to
enter low-power mode.
Performance
Many of these architectural decisions are directed at the maximization of top-end speed,
or more precisely of speed-to-cost ratio. The PIC architecture was among the first scalar CPU
designs, and is still among the simplest and cheapest. The Harvard architecturein which
instructions and data come from conveniently separate sourcessimplifies timing and microcircuit
design greatly, and this pays benefits in areas like clock speed, price, and power consumption.
The PIC is particularly suited to implementation of fast lookup tables in the program
space. Such lookups are O(1) and can complete via a single instruction taking two instruction cycles.
Basically any function can be modelled in this way. Such optimization is facilitated by the relatively
large program space of the PIC (e.g. 4096 x 14-bit words on the 16F690) and by the design of the
instruction set, which allows for embedded constants.
The simplicity of the PIC, and its scalar nature, also serve to greatly simplify the
construction of real-time code. It is typically possible to multiply the line count of a PIC assembler
listing by the instruction cycle time to determine execution time. (This is true because skip-based
instructions take 2 cycles whether the skip occurs or doesn't.) On other CPUs (even the Atmel, with
its MUL instruction), such quick methods are just not possible. In low-level development, precise
timing is often critical to the success of the application, and the real-time features of the PIC can save
crucial engineering time.
A similarly useful and unique property of PICs is that their interrupt latency is constant
(it's also low: 3 instruction cycles). The delay is constant even though instructions can take one or
two instruction cycles: a dead cycle is optionally inserted into the interrupt response sequence to
make this true. External interrupts have to be synchronized with the four clock instruction cycle,
otherwise there can be a one instruction cycle jitter. Internal interrupts are already synchronized.
The constant interrupt latency allows PICs to achieve interrupt driven low jitter timing sequences.
An example of this is a video sync pulse generator. Other microcontrollers can do this in some cases,
but it's awkward. The non-interrupt code has to anticipate the interrupt and enter into a sleep state
before it arrives. On PICs, there is no need for this.
www.BEProjectReport.com
Page 7
The three-cycle latency is increased in practice because the PIC does not store its registers when
entering the interrupt routine. Typically, 4 instructions are needed to store the W-register, the status
register and switch to a specific bank before starting the actual interrupt processing.
Limitations
The PIC architectures have several limitations:
The following limitations have been addressed in the PIC18, but still apply to earlier cores:
Conditional skip instructions are used instead of conditional jump instructions used by most
other architectures
Indexed addressing mode is very rudimentary
Stack:
o The hardware call stack is so small that program structure must often be flattened
o The hardware call stack is not addressable, so pre-emptive task switching cannot be
implemented
o Software-implemented stacks are not efficient, so it is difficult to generate reentrant
code and support local variables
Program memory is not directly addressable, and thus space-inefficient and/or timeconsuming to access. (This is true of most Harvard architecture microcontrollers.)
With paged program memory, there are two page sizes to worry about: one for CALL and GOTO
and another for computed GOTO (typically used for table lookups). For example, on PIC16, CALL
and GOTO have 11 bits of addressing, so the page size is 2048 instruction words. For computed
GOTOs, where you add to PCL, the page size is 256 instruction words. In both cases, the upper
address bits are provided by the PCLATH register. This register must be changed every time control
transfers between pages. PCLATH must also be preserved by any interrupt handler.
Compiler development
These properties have made it difficult to develop compilers that target PIC microcontrollers. While
several commercial compilers are available, in 2008, Microchip finally released their C compilers,
C18, and C30 for their line of 18f 24f and 30/33f processors. By contrast, Atmels AVR
microcontrollerswhich are competitive with PIC in terms of hardware capabilities and price, but
feature a RISC instruction sethave long been supported by the GNU C Compiler.
www.BEProjectReport.com
Page 8
Also, because of these properties, PIC assembly language code can be difficult to comprehend.
Judicious use of simple macros can make PIC assembly language much more palatable, but at the
cost of a reduction in performance. For example, the original Parallax PIC assembler ("SPASM") has
macros which hide W and make the PIC look like a two-address machine. It has macro instructions
like "mov b,a" (move the data from address a to address b) and "add b,a" (add data from address a to
data in address b). It also hides the skip instructions by providing three operand branch macro
instructions such as "cjne a,b,dest" (compare a with b and jump to dest if they are not equal).
Description
No operation
TRIS f
www.BEProjectReport.com
Page 9
MOVWF f Move W to f
CLRF f
DECF f,d
MOVF f,d
Move F (d = f)
COMF f,d
Complement f (d = NOT f)
INCF f,d
Increment f (d = f + 1)
RRF f,d
RLF f,d
BCF f,b
BSF f,b
BTFSS f,b
Decrement f (d = f 1)
www.BEProjectReport.com
Page 10
1000 kkkkkkkk
RETLW k
1001 kkkkkkkk
CALL k
101 kkkkkkkkk
GOTO k
1100 kkkkkkkk
1101 kkkkkkkk
IORLW k
1110 kkkkkkkk
1111 kkkkkkkk
Description
No operation
www.BEProjectReport.com
Page 11
00 0000 1 fffffff
MOVWF f Move W to f
Clear W to 0 (W = 0)
00 0001 1 fffffff
CLRF f
Clear f to 0 (f = 0)
00 0010 d fffffff
00 0011 d fffffff
DECF f,d
00 0100 d fffffff
00 0101 d fffffff
00 0110 d fffffff
00 0111 d fffffff
00 1000 d fffffff
MOVF f,d
Move F (d = f)
00 1001 d fffffff
COMF f,d
Complement f (d = NOT f)
00 1010 d fffffff
INCF f,d
Increment f (d = f + 1)
00 1011 d fffffff
00 1100 d fffffff
RRF f,d
00 1101 d fffffff
RLF f,d
00 1110 d fffffff
00 1111 d fffffff
01 00 bbb fffffff
BCF f,b
01 01 bbb fffffff
BSF f,b
www.BEProjectReport.com
Decrement f (d = f 1)
Page 12
01 10 bbb fffffff
01 11 bbb fffffff
BTFSS f,b
10 0 kkkkkkkkkkk CALL k
10 1 kkkkkkkkkkk GOTO k
www.BEProjectReport.com
Page 13
The auto increment/decrement feature was improved by removing the control bits and adding four
new indirect registers per FSR. Depending on which indirect file register is being accessed it is
possible to postdecrement, postincrement, or preincrement FSR; or form the effective address by
adding W to FSR.
In more advanced PIC18 devices, an "extended mode" is available which makes the addressing even
more favorable to compiled code:
a new offset addressing mode; some addresses which were relative to the access bank are
now interpreted relative to the FSR2 register
the addition of several new instructions, notable for manipulating the FSR registers.
These changes were primarily aimed at improving the efficiency of a data stack implementation. If
FSR2 is used either as the stack pointer or frame pointer, stack items may be easily indexed
allowing more efficient re-entrant code. Microchip C18 chooses to use FSR2 as a frame pointer.
PIC24 and dsPIC 16-bit microcontrollers
In 2001, Microchip introduced the dsPIC series of chips, which entered mass production in late 2004.
They are Microchip's first inherently 16-bit microcontrollers. PIC24 devices are designed as general
purpose microcontrollers. dsPIC devices include digital signal processing capabilities in addition.
Architecturally, although they share the PIC moniker, they are very different from the 8-bit PICs.
The most notable differences are
www.BEProjectReport.com
Page 14
The highest execution speed 80 MIPS (90+ Dhrystone MIPS @80 MHz)
The largest FLASH memory: 512kbyte
One instruction per clock cycle execution
The first cached processor
Allows execution from RAM
Full Speed Host/Dual Role and OTG USB capabilities
Full JTAG and 2 wire programming and debugging
Real-time trace
www.BEProjectReport.com
Page 15
Variants
Within a series, there are still many device variants depending on what hardware resources the chip
features.
Trends
The first generation of PICs with EPROM storage are almost completely replaced by chips with
Flash memory. Likewise, the original 12-bit instruction set of the PIC1650 and its direct descendants
has been superseded by 14-bit and 16-bit instruction sets. Microchip still sells OTP (one-timeprogrammable) and windowed (UV-erasable) versions of some of its EPROM based PICs for legacy
support or volume orders. It should be noted that the Microchip website lists PICs that are not
electrically erasable as OTP despite the fact that UV erasable windowed versions of these chips can
be ordered.
History
The original PIC was built to be used with General Instruments' new 16-bit CPU, the CP1600. While
generally a good CPU, the CP1600 had poor I/O performance, and the 8-bit PIC was developed in
1975 to improve performance of the overall system by offloading I/O tasks from the CPU. The PIC
used simple microcode stored in ROM to perform its tasks, and although the term wasn't used at the
time, it shares some common features with RISC designs.
www.BEProjectReport.com
Page 16
In 1985 General Instruments spun off their microelectronics division, and the new ownership
canceled almost everything which by this time was mostly out-of-date. The PIC, however, was
upgraded with internal EPROM to produce a programmable channel controller, and today a huge
variety of PICs are available with various on-board peripherals (serial communication modules,
UARTs, motor control kernels, etc.) and program memory from 256 words to 64k words and more (a
"word" is one assembly language instruction, varying from 12, 14 or 16 bits depending on the
specific PIC micro family).
PIC and PICmicro are registered trademarks of Microchip Technology. It is generally thought that
PIC stands for Peripheral Interface Controller, although General Instruments' original acronym for
the initial PIC1640 and PIC1650 devices was "Programmable Interface Controller". The acronym
was quickly replaced with "Programmable Intelligent Computer"
The Microchip 16C84 (PIC16x84), introduced in 1993,was the first CPU with on-chip EEPROM
memory. This electrically-erasable memory made it cost less than CPUs that required a quartz "erase
window" for erasing EPROM.
Device Programmers
Page 17
Devices called "programmers" are traditionally used to get program code into the target PIC. Most
PICs that Microchip currently sell feature ICSP (In Circuit Serial Programming) and/or LVP (Low
Voltage Programming) capabilities, allowing the PIC to be programmed while it is sitting in the
target circuit. ICSP programming is performed using two pins, clock and data, while a high voltage
(12V) is present on the Vpp/MCLR pin. Low voltage programming dispenses with the high voltage,
but reserves exclusive use of an I/O pin and can therefore be disabled to recover the pin for other
uses (once disabled it can only be re-enabled using high voltage programming).
There are many programmers for PIC microcontrollers, ranging from the extremely simple designs
which rely on ICSP to allow direct download of code from a host computer, to intelligent
programmers that can verify the device at several supply voltages. Many of these complex
programmers use a pre-programmed PIC themselves to send the programming commands to the PIC
that is to be programmed. The intelligent type of programmer is needed to program earlier PIC
models (mostly EPROM type) which do not support in-circuit programming.
Many of the higher end flash based PICs can also self-program (write to their own program
memory). Demo boards are available with a small bootloader factory programmed that can be used
to load user programs over an interface such as RS-232 or USB, thus obviating the need for a
programmer device. Alternatively there is bootloader firmware available that the user can load onto
the PIC using ICSP. The advantages of a bootloader over ICSP is the far superior programming
speeds, immediate program execution following programming, and the ability to both debug and
program using the same cable.
Microchip Programmers
www.BEProjectReport.com
Page 18
MPLAB ICD2 (RS232 serial and USB 1.0 interface) : ICSP programming only
PICKit 1 (USB interface)
PRO MATE II (RS232 serial interface) : intelligent.
Third-Party Programmers
There are programmers available from other sources, ranging from plans to build your own, to selfassembly kits and fully tested ready-to-go units. Some are simple designs which require a PC to do
the low-level programming signalling (these typically connect to the serial or parallel port and
consist of a few simple components), while others have the programming logic built into them (these
typically use a serial or USB connection, are usually faster, and are often built using PICs themselves
for control). For a directory of PIC related tools and websites, see PIC microcontroller at the Open
Directory Project.
These are some common programmer types:
www.BEProjectReport.com
Page 19
Peripheral Features:
High
Sink/Source Current: 25 mA
Timer0: 8-bit timer/counter with 8-bit prescaler
Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external
crystal/clock
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
Capture, Compare, PWM (CCP) module
- Capture is 16-bit, max. resolution is 12.5 ns
www.BEProjectReport.com
Page 20
MEMORY ORGANIZATION
There are two memory blocks in the PIC16F72 device. These are the program memory and the data
memory. Each block has separate buses so that concurrent access can occur. Program memory and
data memory are explained in this section. Program memory can be read internally by the user code
The data memory can further be broken down into the general purpose RAM and the Special
Function Registers (SFRs). The operation of the SFRs that control the core are described here. The
SFRs used to control the peripheral modules are described in the section discussing each individual
peripheral module.
Page 21
I/O PORTS
Some pins for these I/O ports are multiplexed with an alternate function for the peripheral features on
the device. In general, when a peripheral is enabled, that pin may not be used as a general purpose
I/O pin.
Page 22
PORTC pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals
override the TRIS bit to
make a pin an input. Since the TRIS bit override is in effect while the peripheral is enabled, readmodifywrite
instructions (BSF, BCF, XORWF) with TRISC as destination should be avoided.
www.BEProjectReport.com
Page 23
These devices have a Watchdog Timer, which can be enabled or disabled using a configuration bit. It
runs off its own RC oscillator for added reliability. There are two timers that offer necessary delays
on power-up. One is the Oscillator Start-up Timer (OST), intended to keep the chip in RESET until
the crystal oscillator is stable. The other is the Power-up Timer (PWRT), which provides a fixed
delay of 72 ms (nominal) on power-up only. It is designed to keep the part in RESET while the
power supply stabilizes, and is enabled or disabled using a configuration bit. With these two timers
on-chip, most applications need no external RESET circuitry.
SLEEP mode is designed to offer a very low current Power-down mode. The user can wake-up from
SLEEP through external RESET, Watchdog Timer Wake-up, or through an interrupt. Several
oscillator options are also made available to allow the part to fit the application. The RC oscillator
option saves system cost while the LP crystal option
saves power. Configuration bits are used to select the desired oscillator mode.
ELECTRICAL CHARACTERISTICS
Absolute Maximum Ratings
Ambient temperature under bias........................................................... -55 to +125C
Storage temperature .............................................................................. -65C to +150C
Voltage on any pin with respect to VSS
(except VDD, MCLR. and RA4) .......................................................... -0.3V to (VDD + 0.3V)
Voltage on VDD with respect to VSS ................................................... -0.3 to +6.5V
Voltage on MCLR with respect to VSS (Note 2) ...................................0 to +13.5V
Voltage on RA4 with respect to Vss .......................................................0 to +12V
Total power dissipation (Note 1) ............................................................1.0W
Maximum current out of VSS pin ...........................................................300 mA
Maximum current into VDD pin .............................................................250 mA
Input clamp current, IIK (VI < 0 or VI > VDD).................................. 20 mA
Output clamp current, IOK (VO < 0 or VO > VDD) ........................... .. 20 mA
Maximum output current sunk by any I/O pin..........................................25 mA
Maximum output current sourced by any I/O pin ....................................25 mA
Maximum current sunk by PORTA, PORTB...........................................200 mA
Maximum current sourced by PORTA, PORTB .....................................200 mA
Maximum current sunk by PORTC ............................................................200 mA
Maximum current sourced by PORTC .......................................................200 mA
Note 1: Power dissipation is calculated as follows: Pdis = VDD x {IDD - IOH} + {(VDD VOH) x IOH} + (VOl x IOL)
2: Voltage spikes at the MCLR pin may cause unpredictable results. A series resistor of greater than
1 k
should be used to pull MCLR to VDD, rather than tying the pin directly to VDD.
www.BEProjectReport.com
Page 24
CHAPTER 3
MOVING MESSAGE DISPLAY CIRCUIT
CIRCUIT OF MOVING MESSAGE DISPLAY:
www.BEProjectReport.com
Page 25
1] Micro controller
PIC 16F72 is the heart of the circuit which calls all of the shots. In normal operation when the
display is scrolling a message its task is to read data from the EEPROM, clock out a pulse to the
column selector ICs, which drive the columns, then spit out data at the rows. This is all done
very,very fast as you would imagine. A 20MHz crystal and associated 22pf caps provide a clock
sourcefor the micro. All of the magic is in the software. The bulk of the hardware is configured as a
workhorse if you like. Its a no brainier. During programming of the message into the display via
the Windows based software, the micros main role is to read the serial data and organize it into the
EEPROM.
www.BEProjectReport.com
Page 26
PIC16F72 IMAGE
Programming the message involves pressing the program button of the unit so that
the PIC micro is ready to receive serial data from the Windows based software. This data is then
transferred into a serial 24C256, 256Kb EEPROM for later recall. After successful programming the
display will scroll from right to left the message that you just programmed in. The scroll speed can
be tweaked via the Windows based software and you can set the number of times the message
repeats. In data
terms, whats actually stored on the EEPROM is the row data that is broken down from the
characters that you program.
The characters are all upper case, In normal operation the PIC just scans through this
data in the EEPROM and outputs it at the rows and provides a clock source that increment 5 column
counters that are connected to the columns. Its just a common multiplexing arrangement procedure,
www.BEProjectReport.com
Page 27
2] MCU Clock
Clock signal for the micro controller provided by crystal Y1 (20MHZ) the two 22PF capacitors
hanging off it ensure correct loading for the crystal, so that it starts reliably.
www.BEProjectReport.com
Page 28
www.BEProjectReport.com
Page 29
5] Data communication
RC3 on the micro is the RX line designated to receive the serial data from the PC, because we are
only using the RX line on the serial port to program in the message.
These communicate with PC serial (RS232) port via current limiting resistor
(R20). LED L2 provides data receiver indication and is driven by port RC1 via a 220E resistor. the
excellent IO capabilities of the PIC micro controller range of devices, and the adoption of TTL levels
on most modern PC serial ports, a line driver is often unnecessary unless long distances are involved
between the transmitter and the receiver. Instead a simple current limiting resistor is all that's
required
www.BEProjectReport.com
Page 30
6] EEPROM interfacing
RA0 & RA1 connect to the clock & data lines of IC9, serial EEPROM. This is a
256Kb device which operates serially at up to 600KHz!. The two 4K7 pull ups are essential since the
data & clock lines are bipolar.
Programming the message involves pressing the program button of the unit so that
the PIC micro is ready to receive serial data from the Windows based software. Port RC3 is pulled
up via 10K resistor and used for programming message.
8] Power Supply
Its based on 3 terminal voltage regulators, which provide the
required +5V.Power is derived initially from standard 12V AC/DC adapter or 12V_500ma
Transformer. This is fed to bridge rectifier D2 D8, the output of which is then filtered using 1000uf
electrolytic capacitor and fed to U3 (voltage regulator). U3 +5V output powers the PIC micro
controller and other logic circuitry. LED L1 and its associate 1K current limiting resistors provide
power indication. The unregulated voltage of approximately 12 V is required for matrix display driving
circuit.
www.BEProjectReport.com
Page 31
www.BEProjectReport.com
Page 32
ASSEMBLY INSTRUCTIONS
Use the component overlay on the PCB to place the components starting with the
lowest height components first. Make sure that the diode, LED and electrolytic capacitors are
inserted the right way around.
1. Resistors and diodes
2. IC sockets
3. LED s
4. Ceramic capacitors. And crystal
5. Transistors (Q1 ~ Q7)
6. Electrolytic capacitors. Make sure you insert them the correct
way around.
7. switches and Relimate connector
8. LM7805 regulators. Use needle nosed pliers to bend the leads
of the regulator. It does not require a heat sink. Screw down
onto to PCB
www.BEProjectReport.com
Page 33
PC SOFT WEAR
The software for Scrolling massage Sign Board has been tested with windows
XP, but should also work with Windows 95, 98, 2000 and ME.
www.BEProjectReport.com
Page 34
CHAPTER 4
CONTROL CIRCUIT AND COMPONENTS USED
CONTROL CIRCUIT AND COMPONENTS:
If we just made a big array of LEDs and controlled each one separately then wed
need a chip with about 200 pins for this small sign, and hundreds or thousands more for a larger sign.
By using a few handy control and power techniques weve managed to build a scrolling LED sign
with a lot of functionality in a small package and everything runs on a very simple 8-bit
microcontroller.
So how do we control 192 pixels with a 28 pin microcontroller? A process called
Multiplexingits a lot like how youre TV or computer screen works. Instead of trying to control
each pixel all the time we scan through them much faster than the eye can see. Take a look at the
schematic you can see how all of the LEDs are connected. An individual LED has a cathode
(negative) and anode (positive) lead. To make it light we just give it power and current flows from
anode to cathode. Every LED in a given row has a common anode (most of these connections are
made inside the LED matrix) and theyre connected to a transistor to VCC. The microcontroller can
turn on any of the 8 row transistors and provide that row with a path to VCC (+V).
Ok, now what about the cathode/negative terminal? On any given column all of
the cathode are common and connect to the output pins of column selector IC (shift registers). That
pin can either be low/0/negative in which case it will not supply current to flow through the LED, or
it can be high/1/positive.
Why use shift registers here, cant we just connect directly to the
microcontroller? There are two good reasons why its designed this way and one has to do with
power .The other is that its difficult/expensive to find a microcontroller with enough output pins.
We would need 35 output pins just to control all the columns, but in this setup we just use 2 pins to
provide clock and data to the shift registers. Also, this setup is infinitely expandable just daisy
chain more shift registers together to make a longer display.
.
www.BEProjectReport.com
Page 35
Wire Color
1
2
3
4
Orange
Red
Brown
Black
www.BEProjectReport.com
PIN NAME
GND
CLK
VCC
DIN
Page 36
Wire Color
1
2
3
4
5
6
7
Blue
Green
Yellow
Orange
Red
Brown
Black
PIN NAME
R2
R1
R3
R5
R7
R4
R6
1K
(3)
R2, 3, 4, 6, 8, 11
R13, 16, 18
4K7
(9)
R10, 21
10K
(2)
R22
22E
C1, 2
C3
C4
C5, 6
Y1
20 MHZ Crystal
D1
1N4148 DIODE
D2 ~ 5
1N4007 DIODE
L1 - 3mm 5mm
GREEN LED
L2 - 3mm - 5mm
RED LED
www.BEProjectReport.com
(7)
(2)
(2)
(4)
Page 37
U1 - PIC16F72
U2 - AT24C256
SERIAL EEPROM
U3 - LM7805
Q1 ~ Q7 - BC547
NPN Transistors
CN1
CN2
(7)
CN3
SW1
1nos
2nos
1nos
1nos
www.BEProjectReport.com
Page 38
www.BEProjectReport.com
Page 39
DISPLAY BOARD:
L.E.D. (Light Emitting Doide) are very exciting & excellent media for indoor & outdoor advertising
and are clearly visible from very long distance. Character matrix display panels are cheaper to build
than graphic matrix panels because fewer LEDs are used.
www.BEProjectReport.com
Page 40
The size of the target graphic panel should be an exact multiple of this matrix sub-block. If that can
be achieved, the design will use the minimum number of drivers, and the software driver can treat
the display as an orthogonal array of these matrix sub-blocks.
LED MODULE
INTERFACING WITH PC
LED display circuit is interfaced to computer using serial port RS232. Now we install the setup in
computers and after installation open the page and we change the speed settings and enter the word
we want to display.
As we control the display board using computer , this project is called PC INTERFACED LED
DOT MATRIX DISPLAY
www.BEProjectReport.com
Page 41
This is the software setup page where we type the required word. For example we have just typed
THANKFUL TO DR K.ALICE MARY, EEE HOD. And now we get the display in the dot matrix
board.
www.BEProjectReport.com
Page 42
CHAPTER 5
CODE
CODE FOR PIC16F72
#include <at89c5131.h>
#include <intrins.h>
#define TRUE 1
/* define logical true / false
*/
#define FALSE 0
/* values for bit variables
*/
#define SCROLL_DELAY 2000
/* scroll delay */
#define TIMER0_COUNT 0xFADA // 1.1ms
void delay_us(unsigned int d);
typedef unsigned char byte; /* type define objects with
code unsigned char matrix[59][6]=
{0x00,0x00,0x00,0x00,0x00,0x00, //space
0x00,0x00,0x7d,0x00,0x00,0x00, //!
0x00,0x60,0x00,0x60,0x00,0x00, //"
0x14,0x7f,0x14,0x7f,0x14,0x00, //#
0x32,0x49,0x7f,0x49,0x26,0x00, //$
0x62,0x64,0x08,0x13,0x23,0x00, //%
0x36,0x49,0x35,0x02,0x05,0x00, //&
0x00,0x00,0x00,0x50,0x60,0x00, //'
0x1c,0x22,0x41,0x00,0x00,0x00, //(
0x00,0x00,0x41,0x22,0x1c,0x00, //)
0x2a,0x1c,0x3e,0x1c,0x2a,0x00, //*
0x08,0x08,0x3e,0x08,0x08,0x00, //+
0x00,0x01,0x02,0x00,0x00,0x00, //,
0x08,0x08,0x08,0x08,0x08,0x00, //0x00,0x00,0x01,0x00,0x00,0x00, //.
0x02,0x04,0x08,0x10,0x20,0x00, ///
0x3e,0x45,0x49,0x51,0x3e,0x00, //0
0x00,0x21,0x7f,0x01,0x00,0x00, //1
0x27,0x49,0x49,0x49,0x31,0x00, //2
0x22,0x49,0x49,0x49,0x36,0x00, //3
0x0c,0x14,0x24,0x7f,0x04,0x00, //4
0x7a,0x49,0x49,0x49,0x46,0x00, //5
0x3e,0x49,0x49,0x49,0x26,0x00, //6
0x41,0x42,0x44,0x48,0x70,0x00, //7
0x36,0x49,0x49,0x49,0x36,0x00, //8
0x32,0x49,0x49,0x49,0x3e,0x00, //9
0x00,0x00,0x22,0x00,0x00,0x00, //:
0x00,0x01,0x22,0x00,0x00,0x00, //;
www.BEProjectReport.com
*/
Page 43
0x08,0x14,0x22,0x41,0x00,0x00, //<
0x14,0x14,0x14,0x14,0x14,0x00, //=
0x00,0x41,0x22,0x14,0x08,0x00, //>
0x20,0x40,0x45,0x48,0x30,0x00, //?
0x3e,0x41,0x4d,0x4d,0x39,0x00, //@
0x1f,0x24,0x44,0x24,0x1f,0x00, //A
0x7f,0x49,0x49,0x49,0x36,0x00, //B
0x3e,0x41,0x41,0x41,0x22,0x00, //C
0x7f,0x41,0x41,0x22,0x1c,0x00, //D
0x7f,0x49,0x49,0x49,0x41,0x00, //E
0x7f,0x48,0x48,0x48,0x40,0x00, //F
0x3e,0x41,0x41,0x45,0x26,0x00, //G
0x7f,0x08,0x08,0x08,0x7f,0x00, //H
0x00,0x41,0x7f,0x41,0x00,0x00, //I
0x42,0x41,0x41,0x7e,0x40,0x00, //J
0x7f,0x08,0x14,0x22,0x41,0x00, //K
0x7f,0x01,0x01,0x01,0x01,0x00, //L
0x7f,0x20,0x18,0x20,0x7f,0x00, //M
0x7f,0x10,0x08,0x04,0x7f,0x00, //N
0x3e,0x41,0x41,0x41,0x3e,0x00, //O
0x7f,0x48,0x48,0x48,0x30,0x00, //P
0x3c,0x42,0x46,0x42,0x3d,0x00, //Q
0x7f,0x48,0x4c,0x4a,0x31,0x00, //R
0x32,0x49,0x49,0x49,0x26,0x00, //S
0x40,0x40,0x7f,0x40,0x40,0x00, //T
0x7e,0x01,0x01,0x01,0x7e,0x00, //U
0x78,0x06,0x01,0x06,0x78,0x00, //V
0x7f,0x02,0x0c,0x02,0x7f,0x00, //W
0x63,0x14,0x08,0x14,0x63,0x00, //X
0x60,0x10,0x0f,0x10,0x60,0x00, //Y
0x43,0x45,0x49,0x51,0x61,0x00};//Z
code char TEST_MSG[]="WELCOME TO VIGNAN $";
sbit LED_RCK = P1^1;
sbit LED_SRCK = P1^0;
sbit LED_SRCLK_H = P1^3;
sbit LED_DATA = P1^4;
sbit LED_G_L = P1^2;
//sbit LED_RESET = P3^4;
bit timer0_tick;
/*
use the free-running I timer to multiplex the led displays
*/
void delay_us(unsigned int d){
unsigned int i,m;
www.BEProjectReport.com
Page 44
m=d/14;
for(i=0;i<m;i++);
}
void clock_shift (void) {
LED_RCK = 1;
delay_us(200);
LED_RCK = 0;
delay_us(200);
}
void main(void)
{
int i,j;
unsigned char row;
unsigned char *dataPtr, *tmpDataPtr;
unsigned char messageLength, currentChar, charOffset, tmpCurrentChar, tmpCharOffset;
char msg[32]; // ram for message max length
unsigned char ledArray[40];
P0=0x00;
P3=0x00;
P2=0x00;
LED_SRCLK_H=1;
LED_G_L=0;
/*
main execution loop, executes forever.
*/
//LED_RESET = 0;
LED_RCK = 0;
//LED_RESET = 1;
P0=0;
while(1){
for(i=0;i<sizeof(TEST_MSG);i++) msg[i]=TEST_MSG[i];
for(i=0;i<48;i++) if(msg[i]=='$') break; //calculate length of msg
messageLength = i;
charOffset = 0;
currentChar = 0;
dataPtr = &matrix[msg[0] - 0x20][0];
row = 0x01;
// this loop is the heart of the scroll
// message is scrolled until a key is hit on the keyboard
while (1) {
// load led array
//0x1f,0x24,0x44,0x24,0x1f,0x00
tmpDataPtr = dataPtr;
tmpCharOffset = charOffset;
www.BEProjectReport.com
Page 45
tmpCurrentChar = currentChar;
for (i = 0; i <= 31; i++) {
ledArray[i] = *tmpDataPtr++;
if (++tmpCharOffset==0x06) {
tmpCharOffset = 0;
if (++tmpCurrentChar == messageLength)
tmpCurrentChar = 0;
tmpDataPtr = &matrix[msg[tmpCurrentChar] - 0x20][0];
}
}
if (++charOffset == 0x06) {
charOffset = 0;
if (++currentChar == messageLength)
currentChar = 0;
}
dataPtr = &matrix[msg[currentChar] - 0x20][charOffset];
// display led array
//row = 1;
for (j = 0;j <= SCROLL_DELAY; j++) {
for (i = 0; i <= 10; i++) {
LED_DATA = (ledArray[i] & row) ? 1 : 0; //invert image by interchng 0:1
clock_shift() ;
}
LED_G_L=1;
delay_us(200);
LED_SRCK=1;
delay_us(200);
LED_SRCK=0;
delay_us(200);
//P0 = row;
P0=row;
delay_us(1000);
row <<= 1;
// next line to be switched on
if (row==0x80){
row = 0x01; // if last line go back to the first line
delay_us(1000);
P0 = 0x00; }
LED_G_L=0;
delay_us(200);
}
}//while
}//while
}//----------------end main
www.BEProjectReport.com
Page 46
CHAPTER 6
APPLICATION
This led display circuit is used to display messages at railway stations, buses and bus stations ,
schools, hospitals etc.
Led display board are widely used in sensex , industries etc.
This led display boards are used for fun purposes like displaying their names on caps, shirts, walls
etc.
The use of LED display signs in manufacturing, reader boards on pylon signs, LED displays at
events, outdoor signs in place of static billboards, some creating new types of outdoor signage,
electronic signs are dynamic in their ability to take the electronic sign to a whole new level of uses.
LED channel letters and signage can be purchased from a number of supply distributors, depending
on the type you need. Illuminating channel letters used to always be done by neon, but LEDs are now
emerging as an alternative source. The overall features of LED channel letters on display signs are
high brightness, lower cost in terms of energy efficiency and long operation life.
www.BEProjectReport.com
Page 47
CHAPTER 7
CONCLUSION AND RESULT
The project dot matrix led display circuit which is a scrolling message device is interfaced
with computer by a serial port. When the words are typed into the message box of the software setup.
And after we reset the switch the message appears on to the screen. And we have been successful
with this project , which we have done under the guidance of Dr.K.ALICE MARY, HOD EEE
Department.
And we can type a long sentence of 4000 characters as well as store that sentence in
EEPROM.
www.BEProjectReport.com
Page 48
BIBLIOGRAPHY
1. PICList FAQ and Archive from the "PICList" email list hosted at MIT. A well respected source
Of manufacturer-independent solutions, source code, and expertise.
2. PICNET Programmer Open Source Pic micro programmer.
3. GPUTILS Open Source assembler and linker.
4. Free software tools Free C, C++, Pascal, Basic compilers for the PIC microcontroller series.
5. Example of robot controlled by PIC16F877A: [12] [13]
6. USB Pic Programmer An open source project for a universal PIC programmer
7. A PIC microcontroller-based network I/O controller
8. Technical support is available through the web site at: http://support.microchip.com
9. PIC16F72 DATA SHEET
10. www.googlesearch.com
11. Wikipedia and blogs regarding moving message display circuits.
www.BEProjectReport.com
Page 49