Led Based Scrolling Message Display
-
Upload
vikas-choudhary -
Category
Documents
-
view
1.072 -
download
3
Transcript of Led Based Scrolling Message Display
1
CHAPTER 1INTRODUCTION
1
1. INTRODUCTION
LED-based moving-message displays are becoming popular for transmitting information
to large groups of people quickly. These can be used indoors or outdoors. We can find
such displays in areas like railway platforms, banks, public offices, hotels, training
institutes, nightclubs and shops. Compared to LEDs, liquid-crystal displays (LCDs) are
easy to interface with a microcontroller for displaying information as these have many
built-in functions. But these can’t be observed from a distance and large size LCDs are
very costly. LED-based displays can be of two types: dot-matrix and segmental. If you
implement a moving-message display with multiplexed dot-matrix LEDs, it will be very
costly for displaying 16 characters or more at a time. Moreover, programming will require
a lot of data memory or program memory space.
An external RAM may be needed to complement a microcontroller
likeAT89s52.However, if you use alphanumeric (16-segment LED) displays for the above
purpose, programming burdenis reduced and also it becomes highly cost-effective. You
can make your own display panel consisting of 16 alphanumeric characters at a much
lower cost. The circuit presented here uses 16 common-anode, single-digit, alphanumeric
displays to show 16 characters at a time.
Moreover, programming has been done to make the characters movein a beautiful
manner. A message appears on the panel from the right side, stays for a few seconds when
the first character reaches the leftmost place and then goes out from the left side. It
displays 16 different messages to depict different occasions, which can be selected by the
user through a DIP controlling electronic devices from a 89s52 is fun. Here is a scrolling
message display that mare’s use of the micro controller out put port. The Massage typed
from the keyboard of the PC is displayed on the light-emitting diodes arranged as 5x7 ld-
matrix display in moving message format.
. The PC; computer key board parallel port (LPT PORT) is used to output the
display code and the clock signal for the scrolling message display. The parallel ports in
terminated into a 25-pin D-type female connector at the back of the PC IBM PCs usually
come with one or two LPT ports. Each parallel port is actually made up l of three ports
1
namely. Data part, status port and control port. Here only data port is used scrolling
PROGRAM REACHES THE END of the message it starts from the beginning again To
change the text being displayed, exit the program by pressing Esc and edit the message txt
file using Notepad. After making changes to the message txt file save it and execute the
scroll.exe file. The program makes use of the out port b0 function which works perfectly
only on Windows 95/98 However the program may not work with the latest window
versions such as windows 2000/x When you try to save changes in the message txt file the
window shows an error saying Can’t save message txt.
It is being used by some other application. This is because the scroll.exe file is
running. SO EXIT sacrilege file is running. So Esc key then save your changes made to
the massage txt file and run the scroll.exe file. Now you can view your changes in k the
message being displayed. The program does not show special characters like and It has
been developed for displaying alphabets (A through Z) digits (o through 9) and some
special characters like and Other special characters can be added as follows, Suppose you
want to display character A Draw A on the 5x7 LED display as shown in Fig 3. First 7CH
data is available at the input of IC2 and the first flip-flop of IC8 When a clock pulse is
received this data (7CH ) is output by IC2 and the first flip-flop of IC8 and new data 12H
arrives at f the input pin of IC2 and the first flip-flop of IC8 .
The output data of IC2 and the first flip-flop of IC8 becomes the input for IC3 and
the second flip-flop of IC8 When the next clock pulse is received 7CH data become
available at the output of IC3 and output of second flip-flop of IC8. ‘12’ IS AVAILABLE
at the output of IC2 and the first flip-flop of IC8 and new data ‘11H’ is available at the
input of IC2 and the first flip-flop of IC8 This process continues until the message
completes. Now let’s assume that you want to display ‘<’ for this first draw this symbol on
the 5x7 matrix as shown in Assuming glowing LED as ‘1’ converts the binary column
sequence into hexadecimal for all the five columns as shown in the figure. Finally add the
following lines in the software p r o g r a m where the comment ‘Add your codes here”
appears. Save the file and compile the program again on executing the program you can
watch ‘<’ being displayed on the message display.
1
Other special characters can be added in the same way This project shows as to
how you can use the Atmel microcontroller AT89s52 to drive an LCD display module and
in turn use it as a handheld device to set the parameters of a control unit through RS 232
serial link. The circuit show the circuits of a microcontroller driven control unit and
microcontroller-driven handheld device comprising LCD module, Ports P0 and P2 of the
microcontroller have been configured to act as a common data bus for all the 16
alphanumeric displays whose corresponding data pins have been tied together to make a
common 16-bit data bus. Port-2 provides the higher byte of data, while port-0 provides the
lower one to light up a character on the display. Port pins P1.2-P1.4 and P1.5-P1.7 of the
microcontroller have been used as address inputs for decoder IC3 and IC4 (74LS138) to
enable one of the fourteen alphanumeric displays (DIS3 through DIS16) at a time,
respectively. However, displays DIS1 and DIS2 are enabled or disabled directly by port
pins P1.0 and P1.1. Pins 4 and 5 are grounded and pin 6 is made high to enable
decoder74LS138.the pin configuration of the common-anode alphanumeric display.
1
CHAPTER 2PRINCIPLE & WORKING
1
2. PRINCIPLE & WORKING
The circuit around IC1 (IC A T89s 52) is configured as a control unit while the circuit
around ICD driver unit The two unit are connected via an RS232 serial link. The
combination of an 8.2 k resistor and a 10uF capacitor provides hardware power –on IC1
and IC at their pin 9. An 11.059MHz crystal is connected between pins 18 and 19 of
microcontrollers IC1 and IC2 each to generate the required click and baud rate of 9600
eight LEDs are connected to pins 39 through 32 (PO.7) of IC1, so we can see the status of
each pin of port 0. Txd (pin11) and Rxd (10pin) are used to transmit and receive serial
data through IC MAX232 .IC3 and IC4 (MAX232. IC3 and serve the purpose of linking
the microcontrollers.
Pin 14(T1OUT) of IC3 is connected to pin 13 (R1IN) of IC4 and vice versa the
control unit contains the program control unit contains the program contr. asm to send and
receive data to the handheld directive data to the handheld device (LCD module). IC2
contains the program module the program module asm to drive the LCD a 16- character x
4-row LCD display is used to display the day month-year. The LCD module is interfaced
through 8 bit data bus of IC2 on its port 2 (pins 21 through28) These pins are pulled high
through the 10k resistor network Internal registers of the LCD module are selected pin 1
(p1.0) of LCD module are connected to pins 22 (p1.1 )and 3 (p1.2) of IC2 respectively
Backlight current (intensity)is controlled through series resistor R12 at pin 16 if the LCD
module The contrast and viewing angle are controlled through preset VR1 at pin 3 of the
LCD module.
Four pins of port 1 (pins 4 through7) are used to sense which key has been pressed
The keys are Esc ok up and Down usually pins 4 through 7 are held high through 4.7 k
resistors but any of the pins can be pulled down using the corresponding switches S1
1
through S4 RS-232 link between the two circuits serves the purpose of transferring serial
data from one microcontroller to the other. The functioning of the system depends on the
fact that multiple LED’s when glow together they can be used to display some message.
The problem is with the fact that in order to control so many LED’s we will need equal
number of ports and such a circuit will consume large amounts of current. In order to cope
with this the system is designed as a scanning display such that only one of the 7 rows is
activated.
2.1 Principle
It is assumed that the control unit has some basic data say, someone’s birthday
stored in it .The day, month and the year data are stored at 30H, and 32H RAM locations
respectively. When the remote handheld device (LCD module) is connected to the control
unit through RS- 232 link IC MAX 232, IC2 is reset to start functioning. The data stored
in the control unit is displayed on the LCD screen. The user can then select the data
change the data, increment or decrement it using Up or Down key, and then transfer the
data back to the control unit. RAM locations are reserved for saving various variables such
as the day’s units and tens digits. One location (45H) has been defined for sensing the flag
to find whether serial ports has been interrupted or not. Port pins connected to pins 4
through 6 of the LCD module are defined as rs rw and en keys Esc Ok Up and down is
defined as port 1, which are connected to pins 4 through 7 of IC2, respectively. The main
program starts at location 0000H, while a jump instruction has been set at location 0023H
for the serial port interrupt service routine (ISR ) Whenever the serial port is interrupted,
the program is automatically branched to location 0023H.
Start the main program starts at location 0030H Initially the stack pointer is
initialized to some safe location where it will not get disturbed by normal routines of the
program. Timer I is set as a NOT gated timer for 8-bit auto-reload function mode. The
reload value of I is set for generating a baud rate of 9600 bits per second. The SCON
register is set for Mode 1 Operation and is kept ready for reception. Start timer 1 and set
the required interrupt request bits as enabled. The interrupt flag is kept cleared to start.
1
Now in Fig.3 A few steps after the clr intflg instruction and before step l are for
initializing the LCD module. Step 1. screen 1, screen 2, etc to be displayed on the LCD
module are predefined as scr 1, scr 2, etc at respective location As the program enters step
1, it first screen to be displayed. The setup subroutine displays the screen. The first screen
displayed is a welcome massage. The program waits for the user to press Ok key to come
out from the welcome screen display. When the user presses OK Key the program control
passes to The program now displays the Birthday screen, indicating day, month, and year.
A small arrow pointer (> ) indicator gets added at Collocations COHso the arrow points at
day indicating that the parameter day is being selected.
The first character of each line on the LCD module has unique adders. The firs
character of first, second, third and fourth lines have address as 80HA, C0H, 90H, and
D0H, respectively. As the program executes the add day, add month, and year data is
retrieved from the master IC 89C51 (ICI) COVERTED into proper ASCII format and
saved at LCD locations the display now shows the day month and year also on the LCD
screen. If the user wishes to select month or year, he needs to press DOWN key and shift
the arrow pointer to the required selection place. ON pressing down key the arrow pointer
shifts down. Similarly on pressing Up key the arrow pointer shifts up This way the user
can select the parament he wishes to change In case no parameter is to be selected by
simply pressing Esc key the user can go back to step 1 which is the welcome screen once
the user has selected the parameter ok key takes the program to the next step. Step3. Here
the screen displays all the birthday characters. Except the arrow has been shifted to
indicate month, STEP4.
Here also the screen displays all the birthday characters except the arrow has been
shifted to indicate year. Step5. Depending upon the user’s selection of day or month or
year the program branches to step 5 or step 6 or step 7, where the screen displays set day
or set month or set year respectively. On screen 5 the LCD display set day .the day then
gets added on the screen. At keys label the program checks which key is pressed. As long
as no key is pressed the program keeps looping back to key 5 labels when the user presses
up key the parameter increments as the advance day and display day subroutines are called
in similarly by pressing down key the parameter decrements. During the advance day
subroutine the program first checks whether the day is already 13 If so if resets the day to
1
32 similarly the month doesn’t go beyond 12 and the year doesn’t go beyond 99 However
if the user is decrementing the day parameter the program first checks whether the day is
already 01. if so it resets the day to 31 the month to 12 and the year to 99 Whenever the
desired value of the day is seen on the screen pressing ok key take the program to transfer
the day data to the master IC.
The trfr-day subroutine transfers the value to the appropriate RAM location in the
control unit and returns to the screen. Steps 6 and 7 are similar to step 5 As soon as the
control unit of IC1 sends some data to the serial port, the serial interrupt at location 0023H
gets activated and the program control is passed to the serial port by the spint ISR (serial
port interrupt program) . Spent subroutines First all the interrupts are disabled since we do
not want any interrupt while serving this subroutine. Pushing the program status word
(psw) on the stack saves any useful information on the psw and accumulator The sbuf
register is then read and the same is stored at register B ri bit is then cleared for receiving
the next character flag is set to indicate the interrupt had occurred and finally the program
returns from the subroutine . Send subroutine. The program first disables all the interrupts
and clears the transmission completion flag. Then loads the buffer register to start the
transmission from IC2 to the control unit (ic1). As long as it bit remains low we need to
wait when the transmission is over ti bit goes high. The program then enables the interrupt
and returns to the main control Setup subroutine. The program first sets the address pointer
(register r2) to the first- line first column position (80H) OF the LCD It writes this address
to the LCD using the wi subroutine The program then gets the character from the screen
data library and writes data to the LCD using the wd subroutine THE setup subroutine
displays the character on the LCD screen.
Both the data pointer and the address pointer (register r2) are then incremented.
Line of LCD has been written, If so it modifies the address pointer to the second line
which is COH similarly when the second line is over the third line first character address
is set and then fourth line first character address is set as address pointer. Wi subroutine.
This subroutine is used for transferring control instruction to the LCD it first up the LCD
for writing instruction (rw=0en rs=0 and then moves the data to port 2 (p2.0 through p2.7)
from the accumulator. It then reads the busy bit at the accumulator it then reads the busy
bit at the rd busy subroutine and waits until the writing process is completed and finally
1
returns to the main program. WD subroutine. The subroutine is used for transferring data
to the LCD It first sets the lcd for writing data (rw=0 en=0, rs =1) and moves data to port
2 from the accumulator, it then reads the busy bit by the rd busy subroutine and waits until
the writing processes completed and finally returns to the main program . Rd busy
subroutine This subroutine is used for testing the busy bit during the writing operation to
the LCD it first selects the read set-up for the LCD (rw=1en=0 rs=0 .) .Then it sets port
2bit 7 (p2.7 ) and waits unit this bit become low after successfully writing to the LCD
Finally it returns to the main program . Dellm to delloom subroutines these are just time
delay for the control. Is stored the send con subroutine gets the control unit. This data is
now directly available in the two digit ASCII format for the control unit This data is now
directly available in the two digit ASCII format for the tens and units digits of day.
The tens and units digits of the day are stored and then display at LCD locations
c7H and C8H respectively the add month and add C8 year subroutines are similar to the
add day sub routine. Key press subroutine. This subroutine checks which key (Esc ok up
or Down ) has been pressed if no key is pressed the subroutine returns with the
accumulator containing FFH key switches are connected to port 1 (p1.3 through p1.6)
pins p1. Through p1.6 usually remain high until a key is pressed. If any key is sensed low
the program jumps to confirm whether to confirm whether it was an unintentional low or it
really happened by key press? For confirming so the program waits for the bounce period
of 10 milliseconds and then checks for the low again on the same key. If the key is not
sensed low now it is assumed to be an accidental low and the subroutine returns as if no
key was pressed. But if the key is sensed low for the second time also the program accepts
the key and waits for the user to release the key in about k300 milliseconds After 300
milliseconds, even if the user does not release the key the program repeats the action as if
the key is being pressed again with a code kin the accumulator Codes for the keys are; 0`1’
for pressing Esc key 0’2’ for pressing ok key 0;3; for pressing Up key ‘4’ for pressing
Down key Trfr –day subroutine. This subroutine transfers the day data to the appropriate
location in the control unit. When this subroutine is called the data is available as two
digits tens and units in the ASCII format. As the data needs to be stored at one RAM
ovation in the hex format the program has to convert the two ASCII digits into a single
hex digit by the asci hex subroutine.
1
At the end of the asci hex subroutine an equivalent hex number is available as hex
variable. The program now starts sending the characters first start code 02H IS SENT to
the control unit signaling it to get ready as the data is coming second the address 30H
assent where the day data is to be stored. Finally the hex variable is sent which is the
current day data the trfr-month and trfr-year are similar subroutines. Only the address
where the data is to be stored is different in each case. HEX-ASCI SUBROUTINE. First
the units and tens digits are reset to ASCII zero Then check whether the hex number is
already zero If yes, simply return. Else advance the units If the units digit has crossed
ASCII 9 we need to reset the units digit to zero and advance the tens digit simultaneously
the hex number has to be decremented .the process keeps repeating until hex number
becomes zero The accumulated tens and units are equivalent to the hex number originally
loaded, Asci-her subroutine. Here the process is almost opposite to what e die while
converting hex into ASCII First, the hex number is reset to zero. Then we check whether
both the units and tens digits are zero. If so we simply return. Otherwise we have to
advance the hex number simultaneously the units and tens digits are to be decremented.
The process keeps repeating itself until units and tens digits become zero; Adv-day
subroutine. This subroutine advances the day data but ensures that it does not go beyond
31. The first part checks whether the day’s units digit is 1 (DECIMAL) and tens digit is 3
(decimal). If so the program sets the units digit to 1 and the tens digit to 0 before returning.
The second part of the subroutine advances the day’s units digit until kit crosses 9
(ASCII39) After 9 the day’s units digit is reset to 0 and the tens digit is advanced.
Similarly, if the tens digit crosses 9 the program sets it to 0. Dec-day subroutine. This
subroutine decrements the day value. The first part checks whether the day’s units digit is
1 (decimal) and the tens digit is 0 (decimal) .If so the program sets the tens digit to 3
before returning. In the second part as the day’s unit’s digit is decremented the program
tests whether it has gone below tests whether it has gone below zero. (When ASCII 30h
decrements it will become ASCII 2fh). The program sets the units digit to 9 (ASCII39H)
and decrements the tens digit as the tens digit is decremented the program tests whether it
has gone below zero if so the program sets the tens digit to 9. The adv-month and adv-day
subroutine and the dec-month and dec-year subroutine are similar to the dec-day
subroutine. Send-can subroutine.
1
This subroutine first sends the address to the control unit and waits for the interrupt
flag to go high. This means the data from the control unit is to be received at the specified
address. After receiving the data the interrupt flag gets cleared for the next instruction. The
data is received from register B saved as the hex variable and converted into the ASCII
code that is required for the LCD module and control unit is shown in Fig 4 and its
component layout in Fig 5 The combined PCB can be cut along the dotted lines to separate
the control unit and handheld unit comprising LCD module. Moving message displays are
a lot of fun, and one of my favorite projects to work on. A scrolling message display
would be a great addition to a robotics or other project that needs a message display. Snap
one on your hat before you go to that next football game, but carry a few spares. You'll
probably sell a few while you're there below is a "static" picture of the display in action. It
scrolls from right to left in normal operation, but you can experiment to see the effect of
changing the scroll direction.
Fig. 2.1 Display hello on LED screen
The colors aren't true, but that's the best my "El-Cheapo" digital camera would
produce. The movie file gives you a good idea of how the finished project works, shows
how the display scrolls & the scroll speed when set to 300 as in the sample code. I won't
go into great detail here since the simple code & datasheet will have you up & running
with a scrolling display in just a few minutes. You can easily modify this sample code for
use with other projects. I used the PIC16F877 running at 20MHz, but the 16F876 will
work equally well for this project. Connections from the PIC to display are shown in the
lower section of the project code, and quite simple, but if you have questions, don't
hesitate to ask.
These displays aren't cheap, but they are nice, and don't require series current-
limiting resistors for the matrix LED's. You have software control of the display
1
brightness settings - and current consumption. Just change the value assigned to D_Bus in
the display initialization routine to change the display brightness.
To change the display scroll speed - just change the value in: S_Speed = 300 ' Set
display scroll speed here
Fig. 2.2 PIN designation
Burning a chip is also called Programming but since we refer to writing a program
as "programming," we can think of burning a chip as "DOWNLOADING, DUMPING or
BURNING."The microcontroller we are using in this project (PIC16F84) can be
programmed and re-programmed up to 1,000 times and this makes it ideal for
experimenting. The other advantage of this chip is the ability to program it while it is "IN
CIRCUIT." The manufacturer of the chip has produced only very vague information on
how to design a project capable of self-programming the chip when it is fitted to a project
as they have a vested interest in selling their own "simple programmer”. But we want to
do it even cheaper than the cost of a commercial programmer and we want to design with
almost NO EXTRA parts on the board to provide this function. And it is quite possible.
There has been a range of programmers capable of doing this, from a NO PARTS
programmer to those having buffer chips to improve the programming signals. At first
glance these programmers may seem to be ideal but after studying and trying each of
them; the complexities they contain, don't make them suitable for the beginner. In simple
terms, they were too difficult to get going.
1
The authors were highly technical people and they expect highly technical
constructors to put them together. They offered little or no technical back-up and some
don't even supply a circuit diagram! It would have been nice to take one of these "Public
Domain" projects and use it in our project. But they weren't suitable. Many of them did not
verify the contents of the chip after programming and others were not suitable for
programming a chip "in-situ." You had to take the chip out of the project and program it
on a separate board. Some needed a 5v and 12-14v rail, while others needed to run under
DOS. After eliminating each design, we ended up with having to design something
ourselves. So here it is. THE BASICS The basics of programming a PICF84 are simple.
When /MCLR (pin 4) is taken HIGH (to a voltage called VIHH 12v to 14v), the chip
turns into programming mode and two pins change from in/out pins to Clock and Data
pins. Port B bit 6 (pin 12) changes from an in/out pin to CLOCK. (To clock data into the
chip during programming and clock it out of the chip during "read" mode Port B bit 7 (pin
13) changes from an in/out pin to DATA in/out. The /MCLR pin becomes V test mode
during programming mode. Data books on the state that the programming voltage (about
13v) is internally generated and the voltage delivered to the V test mode pin is purely a
reference voltage and no current is required to be delivered to this pin during
programming. Using these features we can produce a circuit with the PIC chip in
programming mode. This is shown in the diagram below. This is not a functional circuit as
the programming voltage (Vpp) must be able to be switched from LOW to HIGH to place
the chip in programming mode.
To understand the 5 lines of the Communications Port, the direction of data flow
and the voltage on the lines, we have to go back to the basic details of a SERIAL
COMMUNICATIONS PORT. The original use for this port was to connect a computer
(called the Data Terminal Equipment - DTE) to a device such as a printer, plotter or
modem (called the Data Communications Equipment - DCE). The mode of
communication is called RS-232. None of this involves our use of the port as we are not
using it in the way it was intended. For instance, we are taking advantage of the fact that
one of the lines produces a voltage of 12v and we use this voltage to power the project
during programming. To understand how the lines can be used, you need to know if each
line is an input or output and the voltage it is capable of supplying. Some of the lines are
1
capable of supplying very little current (less than 1mA while others can supply 25mA to
35mA).
Since our project draws very little current, (only 1mA or so in programming mode)
the current capability of the lines is not an issue. But the voltage they are able to produce
and the direction of signal-flow are the issues. Once we know the features of the lines, we
can write software to make them HIGH or LOW and either deliver data or receive data.
The TxD line is the Transmit Data line and it is purely used for the 12v it is capable of
supplying. IT is taken HIGH during programming so supply both the programming trigger
voltage for pin 4 of the PIC as well as the 5v rail for the operation of the chip. RTS is an
output line from the computer and it will be used to clock the chip during programming
mode so that command bits and data bits (from the DTR line) can To put the PIC chip into
programming mode, RTS and DTR are held LOW and Tx D is taken HIGH. The chip now
waits for 6 bits of data called a COMMAND. The first command may be "Load
Configuration" or "Load Data for Program Memory" or "Bulk Erase Program Memory."
In this way the commands and the data is placed in the. After programming is
complete, the program can be READ by sending a command "Read Data From Data
Memory" and the bits will be transmitted out of the PIC to the computer via the CTS
line. Resistors are needed between some of the lines and the chip to limit the current. The
10k in the diagram above is not really needed but since V test mode pin requires very little
current, the 10k will not upset the voltage delivered to the chip. The 2k2 feeding the 5v6
zener allows the 5v6 to be generated without reducing the voltage on the TXD line. The
22k on the RTS line allows almost any voltage to be present on the RTS line and only
deliver a maximum of 5v to the PIC. The 4k7 serves two purposes. It limits the voltage
from the DTR line to 5v, and allows the PIC to deliver an output to the CTS line. In other
words, if the DTR line is LOW, the PIC will be able to deliver a HIGH to CTS. This
simple-to-use three-color LED moving message sign features multiple graphics and effects
facilities. The mains adaptor means that you simply switch on and the unit is ready to go.
Messages can be easily programmed from the remote control or even with a PC via a
serial interface and the optional PC interface kit. It’s ideal for promotional messages in
store, at parties, or anywhere a high visibility sign is required. The display is 16 characters
wide and longer messages automatically scroll across the screen. The display can also be
1
set to show the current time. This unit is supplied with remote control & batteries, mains
adaptor and mounting brackets. PC interface and software available separately (Order
Code TB39N).
Electronic Display Signs Electronic display signs are used nowadays in great
extent to display important information instantly all over the world, which uses LED
technology, which stands for light- emitting diodes. These are widely used in the worlds of
commerce, government and even non-profit organizations. Electronic display signs are
widely used in every metropolitan city and most others cities too. This shows their
popularity even in unlikely places as well. This is only because they allow the outlet to
simply and clearly present the information to the world, which can be clearly seen from
great distance. One of the unimagined area, Churches, uses this technology where they
employ these electronic displays, which helps lead worshippers in song. These electronic
display sign are remarkably easy to use and can be updated through data entered via an
infra-red remote keypad or through a computer. Of course, they can be programmed to get
automatically updated. Jayex technology limited is the one, leader in proving this.
These electronic displays utilized four line of text (it can be more or less depending
on the size and height of the character chosen) with fix limit of characters per line. Jayex
offers several models which varies in height of character, color system, graphic options,
LED intensity and dimming capability Sit back and take a big breath. You are about to
take part in one of the best microcomputer (microprocessor) projects you have seen.
They were really impossible to understand. You needed to be an expert to start the
first lesson! That's why he felt compelled to create a project that teaches in a completely
different way. Once you complete this course you will be able to look at the other projects
and work out what they are trying to present. I'm saying this because if you have seen the
other projects and given up in frustration, the worry is over. You can be assured, the
animations you see on the screen in the "Display Effects" page, are fully documented and
you will be able to create similar (and even better) effects. This course has been written
and designed by Colin Mitchell, the author of talking electronics. Talking Electronics is
Australia's most successful electronics publication and been on the market for more than
20 years. It has been produced solely by Colin Mitchell and has stood the test of time
1
without a single advertisement getting in the way of a good-quality construction article.
Don't you hate searching through a magazine for the articles? All our books and
magazines are ARTICLES ONLY and you don't finish up with 30 pages of projects out of
a 150 page magazine !Even though the projects presented by Talking Electronics have all
been of a simple nature, everyone has been described in detail with special sections on
"How it works" and "If it doesn't work." You can take an article and expand on it and
create a more-complex project. But this is only possible if you understand the
fundamentals. That's what we provide.
The fundamentals to back this up, TE provide kits for each and every project and
every PC board is available separately. All the kits are sent out the same day and you don't
have to wait weeks for something to arrive. We waited 3 weeks for one of the competitors
PIC kits and it came with NO PC board and NO circuit diagram! With TE kits, all you
have to do is ring up and order the kit over the phone and it will be sent THE SAME
DAY. For a few dollars extra it will be sent EXPRESS and you are ready to start THE
NEXT DAY.
We have sent out over 200,000 kits so we must be doing something right! Some
readers have bought over worth of kits and when we meet them at seminars and trade
shows, they say they owe their advancement in electronics to Talking Electronics. This is
the biggest compliment we can get and that's why we continue to provide information-
basics. This is the one area that has been so neglected. And that's where we excel. The
common thread of all magazine articles is to describe a project and assume it will work
first go. Not so with us.
The animation above shows just one of the things that can be done with the 5x7
Display. It's a miniature Video Wall and as such you can do ALMOST anything on it. Any
picture, pattern, animation or effect can be displayed. Once you see how a program is
written, you can produce frames for an animation, just like producing a cartoon .The
display above is called the LIFT DISPLAY. It can be used in an elevator to show the
progress from one level to the next and it shows the lift is traveling up or down. The next
closest thing to our display is an 8x8 LED matrix module. These are readily available in a
single colour (red, green, yellow) or tri-color, and you can use one of them if you wish.
1
But they require a little more programming - not much more but it is certainly the next
thing to go to after completing the course.
An 8x8 requires 16 lines in the form of 8 lines from a microcontroller and 8 lines
from a shift register. With an 8x8 matrix, the on-time for each row is slightly less than our
matrix and to produce a brightness equivalent to our matrix, the LEDs have to be scanned
with a higher drive-current. This requires drive transistors for the rows as well as the
columns. This is about the only difference and one of our future projects will show how
the modules are connected together. Back to our project . . . With our design, the scan is
only 5 columns and this gives the LEDs sufficient brightness from the allowable 25mA
from the micro. In one of the experiments you will "dumping onto the screen" as well as
scanning. You will be able to see the difference in brightness of the two modes, and when
you realise the energy delivered to a scanned LED is less than one fifth of a LED that is
being constantly turned on, you will see how efficient LEDs are with pulses of
energy. What can you do with the project? You can do an endless number of things.
You can produce counters, effects, tones, games, tunes animations, scrolling
letters, flashing letters and lots of other things. It's almost unlimited. Below is a simple 0
to 9 counter. You can make it count up or down, turn it into a two-digit counter or even a
three-digit counter with each digit flashing, to show the tally. We have even produced a 5-
digit counter to show how far you can go with simple programming. Even though this
project is designed as a beginners guide to programming, the variety of effects that can be
produced can extend to quite complex programs and once you complete the course, you
will feel like an expert!
Fig. 2.3 LED display, displaying 0.
1
On the "Display Effects" page we have shown some of the capabilities of the
project. It can be used as a stand-alone module to produce any effect you need (the effects
can be controlled by input lines). Devices such as switches can be placed on the input lines
to increment or decrement the display, produce the "lift effect," flash numbers or letters or
even produce a scrolling effect. The 5x7 Display project consists of a small PC board
containing 35 LEDs arranged in a matrix of 5 rows of LEDs with each row containing 7
LEDs. The PC board also contains a PIC16F84 microcontroller chip and this 18-pin chip
has 13 pins (lines) that can be configured as input or output. Five of the lines are called
port "A" and these are connected to three switches and also the second chip on the board
(a shift-counter chip). The other 8 lines (called port B ) are connected to the seven rows of
LEDs and the eighth line is connected to a piezo diaphragm for PIEZO (sound)
experiments. Five transistors sink the cathodes of the five columns of LEDs and another
transistor drives the piezo diaphragm.
Resistors on the board limit the current to the LEDs to prevent damage to the
microcontroller as each output of the chip can deliver a maximum of 25 milliamps. A
capacitor and resistor near the chip creates the R-C timing for the oscillator (the chip
contains the rest of the components for the oscillator). A power supply electrolytic,
voltage-dropping diode and two slide switches complete the components for the 5x7 part
of the project. Also contained on the board are the components for the In-Circuit
Programmer. These components connect the serial port of a computer to the
microcontroller chip. The components pass the programming signals to the chip and at the
same time the voltages are modified so that they are at the correct levels for the chip. The
components also generate voltages for the chip - a 5v rail and a 13v rail. Finally, the set of
components around pin 12 amplify the current so that pin 12 will see a HIGH. The 5x7
project is connected to your computer via a 4-core cable and this connects to a 9-pin plug
to fit into the serial port of a computer.
The end result is the microcontroller chip (PIC16F84) can be programmed without
removing it from the board. This is called "IN CIRCUIT" programming and is very fast
and convenient when you are developing a program. POV -Persistence of Visio There is a
surprising feature with a Light Emitting Diode. If it is pulsed with twice the normal
current for 20% of the time, the result is almost as bright as if it is on all the time with the
1
rated current. This means they perform extremely effectively in a scanned situation and
even though the net energy into each LED is only about 10% as compared with ON all the
time, the brightness level is only reduced by about 50%. Surprisingly, a 50% reduction in
brightness is quite acceptable. This is one of the features of a scanned display. Before we
go any further, let's talk about the the concept of a scanning display. From the outset, you
have to be aware that he image seen on this type of display is a "trick." Only one column
of LEDs is displayed at a time and your eye merges the columns together to get a
"picture." This is called Persistence of Vision (POV) and occurs when the eye sees objects
that change at a rate higher than about 10 per second. A flickering effect is detected at a
rate up to about 20 per second but above 30 per second the effect is quite smooth. Our
display operates at a rate higher than 100 scans per second and the eye sees the display as
"steady." If the scan rate is reduced (by reducing the frequency of the micro-controller
clock) the individual columns can be seen.
LED Moving Message Display led’s becoming more and more popular in all kinds
of lighting fixtures. For simpler, slimmer design, moving message displays utilize Light
Emitting Diodes (LED's) as the display technology. They offer bright displays that can be
eye catching in right environment. LED displays are a vital part of how companies today
are keeping in touch with their customers and employees. Whether you are advertising
your latest special to an audience of drive-by commuters, or informing plant personnel
about production goals? An LED display is the most effective way to communicate your
message. LED signs offer brilliant, animate movement attracting potential customers to
your message, while giving you the flexibility to update your message as often as you
need. Moving text, graphics, and animation capture the attention of the bystander in a
dynamic way. Whether for advertising or communication, your message is more
noticeable, more interesting and more likely to be remembered. And your message can be
updated frequently and easily to keep your communications current and exciting.
LED moving message displays are ideal for creating high visibility across the
globe. A pioneer in the world of electronic signs Jayex Technology Limited manufactures
LED moving message displays as a specialized equipment amongst the wide range of
displays available in the store. It has many features. Current technology highlights alarm
setting, password protection; built in time sequence, auto setting of different moving styles
1
etc. These displays are easy to install and operate. Message can be input by infrared
remote keypad or PC. This makes it very easy to use. There are many methods for
displaying message like cyclic, scroll up, scroll down, open to centre, open from right,
open from left, or any other customer defined type. Technology is the best choice when
you want to customize your message and look of the displays with the feature of battery
backup system. LED moving message displays comes with removable table stand. These
are used both of indoor and outdoor displays for each comes with different mounting
options. These come with different programmable display speed and pre defined graph for
easy to recall. Here different Buzz sound can be added anywhere within the message for
different alert indication. Introduction: Moving Message Displays are ideal for all type of
commercial establishments like Hotels, Restaurants, Retail Shops, Banks, Airports,
Clinics, Hospitals and other such places to get maximum attention of people. These
displays attract customers to watch the display with curiosity and your scrolling message
also is conveyed simultaneously. Very good advertising results are obtained from these
unique displays with latest technology. You can change the message as often as you want
yourself with ordinary computer keyboard without any prior experience of any kind.
Available in various sizes and are also made to custom requirements Specifications
for regular model: Display Matrix: 9 characters in 7x56, 2.5" high character LED
configuration. Power Supply: 220v AC Dimensions: Display Unit: 25 inches X 7 inches X
1.5 inches appx. Control Unit: 6 inches X 7 inches X 2 inches app.( fixed on back side of
display unit ) Compatible with any Computer Keyboard. Some of the routines in the
experiments for the 5x7 Display Project look very simple but a lot of thought has gone
into producing them. The art to producing a good routine is to make it look simple as this
will make it easy to follow and easy to trouble-shoot, if something goes wrong. The delay
routine is a typical example.
1
CHAPTER 3STEPS OF PROJECT
MAKING
1
3. STEPS OF PROJECT MAKING
3.1 STEP TAKEN WHILE PREPARING CIRCUIT
The main purpose of printed circuit is in the routing of electric
currents and signals through thin copper layer that is bounded firmly to and
insulating base material sometimes called the substrata. This base is
manufactured with an integral bounded layer of thin copper foil which has
to be partly etched or otherwise removed to arrive at a pre-designed pattern
to suite the circuit connections.
From the constructors point of view the main attraction of using PCB
is its role as the mechanical support for small components. There is less
need for complicated and time consuming metal work or chassis
construction except perhaps in providing the [mal enclosure. Most straight
forward circuit designs can be easily converted into printed wiring layout
the thorough required to carry out the conversion can often highlights any
1
possible error that would otherwise be missed in convention point to point
wiring. The finished project is usually neater and truly a work of art.
Through proper design of PCB can get noise immunity. The
fabrication process of the printed circuit board will determine to a large
extent the price and reliability of the equipment. A common target aimed at
is the fabrication of small series of highly reliable professional quality
PCBs with low investment cost.
There are two types of PCB:-
3.1.1 Single sided board
3.1.2 Double sided board
3.1.1 Single sided board
The single sided PCBs are mostly used in endearment electronics
where manufacturing costs have to be kept at a minimum however in
industrial electronics. Also cast factors cannot be neglected and single
sided boards should be used whenever a particular circuit can be
accommodated on such boards.
3.1.2Double sided boards
Double sided PCBs can be made with or without plated through
holes. The production of boards with plated-through holes is fairly
expensive. Therefore, plated through hole boards are only chosen where the
circuit complexity and density dose not leave any other choice.
3.2 LAYOUT DESIGN
The layout of a PCB has to incorporate all the information on the
1
board before one can go on to the artwork preparation. This means that a
concept, which clearly defines all the details of the circuit, is a
prerequisite before the actual layout can start. The detailed circuit diagram
is varying important for the layout designer but the must also be familiar
with the design concept and with the philosophy behind the equipment.
When designing the layout one should observe the minimum size
(component body length and weight). Before starting to design the layout
have all the required components to hand so that an accurate assessment of
space can be made care must be taken so as to allow for adequate air flow
after the components have been mounted.
It might be necessary to turn some components round to a different
angular position so that terminals are closer to the connections of other
components. The scale can be checked by positioning the components on
the squad paper. If any connection crosses, then one can reroute to avoid
such condition. All common or earth lines should ideally be connected to a
common line routed around the perimeter of the layout this will act as the
ground plane. If possibly try to route the outer supply line ground plane. If
possibly try to route the other supply lines around the apposite edge of the
layout or through the center. The first step is to rearrange the circuit to
eliminate the crossover without altering the circuit detail in any way.
Plan the layout as if looking at the top side of the board first this
should be translated in reverse later for the etching pattern. Larger areas
are recommended to maintain good copper adhesive. It is important to bear
in mind always that copper track width must be at least to the
recommended minimum dimensions and allowance must be made for
increased width where termination holes are needed from this aspect it can
become little tricky to negotiate the route for connections to small
transistors. One can affect the copper interconnection pattern in the
underside of the board in a way described below Make the interconnections
pattern looking like conventional point to point writing by routing uniform
1
width of copper from component to component
3.3 ETCHING PROCESS
Etching process requires the use of chemicals, acid resistant dishes
and a running water supply. Ferric chloride is the maximum used solution,
but other enchants such as ammonium sulphate can be used.
Nitric acid can also be used but in general it is not used due to the
poisonous fumes. The pattern prepared is glued to the copper surface of the
board using a latex type of adhesive that can be cubed after use. The
pattern is laid firmly on the copper, use vary sharp knife to cut round the
pattern carefully and remove the paper corresponding to the required
copper pattern areas. Then apply the resist solution clean outlines as for as
possible. While the board is drying to test all components. Before going to
the next stage, check the whole pattern and cross check against the circuit
diagram check for any foreign matter on the copper. The etching bath
should be in a glass or enamel disk. If using crystal of ferric chloride these
should be thoroughly dissolved in water to the proportion suggested. There
should be 0.5 Lt. Of water for 125 gm of crystal. The board is then
immersed in FeCl3 solution for 12 hours, in this process only the non
hidden copper portion is etched out by the solution.
Waste liquid should be thoroughly diluted and buried in water land
never pour down the drain. To prevent particles of copper hindering further
etching, agitate the solutions carefully by gently twisting or rocking the
tray. The board should not be left in the bath a moment longer than is
needed to remove just the right amount of cooper. In spite of there being a
resist coating, there is no protection against etching away through exposed
copper edges; this leads to over etching. Have running water ready so that
the etched board can be removed properly and rinsed; this will halt etching
immediate.
1
Now the paint is washed out by the petrol. Now the copper layout on
PCB is rubbed with a smooth sand paper slowly and lightly such that only
the oxide layers over the Cu is removed. Now the holes are drilled at the
respective places, according to component layout as shown in figure.
Drilling is one of those operation that calls for great care, because most of
the holes will be made and vary small drill . For most purpose a no. 60 drill
all holes with this size first those that need to be larger can be easily
drilled again with the appropriate large size.
3.4 COMPONENT ASSEMBLY
There should be no damage, such as hair line crack in the copper on
PCB that could have a serious effect on the operational ability of the
completed assembly holes. If there are, than they can and should be
repaired first, by soldering a short link of bare copper wire over the
affected part. The most popular method of holding all the items is to bend
the wires further apart after they have been inserted in the appropriate
holes. This will hold the component in position ready for soldering.
Some component will be considerably larger than others, occupying
and possibly partly obscuring component. Because of this, it is best to start
by mounting the smallest first and progressing through to the largest,
before starting, makes certain that no further drilling is likely to be
necessary, because access may be impossible later. When filling each
group of components, mark off each one on the components list as it is
fitted and, if we have to leave the job, we will know where to recommence.
1
Although transistors and integrated circuits are small items, there are
good reasons for leaving the soldering of these until the last step. The main
point is that these components are varying sensitive to heat and if
subjected to prolonged application of the soldering iron, they could be
internally damaged. All the components before mounting are rubbed with
sand paper so that oxide layer is removed iron their tips. Now they are
mounted according to the components layout.
3.5 Soldering Guide
3.5.1 First a few safety precautions:
Never touch the element or tip of the soldering iron. They are very hot (about
400°C) and will give you a nasty burn.
Take great care to avoid touching the mains flex with the tip of the iron.
The iron should have a heatproof flex for extra protection. An ordinary plastic flex
will melt immediately if touched by a hot iron and there is a serious risk of burns
and electric shock.
Always return the soldering iron to its stand when not in use.
Never put it down on your workbench, even for a moment!
Work in a well-ventilated area.
The smoke formed as you melt solder is mostly from the flux and quite irritating.
Avoid breathing it by keeping you head to the side of, not above, your work.
Wash your hands after using solder.
Solder contains lead which is a poisonous metal.
3.5.2 Preparing the soldering iron:
Place the soldering iron in its stand and plug in. The iron will take a few minutes to
reach its operating temperature of about 400°C.
Dampen the sponge in the stand.
1
The best way to do this is to lift it out the stand and hold it under a cold tap for a
moment, then squeeze to remove excess water. It should be damp, not dripping
wet.
Wait a few minutes for the soldering iron to warm up. You can check if it is ready
by trying to melt a little solder on the tip.
Wipe the tip of the iron on the damp sponge. This will clean the tip.
Melt a little solder on the tip of the iron. This is called 'tinning' and it will help the
heat to flow from the iron's tip to the joint. It only needs to be done when you plug
in the iron, and occasionally while soldering if you need to wipe the tip clean on
the sponge.
3.5.3 You are now ready to start soldering:
Hold the soldering iron like a pen, near the base of the handle.
Imagine you are going to write your name! Remember to never touch the hot
element or tip.
Touch the soldering iron onto the joint to be made. Make sure it touches both the
component lead and the track. Hold the tip there for a few seconds and...
Feed a little solder onto the joint.
It should flow smoothly onto the lead and track to form a volcano shape as shown
in the diagram. Apply the solder to the joint, not the iron.
Remove the solder, then the iron, while keeping the joint still.
Allow the joint a few seconds to cool before you move the circuit board.
Inspect the joint closely.
It should look shiny and have a 'volcano' shape. If not, you will need to reheat it
and feed in a little more solder. This time ensure that both the lead and track are
heated fully before applying solder.
3.5.6 Using a heat sink
1
Some components, such as transistors, can be damaged by heat when soldering so if you
are not an expert it is wise to use a heat sink clipped to the lead between the joint and the
component body. You can buy a special tool, but a standard crocodile clip works just as
well and is cheaper.
Soldering Advice for Components
It is very tempting to start soldering components onto the circuit board straight away, but
please take time to identify all the parts first. You are much less likely to make a mistake if
you do this!
1. Stick all the components onto a sheet of paper using sticky tape.
2. Identify each component and write its name or value beside it.
3. Add the code (R1, R2, C1 etc.) if necessary.
4. Many projects from books and magazines label the components with codes (R1,
R2, C1, D1 etc.) and you should use the project's parts list to find these codes if
they are given.
5. Resistor values can be found using the resistor colour code which is explained on
our Resistors page. You can print out and make your own Resistor Colour Code
Calculator to help you.
6. Capacitor values can be difficult to find because there are many types with
different labeling systems! The various systems are explained on our Capacitors
page.
Some components require special care when soldering. Many must be placed the correct
way round and a few are easily damaged by the heat from soldering. Appropriate warnings
are given in the table below, together with other advice which may be useful when
soldering.
For most projects it is best to put the components onto the board in the order given below:
1
3.6 What is solder?
Solder is an alloy (mixture) of tin and lead, typically 60% tin and 40% lead. It melts at a
temperature of about 200°C. Coating a surface with solder is called 'tinning' because of the
tin content of solder. Lead is poisonous and you should always wash your hands after
using solder.
Solder for electronics use contains tiny cores of flux, like the wires inside a mains flex.
The flux is corrosive, like an acid, and it cleans the metal surfaces as the solder melts. This
is why you must melt the solder actually on the joint, not on the iron tip. Without flux
most joints would fail because metals quickly oxidize and the solder itself will not flow
properly onto a dirty, oxidized, metal surface. The best size of solder for electronics is
22swg (swg = standard wire gauge).
Desoldering
At some stage you will probably need to desolder a joint to remove or re-position a wire or
component. There are two ways to remove the solder:
3.6.1 With a desoldering pump (solder sucker)
Set the pump by pushing the spring-loaded plunger down until it locks.
Apply both the pump nozzle and the tip of your soldering iron to the joint.
Wait a second or two for the solder to melt.
Then press the button on the pump to release the plunger and suck the molten
solder into the tool.
Repeat if necessary to remove as much solder as possible.
The pump will need emptying occasionally by unscrewing the nozzle.
3.6.2 With solder remover wick (copper braid)
Apply both the end of the wick and the tip of your soldering iron to the joint.
As the solder melts most of it will flow onto the wick, away from the joint.
Remove the wick first, then the soldering iron.
1
Cut off and discard the end of the wick coated with solder.
After removing most of the solder from the joint(s) you may be able to remove the wire or
component lead straight away (allow a few seconds for it to cool). If the joint will not
come apart easily apply your soldering iron to melt the remaining traces of solder at the
same time as pulling the joint apart, taking care to avoid burning yourself.
3.7 First Aid for Burns
Most burns from soldering are likely to be minor and treatment is simple:
Immediately cool the affected area under gently running cold water.
Keep the burn in the cold water for at least 5 minutes (15 minutes is
recommended). If ice is readily available this can be helpful too, but do not delay
the initial cooling with cold water.
Do not apply any creams or ointments.
The burn will heal better without them. A dry dressing, such as a clean
handkerchief, may be applied if you wish to protect the area from dirt.
Seek medical attention if the burn covers an area bigger than your hand.
3.8 To reduce the risk of burns:
Always return your soldering iron to its stand immediately after use.
Allow joints and components a minute or so to cool down before you touch them.
Never touch the element or tip of a soldering iron unless you are certain it is cold.
1
CHAPTER 4
1
BLOCK DIAGRAM
4. BLOCK DIAGRAM
3.1 Block Diagram Explanation
Message display Pins 2 through 9 forms the 8-bit data output port this is purely a
write-only port which means it can only output data. The base address of the first parallel
port (LPT1) is 378H OR 888 (decimal) Parallel-input parallel-output (PIPO) REGISTERS
ARE USED to shift the signal from right to left. The clock pulse and code signal are
generated by the computer program and output from the parallel port (bade address 0x378)
theoretically, we can add infinite number of PIPO registers but the maximum number of
registers is actually limited to the current triggering value of the shows the circuit of the
microcontroller-based moving-message display. It comprises microcontroller AT89s52,
three-to-eight decoder 74LS138, common anode alphanumeric displays, regulator 7805
and a few discrete components. The heart of the moving-message display is Atmel
AT89s52 microcontroller (IC1).
1
Fig. 3.1 Block diagram
It is a low-power, high-performance, 8-bit microcontroller with 4 kB of flash
programmable and erasable read-only memory (PEROM) used as on-chip program
memory, 128 bytes of RAM used as internal data memory, 32 individually programmable
input/output (I/O) lines divided into four 8-bit ports, two 16-bit programmable
timers/counters, a five-vector two-level interrupt architecture, on-chip oscillator and clock
circuit. To add a large number of PIPO registers, amplify the clock pulse prior to
connecting it to the PIPO ICs. Circuit description the circuit for the scrolling message
display IC74174 has been used as PIPO REGISTER WHICH comprises high-speed, hex
type flip-flops it is used as a 6-bit edge-triggered storage register THE DATA ON the
inputs of the flip- flop is transferred for storage during high-to low transition clock.
Data lines do through D5 l of the parallel part are connected to the input pins of the
first flop (IC2) the output of IC2 is fed to the next flip-flop IC input as well as LED. Data
1
line D6 is fed to IC8, while data line D7 is connected to the clock inputs of IC2 through
IC8 Clock pins of all the flip-flop ICs are connected together. Master reset pin 1 of all the
flip-flops is connected to Vcc. Pins 18 thr0ugh 25 of the parallel port are grounded. As
data present on lines DO through D6 shifts from the first stage to the next stage, And so on
the message appears as scrolling on the dot-matrix LED display. The present circuit
supports a display made of 42 LEDs comprising seven rows and six columns. Up to 30
such units can be added with no change in the circuit.
To add these units you need to amplify the clock pulse output, Note that each
character is displayed in a matrix of 5 columns and 7 rows (explained later) hence the
sixth column LEDs form part of the next character (column1) the power supply circuit.
The AC mains is stepped down by transformer x1 to deliver a secondary output of 7.5V
AC at 1A The transformer output is rectified by a full-wave bridge rectifier comprising
diodesD1 through D4 filtered by capacitor C1 then regulated by IC 7805C (ic1) to provide
regulated 5V DC to the circuit commercially 7X5 dot-matrix displays with discrete LEDs
may not be easily available in the market; therefore a perforated board with holes for the
LED leads may be used. The layout of such a board The holes are used for passing the
LED leads.
1
CHAPTER 5CIRCUIT DIAGRAM
5. CIRCUIT DIAGRAM
Message display Pins 2 through 9 forms the 8-bit data output port this is purely a
write-only port which means it can only output data. The base address of the first parallel
port (LPT1) is 378H OR 888 (decimal) Parallel-input parallel-output (PIPO) REGISTERS
ARE USED to shift the signal from right to left. The clock pulse and code signal are
generated by the computer program and output from the parallel port (bade address 0x378)
theoretically, we can add infinite number of PIPO registers but the maximum number of
registers is actually limited to the current triggering value of the shows the circuit of the
microcontroller-based moving-message display. It comprises microcontroller AT89s52,
three-to-eight decoder 74LS138, common anode alphanumeric displays, regulator 7805
1
and a few discrete components. the heart of the moving-message display is Atmel
AT89s52 microcontroller (IC1)
Fig. 5.1 Circuit diagram
It is a low-power, high-performance, 8-bit microcontroller with 4 kB of flash
programmable and erasable read-only memory (PEROM) used as on-chip program
memory, 128 bytes of RAM used as internal data memory, 32 individually programmable
input/output (I/O) lines divided into four 8-bit ports, two 16-bit programmable
timers/counters, a five-vector two-level interrupt architecture, on-chip oscillator and clock
circuit. To add a large number of PIPO registers, amplify the clock pulse prior to
connecting it to the PIPO ICs. Circuit description the circuit for the scrolling message
display IC74174 has been used as PIPO REGISTER WHICH comprises high-speed, hex
type flip-flops it is used as a 6-bit edge-triggered storage register THE DATA ON the
inputs of the flip- flop is transferred for storage during high-to low transition clock.
1
Available in various sizes and are also made to custom requirements Specifications
for regular model: Display Matrix: 9 characters in 7x56, 2.5" high character LED
configuration. Power Supply: 220v AC Dimensions: Display Unit: 25 inches X 7 inches X
1.5 inches appx. Control Unit: 6 inches X 7 inches X 2 inches app.( fixed on back side of
display unit ) Compatible with any Computer Keyboard. Some of the routines in the
experiments for the 5x7 Display Project look very simple but a lot of thought has gone
into producing them. The art to producing a good routine is to make it look simple as this
will make it easy to follow and easy to trouble-shoot, if something goes wrong. The delay
routine is a typical example. It can be laid out using simple-to-follow instructions or
complex instructions. Let's not worry about the complex approach; our aim is to show how
easy it is to program the PIC chip
1
CHAPTER 6PCB LAYOUT
6. PCB LAYOUT
1
Fig 6.1 PCB layout
1
CHAPTER 7CODING
7. CODING
1
7.1 Operating Manual for Keyboard
7.1.1 Data Entering and Editing
Press F9 Function key: - “WR PAD” appears on screen.
Press Insert Function key: - First message will appear on screen i.e.
<01>Message <FX>
For new ram it will be <01> <FX>
EDIT your message according to requirement
Press enter function key to save the data appearing on screen and it will switch to the next page i.e.
<02>Message <FX>
NOTE: - Must enter <FZ> at the end of last message for proper functioning
7.2 Settings for Date and Time
Press F9 Function key “WR PAD” appearing on screen
Press F11 Function key Setting for TIME appearing on screen
i.e. TIME **:** HH:MM
7.2.1 Set the Time Accordingly
Press F11 Function key It saves the time, setting for DATE appearing on screen i.e.
i.e. DATE **:**:** DD: MM: YY
7.2.2 Set the Date Accordingly
Press F11 Function key it saves the date, and get back to the display mode.
7.3 Commands and Speed Settings
7.3.1 Commands
<FB> : bold fonts (14*10) approximately
1
<FC> : complement the running matter
<FD> : call the live date
<FE> : normal english (11*8) approximately (caps and small char)
<FF> : bold fat fonts (16*14) approximately
<FH> : normal thin hindi fonts (11*8) approximately
<FJ> : jump to next message or page
<FN> : small font (7*5)
<FT> : call the live time
<FV> : vertical font
<FX> : end of current message
<FZ> ; end of all the message and jump to the first message
7.3.2 Speed Settings:-
<S1> Fastest speed in single look
<S2> Fast speed in single look
<S3> Fastest speed in double look
<S4> Fast speed in double look
<S5> Fastest speed in triple look
<S6> Fast speed in triple look
<S7> Fastest speed in four look (slider)
<S8> Fast speed in four looks (slider)
<S9> Fast speed (slider)
<S0> Slow speed in single look
7.3.3 Functions and Effects:-
1
<F3> Flashing the screen
<F6> Freeze the screen
<D1> Curtain up
<D2> Curtain down
<D3> Curtain right to left
<D4> Curtain left to right
<D5> Curtain out to in
<D6> Curtain in to out
<D7> Page up
<D8> Page down
<D9> Page out to in
<D0> Page in to out
I.E. <F6>MESSAGE <F6>
Note: - Function must start and stop with the same close or command
7.4 Operating For Hindi with Keyboard
Press F2 Function key the data appearing on screen in the following format i.e.
<01> <FH>Message<FX>
<01><FH><FX> NEW MESSAGE
After pressing the F2 Function key you can type in hindi
Commands for the two lines format is the command <DU> for the upper line and <DL> for the second line.
For pictures on the screen
<P0> TO <P9> AND <PA> TO <PZ>
1
CHAPTER 8HARDWARE SECTION
1
8. HARDWARE SECTION
8.1 PCB MANUFACTURING PROCESS & LAYOUT MAKING
From the constructors point of view the main attraction of using PCB
is its role as the mechanical support for small components. There is less
need for complicated and time consuming metal work or chassis
construction except perhaps in providing the [mal enclosure. Most straight
forward circuit designs can be easily converted into printed wiring layout
the thorough required to carry out the conversion can often highlights any
possible error that would otherwise be missed in convention point to point
wiring. The finished project is usually neater and truly a work of art.
Through proper design of PCB can get noise immunity. The
fabrication process of the printed circuit board will determine to a large
extent the price and reliability of the equipment. A common target aimed at
is the fabrication of small series of highly reliable professional quality
PCBs with low investment cost.
There are two types of PCB:-
1. Single sided board
The single sided PCBs are mostly used in endearment electronics where
manufacturing costs have to be kept at a minimum however in industrial
electronics. Also cast factors cannot be neglected and single sided boards
should be used whenever a particular circuit can be accommodated on such
boards.
2. Double sided boards
Double sided PCBs can be made with or without plated through holes. The
production of boards with plated-through holes is fairly expensive.
1
Therefore, plated through hole boards are only chosen where the circuit
complexity and density dose not leave any other choice.
8.1.1 Layout Design
The layout of a PCB has to incorporate all the information on the
board before one can go on to the artwork preparation. This means that a
concept, which clearly defines all the details of the circuit, is a
prerequisite before the actual layout can start. The detailed circuit diagram
is varying important for the layout designer but they must also be familiar
with the design concept and with the philosophy behind the equipment.
When designing the layout one should observe the minimum size
(component body length and weight). Before starting to design the layout
have all the required components to hand so that an accurate assessment of
space can be made care must be taken so as to allow for adequate air flow
after the components have been mounted.
It might be necessary to turn some components round to a different angular
position so that terminals are closer to the connections of other
components. The scale can be checked by positioning the components on
the squad paper. If any connection crosses, then one can reroute to avoid
such condition. All common or earth lines should ideally be connected to a
common line routed around the perimeter of the layout this will act as the
ground plane. If possibly try to route the outer supply line ground plane. If
possibly try to route the other supply lines around the opposite edge of the
layout or through the center. The first step is to rearrange the circuit to
eliminate the crossover without altering the circuit detail in any way.
Plan the layout as if looking at the top side of the board first this
should be translated in reverse later for the etching pattern. Larger areas
are recommended to maintain good copper adhesive. It is important to bear
in mind always that copper track width must be at least to the
recommended minimum dimensions and allowance must be made for
increased width where termination holes are needed from this aspect it can
1
become little tricky to negotiate the route for connections to small
transistors. One can affect the copper interconnection pattern in the
underside of the board in a way described below Make the interconnections
pattern looking like conventional point to point writing by routing uniform
width of copper from component to component
8.1.2 Etching Process
Etching process requires the use of chemicals, acid resistant dishes
and a running water supply. Ferric chloride is the maximum used solution,
but other enchants such as ammonium sulphate can be used.
Nitric acid can also be used but in general it is not used due to the
poisonous fumes. The pattern prepared is glued to the copper surface of the
board using a latex type of adhesive that can be cubed after use. The
pattern is laid firmly on the copper, use vary sharp knife to cut round the
pattern carefully and remove the paper corresponding to the required
copper pattern areas. Then apply the resist solution clean outlines as for as
possible. While the board is drying to test all components. Before going to
the next stage, check the whole pattern and cross check against the circuit
diagram check for any foreign matter on the copper. The etching bath
should be in a glass or enamel disk. If using crystal of ferric chloride these
should be thoroughly dissolved in water to the proportion suggested. There
should be 0.5 Lt. Of water for 125 gm of crystal. The board is then
immersed in FeCl3 solution for 12 hours, in this process only the non
hidden copper portion is etched out by the solution.
2FeCl3 + 2H2O + 3Cu 0 3CuCl2 + 2Fe (OH) 2
Waste liquid should be thoroughly diluted and buried in water land
never pour down the drain. To prevent particles of copper hindering further
etching, agitate the solutions carefully by gently twisting or rocking the
1
tray. The board should not be left in the bath a moment longer than is
needed to remove just the right amount of cooper. In spite of there being a
resist coating, there is no protection against etching away through exposed
copper edges; this leads to over etching. Have running water ready so that
the etched board can be removed properly and rinsed; this will halt etching
immediate.
Now the paint is washed out by the petrol. Now the copper layout on
PCB is rubbed with a smooth sand paper slowly and lightly such that only
the oxide layers over the Cu is removed. Now the holes are drilled at the
respective places, according to component layout as shown in figure.
Drilling is one of those operation that calls for great care, because most of
the holes will be made and vary small drill .
8.1.3 Component Assembly
There should be no damage, such as hair line crack in the copper on
PCB that could have a serious effect on the operational ability of the
completed assembly holes.
If there are, than they can and should be repaired first, by soldering
a short link of bare copper wire over the affected part. The most popular
method of holding all the items is to bend the wires further apart after they
have been inserted in the appropriate holes. This will hold the component
in position ready for soldering.
Some component will be considerably larger than others, occupying
and possibly partly obscuring component. Because of this, it is best to start
by mounting the smallest first and progressing through to the largest,
before starting, makes certain that no further drilling is likely to be
necessary, because access may be impossible later. When filling each
group of components, mark off each one on the components list as it is
fitted and, if we have to leave the job, we will know where to recommence.
1
Although transistors and integrated circuits are small items, there are
good reasons for leaving the soldering of these until the last step. The main
point is that these components are varying sensitive to heat and if
subjected to prolonged application of the soldering iron, they could be
internally damaged. All the components before mounting are rubbed with
sand paper so that oxide layer is removed iron their tips. Now they are
mounted according to the components layout.
8.1.4 Soldering Guide
8.1.4.1 First a few safety precautions:
Never touch the element or tip of the soldering iron.
They are very hot (about 400°C) and will give you a nasty burn.
Take great care to avoid touching the mains flex with the tip of the iron.
The iron should have a heatproof flex for extra protection. An ordinary plastic flex
will melt immediately if touched by a hot iron and there is a serious risk of burns
and electric shock.
Always return the soldering iron to its stand when not in use.
Never put it down on your workbench, even for a moment!
Work in a well-ventilated area.
The smoke formed as you melt solder is mostly from the flux and quite irritating.
Avoid breathing it by keeping you head to the side of, not above, your work.
Wash your hands after using solder.
Solder contains lead which is a poisonous metal.
8.1.4.2 Preparing the soldering iron:
Place the soldering iron in its stand and plug in the iron will take a few minutes to
reach its operating temperature of about 400°C.
Dampen the sponge in the stand.
1
The best way to do this is to lift it out the stand and hold it under a cold tap for a
moment, then squeeze to remove excess water. It should be damp, not dripping
wet.
Wait a few minutes for the soldering iron to warm up. You can check if it is ready
by trying to melt a little solder on the tip.
Wipe the tip of the iron on the damp sponge. This will clean the tip.
Melt a little solder on the tip of the iron. This is called 'tinning' and it will help the
heat to flow from the iron's tip to the joint. It only needs to be done when you plug
in the iron, and occasionally while soldering if you need to wipe the tip clean on
the sponge.
8.1.4.3 You are now ready to start soldering:
Fig 8.1.4.1 How a good soldering is done
Hold the soldering iron like a pen, near the base of the handle.
Imagine you are going to write your name! Remember to never touch the hot
element or tip.
Touch the soldering iron onto the joint to be made.
Make sure it touches both the component lead and the track. Hold the tip there for
a few seconds and...
Feed a little solder onto the joint.
It should flow smoothly onto the lead and track to form a volcano shape as shown
in the diagram. Apply the solder to the joint, not the iron.
1
Remove the solder, then the iron, while keeping the joint still.
Allow the joint a few seconds to cool before you move the circuit board.
Inspect the joint closely.
It should look shiny and have a 'volcano' shape. If not, you will need to reheat it
and feed in a little more solder. This time ensure that both the lead and track are
heated fully before applying solder.
Fig. 8.1.4.2 Crocodile chip
8.1.4.4 Using a heat sink
Some components, such as transistors, can be damaged by heat when soldering so
if you are not an expert it is wise to use a heat sink clipped to the lead between the joint
and the component body. You can buy a special tool, but a standard crocodile clip works
just as well and is cheaper.
8.1.4.5 Soldering Advice for Components
It is very tempting to start soldering components onto the circuit board straight away, but
please take time to identify all the parts first. You are much less likely to make a mistake if
you do this!
Fig.8.1.4.5.1 Soldering Advice for Components
7. Stick all the components onto a sheet of paper using sticky tape.
1
8. Identify each component and write its name or value beside it.
9. Add the code (R1, R2, C1 etc.) if necessary.
10. Many projects from books and magazines label the components with codes
(R1, R2, C1, D1 etc.) and you should use the project's parts list to find these codes
if they are given.
11. Resistor values can be found using the resistor colour code which is
explained on our Resistors page. You can print out and make your own Resistor
Colour Code Calculator to help you.
12. Capacitor values can be difficult to find because there are many types with
different labeling systems! The various systems are explained on our Capacitors
page.Some components require special care when soldering. Many must be placed
the correct way round and a few are easily damaged by the heat from soldering.
Appropriate warnings are given in the table below, together with other advice
which may be useful when soldering. For most projects it is best to put the
components onto the board in the order given below:
Components Pictures Reminders and Warnings
1Chip Holders(DIL sockets)
Connect the correct way round by making sure the notch is at the correct end. Do NOT put the ICs (chips) in yet.
2 ResistorsNo special precautions are needed with resistors.
3Small value capacitors(usually less than 1µF)
These may be connected either way round. Take care with polystyrene capacitors because they are easily damaged by heat.
1
4Electrolytic capacitors(1µF and greater)
Connect the correct way round. They will be marked with a + or - near one lead.
5 Diodes
Connect the correct way round. Take care with germanium diodes (e.g. OA91) because they are easily damaged by heat.
6 LEDs
Connect the correct way round. The diagram may be labeled a or + for anode and k or - for cathode; yes, it really is k, not c, for cathode! The cathode is the short lead and there may be a slight flat on the body of round LEDs.
7 Transistors
Connect the correct way round. Transistors have 3 'legs' (leads) so extra care is needed to ensure the connections are correct. Easily damaged by heat.
8Wire Links between points on the circuit board.
single core wire
Use single core wire; this is one solid wire which is plastic-coated. If there is no danger of touching other parts you can use tinned copper wire, this has no plastic coating and looks just like solder but it is stiffer.
9Battery clips, buzzers and other parts with their own wires
Connect the correct way round.
10
Wires to parts off the circuit board, including switches, relays, variable resistors and loudspeakers.
stranded wire
You should use stranded wire which is flexible and plastic-coated. Do not use single core wire because this will break when it is repeatedly flexed.
11 ICs (chips) Connect the correct way round. Many ICs are static sensitive. Leave ICs in their antistatic packaging until you need them, and then earth your hands by touching a
1
metal water pipe or window frame before touching the ICs.
8.1.4.6 What is solder?
Solder is an alloy (mixture) of tin and lead, typically 60% tin and 40% lead. It melts at a
temperature of about 200°C. Coating a surface with solder is called 'tinning' because of
the tin content of solder. Lead is poisonous and you should always wash your hands after
using solder.
Fig. 8.1.4.6.1 Reels of solder.
Solder for electronics use contains tiny cores of flux, like the wires inside a mains flex.
The flux is corrosive, like an acid, and it cleans the metal surfaces as the solder melts. This
is why you must melt the solder actually on the joint, not on the iron tip. Without flux
most joints would fail because metals quickly oxidize and the solder itself will not flow
properly onto a dirty, oxidized, metal surface. The best size of solder for electronics is
22swg (swg = standard wire gauge).
8.1.4.7 Desoldering
At some stage you will probably need to desolder a joint to remove or re-position a wire or
component. There are two ways to remove the solder:
8.1.4.7.1 With a Desoldering pump (solder sucker)
Set the pump by pushing the spring-loaded plunger down until it locks.
1
Apply both the pump nozzle and the tip of your soldering iron to the joint.
Wait a second or two for the solder to melt.
Then press the button on the pump to release the plunger and suck the molten
solder into the tool.
Repeat if necessary to remove as much solder as possible.
The pump will need emptying occasionally by unscrewing the nozzle.
8.1.4.7.2. With solder remover wick (copper braid)
Apply both the end of the wick and the tip of your soldering iron to the joint.
As the solder melts most of it will flow onto the wick, away from the joint.
Remove the wick first, then the soldering iron.
Cut off and discard the end of the wick coated with solder.
After removing most of the solder from the joint(s) you may be able to remove the wire or
component lead straight away (allow a few seconds for it to cool). If the joint will not
come apart easily apply your soldering iron to melt the remaining traces of solder at the
same time as pulling the joint apart, taking care to avoid burning yourself.
8.1.4.8 First Aid for Burns
Most burns from soldering are likely to be minor and treatment is simple:
Immediately cool the affected area under gently running cold water.
Keep the burn in the cold water for at least 5 minutes (15 minutes is
recommended). If ice is readily available this can be helpful too, but do not delay
the initial cooling with cold water.
Do not apply any creams or ointments.
The burn will heal better without them. A dry dressing, such as a clean
handkerchief, may be applied if you wish to protect the area from dirt.
Seek medical attention if the burn covers an area bigger than your hand.
To reduce the risk of burns:
1
Always return your soldering iron to its stand immediately after use.
Allow joints and components a minute or so to cool down before you touch them.
Never touch the element or tip of a soldering iron unless you are certain it is cold.
8.2 COMPONENT USED
8.2.1 Semiconductors:
IC1 - AT89s52 microcontroller
IC2, IC3 - 74LS138 3-to-8 decoder
IC4 - 7805 5V regulator
T1-T16 - BC558 pnp transistor
D1-D4 - 1N4007 rectifier diode
LED LED1 - 5mm
8.2.2 Resistors (all ¼-watt, ±5% carbon):
1
R1-R16 - 2.2-kilo-ohm
R17-R32 - 120-ohm
-R37 - 10-kilo-ohm
R38 - 220-ohm
8.2.3 Capacitors:
C1, C2 - 33pF ceramic disk
C3 - 2200μF, 25V electrolytic
C4 - 1μF, 16V electrolytic
C5 - 10μF, 16V electrolytic
C6 - 0.1μF ceramic disk
8.2.4 Miscellaneous:
X1 - 220V AC primary to 9V,
500mA secondary transformer
XTAL - 11.0592MHz crystal
S0-S3 - 4-pin DIP switch
S4 - Push-to-‘on’ switch
8.3 Component Description
8.3.1 Resistors
1
Example: Fig. 8.3.1.1 Physical structure
Circuit symbol: Fig 8.3.1.2 Circuit symbol
8.3.1.1Function
Resistors restrict the flow of electric current, for example a resistor is placed in series with
a light-emitting diode (LED) to limit the current passing through the LED.
The Resistor
Color Code
Color Number
Black 0
Brown 1
Red 2
Orange 3
Yellow 4
Green 5
Blue 6
Violet 7
Grey 8
White 9
1
Fig. 8.3.1.1.1 Resistor color code
8.3.1.2 Connecting and soldering
Resistors may be connected either way round. They are not damaged by heat when
soldering.
Resistor values - the resistor color code
Resistance is measured in ohms; the symbol for ohm is an omega ( ). 1 is quite small so
resistor values are often given in k and M .
1 k = 1000 1 M = 1000000 .
Resistor values are normally shown using colored bands.
Each colour represents a number as shown in the table.
Most resistors have 4 bands:
The first band gives the first digit.
The second band gives the second digit.
The third band indicates the number of zeros.
1
The fourth band is used to shows the tolerance (precision) of the resistor, this may
be ignored for almost all circuits but further details are given below.
Fig. 8.3.1.2.1 Resistor color bands.
This resistor has red (2), violet (7), yellow (4 zeros) and gold bands.
So its value is 270000 = 270 k .
On circuit diagrams the is usually omitted and the value is written 270K.
8.3.2 Buzzer and Bleeper
These devices are output transducers converting electrical energy to sound. They contain
an internal oscillator to produce the sound which is set at about 400Hz for buzzers and
about 3 kHz for bleeper’s. Buzzers have a voltage rating but it is only approximate, for
example 6V and 12V buzzers can be used with a 9V supply. Their typical current is about
25mA. Beepers have wide voltage ranges, such as 3-30V, and they pass a low current of
about 10mA. Buzzers and beepers must be connected the right way round, their red lead is
positive (+).
8.3.3 Inductor (coil)
An inductor is a coil of wire which may have a core of air, iron or ferrite (a brittle
material made from iron). Its electrical property is called inductance and the unit for this is
the henry, symbol H. 1H is very large so mH and µH are used, 1000µH = 1mH and
1000mH = 1H. Iron and ferrite cores increase the inductance. Inductors are mainly used in
tuned circuits and to block high frequency AC signals (they are sometimes called chokes).
They pass DC easily, but block AC signals; this is the opposite of capacitors.
1
Inductors are rarely found in simple projects, but one exception is the tuning coil of
a radio receiver. This is an inductor which you may have to make yourself by neatly
winding enameled copper wire around a ferrite rod. Enameled copper wire has very thin
insulation, allowing the turns of the coil to be close together, but this makes it impossible
to strip in the usual way - the best method is to gently pull the ends of the wire through
folded emery paper.
Warning: A ferrite rod is brittle so treat it like glass, not iron! An inductor may be
connected either way round and no special precautions are required when soldering.
8.3.4 Loudspeaker
Loudspeakers are output transducers which convert an electrical signal to sound.
Usually they are called 'speakers'. They require a driver circuit, such as a 555 astable or an
audio amplifier, to provide a signal. There is a wide range available, but for many
electronics projects a 300mW miniature loudspeaker is ideal. This type is about 70mm
diameter and it is usually available with resistances of 8 and 64 . If a project specifies a
64 speaker you must use this higher resistance to prevent damage to the driving circuit.
Fig. 8.3.3.1 Inductor (miniature)
Fig. 8.3.3.2 Circuit symbol
1
Most circuits used to drive loudspeakers produce an audio (AC) signal which is combined
with a constant DC signal.
The DC will make a large current flow through the speaker due to its low
resistance, possibly damaging both the speaker and the driving circuit. To prevent this
happening a large value electrolytic capacitor is connected in series with the speaker, this
blocks DC but passes audio (AC) signals.
8.3.5 Diodes
Example:
Fig. 8.3.5.1 Diodes
Circuit symbol:
Fig. 8.3.5.2 Circuit symbol
1
8.3.5.1 Function
Diodes allow electricity to flow in only one direction. The arrow of the circuit
symbol shows the direction in which the current can flow. Diodes are the electrical version
of a valve and early diodes were actually called valves.
8.3.5.2 Forward Voltage Drop
Electricity uses up a little energy pushing its way through the diode, rather like a
person pushing through a door with a spring. This means that there is a small voltage
across a conducting diode, it is called the forward voltage drop and is about 0.7V for all
normal diodes which are made from silicon. The forward voltage drop of a diode is almost
constant whatever the current passing through the diode so they have a very steep
characteristic (current-voltage graph).
8.3.5.3 Reverse Voltage
When a reverse voltage is applied a perfect diode does not conduct, but all real
diodes leak a very tiny current of a few µA or less. This can be ignored in most circuits
because it will be very much smaller than the current flowing in the forward direction.
However, all diodes have a maximum reverse voltage (usually 50V or more) and if this is
exceeded the diode will fail and pass a large current in the reverse direction, this is called
1
breakdown. Ordinary diodes can be split into two types: Signal diodes which pass small
currents of 100mA or less and Rectifier diodes which can pass large currents.
8.3.5.4 Connecting and soldering
Diodes must be connected the correct way round, the diagram may be labeled a or
+ for anode and k or - for cathode (yes, it really is k, not c, for cathode!). The cathode is
marked by a line painted on the body. Diodes are labeled with their code in small print;
you may need a magnifying glass to read this on small signal diodes!
Small signal diodes can be damaged by heat when soldering, but the risk is small
unless you are using a germanium diode (codes beginning OA...) in which case you should
use a heat sink clipped to the lead between the joint and the diode body. A standard
crocodile clip can be used as a heat sink. Rectifier diodes are quite robust and no special
precautions are needed for soldering them.
8.3.8 Light Emitting Diodes (LEDs)
Example:
Fig 8.3.8.1 LED
Circuit symbol:
Fig 8.3.8.2 Circuit symbol of diode
1
8.3.8.1 Function
LEDs emit light when an electric current passes through them.
8.3.8.2 Connecting and soldering
Fig. 8.3.8.2.1 Connecting & soldering of an LED
LEDs must be connected the correct way round, the diagram may be labeled a or +
for anode and k or – for cathode (yes, it really is k, not c, for cathode!). The cathode is the
short lead and there may be a slight flat on the body of round LEDs. If you can see inside
the LED the cathode is the larger electrode (but this is not an official identification
method). LEDs can be damaged by heat when soldering, but the risk is small unless you
are very slow. No special precautions are needed for soldering most LEDs.
Fig 8.3.8.2.2 Circuit diagram for LED
8.3.8.3 Testing an LED
Never connect an LED directly to a battery or power supply!
It will be destroyed almost instantly because too much current will pass through and burn
it out. LEDs must have a resistor in series to limit the current to a safe value, for quick
testing purposes a 1k resistor is suitable for most LEDs if your supply voltage is 12V or
less. Remember to connect the LED the correct way round!
1
8.3.8.4 Colors of LEDs
Fig. 8.3.8.4.1 Colors of LED.
LEDs are available in red, orange, amber, yellow, green, and blue and white. Blue and
white LEDs are much more expensive than the other colors. The color of an LED is
determined by the semiconductor material, not by the coloring of the 'package' (the plastic
body). LEDs of all colors are available in uncolored packages which may be diffused
(milky) or clear (often described as 'water clear'). The colored packages are also available
as diffused (the standard type) or transparent.
8.3.8.5 Tri-color LEDs
Fig. 8.3.8.5.1 Tri-color LED.
The most popular type of tri-color LED has a red and a green LED combined in
one package with three leads. They are called tri-color because mixed red and green light
appears to be yellow and this is produced when both the red and green LEDs are on. The
diagram shows the construction of a tri-color LED. Note the different lengths of the three
leads. The centre lead (k) is the common cathode for both LEDs; the outer leads (a1 and
a2) are the anodes to the LEDs allowing each one to be lit separately, or both together to
give the third color.
1
8.3.9 Capacitors
Function
Capacitors store electric charge. They are used with resistors in timing circuits
because it takes time for a capacitor to fill with charge. They are used to smooth varying
DC supplies by acting as a reservoir of charge. They are also used in filter circuits because
capacitors easily pass AC (changing) signals but they block DC (constant) signals.
8.3.9.1Capacitance
This is a measure of a capacitor's ability to store charge. A large capacitance means
that more charge can be stored. Capacitance is measured in farads, symbol F. However 1F
is very large, so prefixes are used to show the smaller values.
Three prefixes (multipliers) are used, µ (micro), n (nano) and p (pico):
µ means 10-6 (millionth), so 1000000µF = 1F
n means 10-9 (thousand-millionth), so 1000nF = 1µF
p means 10-12 (million-millionth), so 1000pF = 1nF
Capacitor values can be very difficult to find because there are many types of capacitor
with different labeling systems! There are many types of capacitor but they can be split
into two groups, polarized and Unpolarised. Each group has its own circuit symbol.
8.3.9.2 Polarized capacitors (large values, 1µF +)
Examples:
Fig. 8.3.9.1.1 Polarized capacitor
1
Circuit symbol:
Fig. 8.3.9.1.2 Circuit diagram
8.3.9.2.1 Electrolytic Capacitors
Electrolytic capacitors are polarized and they must be connected the correct way
round, at least one of their leads will be marked + or -. They are not damaged by heat
when soldering. There are two designs of electrolytic capacitors; axial where the leads are
attached to each end (220µF in picture) and radial where both leads are at the same end
(10µF in picture). Radial capacitors tend to be a little smaller and they stand upright on the
circuit board.
It is easy to find the value of electrolytic capacitors because they are clearly printed
with their capacitance and voltage rating. The voltage rating can be quite low (6V for
example) and it should always be checked when selecting an electrolytic capacitor. It the
project parts list does not specify a voltage; choose a capacitor with a rating which is
greater than the project's power supply voltage. 25V is a sensible minimum for most
battery circuits.
8.3.10 Multimeters
Fig. 8..3.10.1 Liquid-Crystal Display (LCD)
1
Multimeters are very useful test instruments. By operating a multi-position switch
on the meter they can be quickly and easily set to be a voltmeter, an ammeter or an
ohmmeter. They have several settings (called 'ranges') for each type of meter and the
choice of AC or DC. Some multimeters have additional features such as transistor testing
and ranges for measuring capacitance and frequency.
8.3.10.1 Choosing a multimeter
The photographs below show modestly priced multimeters which are suitable for general
electronics use, you should be able to buy meters like these for less than £15. A digital
multimeter is the best choice for your first multimeter; even the cheapest will be suitable
for testing simple projects.
If you are buying an analogue multimeter make sure it has a high sensitivity of 20k
/V or greater on DC voltage ranges, anything less is not suitable for electronics. The
sensitivity is normally marked in a corner of the scale, ignore the lower AC value
(sensitivity on AC ranges is less important), the higher DC value is the critical one.
Fig.8.3.10.2 Digital Multimeter
1
Beware of cheap analogue multimeters sold for electrical work on cars because their
sensitivity is likely to be too low.
8.3.10.2 Digital multimeters
All digital meters contain a battery to power the display so they use virtually no power
from the circuit under test. This means that on their DC voltage ranges they have a very
high resistance (usually called input impedance) of 1M or more, usually 10M , and they
are very unlikely to affect the circuit under test. Typical ranges for digital multimeters like
the one illustrated: (the values given are the maximum reading on each range)
DC Voltage: 200mV, 2000mV, 20V, 200V, 600V.
AC Voltage: 200V, 600V.
DC Current: 200µA, 2000µA, 20mA, 200mA, 10A*.
*The 10A range is usually unused and connected via a special socket.
AC Current: None. (You are unlikely to need to measure this).
Resistance: 200 , 2000 , 20k , 200k , 2000k , Diode Test.
Digital meters have a special diode test setting because their resistance ranges cannot be
used to test diodes and other semiconductors. Multimeters are easily damaged by careless
use so please take these precautions:
Always disconnect the multimeter before adjusting the range switch.
Always check the setting of the range switch before you connect to a circuit.
Never leave a multimeter set to a current range (except when actually taking a
reading).
The greatest risk of damage is on the current ranges because the meter has a low
resistance.
8.3.11 Relays
A relay is an electrically operated switch. Current flowing through the coil of the
relay creates a magnetic field which attracts a lever and changes the switch contacts. The
1
coil current can be on or off so relays have two switch positions and they are double throw
(changeover) switches. Relays allow one circuit to switch a second circuit which can be
completely separate from the first. For example a low voltage battery circuit can use a
relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay
between the two circuits; the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower voltages.
Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the
small IC current to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification. Relays are usually SPDT or DPDT but they can have many
more sets of switch contacts, for example relays with 4 sets of changeover contacts are
readily available.
Fig.8.3.10.1 Circuit symbol for a relay
1
Fig.8.3.10.2 Relays
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay. The supplier's
catalogue should show you the relay's connections. The coil will be obvious and it may be
connected either way round. Relay coils produce brief high voltage 'spikes' when they are
switched off and this can destroy transistors and ICs in the circuit. To prevent damage you
must connect a protection diode across the relay coil.
The animated picture shows a working relay with its coil and switch contacts. You
can see a lever on the left being attracted by magnetism when the coil is switched on. This
lever moves the switch contacts. There is one set of contacts (SPDT) in the foreground and
another behind them, making the relay DPDT. The relay's switch connections are usually
labeled COM, NC and NO:
COM = Common, always connect to this; it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Connect to COM and NO if you want the switched circuit to be on when the relay
coil is on.
Connect to COM and NC if you want the switched circuit to be on when the relay
coil is off.
1
CHAPTER 9ADVANTAGE & APPLICATION
1
9. ADVANTAGES & APPLICATION
9.1 Application
LED-based moving-message displays are becoming popular for transmitting
information to large groups of people quickly. These can be used indoors or outdoors. We
can find such displays in areas like railway platforms, banks, public offices, hotels,
training institutes, nightclubs and shops.
Limitation
At the heart of the moving-message display is Atmel AT89s52microcontroller It is
a low-power, high-performance, 8-bit microcontroller with 4 kB of flash programmable
and erasable read-only memory(PEROM) used as on-chip program memory, 128 bytes of
RAM used as internal data memory, 32 individually programmable input/output (I/O)
lines divided into four 8-bit
1
CHAPTER 10FUTURE
ENHANCEMENT
1
10. FUTURE ENHANCEMENT
Many more messages would be possible if complete Port-3 is used for message
selection. Pins RxD,TxD, INT0 and INT1 have been kept free, so that these can be used
interfacing with the serial port of the PC. Also, interrupt pins can be used to display some
message and sound an alarm in the case of an emergency. For example, a fire sensor can
be connected to ‘INT0’ and a vibration detector to ‘INT1.’ These pins can also be used to
send signals to synchronize a similar system that displays another related message at the
same time, so a 16-character, two line displays is made possible.
1
CHAPTER 11SOFTWARE USED
1
11. SOFTWARE USED
1. setupLayo1PCB
2. dip beta
3. AutoTRAX
1
CHAPTER 12REFERENCE
1
12. REFERENCES
www.google.com
www.texas.com
www.efymeg.com
www.efy.com
www.micro.edu/echips.com
www.answers.com
www.google.com
www.national.com
www.ascom.com
www.electronicsconsulting.co.uk/
www.radarsystem.com
www.electronicsproject.com
www.scienceproject.com
1
CHAPTER 13DATASHEETS OF
COMPONENT USED
1
13.DATASHEETS OF COMPONENTS USED
M24C16, M24C08
M24C04, M24C02, M24C01
16Kbit, 8Kbit, 4Kbit, 2Kbit and 1Kbit Serial I²C Bus EEPROM
1
FEATURES SUMMARY
Two Wire I2C Serial Interface
Supports 400 kHz Protocol
Single Supply Voltage:
– 4.5V to 5.5V for M24Cxx
– 2.5V to 5.5V for M24Cxx-W
– 2.2V to 5.5V for M24Cxx-L –
1.8V to 5.5V for M24Cxx-R
Write Control Input
BYTE and PAGE WRITE (up to 16 Bytes)
RANDOM and SEQUENTIAL READ Modes
Self-Timed Programming Cycle
Automatic Address Incrementing
Enhanced ESD/Latch-Up Behaviour
More than 1 Million Erase/Write Cycles
More than 40 Year Data Retention
Figure 1. Packages
8
1
PDIP8 (BN)
8
1
SO8 (MN) 150 mil width
1
TSSOP8 (DW) 169 mil width
TSSOP8 (DS) 3x3mm² body size (MSOP)
1
1
SUMMARY DESCRIPTION
These I2C-compatible electrically erasable programmable memory (EEPROM) devices are organized as
2048/1024/512/256/128 x 8 (M24C16, M24C08, M24C04, M24C02, M24C01).
VCC
3E0-E2 SDA
M24CxxSCL
WC
VSSAI02033
Figure 2. Logic Diagram
These devices are compatible with the I2C memo-ry protocol. This is a two wire serial
interface that uses a bi-directional data bus and serial clock. The devices carry a built-in 4-bit
Device Type Identifier code (1010) in accordance with the I2C bus definition. The device
behaves as a slave in the I2C protocol, with all memory operations synchronized by the serial
clock. Read and Write operations are initiated by a Start condition, generated by the bus master.
The Start condition is followed by a Device Select Code and RW bit (as described in Table 2),
terminated by an acknowledge bit.
When writing data to the memory, the device inserts an acknowledge bit during the 9 th
bit time, following the bus master’s 8-bit transmission. When data is read by the bus master, the
bus master acknowledges the receipt of the data byte in the same way. Data transfers are
terminated by a Stop condition after an Ack for Write and after a NoAck for Read.
1
E0, E1, E2 Chip Enable
SDA Serial Data
SCL Serial Clock
Write ControlWC
VCC Supply Voltage
VSS Ground
Power On Reset: VCC Lock-Out Write ProtectTable 1. Signal Names
In order to prevent data corruption and inadvertent Write operations during Power-up, a
Power On Reset (POR) circuit is included. The internal reset is held active until VCC has
reached the POR threshold value, and all operations are disabled – the device will not respond
to any command. In the same way, when VCC drops from the operating voltage, below the POR
threshold value, all operations are disabled and the device will not respond to any command. A
stable and valid VCC must be applied before applying any logic signal.
M24Cxx
16Kb /8Kb /4Kb /2Kb /1Kb
NC / NC / NC / E0 / E0 8 VCC1
NC / NC / E1 / E1 / E1 7 WC2
NC / E2 / E2 / E2 / E2 6 SCL3VSS 4 5 SDA
AI02034E
Note: 1. NC = Not Connected 2. See page 20 (onwards) for package dimensions, and how to identify pin
SIGNAL DESCRIPTION Serial Clock (SCL)
This input signal is used to strobe all data in and out of the device. In applications where
this signal is used by slave devices to synchronize the bus to a slower clock, the bus master
must have an open drain output, and a pull-up resistor can be con-nected from Serial Clock
(SCL) to VCC. (Figure 4 indicates how the value of the pull-up resistor can be calculated). In
most applications, though, this method of synchronization is not employed, and so the pull-up
resistor is not necessary, provided that the bus master has a push-pull (rather than open drain)
output.
Serial Data (SDA)
This bi-directional signal is used to transfer data in or out of the device. It is an open
drain output that may be wire-OR’ed with other open drain or open collector signals on the bus.
A pull up resistor must be connected from Serial Data (SDA) to VCC. (Fig-ure 4 indicates how
the value of the pull-up resistor can be calculated).
Chip Enable (E0, E1, E2)
These input signals are used to set the value that is to be looked for on the three least
significant bits (b3, b2, b1) of the 7-bit Device Select Code. These inputs must be tied to VCC or
VSS, to establish the Device Select Code.
This input signal is useful for protecting the entire contents of the memory from
inadvertent write operations. Write operations are disabled to the en-tire memory array when
Write Control (WC) is driven High. When unconnected, the signal is internally read as V IL, and
Write operations are al-lowed. When Write Control (WC) is driven High, Device Select and
Address bytes are acknowledged, Data bytes are not acknowledged.
Max
imum
RP
val
ue (
k)
20
16
12
8
4
010
VCC
RLR L
SDA
MASTERSCL
CBUSfc = 100kHz
fc = 400kHz CBUS100 1000
CBUS (pF)AI01665
Figure 4. Maximum RL Value versus Bus Capacitance (CBUS) for an I2C Bus
DEVICE OPERATION
The device supports the I2C protocol. This is summarized in Figure 5. Any device that
sends data on to the bus is defined to be a transmitter, and any device that reads the data to be a
receiver. The device that controls the data transfer is known as the bus master, and the other as
the slave device. A data transfer can only be initiated by the bus master, which will also provide
the serial clock for synchronization. The M24Cxx device is always a slave in all
communication.
Start Condition
Start is identified by a falling edge of Serial Data (SDA) while Serial Clock (SCL) is
stable in the High state. A Start condition must precede any data transfer command. The device
continuously monitors (except during a Write cycle) Serial Data (SDA) and Serial Clock (SCL)
for a Start condition, and will not respond unless one is given.
Stop Condition
Stop is identified by a rising edge of Serial Data (SDA) while Serial Clock (SCL) is
stable and driven high. A Stop condition terminates communication between the device and the
bus master. A Read command that is followed by NoAck can be followed by a Stop condition
to force the device into the Stand-by mode. A Stop condition at the end of a Write command
triggers the internal EE-PROM Write cycle.
Acknowledge Bit (ACK)
The acknowledge bit is used to indicate a success-ful byte transfer. The bus transmitter,
whether it be bus master or slave device, releases Serial Data (SDA) after sending eight bits of
data. During the 9th clock pulse period, the receiver pulls Serial Data (SDA) Low to
acknowledge the receipt of the eight data bits.
Data Input
During data input, the device samples Serial Data (SDA) on the rising edge of Serial
Clock (SCL). For correct device operation, Serial Data (SDA) must be stable during the rising
edge of Serial Clock (SCL), and the Serial Data (SDA) signal must change only when Serial
Clock (SCL) is driven Low.
Memory Addressing
To start communication between the bus master and the slave device, the bus master
must initiate a Start condition. Following this, the bus master sends the Device Select Code,
shown in Table 2 (on Serial Data (SDA), most significant bit first).The Device Select Code
consists of a 4-bit Device Type Identifier, and a 3-bit Chip Enable “Address” (E2, E1, E0). To
address the memory array, the 4-bit Device Type Identifier is 1010b.When the Device Select
Code is received on Seri-al Data (SDA), the device only responds if the Chip Enable Address is
the same as the value on the Chip Enable (E0, E1, E2) inputs. The 8 th bit is the Read/Write bit
(RW). This bit is set to 1 for Read and 0 for Write operations. If a match occurs on the Device
Select code, the corresponding device gives an acknowledgment on Serial Data (SDA) during
the 9th bit time. If the device does not match the Device Select code, it deselects itself from the
bus, and goes into Stand-by mode.
Devices with larger memory capacities (the M24C16, M24C08 and M24C04) need
more ad-dress bits. E0 is not available for use on devices that need to use address line A8; E1 is
not avail-able for devices that need to use address line A9, and E2 is not available for devices
that need to use address line A10 (see Figure 3 and Table 2 for de-tails). Using the E0, E1 and
E2 inputs pins, up to eight M24C02 (or M24C01), four M24C04, two M24C08 or one M24C16
device can be connected to one I2C bus. In each case, and in the hybrid cases, this gives a total
memory capacity of 16 Kbits, 2 Kbytes (except where M24C01 devices are used).
Mode RW bit1
Bytes Initial SequenceWC
Current Address Read 1 X 1 START, Device Select, RW = 1
Random Address Read
0 X
1
START, Device Select, RW = 0, Address
1 X reSTART, Device Select, RW = 1
Sequential Read 1 X 1Similar to Current or Random Address Read
Byte Write 0VIL 1 START, Device Select, RW = 0
Page Write 0VIL 16 START, Device Select, RW = 0
Note: 1. X = VIH or VIL. Table 3. Operating Modes
WC
ACK ACK
Byte Write DEV SEL BYTE ADDR
STA
RT
R/W
WC
ACK ACK
Page Write DEV SEL BYTE ADDR
NO ACK
DATA IN
STO
P
NO ACK NO ACK
DATA IN 1 DATA IN 2 DATA IN 3
STA
RT
WC (cont'd)
Page Write(cont'd)
R/W
NO ACK NO ACK
DATA IN N
STO
P
AI02803C
Figure 6. Write Mode Sequences with WC=1 (data write inhibited)
Write Operations
Following a Start condition the bus master sends a Device Select Code with the RW bit
reset to 0. The device acknowledges this, as shown in Figure 7, and waits for an address byte.
The device responds to the address byte with an acknowledge bit, and then waits for the data
byte. When the bus master generates a Stop condition immediately after the Ack bit (in the
“10th bit” time slot), either at the end of a Byte Write or a Page Write, the internal memory
Write cycle is triggered. A Stop condition at any other time slot does not trigger the internal
Write cycle.
During the internal Write cycle, Serial Data (SDA) and Serial Clock (SCL) are ignored,
and the de-vice does not respond to any requests.
Byte Write
After the Device Select code and the address byte, the bus master sends one data byte. If
the ad-dressed location is Write-protected, by Write Control (WC) being driven high (during
the period from the Start condition until the end of the address byte), the device replies to the
data byte with NoAck, as shown in Figure 6, and the location is not modified. If, instead, the
addressed location is not Write-protected, the device replies with Ack. The bus master
terminates the transfer by generating a Stop condition, as shown in Figure 7.
Page Write
The Page Write mode allows up to 16 bytes to be written in a single Write cycle,
provided that they are all located in the same page in the memory: that is, the most significant
memory address bits are the same. If more bytes are sent than will fit up to the end of the page,
a condition known as ‘roll-over’ occurs. This should be avoided, as data starts to become
overwritten in an implementation dependent way. The bus master sends from 1 to 16 bytes of
data, each of which is acknowledged by the device if Write Control (WC) is Low. If the
addressed location is Write-protected, by Write Control (WC) being driven high (during the
period from the Start Condition until the end of the address byte), the de-vice replies to the data
bytes with NoAck, as shown in Figure 6, and the locations are not modified. After each byte is
transferred, the internal byte address counter (the 4 least significant ad-dress bits only) is
incremented. The transfer is terminated by the bus master generating a Stop condition.
Figure 7. Write Mode Sequences with WC=0 (data write enabled)
WC
ACK ACK ACK
BYTE WRITE DEV SEL BYTE ADDR DATA IN
STA
RT
STO
PR/W
WC
PAGE WRITE
ST
AR
T
WC (cont'd)
PAGE WRITE(cont'd)
ACK ACK ACK ACK
DEV SEL BYTE ADDR DATA IN 1 DATA IN 2 DATA IN 3
R/W
ACK ACK
DATA IN NS
TO
P
AI02804B
Figure 8. Write Cycle Polling Flowchart using ACK
WRITE Cyclein Progress
START Condition
DEVICE SELECTwith RW = 0
NO ACKReturned
First byte of instruction YESwith RW = 0 alreadydecoded by the device
NO YES
Send Address
ReSTART and Receive ACK
NO YESSTARTSTOPCondition
DATA for the DEVICE SELECTWRITE Operation with RW = 1
Continue the Continue theWRITE Operation Random READ Operation AI01847C
KA78XX/KA78XXA3-Terminal 1A Positive Voltage Regulator
Features Description• Output Current up to 1A The KA78XX/KA78XXA series of three-terminal positive• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V regulator are available in the TO-220/D-PAK package and• Thermal Overload Protection with several fixed output voltages, making them useful in a• Short Circuit Protection wide range of applications. Each type employs internal• Output Transistor Safe Operating Area Protection current limiting, thermal shut down and safe operating area
protection, making it essentially indestructible. If adequateheat sinking is provided, they can deliver over 1A outputcurrent. Although designed primarily as fixed voltageregulators, these devices can be used with externalcomponents to obtain adjustable voltages and currents.
TO-220
1
D-PAK
1
1. Input 2. GND 3. Output
Internal Block Diagram
Absolute Maximum Ratings
Parameter Symbol Value UnitInput Voltage (for VO = 5V to 18V) VI 35 V(for VO = 24V) VI 40 VThermal Resistance Junction-Cases (TO-220) Rθ JC 5 C/WThermal Resistance Junction-Air (TO-220) Rθ JA 65 C/WOperating Temperature Range (KA78XX/A/R) TOPR 0 ~ +125 C
Storage Temperature Range TSTG -65 ~ +150 C
Electrical Characteristics (KA7805/KA7805R)(Refer to test circuit, 0 C < TJ < 125 C, IO = 500mA, VI =10V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7805
UnitMin. Typ.
Max.
Output Voltage VOTJ =+25 oC 4.8 5.0 5.25.0mA ≤ Io ≤ 1.0A, PO ≤ 15W
VVI = 7V to 20V 4.75 5.0 5.25
Line Regulation (Note1) Regline TJ=+25 oCVO = 7V to 25V - 4.0 100
mVVI = 8V to 12V - 1.6 50
Load Regulation (Note1) Regload TJ=+25 oC
IO = 5.0mA to1.5A - 9 100mVIO =250mA to
750mA - 4 50Quiescent Current IQ TJ =+25 oC - 5.0 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1.0A - 0.03 0.5
mAVI= 7V to 25V - 0.3 1.3
Output Voltage Drift ∆ VO/∆ T IO= 5mA - -0.8 - mV/ oCOutput Noise Voltage VN f = 10Hz to 100KHz, TA=+25 oC - 42 - V/VO
Ripple Rejection RRf = 120Hz
62 73 - dBVO = 8V to 18V
Dropout Voltage VDrop IO = 1A, TJ =+25 oC - 2 - VOutput Resistance rO f = 1KHz - 15 - mΩShort Circuit Current ISC VI = 35V, TA =+25 oC - 230 - mAPeak Current IPK TJ =+25 oC - 2.2 - A
Electrical Characteristics (KA7806/KA7806R)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =11V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7806
UnitMin. Typ.
Max.
Output Voltage VOTJ =+25 oC 5.75 6.0 6.255.0mA ≤ IO ≤ 1.0A, PO ≤ 15W
VVI = 8.0V to 21V 5.7 6.0 6.3
Line Regulation (Note1) Regline TJ =+25 oCVI = 8V to 25V - 5 120
mVVI = 9V to 13V - 1.5 60
Load Regulation (Note1) Regload TJ =+25 oCIO =5mA to 1.5A - 9 120
mVIO =250mA to750mA - 3 60
Quiescent Current IQ TJ =+25 oC - 5.0 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1A - - 0.5
mAVI = 8V to 25V - - 1.3
Output Voltage Drift ∆ VO/∆ T IO = 5mA - -0.8 -mV/
oC
Output Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 45 -
V/Vo
Ripple Rejection RRf = 120Hz
59 75 - dBVI = 9V to 19V
Dropout Voltage VDrop IO = 1A, TJ =+25 oC - 2 - VOutput Resistance rO f = 1KHz - 19 - mΩShort Circuit Current ISC VI= 35V, TA=+25 oC - 250 - mAPeak Current IPK TJ =+25 oC - 2.2 - A
Note:
1. Load and line regulation are specified at constant junction temperature. Changes in VO due to heating effects must be taken into account separately. Pulse testing with low duty is used.
ELectrical Characteristics (KA7808/KA7808R)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =14V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7808
UnitMin. Typ.
Max.
Output Voltage VO
TJ =+25 oC 7.7 8.0 8.35.0mA ≤ IO ≤ 1.0A, PO ≤ 15W
VVI = 10.5V to 23V 7.6 8.0 8.4
Line Regulation (Note1) ReglineTJ =+25 oC
VI = 10.5V to 25V - 5.0 160
mVVI = 11.5V to 17V - 2.0 80
Load Regulation (Note1) RegloadTJ =+25 oC
IO = 5.0mA to 1.5A - 10 160
mVIO= 250mA to
- 5.0 80750mA
Quiescent Current IQTJ =+25 oC - 5.0 8.0 mA
Quiescent Current Change ∆ IQIO = 5mA to 1.0A - 0.05 0.5
mAVI = 10.5A to 25V - 0.5 1.0
Output Voltage Drift ∆ VO/∆ TIO = 5mA - -0.8 - mV/ oC
Output Noise Voltage VNf = 10Hz to 100KHz, TA =+25 oC - 52 - V/Vo
Ripple Rejection RR f = 120Hz, VI= 11.5V to 21.5V 56 73 - dBDropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 17 - mΩShort Circuit Current ISC VI= 35V, TA =+25 oC - 230 - mA
Peak Current IPKTJ =+25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7809/KA7809R)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =15V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7809
UnitMin. Typ.
Max.
Output Voltage VOTJ =+25 oC 8.65 9 9.35
5.0mA≤ IO ≤ 1.0A, PO ≤ 15WVVI= 11.5V to
24V 8.6 9 9.4
Line Regulation (Note1) Regline TJ=+25 oCVI = 11.5V to 25V - 6 180
mVVI = 12V to 17V - 2 90
Load Regulation (Note1) Regload TJ=+25 oC
IO = 5mA to 1.5A - 12 180mVIO = 250mA to
750mA - 4 90Quiescent Current IQ TJ=+25 oC - 5.0 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1.0A - - 0.5
mAVI = 11.5V to 26V - - 1.3
Output Voltage Drift ∆ VO/∆ T IO = 5mA - -1 - mV/ oCOutput Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 58 - V/VoRipple Rejection
RRf = 120Hz
56 71 - dBVI = 13V to 23V
Dropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 17 - mΩShort Circuit Current ISC VI= 35V, TA =+25 oC - 250 - mAPeak Current IPK TJ= +25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to heating
effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7810)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =16V, CI= 0.33 F, CO=0.1
F, unless otherwise specified)
Parameter Symbol Conditions
KA7810
UnitMin. Typ.
Max.
Output Voltage VO
TJ =+25 oC 9.6 10 10.4
5.0mA ≤ IO ≤ 1.0A, PO ≤ 15W
VVI = 12.5V to 25V 9.5 10 10.5
Line Regulation (Note1) ReglineTJ =+25 oC
VI = 12.5V to 25V - 10 200mV
VI = 13V to 25V - 3 100Load Regulation (Note1) Regload
TJ =+25 oC
IO = 5mA to 1.5A - 12 200mVIO = 250mA to
750mA - 4 400
Quiescent Current IQTJ =+25 oC - 5.1 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1.0A - - 0.5mA
VI = 12.5V to 29V - - 1.0Output Voltage Drift ∆ VO/∆ T IO = 5mA - -1 - mV/ oCOutput Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 58 - V/Vo
Ripple Rejection RRf = 120Hz
56 71 - dBVI = 13V to 23V
Dropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 17 - mΩShort Circuit Current ISC VI = 35V, TA=+25 oC - 250 - mA
Peak Current IPKTJ =+25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7812/KA7812R)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =19V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7812/KA7812R
UnitMin. Typ.
Max.
Output Voltage VO
TJ =+25 oC 11.5 12 12.5
5.0mA ≤ IO≤ 1.0A, PO≤ 15W
VVI = 14.5V to 27V 11.4 12 12.6
Line Regulation (Note1) ReglineTJ =+25 oC
VI = 14.5V to 30V - 10 240mV
VI = 16V to 22V - 3.0 120
Load Regulation (Note1) RegloadTJ =+25 oC
IO = 5mA to 1.5A - 11 240mVIO = 250mA to
750mA - 5.0 120
Quiescent Current IQTJ =+25 oC - 5.1 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1.0A - 0.1 0.5mA
VI = 14.5V to 30V - 0.5 1.0Output Voltage Drift ∆ VO/∆ T IO = 5mA - -1 - mV/ oCOutput Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 76 - V/Vo
Ripple Rejection RRf = 120Hz
55 71 - dBVI = 15V to 25V
Dropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 18 - mΩShort Circuit Current ISC VI = 35V, TA=+25 oC - 230 - mA
Peak Current IPKTJ = +25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7815)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =23V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol ConditionsKA7815
UnitMin. Typ.
Max.
Output Voltage VOTJ =+25 oC 14.4 15 15.6
5.0mA ≤ IO≤ 1.0A, PO≤ 15WVVI = 17.5V to
30V 14.25 15 15.75
Line Regulation (Note1) Regline TJ =+25 oCVI = 17.5V to 30V - 11 300
mVVI = 20V to 26V - 3 150
Load Regulation (Note1) Regload TJ =+25 oCIO = 5mA to 1.5A - 12 300
mVIO = 250mA to 750mA - 4 150
Quiescent Current IQ TJ =+25 oC - 5.2 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1.0A - - 0.5
mAVI = 17.5V to 30V - - 1.0
Output Voltage Drift ∆ VO/∆ T IO = 5mA - -1 - mV/ oCOutput Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 90 - V/Vo
Ripple Rejection RRf = 120Hz
54 70 - dBVI = 18.5V to 28.5V
Dropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 19 - mΩShort Circuit Current ISC VI = 35V, TA=+25 oC - 250 - mAPeak Current IPK TJ =+25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used
Electrical Characteristics (KA7818)(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =27V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7818
UnitMin. Typ.
Max.
Output Voltage VOTJ =+25 oC 17.3 18 18.7
5.0mA ≤ IO ≤ 1.0A, PO ≤ 15WVVI = 21V to
33V 17.1 18 18.9
Line Regulation (Note1) Regline TJ =+25 oCVI = 21V to 33V - 15 360
mVVI = 24V to 30V - 5 180
Load Regulation (Note1) Regload TJ =+25 oC
IO = 5mA to 1.5A - 15 360mVIO = 250mA to
750mA - 5.0 180Quiescent Current IQ TJ =+25 oC - 5.2 8.0 mA
Quiescent Current Change ∆ IQ
IO = 5mA to 1.0A - - 0.5
mAVI = 21V to 33V - - 1
Output Voltage Drift ∆ VO/∆ T IO = 5mA - -1 - mV/ oCOutput Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 110 - V/Vo
Ripple Rejection RRf = 120Hz
53 69 - dBVI = 22V to 32V
Dropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 22 - mΩShort Circuit Current ISC VI = 35V, TA=+25 oC - 250 - mAPeak Current IPK TJ =+25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7824)(Refer to test circuit, 0 C < TJ < 125 C, IO = 500mA, VI =33V, CI= 0.33 F, CO=0.1 F, unless otherwise specified)
Parameter Symbol Conditions
KA7824
UnitMin. Typ. Max.
Output Voltage VO
TJ =+25 oC 23 24 25
5.0mA ≤ IO ≤
1.0A, PO ≤ 15W
VVI = 27V to 38V 22.8 24 25.25
Line Regulation (Note1) ReglineTJ =+25 oC
VI = 27V to 38V - 17 480mV
VI = 30V to 36V - 6 240Load Regulation (Note1)
Regload
TJ =+25 oC
IO = 5mA to 1.5A - 15 480mVIO = 250mA to
750mA - 5.0 240
Quiescent Current IQTJ =+25 oC - 5.2 8.0 mA
Quiescent Current Change ∆IQ
IO = 5mA to 1.0A - 0.1 0.5mAV
I = 27V to 38V - 0.5 1
Output Voltage Drift∆ V
/∆ T I = 5mA - -1.5 -
mV/
O O oC
Output Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC - 60 -
V/Vo
Ripple Rejection RRf = 120Hz
50 67 - dBVI = 28V to 38V
Dropout Voltage VDrop IO = 1A, TJ=+25 oC - 2 - VOutput Resistance rO f = 1KHz - 28 - mΩShort Circuit Current ISC VI = 35V, TA=+25 oC - 230 - mA
Peak Current IPKTJ =+25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Changes in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7805A)(Refer to the test circuits. 0oC < TJ < +125 oC, Io =1A, V I = 10V, C I=0.33 F, C O=0.1 F, unless otherwise specified)
Parameter Symbol Conditions Min. Typ. Max. Unit
Output Voltage VOTJ =+25 oC 4.9 5 5.1
VIO = 5mA to 1A, PO ≤ 15W
4.8 5 5.2VI = 7.5V to 20VVI = 7.5V to 25V
- 5 50IO = 500mALine Regulation
(Note1)
Regline
VI = 8V to 12V - 3 50
mV
TJ =+25 oCVI= 7.3V to 20V - 5 50
VI= 8V to 12V - 1.5 25TJ =+25 oC
- 9 100Load Regulation (Note1) IO = 5mA to 1.5A
Regload mVIO = 5mA to 1A - 9 100IO = 250mA to 750mA - 4 50
Quiescent Current IQ TJ =+25 oC - 5.0 6.0 mA
Quiescent Current
IO = 5mA to 1A - - 0.5
∆ IQ VI = 8 V to 25V, IO = 500mA - - 0.8 mAChange
VI = 7.5V to 20V, TJ =+25 oC - - 0.8Output Voltage Drift ∆ V/∆ T Io = 5mA - -0.8 - mV/ oC
Output Noise Voltage VNf = 10Hz to 100KHz
- 10 - V/VoTA =+25 oC
Ripple Rejection RRf = 120Hz, IO = 500mA
- 68 - dBVI = 8V to 18V
Dropout Voltage VDrop IO = 1A, TJ =+25 oC - 2 - VOutput Resistance rO f = 1KHz - 17 - mΩShort Circuit Current ISC VI= 35V, TA =+25 oC - 250 - mAPeak Current IPK TJ= +25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Change in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7806A)(Refer to the test circuits. 0oC < TJ < +125 oC, Io =1A, V I = 11V, C I=0.33 F, C O=0.1 F, unless otherwise specified)
Parameter Symbol Conditions Min.Typ. Max. Unit
Output Voltage VOTJ =+25 oC 5.58 6 6.12
VIO = 5mA to 1A, PO ≤ 15W
5.76 6 6.24VI = 8.6V to 21VVI= 8.6V to 25V
- 5 60IO = 500mA
Line Regulation (Note1)
Regline
VI= 9V to 13V - 3 60
mV
TJ =+25 oCVI= 8.3V to 21V - 5 60
VI= 9V to 13V - 1.5 30TJ =+25 oC
- 9 100Load Regulation (Note1) IO = 5mA to 1.5A
Regload mVIO = 5mA to 1A - 4 100IO = 250mA to 750mA - 5.0 50
Quiescent Current IQ TJ =+25 oC - 4.3 6.0 mAIO = 5mA to 1A - - 0.5
Quiescent Current Change ∆ IQ VI = 9V to 25V, IO = 500mA - - 0.8 mAVI= 8.5V to 21V, TJ =+25 oC - - 0.8
Output Voltage Drift ∆ V/∆ T IO = 5mA - -0.8 - mV/ oC
Output Noise Voltage VNf = 10Hz to 100KHz
- 10 - V/VoTA =+25 oC
Ripple Rejection RRf = 120Hz, IO = 500mA
- 65 - dBVI = 9V to 19V
Dropout Voltage VDrop IO = 1A, TJ =+25 oC - 2 - VOutput Resistance rO f = 1KHz - 17 - mΩShort Circuit Current ISC VI= 35V, TA =+25 oC - 250 - mAPeak Current IPK TJ=+25 oC - 2.2 - A
Note:1. Load and line regulation are specified at constant junction temperature. Change in VO due to
heating effects must be taken into account separately. Pulse testing with low duty is used.
Electrical Characteristics (KA7808A)(Refer to the test circuits. 0oC < TJ < +125 oC, Io =1A, V I = 14V, C I=0.33 F, C O=0.1 F, unless otherwise speci-fied)
Parameter Symbol ConditionsMin. Typ.
Max. Unit
Output Voltage VOTJ =+25 oC 7.84 8 8.16
VIO = 5mA to 1A, PO ≤ 15W
7.7 8 8.3VI = 10.6V to 23VVI= 10.6V to 25V
- 6 80IO = 500mA
Line Regulation (Note1)
Regline
VI= 11V to 17V - 3 80
mV
TJ =+25 oC
VI= 10.4V to 23V - 6 80
VI= 11V to 17V - 2 40TJ =+25 oC
- 12 100Load Regulation (Note1) IO = 5mA to 1.5A
Regload mVIO = 5mA to 1A - 12 100IO = 250mA to 750mA - 5 50
Quiescent Current IQ TJ =+25 oC - 5.0 6.0 mAIO = 5mA to 1A - - 0.5
Quiescent Current Change ∆ IQVI = 11V to 25V, IO = 500mA - - 0.8 mAVI= 10.6V to 23V, TJ =+25 oC - - 0.8
Output Voltage Drift ∆ V/∆ T IO = 5mA - -0.8 - mV/ oC
Output Noise Voltage VN
f = 10Hz to 100KHz- 10 - V/Vo
TA =+25 oC
Ripple Rejection RRf = 120Hz, IO = 500mA
- 62 - dBVI = 11.5V to 21.5V
Dropout Voltage VDrop IO = 1A, TJ =+25 oC - 2 - VOutput Resistance rO f = 1KHz - 18 - mΩShort Circuit Current ISC VI= 35V, TA =+25 oC - 250 - mAPeak Current IPK TJ=+25 oC - 2.2 - A
Features Compatible with MCS-51® Products 8K Bytes of In-System Programmable (ISP) Flash
Memory – Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag
DescriptionThe AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density non-volatile memory technology and is compatible with the industry standard 80C51 instruction set and piout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.
8-bit Microcontroller with 8K Bytes In-System Programmable Flash
AT89S52
Pin ConfigurationsPDIP
1 40 VCC(T2) P1.0
2 39 P0.0 (AD0)(T2 EX) P1.1
3 38 P0.1 (AD1)P1.2
4 37 P0.2 (AD2)P1.3
5 36 P0.3 (AD3)P1.4
6 35 P0.4 (AD4)(MOSI) P1.5
7 34 P0.5 (AD5)(MISO) P1.6
8 33 P0.6 (AD6)(SCK) P1.7
9 32 P0.7 (AD7)RST
10 31 EA/VPP(RXD) P3.0
11 30 ALE/PROG(TXD) P3.1
12 29 PSEN(INT0) P3.2
13 28 P2.7 (A15)(INT1) P3.3
14 27 P2.6 (A14)(T0) P3.4
(T1) P3.5 15 26 P2.5 (A13)25 P2.4 (A12)(WR) P3.6 16
24 P2.3 (A11)(RD) P3.7 17
23 P2.2 (A10)XTAL2 18
22 P2.1 (A9)XTAL1 19
21 P2.0 (A8)GND 20
TQFP
EX
)
(T2)
(AD
0)(A
D1)
(AD
2)
(AD
3)
(T 2
VC
C4 3 2 1 0 0 1 2
P0
.3
.....
NC ...
P1
P1
P1 P 1 P1
P0 P 0 P0
44
43
42 4 1 40
39 3 8
37 36
35 3 4
(MOSI) P1.5 1 33 P0.4 (AD4)
(MISO) P1.6 2 32 P0.5 (AD5)
(SCK) P1.7 3 31 P0.6 (AD6)
RST 4 30 P0.7 (AD7)
(RXD) P3.0 5 29 EA/VPP
NC 6 28 NC
(TXD) P3.1 7 27 ALE/PROG
(INT0) P3.2 8 26 PSEN
(INT1) P3.3 9 25 P2.7 (A15)
(T0) P3.4 10 24 P2.6 (A14)
(T1) P3.5 11 23 P2.5 (A13)
12 13 14 15 1 6 1 7 18 19 20 21 2 2
6 7
XT
AL
2
XT
AL
1G
ND G
ND 0 1 2 3 4. . ... .
P 2 .P3
P3
P2
P2
P2
P2
(WR
)(R
D)
(A8
)
(A9
)(A
10)
(A1
1)( A 1 2
PLCC
EX
)
(T2)
(AD
0)
(AD
1)(A
D2)
(AD
3)
(T 2
VC
C 0 1 2 3
NC . . . .
P 1 P1
P1 P 1 P 1 P0
P0
P0
P 0
1 4 4 43 42 41 4 0
(MOSI) P1.5 7 39 P0.4 (AD4)
8 38 P0.5 (AD5)(MISO) P1.6
9 37 P0.6 (AD6)(SCK) P1.7
10 36 P0.7 (AD7)RST
11 35 EA/VPP(RXD) P3.0
12 34 NCNC
13 33 ALE/PROG(TXD) P3.1
14 32 PSEN(INT0) P3.2
15 31 P2.7 (A15)(INT1) P3.3
16 30 P2.6 (A14)(T0) P3.4
17 29 P2.5 (A13)(T1) P3.5
19
20 2 1 2 2 23
2 4 25
26
27
2 8
P3
.7X
TA
L2
XT
AL
1G
ND N
C 0 1 2 3 4
. . . . .
P 3 P 2 P2
P2
P2
P 2
(WR
) (RD
)
(A8
) (A9
)
(A1
0)(A
11)
(A1
2)
Block DiagramP0.0 - P0.7 P2.0 - P2.7
VCC
GND
PSEN
ALE/PROG
EA / VPP
RST
WATCH ISP PROGRAMDOG PORT LOGIC
P3.0 - P3.7 P1.0 - P1.7
Pin DescriptionVCCSupply voltage.
GNDGround.
Port 0Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance inputs.
Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification.
Port 1Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will
source current (IIL) because of the internal pull-ups.In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table.
Port 1 also receives the low-order address bytes during Flash programming and verification.
Port Pin Alternate Functions
P1.0 T2 (external count input to Timer/Counter 2),clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload triggerand direction control)
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming)
Port 2Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will
source current (IIL) because of the internal pull-ups.Port 2 emits the high-order address byte during fetches from external program memory and during accesses to
external data memory that use 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register.
Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.
Port 3Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source
current (IIL) because of the pull-ups.Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.
Port 3 also receives some control signals for Flash programming and verification.
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
RSTReset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives High for 96 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROGAddress Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to externalmemory. 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.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only dur-ing a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.
PSENProgram Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external pro-gram memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.
EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external pro-gram memory locations starting at 0000H up to FFFFH.
Table 1. AT89S52 SFR Map and Reset Values
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 volt-age (VPP) during Flash programming.
XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2Output from the inverting oscillator amplifier.
0F8H 0FFH
0F0HB
0F7H00000000
0E8H 0EFH
0E0HACC
0E7H00000000
0D8H 0DFH
0D0HPSW
0D7H00000000
0C8HT2CON T2MOD RCAP2L RCAP2H TL2 TH2
0CFH00000000 XXXXXX00 00000000 00000000 00000000 00000000
0C0H 0C7H
0B8HIP
0BFHXX000000
0B0HP3
0B7H11111111
0A8HIE
0AFH0X000000
0A0HP2 AUXR1 WDTRST
0A7H11111111 XXXXXXX0 XXXXXXXX
98HSCON SBUF
9FH00000000 XXXXXXXX
90HP1
97H11111111
88HTCON TMOD TL0 TL1 TH0 TH1 AUXR
8FH00000000 00000000 00000000 00000000 00000000 00000000 XXX00XX0
80HP0 SP DP0L DP0H DP1L DP1H PCON
87H11111111 00000111 00000000 00000000 00000000 00000000 0XXX0000
Special Function Registers
A map of the on-chip memory area called the Special Function Register (SFR) space is shown in Table 1.
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.
User software should not write 1s to these unlisted locations, since they may be used in future products to invoke
Table 2. T2CON – Timer/Counter 2 Control Register
new features. In that case, the reset or inactive values of the new bits will always be 0.Timer 2 Registers: Control and status bits are contained in registers T2CON (shown in Table 2) and T2MOD (shown in Table 3) for Timer 2. The register pair (RCAP2H, RCAP2L) are the Capture/Reload registers for Timer 2 in 16-bit cap-ture mode or 16-bit auto-reload mode.
Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six interrupt sources in the IP register.
T2CON Address = 0C8H Reset Value = 0000 0000B
Bit Addressable
Bit TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL2
7 6 5 4 3 2 1 0
Symbol Function
TF2 Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2 will not be set when either RCLK = 1or TCLK = 1.
EXF2 Timer 2 external flag set when either a capture or reload is caused by a negative transition on T2EX and EXEN2 = 1.When Timer 2 interrupt is enabled, EXF2 = 1 will cause the CPU to vector to the Timer 2 interrupt routine. EXF2 must becleared by software. EXF2 does not cause an interrupt in up/down counter mode (DCEN = 1).
RCLK Receive clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its receive clock in serial portModes 1 and 3. RCLK = 0 causes Timer 1 overflow to be used for the receive clock.
TCLK Transmit clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its transmit clock in serial portModes 1 and 3. TCLK = 0 causes Timer 1 overflows to be used for the transmit clock.
EXEN2 Timer 2 external enable. When set, allows a capture or reload to occur as a result of a negative transition on T2EX if Timer2 is not being used to clock the serial port. EXEN2 = 0 causes Timer 2 to ignore events at T2EX.
TR2 Start/Stop control for Timer 2. TR2 = 1 starts the timer.
C/T2 Timer or counter select for Timer 2. C/T2 = 0 for timer function. C/T2 = 1 for external event counter (falling edge triggered).
CP/RL2 Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1. CP/RL2 = 0causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX when EXEN2 = 1. Wheneither RCLK or TCLK = 1, this bit is ignored and the timer is forced to auto-reload on Timer 2 overflow.
Table 3a. AUXR: Auxiliary Register
AUXR Address = 8EH Reset Value = XXX00XX0B
Not Bit Addressable
– – – WDIDLE DISRTO – – DISALE
Bit 7 6 5 4 3 2 1 0
– Reserved for future expansion
DISALE Disable/Enable ALE
DISALE Operating Mode
0 ALE is emitted at a constant rate of 1/6 the oscillator frequency
1 ALE is active only during a MOVX or MOVC instruction
DISRTO Disable/Enable Reset out
DISRTO
0 Reset pin is driven High after WDT times out
1 Reset pin is input only
WDIDLE Disable/Enable WDT in IDLE mode
WDIDLE
0 WDT continues to count in IDLE mode
1 WDT halts counting in IDLE mode
Dual Data Pointer Registers: To facilitate accessing both internal and external data memory, two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user should always initialize the DPS bit to the
appropriate value before accessing the respective Data Pointer Register.
Power Off Flag: The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is set to “1” during power up. It can be set and rest under software control and is not affected by reset.
Table 3b. AUXR1: Auxiliary Register 1
AUXR1 Address = A2H Reset Value = XXXXXXX0B
Not Bit Addressable
– – – – – – – DPS
Bit 7 6 5 4 3 2 1 0
– Reserved for future expansion
DPS Data Pointer Register Select
DPS
0 Selects DPTR Registers DP0L, DP0H
1 Selects DPTR Registers DP1L, DP1H
MAX232, MAX232I
DUAL EIA 232 DRIVERS/RECEIVERS
Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28
Operates From a Single 5-V Power Supply With 1.0-mF Charge-Pump Capacitors
Operates Up To 120 kbit/s Two Drivers and Two Receivers 30-V Input Levels Low Supply Current 8 mA Typical ESD Protection Exceeds JESD 22
o 2000-V Human-Body Model (A114-A)
Upgrade With Improved ESD (15-kV HBM) and 0.1-mF Charge-Pump Capacitors is
Available With the MAX202 Applications
o TIA/EIA-232-F, Battery-
Powered Systems, Terminals, Modems, and Computers
MAX232 . . . D, DW, N, OR NS PACKAGE MAX232I . . . D, DW, OR N PACKAGE
(TOP VIEW)
VCC1 16C1+
VS+ 2 15GND
C1− 3 14T1OUT
4 13C2+ R1IN
5 12C2−R1OUT
VS− 6 11 T1IN
7 10T2OU
T T2IN
8 9R2OUTR2IN
Description/ordering information
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F voltage levels from a single 5-V supply. Each receiver converts TIA/EIA-232-F inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments LinASIC library.
ORDERING INFORMATION
TA PACKAGE†
ORDERABLE
TOP-SIDE
PART NUMBER
MARKING
PDIP (N) Tube of 25 MAX232N
MAX232N
SOIC (D)
Tube of 40 MAX232D
MAX232
0C to 70C
Reel of 2500 MAX232DR
SOIC (DW)
Tube of 40 MAX232DW
MAX232Reel of 2000 MAX232DWR
SOP (NS) Reel of 2000 MAX232NSR MAX232
PDIP (N) Tube of 25 MAX232IN
MAX232IN
SOIC Tube of 40 MAX232ID MAX232I
(D)−40 C to 85C Reel of 2500 MAX232IDR
SOIC (DW)
Tube of 40 MAX232IDW
MAX232IReel of 2000
MAX232IDWR
†Package drawings, standard packing quantities, thermal data, symbolization, and PCB design guidelines are available at www.ti.com/sc/package.
Function Tables
EACH DRIVER
INPUT
OUTPUT
TIN TOUT
L HH L
H = high level, L = lowlevel
EACH RECEIVER
INPUT
OUTPUT
RIN ROUT
L HH L
H = high level, L = low level
logic diagram (positive logic)
11 14T1IN
T1OUT
710T2IN
T2OUT
12 13R1OUT
R1IN
9 8R2OUT
R2IN
Absolute maximum ratings over operating free-air temperature range (unless otherwise noted)Input supply voltage range, VCC (see Note 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . −0.3 V to 6 V
Positive output supply voltage range, VS+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . VCC − 0.3 V to 15 V
Negative output supply voltage range, VS− . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . −0.3 V to −15 V
Input voltage range, VI: Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . −0.3 V to VCC + 0.3 V
Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . ±30 V
Output voltage range, VO: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
VS− − 0.3 V to V S+ + 0.3 V
R1OUT, R2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . −0.3 V to V CC + 0.3 V
Short-circuit duration: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . Unlimited
Package thermal impedance, θJA (see Notes 2 and 3): D package . . . . . . . . . . . .
. . . . . . . . . . . . . . . . 73°C/W
DW package . . . . . . . . . .. . . . . . . . . . . . . . . . 57°C/W
N package . . . . . . . . . . . .. . . . . . . . . . . . . . . . 67°C/W
NS package . . . . . . . . . . .. . . . . . . . . . . . . . . . 64°C/W
Operating virtual junction temperature, TJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . 150°C
Storage temperature range,
Tstg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . −65 °C to 150°C
†Stresses beyond those listed under “absolute maximum ratings” may cause permanent damage to the device. These are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated under “recommended operating conditions” is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
NOTES: 1. All voltages are with respect to network GND.2 Maximum power dissipation is a function of TJ(max), θJA, and TA. The maximum allowable
power dissipation at any allowable ambient temperature is PD = (TJ(max) − T A)/θJA. Operating at the absolute maximum TJ of 150°C can affect reliability.
3 The package thermal impedance is calculated in accordance with JESD 51-7.
Recommended operating conditions
MINNO
MMA
X UNIT
VCC Supply voltage 4.5 5 5.5 VVIH High-level input voltage (T1IN,T2IN) 2 VVIL Low-level input voltage (T1IN, T2IN) 0.8 VR1IN, R2IN Receiver input voltage ±30 V
TA Operating free-air temperature
MAX232 0 70
CMAX232I −40 85
Electrical characteristics over recommended ranges of supply voltage and operating free-air temperature (unless otherwise noted) (see Note 4 and Figure 4)
PARAMETERTEST CONDITIONS
MIN
TYP‡
MAX UNIT
ICC Supply current
VCC = 5.5 V,
All outputs open,
8 10 mATA = 25°C
‡ All typical values are at VCC = 5 V and TA = 25°C.NOTE 4: Test conditions are C1−C4 = 1 µF at VCC = 5 V ± 0.5 V.
Electrical characteristics over recommended ranges of supply voltage and operating free-air temperature range (see Note 4)
PARAMETER
TEST CONDITIONS MIN
TYP†
MAX UNIT
VOH High-level output voltageT1OUT, T2OUT
RL = 3 kΩ to GND 5 7 V
VOL Low-level output voltage‡T1OUT, T2OUT
RL = 3 kΩ to GND −7 −5 V
ro Output resistanceT1OUT, T2OUT
VS+ = VS− = 0, VO = 2 V 300 Ω
IOS§ Short-circuit output
currentT1OUT, T2OUT VCC = 5.5 V, VO = 0 10 mA
IISShort-circuit input current T1IN, T2IN VI = 0 200 A
All typical values are at VCC = 5 V, TA = 25C.2 The algebraic convention, in which the least-positive (most negative) value is designated minimum, is used in this data sheet for logic voltage levels only.
§ Not more than one output should be shorted at a time.NOTE 4: Test conditions are C1−C4 = 1 F at VCC = 5 V 0.5 V.
switching characteristics, VCC = 5 V, TA = 25C (see Note 4)
PARAMETERTEST CONDITIONS
MIN TYP
MAX
UNIT
SR Driver slew rate
RL = 3 kΩ to 7 kΩ,
30Vs
See Figure 2
SR(t) Driver transition region slew rate See Figure 3 3Vs
Data rateOne TOUT switching 120 kbit/s
RECEIVER SECTION
Electrical characteristics over recommended ranges of supply voltage and operating free-air temperature range (see Note 4)
PARAMETERTEST CONDITIONS MIN
TYP†
MAX UNIT
VOH High-level output voltageR1OUT, R2OUT
IOH = −1 mA 3.5 V
V‡ R1OUT,
R2OUT I= 3.2 mA 0.4 V
Low-level output voltageOL OL
VIT+
Receiver positive-going input
R1IN, R2INVCC = 5 V, TA = 25C 1.7 2.4 V
threshold voltage
VIT−
Receiver negative-going input
R1IN, R2INVCC = 5 V, TA = 25C 0.8 1.2 V
threshold voltage
Vhys Input hysteresis voltage R1IN, R2INVCC = 5 V 0.2 0.5 1 V
ri Receiver input resistance R1IN, R2IN VCC = 5, TA = 25C 3 5 7 kΩ
†All typical values are at VCC = 5 V, TA = 25C.‡ The algebraic convention, in which the least-positive (most negative) value is designated minimum, is used in this data sheet for logic voltage levels only.
NOTE 4: Test conditions are C1−C4 = 1 F at VCC = 5 V 0.5 V.
switching characteristics, VCC = 5 V, TA = 25C (see Note 4 and Figure 1)
PARAMETER TYP UNIT
tPLH(R) Receiver propagation delay time, low- to high-level output 500 nstPHL(R) Receiver propagation delay time, high- to low-level output 500 ns
NOTE 4: Test conditions are C1−C4 = 1 F at VCC = 5 V 0.5 V