You are on page 1of 125

CHAPTER 1 INTRODUCTION

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 cant 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 mares 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 ldmatrix 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

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 Cant 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 lets 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.

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

CHAPTER 2
PRINCIPLE & WORKING

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 4row 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 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 LEDs when glow together they can be used to display some message. The problem is with the fact that in order to control so many LEDs 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, someones 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 days 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. 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 users 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 32 similarly the month doesnt go beyond 12 and the year doesnt 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 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 02 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. 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 days 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 days units digit until kit crosses 9 (ASCII39) After 9 the days 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 days 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 days units 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. 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 currentlimiting resistors for the matrix LED's. You have software control of the display 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. 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 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 threecolor 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. Its 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 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 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. 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 threedigit 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.

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 shiftcounter 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, voltagedropping 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 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 leds 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 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.

CHAPTER 3 STEPS OF PROJECT MAKING

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 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 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 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. 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. 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 400C) 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 400C. Dampen the sponge in the stand. 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 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:

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 200C. 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. 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.

CHAPTER 4 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).

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

CHAPTER 5 CIRCUIT 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 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. 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

CHAPTER 6 PCB LAYOUT

6. PCB LAYOUT

Fig 6.1 PCB layout

CHAPTER 7 CODING

7. CODING

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

<FC> : <FD> : <FE> : <FF> : <FH> : <FJ> : <FN> : <FT> : <FV> : <FX> : <FZ> ;

complement the running matter call the live date normal english (11*8) approximately (caps and small char) bold fat fonts (16*14) approximately normal thin hindi fonts (11*8) approximately jump to next message or page small font (7*5) call the live time vertical font end of current message end of all the message and jump to the first message

7.3.2 Speed Settings:<S1> <S2> <S3> <S4> <S5> <S6> <S7> <S8> <S9> <S0> Fastest speed in single look Fast speed in single look Fastest speed in double look Fast speed in double look Fastest speed in triple look Fast speed in triple look Fastest speed in four look (slider) Fast speed in four looks (slider) Fast speed (slider) Slow speed in single look

7.3.3 Functions and Effects:-

<F3> <F6> <D1> <D2> <D3> <D4> <D5> <D6> <D7> <D8> <D9> <D0>

Flashing the screen Freeze the screen Curtain up Curtain down Curtain right to left Curtain left to right Curtain out to in Curtain in to out Page up Page down Page out to in 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>

CHAPTER 8
HARDWARE SECTION

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. 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 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 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. 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 400C) 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 400C.

Dampen the sponge in the stand. 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.

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. 8. 9.

Stick all the components onto a sheet of paper using sticky tape. Identify each component and write its name or value beside it. Add the code (R1, R2, C1 etc.) if necessary. Many projects from books and magazines label the components with codes

10.

(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 Connect the correct way round by making sure the notch is at the correct end. Do NOT put the ICs (chips) in yet. No special precautions are needed with resistors. These may be connected either way round. Take care with polystyrene capacitors because they are easily damaged by heat. Connect the correct way round. They will be marked with a + or - near one lead. Connect the correct way round. Take care with germanium diodes (e.g. OA91) because they are easily damaged by heat. 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. 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. 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.

Chip Holders 1 (DIL sockets)

2 Resistors

Small value capacitors (usually less than 1F)

Electrolytic capacitors (1F and greater)

5 Diodes

6 LEDs

7 Transistors

Wire Links between points on the circuit board. single core wire

Battery clips, buzzers and 9 other parts with their own wires Wires to parts off the circuit board, including switches, 10 relays, variable resistors and loudspeakers.

Connect the correct way round.

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. 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 metal water pipe or window frame before touching the ICs.

11 ICs (chips)

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 200C. 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. 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:


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):


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 - 2200F, 25V electrolytic C4 - 1F, 16V electrolytic C5 - 10F, 16V electrolytic C6 - 0.1F 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
Example:
Fig. 8.3.1.1 Physical structure

Circuit symbol: 8.3.1.1Function

Fig 8.3.1.2 Circuit symbol

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 Black Brown Red Orange Yellow Green Blue Violet Grey White Number 0 1 2 3 4 5 6 7 8 9

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 resistor values are often given in k and M . 1 k = 1000 1 M = 1000000 . is quite small so

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. 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 bleepers. 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, 1000H = 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.

Fig. 8.3.3.1 Inductor (miniature)

Fig. 8.3.3.2 Circuit symbol

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 64 and 64 . If a project specifies a speaker you must use this higher resistance to prevent damage to the driving circuit.

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

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

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 power connect supply! an LED directly to a battery or

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

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 1000000F = 1F n means 10-9 (thousand-millionth), so 1000nF = 1F 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, 1F +)

Examples:
Fig. 8.3.9.1.1 Polarized capacitor

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 (220F in picture) and radial where both leads are at the same end (10F 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)

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.

