Sunteți pe pagina 1din 8

7 CHAPTER 3 MICROCONTROLLER AT89s52 3.1 INTRODUCTION A microcontroller is an integrated chip that is often part of an embedded system.

The microcontroller includes a CPU, RAM, ROM, I/O ports, and timers like a standard computer, but because they are designed to execute only a single specific task to control a single system, they are much smaller and simplified . 3.1.1 Architecture Architecture of Microcontroller is classified into two types: Data Flow and Instruction. Data Flow There are two types of architecture in data flow. They are : Von Neumann Architecture Harvard Architecture One shared memory is only available for instructions (program) and data instructions and data have to be fetched in sequential order in case of Von Neumann architecture. The Harvard architecture on the other hand uses physically separate memories for their instructions

8 and data, requiring dedicated buses for each of them. Instructions and Operands can therefore be fetched simultaneously. 3.1.2 Instruction Type There are two types of architecture in instruction type. They are CISC RISC CISC CISC architecture supports as many as 200 instructions. A CISC microprocessor contains a more complex set of instructions that it responds to and some of these instructions cannot be completed in one machine cycle. RISC This is a type of architecture that recognizes a relatively limited number of instructions. Until the mid-1980s, the tendency among computer manufacturers was to build increasingly complex CPUs that had ever-larger sets of instructions . At that time, however, a number of computer manufacturers decided to reverse this trend by building CPUs capable of executing only a very limited set of instructions. One advantage of reduced instruction set computers is that they can execute their instructions very fast because the instructions are so simple.

9 3.1.3 8- Bit Controller Application volumes for the 8-bit microcontrollers may be as high as the 4-bit models, or they may be very low. Application sophistication can also range from simple application control to high-speed machine control and data collection. For these reasons, the microcontroller vendors have established extensive families of similar models. All features a common language, but differ in the amount of internal ROM, RAM, and other cost-sensitive features. Often the memory can be expanded to include off-chip ROM and RAM; in some cases, the microcontroller has no on-board ROM at all, or the ROM is an electrically reprogrammable read only memory (EPROM). Manufacture: Pins/I/O Counter RAM ROM : : : : Intel 8051 40/32 2 256bytes 8K

3.2 FEATURES OF AT89s52


8 bit Microcontroller 8K bytes of Flash Programmable and Erasable ROM Fully Static Operation: 0 Hz to 24 MHz 10

256* 8-bit Internal RAM 32 Programmable I/O Lines 6 Interrupt Sources Two 16 bit Timer/Counters Programmable Serial Channel Low Power Idle and Power-down modes Three level Program Memory Lock

3.3 PIN DESCRIPTION Vcc: Supply Voltage (Pin 40) GND: Ground (Pin 20) Port 0 It occupies a total of 8 pins (32-39) which can be used as both input and output. To use the pins of port 0 as both input and output ports, each pin must be connected externally to a 10K pull-up resistor .This is due to the fact that P0 is an open drain, unlike P1,P2,P3. When 1s are written to port 0 pins, they can be used as high impedance inputs. Port 0 may also be configured to be a multiplexed low order address/data bus during accesses to external program and data memory. It receives code bytes during flash programming.

11

Port 1 It occupies a total of 8 pins(1-8). It is bidirectional port with internal pull ups. When 1s are written to port 1, they can be used as inputs. It receives low order address bytes during flash programming and verification. Port 2 It occupies a total of 8 pins (21-28). It is a bidirectional port with internal pull ups. When 1s are written to port 1, they can be used as inputs. It emits higher order address bytes during fetches from external program memory and during accesses to external data memory that uses 16 bit address. It receives higher order address bits and control signals during flash programming and verification. Port 3 It occupies a total of 8 pins (10-17). It is a bidirectional port with internal pull ups.When 1s are written to port 3, they are used as inputs. It also receives control signals during flash programming and verification. Port 3 has the additional function of providing some extremely important signals such as interrupts. P3.0 and P3.1 are used for RxD and TxD serial communication signals. Bits 3.2 and 3.3 are set for external interrupts. Bits 3.3 and 3.4 are used for timers 0 and 1. Pins 3.6 and 3.7 are used to provide the read and write signals( active- low) of external memories.

12

Table 3.1 Pin details of Port 3 Special Function Port RST Reset Input (Pin 9). A high on this pin (normally low) for two machine cycles while the oscillator is running resets the device. This is often referred to as Power-On reset. Activating a power-on reset will cause all values in the registers to be lost. It will set Program Counter to all 0s. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. (Pin 19) XTAL2 Output from the inverting oscillator amplifier (Pin 20). 13

ALE/PROG Address Latch Enable output pulse (Pin 30) 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. PSEN Program Store Enable is the read strobe to external program memory (Pin 29). EA/VPP External Access Enable (Pin 31). EA must be strapped to ground in order to enable the device to fetch code from external program memory locations. EA should be strapped to Vcc for internal program executions. It also receives the 12V programming enable voltage during flash programming. 3.4 ADVANTAGES OF AT89C51 Cost effective Low Power Highly flexible High performance

14

Figure 3.1 Pin Diagram of AT89C51

S-ar putea să vă placă și