AT89S528051 is the name of a big family of microcontrollers. The device which we used in our project was theAT89S52 which is a typical 8051 microcontroller manufactured by Atmel™. The block diagram providedby Atmel™ in their datasheet that showed the architecture of 89S52 device seemed a bit complicated. Asimpler architecture can be represented belowThe 89S52 has 4 different ports, each one having 8 Input/output lines providing a total of 32 I/O lines.Those ports can be used to output DATA and orders do other devices, or to read the state of a sensor, ora switch. Most of the ports of the 89S52 have dual function meaning that they can be used for twodifferent functions.The first one is to perform input/output operations and the second one is used to implement specialfeatures of the microcontroller like counting external pulses, interrupting the execution of the programaccording to external events, performing serial data transfer or connecting the chip to a computer toupdate the software. Each port has 8 pins, and will be treated from the software point of view as an 8-bit variable called register, each bit being connected to a different Input/Output pin.There are two different memory types: RAM and EEPROM. Shortly, RAM is used to store variable duringprogram execution, while the EEPROM memory is used to store the program itself, thats why it is oftenreferred to as the program memory. It is clear that the CPU (Central Processing Unit) is the heart of themicro controllers. It is the CPU that will Read the program from the FLASH memory and Execute it byinteracting with the different peripheralsDiagram below shows the pin configuration of the 89S52, where the function of each pin is written nextto it, and, if it exists, the dual function is written between brackets. Note that the pins that have dualfunctions can still be used normally as an input/output pin. Unless the program uses their dualfunctions, all the 32 I/O pins of the microcontroller are configured as input ouput pins1. DescriptionThe AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-systemprogrammable Flash memory. The device is manufactured using Atmel’s high-density nonvolatilememory technology and is compatible with the industry-standard 80C51 instruction set and pinout. Theon-chip Flash allows the programmemory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. Bycombining a versatile 8-bit CPU with in-system programmable Flash ona monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides ahighly-flexible and cost-effective solution to many embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytesof RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, asix-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 operationdown 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, andinterrupt system to continue functioning. The Power-down mode saves the RAM contents but freezesthe oscillator, disabling all other chip functions until the next interruptor hardware resetlcd:A liquid crystal display (LCD) is a flat panel display, electronic visual display, or video display that usesthe light modulating properties of liquid crystals. Liquid crystals do not emit light directly.LCDs are available to display arbitrary images (as in a general-purpose computer display) or fixed imageswhich can be displayed or hidden, such as preset words, digits, and 7-segment displays as in a digitalclock. They use the same basic technology, except that arbitrary images are made up of a large numberof small pixels, while other displays have larger elements.LCDs are used in a wide range of applications including computer monitors, televisions, instrumentpanels, aircraft cockpit displays, and signage. They are common in consumer devices such as videoplayers, gaming devices, clocks, watches, calculators, and telephones, and have replaced cathode raytube (CRT) displays in most applications. They are available in a wider range of screen sizes than CRT andplasma displays, and since they do not use phosphors, they do not suffer image burn-in. LCDs are,however, susceptible to image persistence.The LCD is more energy efficient and can be disposed of more safely than a CRT. Its low electrical powerconsumption enables it to be used in battery-powered electronic equipment. It is an electronicallymodulated optical device made up of any number of segments filled with liquid crystals and arrayed infront of a light source (backlight) or reflector to produce images in color or monochrome. Liquid crystalswere first developed in 1888. By 2008, worldwide sales of televisions with LCD screens exceededannual sales of CRT units; the CRT became obsolete for most purposes.loudspeaker:A loudspeaker (or "speaker") is an electroacoustic transducer that produces sound in response to anelectrical audio signal input. Non-electrical loudspeakers were developed as accessories to telephonesystems, but electronic amplification by vacuum tube made loudspeakers more generally useful. The
most common form of loudspeaker uses a paper cone supporting a voice coil electromagnet acting on apermanent magnet, but many other types exist. Where accurate reproduction of sound is required,multiple loudspeakers may be used, each reproducing a part of the audible frequency range. Miniatureloudspeakers are found in devices such as radio and TV receivers, and many forms of music players.Larger loudspeaker systems are used for music, sound reinforcement in theatres and concerts, and inpublic address systems.In-System Programming (ISP): is the ability of some programmable logic devices, microcontrollers, and other programmable electronicchips to be programmed while installed in a complete system, rather than requiring the chip to beprogrammed prior to installing it into the system.The primary advantage of this feature is that it allows manufacturers of electronic devices to integrateprogramming and testing into a single production phase, rather than requiring a separate programmingstage prior to assembling the system. This may allow manufacturers to program the chips in their ownsystems production line instead of buying preprogrammed chips from a manufacturer or distributor,making it feasible to apply code or design changes in the middle of a production run.Typically, chips supporting ISP have internal circuitry to generate any necessary programming voltagefrom the systems normal supply voltage, and communicate with the programmer via a serial protocol.Most programmable logic devices use a variant of the JTAG protocol for ISP, in order to facilitate easierintegration with automated testing procedures. Other devices usually use proprietary protocols orprotocols defined by older standards. In systems complex enough to require moderately large glue logic,designers may implement a JTAG-controlled programming subsystem for non-JTAG devices such as flashmemory and microcontrollers, allowing the entire programming and test procedure to be accomplishedunder the control of a single protocol.An example of devices using ISP is the AVR line of micro-controllers by Atmel such as the ATmega seriesStep down transformersare designed to reduce electrical voltage. Their primary voltage is greater than their secondary voltage.This kind of transformer "steps down" the voltage applied to it. For instance, a step down transformer isneeded to use a 110v product in a country with a 220v supply.Step down transformers convert electrical voltage from one level or phase configuration usually down toa lower level. They can include features for electrical isolation, power distribution, and control andinstrumentation applications. Step down transformers typically rely on the principle of magneticinduction between coils to convert voltage and/or current levels.Step down transformers are made from two or more coils of insulated wire wound around a core madeof iron. When voltage is applied to one coil (frequently called the primary or input) it magnetizes the
iron core, which induces a voltage in the other coil, (frequently called the secondary or output). Theturns ratio of the two sets of windings determines the amount of voltage transformation.An example of this would be: 100 turns on the primary and 50 turns on the secondary, a ratio of 2 to 1.Step down transformers can be considered nothing more than a voltage ratio device.With step down transformers the voltage ratio between primary and secondary will mirror the "turnsratio" (except for single phase smaller than 1 kva which have compensated secondaries). A practicalapplication of this 2 to 1 turns ratio would be a 480 to 240 voltage step down. Note that if the inputwere 440 volts then the output would be 220 volts. The ratio between input and output voltage will stayconstant. Transformers should not be operated at voltages higher than the nameplate rating, but maybe operated at lower voltages than rated. Because of this it is possible to do some non-standardapplications using standard transformers.Single phase step down transformers 1 kva and larger may also be reverse connected to step-down orstep-up voltages. (Note: single phase step up or step down transformers sized less than 1 KVA shouldnot be reverse connected because the secondary windings have additional turns to overcome a voltagedrop when the load is applied. If reverse connected, the output voltage will be less than desired)transformer (tr ns-fôr m r)A device used to change the voltage of an alternating current in one circuit to a different voltage in asecond circuit, or to partially isolate two circuits from each other. Transformers consist of two or more coilsof conducting material, such as wire, wrapped around a core (often made of iron). The magnetic fieldproduced by an alternating current in one coil induces a similar current in the other coils. If there arefewer turns on the coil that carries the source of the power than there are on a second coil, the secondcoil will provide the same power but at a higher voltage. This is called a step-up transformer. If thereare fewer turns on the second coil than on the source coil, the outgoing power will have a lower voltage.This is called a step-down transformer.The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using both half cycles of theinput ac voltage. The Bridge rectifier circuit is shown in the figure. The circuit hasfour diodes connected to form a bridge. The ac input voltage is applied to thediagonally opposite ends of the bridge. The load resistance is connected between theother two ends of the bridge.For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas
diodes D2 and D4 remain in the OFF state. The conducting diodes will be in serieswith the load resistance RL and hence the load current flows through R L.For the negative half cycle of the input ac voltage, diodes D2 and D4 conductwhereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in serieswith the load resistance RL and hence the current flows through R L in the samedirection as in the previous half cycle. Thus a bi-directional wave is converted into aunidirectional wavefilterIt is sometimes desirable to have circuits capable of selectively filtering one frequency orrange of frequencies out of a mix of different frequencies in acircuit. A circuit designed toperform this frequency selection is called a filter circuit, or simply a filter. A common needfor filter circuits is in high-performance stereo systems, where certain ranges of audiofrequencies need to be amplified or suppressed for best sound quality and power efficiency.You may be familiar with equalizers, which allow the amplitudes of several frequency rangesto be adjusted to suit the listeners taste and acoustic properties of the listening area. Youmay also be familiar with crossover networks, which block certain ranges of frequenciesfrom reaching speakers. A tweeter (high-frequency speaker) is inefficient at reproducinglow-frequency signals such as drum beats, so a crossover circuit is connected between thetweeter and the stereos output terminals to block low-frequency signals, only passing high-frequency signals to the speakers connection terminals. This gives better audio systemefficiency and thus better performance. Both equalizers and crossover networks areexamples of filters, designed to accomplish filtering of certain frequenciesave.Flash memory is a non-volatile computer storage chip that can be electrically erased and reprogrammed.It was developed from EEPROM (electrically erasable programmable read-only memory) and must beerased in fairly large blocks before these can be rewritten with new data. The high density NAND typemust also be programmed and read in (smaller) blocks, or pages, while the NOR type allows asingle machine word (byte) to be written or read independently.The NAND type is primarily used in memory cards, USB flash drives, solid-state drives, and similarproducts, for general storage and transfer of data. The NOR type, which allows true random access andtherefore direct code execution, is used as a replacement for the older EPROM and as an alternative tocertain kinds of ROM applications. However, NOR flash memory may emulate ROM primarily atthe machine code level; many digital designs need ROM (or PLA) structures for other uses, often atsignificantly higher speeds than (economical) flash memory may achieve. NAND or NOR flash memory isalso often used to store configuration data in numerous digital products, a task previously made possibleby EEPROMs or battery-powered static RAM.