Fig.8.3.10.2 Digital Multimeter

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. 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: 200A, 2000A, 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 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

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.

CHAPTER 9

ADVANTAGE & APPLICATION

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

CHAPTER 10 FUTURE ENHANCEMENT

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.

CHAPTER 11 SOFTWARE USED

11.

SOFTWARE USED

1. setupLayo1PCB
2.

dip beta

3. AutoTRAX

CHAPTER 12 REFERENCE

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

CHAPTER 13
DATASHEETS OF COMPONENT USED

13.DATASHEETS OF COMPONENTS USED


M24C16, M24C08

M24C04, M24C02, M24C01


16Kbit, 8Kbit, 4Kbit, 2Kbit and 1Kbit Serial IC Bus EEPROM
FEATURES SUMMARY

Two

Wire I C Serial Interface Supports 400 kHz Protocol

Figure 1. Packages

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
PDIP8 (BN)

8 1

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

8 1
SO8 (MN) 150 mil width

TSSOP8 (DW) 169 mil width

TSSOP8 (DS) 3x3mm body size (MSOP)

SUMMARY DESCRIPTION
These I C-compatible electrically erasable programmable memory (EEPROM) devices are organized as 2048/1024/512/256/128 x 8 (M24C16, M24C08, M24C04, M24C02, M24C01).
2

CC
SDA M24Cxx

3 E0-E2 SCL WC

SS
AI02033

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

E0, E1, E2 SDA SCL WC

Chip Enable Serial Data Serial Clock Write Control Supply Voltage Ground

V V

CC SS

Power On Reset: VCC Lock-Out Write Protect Table 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 NC / NC / E1 / E1 / E1 NC / E2 / E2 / E2 / E2


1
V

SS

2 3

8 7 6 5

CC

WC SCL 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-ORed 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 VIL, 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.

V
20 16

CC
RL RL
C

Maximum RP value (k )

12 MASTER 8 4 0
10
fc = 100kHz

SDA SCL

BUS

fc = 400kH z

C
1000

BUS
AI01665

100 CBUS (pF)

Figure 4. Maximum RL Value versus Bus Capacitance (CBUS) for an I C 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 4bit 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 8th 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).

1 Mode Current Address Read RW bit 1 0 Random Address Read 1 Sequential Read Byte Write Page Write Note: 1. X = VIH or VIL. Table 3. Operating Modes 1 0 0 X X VI L VI L 1 1 16 W C X X 1 reSTART, Device Select, RW = 1 Similar to Current or Random Address Read START, Device Select, RW = 0 START, Device Select, RW = 0 Bytes 1 Initial Sequence START, Device Select, RW = 1 START, Device Select, RW = 0, Address

WC ACK Byte Write START DEV SEL R/W ACK NO ACK DATA IN STOP ACK

BYTE ADDR

WC ACK Page Write DEV SEL NO ACK DATA IN 1 NO ACK DATA IN 3

BYTE ADDR

DATA IN 2

START

R/W

WC (cont'd)

NO ACK Page Write (cont'd)

NO ACK

DATA IN N STOP

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 10 th 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 Writeprotected, 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 BYTE WRITE START DEV SEL R/W BY TE ADDR ACK DATA IN STOP ACK DATA IN 1 ACK DATA IN 2 ACK

WC

ACK PAGE WRITE


START

ACK DATA IN 3

DEV SEL R/W

BYTE ADDR

WC (cont'd)

ACK PAGE WRITE (cont'd)


STOP

ACK

DATA IN N

AI02804B

Figure 8. Write Cycle Polling Flowchart using ACK

WRITE Cycle in Progress

START Condition DEVICE SELECT with RW = 0

NO ACK Returned First byte of instruction with RW = 0 already decoded by the device YES

NO

YES

ReSTART

Send Address and Receive ACK

STOP

NO

START Condition

YES

DATA for the WRITE Operation

DEVICE SELECT with RW = 1

Continue the WRITE Operation

Continue the Random READ Operation

AI01847C

KA78XX/KA78XXA

3-Terminal 1A Positive Voltage Regulator


Features
Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection Output Transistor Safe Operating Area Protection

Description
The KA78XX/KA78XXA series of three-terminal positive regulator are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliverover 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components 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 Input Voltage (for VO = 5V to 18V) (for VO = 24V) Thermal Resistance Junction-Cases (TO220) Thermal Resistance Junction-Air (TO-220) Operating Temperature Range (KA78XX/A/R) Storage Temperature Range Symbol VI VI R JC R JA TOPR TSTG Value 35 40 5 65 0 ~ +125 -65 ~ +150 Unit V V

C/W C/W

C C

Electrical Characteristics (KA7805/KA7805R)


(Refer to test circuit, 0C < TJ < 125 C, IO = 500mA, VI =10V, CI= 0.33 F, CO=0.1 F, unless otherwise specified) KA780 5 Parameter Symbol Conditions Mi n. 4.8 Max Unit Typ. . 5.0 5.2

TJ =+25 oC Output Voltage VO 5.0mA Io 1.0A, PO 15W VI = 7V to V 20V 4.75 5.0 5.25 VO = 7V to 25V 4.0 100 o Line Regulation (Note1) Regline TJ=+25 C mV VI = 8V to 12V 1.6 50 IO = 5.0mA to1.5A 9 100 o Load Regulation (Note1) Regload TJ=+25 C IO =250mA to mV 750mA 4 50 TJ =+25 oC Quiescent Current IQ 5.0 8.0 mA IO = 5mA to 1.0A 0.03 0.5 Quiescent Current Change mA IQ VI= 7V to 25V 0.3 1.3 Output Voltage Drift VO/ T IO= 5mA -0.8 - mV/ oC f = 10Hz to 100KHz, TA=+25 oC Output Noise Voltage VN 42 - V/VO f = 120Hz Ripple Rejection RR VO = 8V to 62 73 dB 18V Dropout Voltage VDrop IO = 1A, TJ =+25 oC 2 V Output Resistance rO f = 1KHz 15 m o VI = 35V, TA =+25 C Short Circuit Current ISC 230 mA TJ =+25 oC Peak Current IPK 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) KA780 6 Parameter Symbol Conditions Min Max Unit . Typ. . 5.75 6.0 6.25 V 5.7 59 6.0 5 1.5 9 3 5.0 -0.8 45 75 2 19 250 2.2 6.3 120 mV 60 120 mV 60 8.0 0.5 mA 1.3 mV/ oC V/Vo dB V m mA A mA

Output Voltage

Line Regulation (Note1)

Load Regulation (Note1) Quiescent Current

Quiescent Current Change

TJ =+25 oC VO 5.0mA IO 1.0A, PO 15W VI = 8.0V to 21V VI = 8V to 25V o Regline TJ =+25 C VI = 9V to 13V IO =5mA to 1.5A Regload TJ =+25 oC IO =250mA to750mA o TJ =+25 C IQ IO = 5mA to 1A VI = 8V to IQ 25V VO/ T IO = 5mA VN RR VDrop rO ISC IPK f = 10Hz to 100KHz, TA =+25 oC f = 120Hz VI = 9V to 19V IO = 1A, TJ =+25 oC f = 1KHz VI= 35V, TA=+25 oC TJ =+25 oC

Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current

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) KA780 8 Parameter Symbol Conditions Mi n. Unit Typ. Max. 8.0 8.0 5.0 2.0 10 5.0 8.3 V VI = 10.5V to 23V VI = 10.5V to 25V TJ =+25 o Regline C VI = 11.5V to 17V IO = 5.0mA to 1.5A TJ =+25 Regload oC IO= 250mA to 750mA TJ =+25 o C IO = 5mA to 1.0A 7.6 8.4 160 mV 80 160 mV 80

Output Voltage

VO

TJ =+25 o C 7.7 5.0mA IO 1.0A, PO 15W

Line Regulation (Note1)

Load Regulation (Note1)

Quiescent Current Quiescent Current Change Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current

IQ IQ

56 -

5.0 0.05 0.5 -0.8 52 73 2 17 230 2.2

8.0 0.5 1.0 -

mA mA mV/ oC V /V o dB V m mA A

VI = 10.5A to 25V IO = VO/ T 5mA f = 10Hz to 100KHz, TA =+25 o C VN RR f = 120Hz, VI= 11.5V to 21.5V VDrop IO = 1A, TJ=+25 oC rO f = 1KHz VI= 35V, TA =+25 oC ISC TJ =+25 o C IPK

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) KA780 9 Parameter Symbol TJ =+25 oC Output Voltage VO V 8.6 56 9 6 2 12 4 5.0 -1 58 71 2 17 250 2.2 9.4 180 mV 90 180 mV 90 8.0 0.5 mA 1.3 - mV/ oC - V/Vo dB V m mA A mA 5.0mA IO 1.0A, PO 15W VI= 11.5V to 24V VI = 11.5V to 25V o Line Regulation (Note1) Regline TJ=+25 C VI = 12V to 17V IO = 5mA to 1.5A o Load Regulation (Note1) Regload TJ=+25 C IO = 250mA to 750mA o TJ=+25 C Quiescent Current IQ IO = 5mA to 1.0A Quiescent Current Change IQ VI = 11.5V to 26V Output Voltage Drift VO/ T IO = 5mA Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current 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.

Conditions

Mi Unit n. Typ. Max. 8.65 9 9.35

f = 10Hz to 100KHz, TA =+25 oC f = 120Hz RR VI = 13V to 23V VDrop IO = 1A, TJ=+25 oC rO f = 1KHz VI= 35V, TA =+25 oC ISC TJ= +25 oC IPK VN

Electrical Characteristics (KA7810)

(Refer to test circuit ,0 C < TJ < 125 C, IO = 500mA, VI =16V, CI= 0.33 F, unless otherwise F, CO=0.1 specified)

KA781 0 Parameter Symbol Conditions TJ =+25 oC 5.0mA IO 1.0A, PO 15W Mi n. 9.6 Unit Typ. Max. 10 10.4 V VI = 12.5V to 25V VI = 12.5V to 25V o Line Regulation (Note1) Regline TJ =+25 C VI = 13V to 25V IO = 5mA to 1.5A Load Regulation (Note1) Regload TJ =+25 oC IO = 250mA to 750mA o TJ =+25 C Quiescent Current IQ IO = 5mA to 1.0A Quiescent Current Change IQ VI = 12.5V to 29V Output Voltage Drift VO/ T IO = 5mA f = 10Hz to 100KHz, TA =+25 oC Output Noise Voltage VN f = 120Hz Ripple Rejection RR VI = 13V to 23V Dropout Voltage VDrop IO = 1A, TJ=+25 oC Output Resistance rO f = 1KHz VI = 35V, TA=+25 oC Short Circuit Current ISC TJ =+25 oC Peak Current IPK 9.5 56 10 10 3 12 4 5.1 -1 58 71 2 17 250 2.2 10.5 200 mV 100 200 mV 400 8.0 0.5 mA mA 1.0 - mV/ oC - V/Vo dB V m mA A

Output Voltage

VO

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 ,0C < TJ < 125 C, IO = 500mA, VI =19V, CI= 0.33 F, CO=0.1 F, unless otherwise specified) KA7812/KA781 2R Min Max Unit . Typ. . 11.5 12 1.0A, PO 15W V VI = 14.5V to 27V VI = 14.5V to 30V TJ =+25 o Line Regulation (Note1) Regline C VI = 16V to 22V IO = 5mA to 1.5A TJ =+25 Load Regulation (Note1) Regload oC IO = 250mA to 750mA TJ =+25 o C Quiescent Current IQ IO = 5mA to 1.0A Quiescent Current Change IQ VI = 14.5V to 30V Output Voltage Drift VO/ T IO = 5mA Output Noise Voltage VN f = 10Hz to 100KHz, TA =+25 oC f = 120Hz Ripple Rejection RR VI = 15V to 25V Dropout Voltage VDrop IO = 1A, TJ=+25 oC Output Resistance rO f = 1KHz Short Circuit Current ISC VI = 35V, TA=+25 oC TJ = +25 Peak Current IPK oC 11.4 12 10 55 3.0 11 5.0 5.1 0.1 0.5 -1 76 71 2 18 230 2.2 12.6 240 mV 120 240 mV 120 8.0 0.5 mA 12.5

Parameter

Symbol TJ =+25 o C 5.0mA IO

Conditions

Output Voltage

VO

mA 1.0 - mV/ oC - V /V o dB V m mA 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 TJ =+25 oC Output Voltage VO V 14.25 15 15.75 11 300 mV 54 VI = 18.5V to 28.5V IO = 1A, TJ=+25 oC f = 1KHz VI = 35V, TA=+25 oC TJ =+25 oC 3 12 150 300 mV 4 150 5.2 8.0 -1 90 70 2 19 250 2.2 0.5 mA 1.0 - mV/ oC V/Vo dB V m mA A mA 5.0mA IO 1.0A, PO 15W VI = 17.5V to 30V VI = 17.5V to 30V o Line Regulation (Note1) Regline TJ =+25 C VI = 20V to 26V IO = 5mA to 1.5A Load Regulation (Note1) Regload TJ =+25 oC IO = 250mA to 750mA o TJ =+25 C Quiescent Current IQ IO = 5mA to 1.0A Quiescent Current Change VI = 17.5V to IQ 30V Output Voltage Drift VO/ T IO = 5mA Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current VN RR VDrop rO ISC IPK f = 10Hz to 100KHz, TA =+25 oC f = 120Hz Conditions KA7815 Max Unit Min. Typ. . 14.4 15 15.6

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) KA78 18 Parameter Symbol TJ =+25 oC Output Voltage VO 5.0mA IO 1.0A, PO 15W VI = 21V to 33V VI = 21V to 33V o TJ =+25 C VI = 24V to 30V IO = 5mA to 1.5A o TJ =+25 C IO = 250mA to 750mA o TJ =+25 C IO = 5mA to 1.0A VI = 21V to 33V IO = 5mA f = 10Hz to 100KHz, TA =+25 oC f = 120Hz VI = 22V to 32V IO = 1A, TJ=+25 oC f = 1KHz VI = 35V, TA=+25 oC TJ =+25 oC V 17.1 53 18 15 5 15 5.0 5.2 -1 110 69 2 22 250 2.2 18.9 360 mV 180 360 mV 180 8.0 0.5 mA 1 - mV/ oC - V/Vo dB V m mA A mA Conditions Mi Max Unit n. Typ. . 17.3 18 18.7

Line Regulation (Note1) Regline

Load Regulation (Note1) Regload Quiescent Current Quiescent Current Change Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current IQ

IQ VO/ T VN RR VDrop rO ISC IPK

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) KA782 4 Parameter Symbol Conditions TJ =+25 oC 5.0mA IO 1.0A, PO 15W VI = 27V to 38V VI = 27V to 38V Line Regulation (Note1) Regline TJ =+25 oC Load Regulation (Note1)Regload TJ =+25 oC Quiescent Current Quiescent Current Change Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current V IQ IQ / T O VN RR VI = 28V to 38V VDrop IO = 1A, TJ=+25 oC rO f = 1KHz ISC VI = 35V, TA=+25 oC IPK TJ =+25 oC VI = 30V to 36V IO = 5mA to 1.5A IO = 250mA to 750mA 50 6 15 5.0 5.2 0.1 0.5 -1.5 60 67 2 28 230 2.2 240 480 mV 240 8.0 0.5 1 mV/ I = 5mA O f = 10Hz to 100KHz, TA =+25 oC f = 120Hz oC V /V o dB V m mA A mA mA Min Unit . Typ. Max. 23 24 25 V 22.8 24 17 25.25 480 mV

Output Voltage

VO

TJ =+25 oC IO = 5mA to 1.0A V I = 27V to 38V

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 Output Voltage Symbol VO IO = 5mA to 1A, PO 15W 4.8 VI = 7.5V to 20V VI = 7.5V to 25V Line Regulation (Note1) Regline VI= 7.3V to 20V TJ =+25 oC VI= 8V to 12V TJ =+25 oC Load Regulation (Note1) IO = 5mA to 1.5A Regload IO = 5mA to 1A IO = 250mA to 750mA TJ =+25 oC IQ IO = 5mA to 1A IQ Change Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current V/ T VN RR VDrop rO ISC IPK VI = 8 V to 25V, IO = 500mA VI = 7.5V to 20V, TJ =+25 oC Io = 5mA f = 10Hz to 100KHz TA =+25 oC f = 120Hz, IO = 500mA VI = 8V to 18V IO = 1A, TJ =+25 oC f = 1KHz VI= 35V, TA =+25 oC TJ= +25 oC 9 9 4 5.0 -0.8 10 68 2 17 250 2.2 100 mV 100 50 6.0 0.5 0.8 0.8 mA mV/ oC V/Vo dB V m mA A 1.5 25 5 50 IO = 500mA VI = 8V to 12V 5 3 50 50 mV 5 5.2 Conditions TJ =+25 oC Min. 4.9 Typ. 5 Max. 5.1 Unit V

Quiescent Current

mA

Quiescent Current

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 Output Voltage Symbol VO IO = 5mA to 1A, PO 15W 5.76 VI = 8.6V to 21V VI= 8.6V to 25V Line Regulation (Note1) Regline VI= 8.3V to 21V TJ =+25 C VI= 9V to 13V TJ =+25 C Load Regulation (Note1) IO = 5mA to 1.5A Regload IO = 5mA to 1A IO = 250mA to 750mA TJ =+25 oC IQ IO = 5mA to 1A IQ VI = 9V to 25V, IO = 500mA VI= 8.5V to 21V, TJ =+25 oC V / T IO = 5mA f = 10Hz to 100KHz TA =+25 oC VN f = 120Hz, IO = 500mA RR VI = 9V to 19V VDrop IO = 1A, TJ =+25 oC rO f = 1KHz VI= 35V, TA =+25 oC ISC TJ=+25 oC IPK 9 4 5.0 4.3 -0.8 10 65 2 17 250 2.2 100 mV 100 50 6.0 0.5 0.8 0.8 o o

Conditions o TJ =+25 C

Typ Min. . Max. Unit 5.58 6 6.12 V 6 5 3 5 1.5 6.24 60 60 mV 60 30

IO = 500mA VI= 9V to 13V

Quiescent Current

mA

Quiescent Current Change Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current

mA mV/ oC V/Vo dB V m mA 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 Output Voltage Symbol VO IO = 5mA to 1A, PO 15W 7.7 VI = 10.6V to 23V VI= 10.6V to 25V Line Regulation (Note1) Regline VI= 10.4V to 23V TJ =+25 C VI= 11V to 17V TJ =+25 oC Load Regulation (Note1) IO = 5mA to 1.5A Regload IO = 5mA to 1A IO = 250mA to 750mA TJ =+25 oC IQ IO = 5mA to 1A IQ VI = 11V to 25V, IO = 500mA VI= 10.6V to 23V, TJ =+25 oC V/ T IO = 5mA f = 10Hz to 100KHz V TA =+25 oC N f = 120Hz, IO = 500mA RR VI = 11.5V to 21.5V VDrop IO = 1A, TJ =+25 oC rO f = 1KHz VI= 35V, TA =+25 oC ISC TJ=+25 oC IPK 12 12 5 5.0 -0.8 10 62 2 18 250 2.2 100 mV 100 50 6.0 2 40
o

Conditions TJ =+25 C
o

Min. Typ. Max. Unit 7.84 8 8.16 V 8 6 3 6 8.3 80 80 mV 80

IO = 500mA VI= 11V to 17V

Quiescent Current

mA

Quiescent Current Change Output Voltage Drift Output Noise Voltage Ripple Rejection Dropout Voltage Output Resistance Short Circuit Current Peak Current

0.5 0.8 mA 0.8 - mV/ oC V/Vo dB V m mA 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

Description
The 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 Atmels 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 contents 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 Configurations
PDIP
(T2) P1.0 (T2 EX) P1.1 P1.2 P1.3 P1.4 (MOSI) P1.5 (MISO) P1.6 (SCK) P1.7 RST (RXD) P3.0 (TXD) P3.1 (INT0) P3.2 (INT1) P3.3 (T0) P3.4

PLCC
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 VCC P0.0 (AD0) P0.1 (AD1) P0.2 (AD2) P0.3 (AD3) P0.4 (AD4) P0.5 (AD5) P0.6 (AD6) P0.7 (AD7) EA/VPP ALE/PROG PSEN P2.7 (A15) P2.6 (A14) P2.5 (A13) P2.4 (A12) P2.3 (A11) P2.2 (A10) P2.1 (A9) P2.0 (A8) (T2 EX) NC VCC ... P0 . (AD0) P0 (AD1) P0 (AD2) P0 (AD3) 1 44 43 42 41 40
39 P0.4
0123

(T1) P3.5
(WR) P3.6 (RD) P3.7 XTAL2 XTAL1 GND

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20

P1

P1 P1 P1

(MOSI) P1.5 (MISO) P1.6 (SCK) P1.7 RST (RXD) P3.0 NC (TXD) P3.1 (INT0) P3.2 (INT1) P3.3 (T0) P3.4 (T1) P3.5

65432

P1

.... 43210 .

(T2)

(AD4)

8 9 10 11 12 13 14 15 16 17 (RD) P3.7 19 XTAL2 20 XTAL1 21 (WR) P3 .6 18 GND 22


.... 01234 .

38 37 36 35 34 33 32 31 30 29 NC (A8) P2 (A9) P2 (A10) P2 (A11) P2 (A12) P2 23 24 25 26 27 28

P0.5 (AD5) P0.6 (AD6) P0.7 (AD7) EA/VPP NC ALE/PROG PSEN P2.7 (A15) P2.6 (A14) P2.5 (A13)

TQFP
P1 1 (T2 EX) P1 0 (T2) NC P0.3 (AD3) 34 33 32 31 30 29 28 27 26 25 24 23 12 13 14 15 16 17 18 19 20 21 22 P0 0 (AD0) P0 1 (AD1) P0 2 (AD2) 37 36 35

VCC 38

P1 4

P1 3 P1 2

(MOSI) P1.5 (MISO) P1.6 (SCK) P1.7 RST (RXD) P3.0 NC (TXD) P3.1 (INT0) P3.2 (INT1) P3.3 (T0) P3.4 (T1) P3.5

1 2 3 4 5 6 7 8 9 10 11

41 40 39

44

43 42

...

. ...

P0.4 (AD4) P0.5 (AD5) P0.6 (AD6) P0.7 (AD7) EA/VPP NC ALE/PROG PSEN P2.7 (A15) P2.6 (A14) P2.5 (A13)

(WR) P3 . 6 (RD) P3 . 7 XTAL2 XTAL1

GND GND ... (A8) P2 . 0 (A9) P2 1 (A10) P2 2 (A11) P2 3 (A12) P2. 4

Block Diagram
P0.0 - P0.7 P2.0 - P2.7

CC

GND

PSEN ALE/PROG EA / VPP RST WATCH DOG ISP PORT PROGRAM LOGIC

P3.0 - P3.7

P1.0 - P1.7

Pin Description
VCC Supply voltage. GND Ground. Port 0 Port 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 highimpedance inputs. Port 0 can also be configured to be the multiplexed loworder 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 1 Port 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 P1.0 P1.1 P1.5 P1.6 P1.7 Alternate Functions T2 (external count input to Timer/Counter 2), clock-out T2EX (Timer/Counter 2 capture/reload trigger and direction control) MOSI (used for In-System Programming) MISO (used for In-System Programming) SCK (used for In-System Programming)

external data memory that use 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pullups 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 3 Port 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 P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 Alternate Functions RXD (serial input port) TXD (serial output port) INT0 (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input) T1 (timer 1 external input) WR (external data memory write strobe) RD (external data memory read strobe)

RST Reset 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/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is

Port 2 Port 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

weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Table 1. AT89S52 SFR Map and Reset Values
0F8H 0F0H 0E8H 0E0H 0D8H 0D0H 0C8H 0C0H 0B8H 0B0H 0A8H 0A0H 98H 90H 88H 80H IP XX000000 P3 11111111 IE 0X000000 P2 11111111 SCON 00000000 P1 11111111 TCON 00000000 P0 11111111 TMOD 00000000 SP 00000111 TL0 00000000 DP0L 00000000 TL1 00000000 DP0H 00000000 SBUF XXXXXXXX AUXR1 XXXXXXX0 PSW 00000000 T2CON 00000000 T2MOD XXXXXX00 RCAP2L 00000000 RCAP2H 00000000 ACC 00000000 B 00000000

Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier.

0FFH 0F7H 0EFH 0E7H 0DFH 0D7H TL2 00000000 TH2 00000000 0CFH 0C7H 0BFH 0B7H 0AFH WDTRST XXXXXXXX 0A7H 9FH 97H TH0 00000000 DP1L 00000000 TH1 00000000 DP1H 00000000 AUXR XXX00XX0 PCON 0XXX0000 8FH 87H

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 Bit Addressable Bit TF2 7 EXF2 6 RCLK 5 TCLK 4 EXEN2 3 TR2 2

Reset Value = 0000 0000B

C/T2 1

CP/RL2 0

Symbol TF2 EXF2

Function Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2 will not be set when either RCLK = 1 or TCLK = 1. 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 be cleared by software. EXF2 does not cause an interrupt in up/down counter mode (DCEN = 1). Receive clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its receive clock in serial port Modes 1 and 3. RCLK = 0 causes Timer 1 overflow to be used for the receive clock. Transmit clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its transmit clock in serial port Modes 1 and 3. TCLK = 0 causes Timer 1 overflows to be used for the transmit clock. Timer 2 external enable. When set, allows a capture or reload to occur as a result of a negative transition on T2EX if Timer 2 is not being used to clock the serial port. EXEN2 = 0 causes Timer 2 to ignore events at T2EX. Start/Stop control for Timer 2. TR2 = 1 starts the timer. Timer or counter select for Timer 2. C/T2 = 0 for timer function. C/T2 = 1 for external event counter (falling edge triggered). Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1. CP/RL2 = 0 causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX when EXEN2 = 1. When either RCLK or TCLK = 1, this bit is ignored and the timer is forced to auto-reload on Timer 2 overflow.

RCLK TCLK EXEN2 TR2 C/T2 CP/RL2

Table 3a. AUXR: Auxiliary Register


AUXR Address = 8EH Not Bit Addressable Bit 7 6 5 WDIDLE 4 DISRTO 3 2 1 DISALE 0 Reset Value = XXX00XX0B

DISALE

Reserved for future expansion Disable/Enable ALE DISALE 0 1 Operating Mode ALE is emitted at a constant rate of 1/6 the oscillator frequency ALE is active only during a MOVX or MOVC instruction

DISRTO

Disable/Enable Reset out DISRTO 0 1 Reset pin is driven High after WDT times out Reset pin is input only

WDIDLE

Disable/Enable WDT in IDLE mode

WDIDLE 0 1 WDT continues to count in IDLE mode 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 Table 3b. AUXR1: Auxiliary Register 1
AUXR1 Address = A2H Not Bit Addressable Bit 7 6 5 4

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.

Reset Value = XXXXXXX0B

DPS 0

DPS

Reserved for future expansion Data Pointer Register Select DPS 0 1 Selects DPTR Registers DP0L, DP0H 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) HBM) is Upgrade With Improved ESD (15-kV and 0.1-mF Charge-Pump Capacitors Available With the MAX202 Applications o TIA/EIA-232-F, BatteryPowered Systems, Terminals, Modems, and Computers

MAX232 . . . D, DW, N, OR NS PACKAGE MAX232I . . . D, DW, OR N PACKAGE (TOP VIEW)

C1+
V

S+ 2 C1 3 C2+ 4 C2 5
V

16 VCC GND 15 T1OU 14 T 13 R1IN R1OU 12 T 11 T1IN 10 T2IN R2OU 9 T

S 6

T2OU T 7 R2IN 8

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 V inputs. Each driver converts TTL/CMOS input levels into 30TIA/EIA-232-F levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments LinASIC library.

TA PDIP (N)

ORDERING INFORMATION ORDERABL TOPE SIDE PACKAGE PART MARKI NUMBER NG Tube of 25 Tube of 40 SOIC (D) Reel of 2500 MAX232DR MAX232N MAX232D MAX232 MAX232N

0 to C 70C Tube of 40 SOIC (DW) Reel of 2000 MAX232DWR SOP (NS) PDIP (N) Reel of 2000 MAX232NSR Tube of 25 Tube of 40 40 to C 85C SOIC (D) Reel of 2500 MAX232IDR Tube of 40 MAX232IDW SOIC (DW) Reel of 2000 MAX232IDWR

MAX232DW MAX232

MAX232 MAX232I N

MAX232IN MAX232ID

MAX232I

MAX232I

Package drawings, standard packing quantities, thermal data, symbolization, and PCB design guidelines are available at www.ti.com/sc/package.

Function Tables EACH DRIVER INPU OUTPU T T TIN TOUT L H H L

H = high level, L = low level EACH RECEIVER INPU OUTPU T T RIN ROUT L H H L

H = high level, L = low level logic diagram (positive logic) 11 T1I N 10 T2I N 12 R1OU T 9 R2OU T 8 R2I N 13 R1I N 7 T2O UT 14 T1O UT

Absolute maximum ratings over operating free-air temperature range (unless otherwise noted) Input supply voltage range, VCC (see Note . . . . . . . . . . . 0.3 V to 6 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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: . . . . 0.3 V to VCC + Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.3 V .................. Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 V Output voltage range, VO: T1OUT, VS 0.3 V to V S+ + T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.3 V . . . . 0.3 V to V CC + R1OUT, R2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.3 V Short-circuit duration: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Unlimited Package thermal impedance, JA (see Notes 2 and 3): D package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73C/W ................ DW package . . . . . . . . . . 57C/W ................ N package . . . . . . . . . . . . 67C/W ................ NS package . . . . . . . . . . . 64C/W Operating virtual junction temperature, . . . . . . . . . . . . . . . . . TJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150C Storage temperature range,stgT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 C to . 150C 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 150C can affect reliability. 3 The package thermal impedance is calculated in accordance with JESD 51-7. Recommended operating conditions MA MINNOM X UNIT
V V

CC IH V IL R1IN, R2IN

Supply voltage High-level input voltage (T1IN,T2IN) Low-level input voltage (T1IN, T2IN) Receiver input voltage MAX232

4.5 2

5.5 0.8 30 70 85

V V V V C

0 40

TA

Operating free-air temperature MAX232I

Electrical characteristics over recommended ranges of supply voltage and operating free-air temperature (unless otherwise noted) (see Note 4 and Figure 4) PARAMETER
I

TEST CONDITIONS VCC = 5.5 All outputs open, V, TA = 25C

MI TYP N 8

MA X UNIT 10 mA

C C Supply current

All typical values are at VCC = 5 V and TA = 25C. NOTE 4: Test conditions are C1C4 = 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) PARAMETE R T1OUT, O H High-level output voltage T2OUT T1OUT, V O L Low-level output voltage T2OUT T1OUT, Output resistance T2OUT ro Short-circuit output T1OUT, I O S current T2OUT I IS Short-circuit input current T1IN, T2IN
V

TEST CONDITIONS MIN RL = 3 k to 5 GND RL = 3 k to GND VS+ = VS = 300 0, VO = 2 V VCC = 5.5 V, VI = 0 VO = 0

TYP

MA X UNIT V 5 V

7 7

10

mA 200 A

All typical values are at VCC = 5 V, TA = 25 C. 2The 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 C1C4 = 1 at V = 5 V 0.5 V. F CC

switching characteristics, VCC = 5 V, TA = 25 (see Note 4) C


PARAMETER TEST CONDITIONS RL = 3 k to 7 k, SR SR(t) Driver slew rate See Figure 2 Driver transition region slew rate Data rate See Figure 3 One TOUT switching 3 120 Vs kbit/s MI MA UNI N TYP X T

30 V s

RECEIVER SECTION Electrical characteristics over recommended ranges of supply voltage and operating free-air temperature range (see Note 4) MA X UNIT V 0.4 V

PARAMETER R1OUT, O H High-level output voltage R2OUT R1OUT, V R2OUT Low-level output voltage OL Receiver positive-going input V IT + R1IN, R2IN threshold voltage
V

TEST CONDITIONS MIN IOH = 1 3.5 mA = 3.2 I mA OL VCC = 5 V, TA = 25C

TYP

1.7

2.4

Receiver negative-going input


V

IT threshold voltage

R1IN, R2IN

VCC = 5 V, VCC = V 5 VCC = 5,

TA = 25C

0.8

1.2

h y s Input hysteresis voltage r i Receiver input resistance

R1IN, R2IN R1IN, R2IN

TA = 25 C

0.2 3

0.5 5

1 V 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 C1C4 = 1 at V = 5 V 0.5 V. F CC

switching characteristics, VCC = 5 V, TA = 25C (see Note 4 and Figure 1)

PARAMETER
t t

TYP UNIT 500 500 ns ns

P L H (R )Receiver propagation delay time, low- to high-level output P H L (R ) Receiver propagation delay time, high- to low-level output

NOTE 4: Test conditions are C1C4 = 1 F at VCC = 5 V 0.5 V