Sie sind auf Seite 1von 5

[Type text]

MICROCONTROLLER:-

The integrated circuit from an Intel 8742, an 8-bit microcontroller that includes a CPU running at 12 MHz, 128 bytes of RAM, 2048 bytes of EPROM, and I/O in the same chip. A micro-controller (also MCU or C) is a functional computer system-on-a-chip. It contains a processor core, memory, and programmable input/output peripherals. Microcontrollers include an integrated CPU, memory (a small amount of RAM, program memory, or both) and peripherals capable of input and output. It emphasizes high integration, in contrast to a microprocessor which only contains a CPU (the kind used in a PC). In addition to the usual arithmetic and logic elements of a general purpose microprocessor, the microcontroller integrates additional elements such as read-write memory for data storage, read-only memory for program storage, Flash memory for permanent data storage, peripherals, and input/output interfaces. At clock speeds of as little as 32 KHz, microcontrollers often operate at very low speed compared to microprocessors, but this is adequate for typical applications. They consume relatively little power (mill watts), and will generally have the ability to retain functionality while waiting for an event such as a button press or interrupt. Power consumption while sleeping (CPU and peripherals off) may be just nanowatts, making them ideal for low power and long lasting battery applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, remote controls, office machines, appliances, power tools, and toys. By reducing the size, cost, and power consumption compared to a design using a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to electronically control many more processes. A designer will use a Microcontroller to gather input from various sensors Process this input into a set of actions Use the output mechanisms on the Microcontroller to do something useful. The 'general purpose' attribute of a Microcontroller is very significant, and shouldn't be overlooked. A general purpose Microcontroller is a very powerful tool that allows a designer to create a special purpose design. The design becomes partially hardware and partially software. There is great flexibility in the software end, as the designer can create practically unlimited variations on the design by changing the software. A Microcontroller has several major sections that are pretty typical no matter which type or version of Microcontroller you end up using. Talking about Microcontrollers in the abstract is going to be pretty boring, so I am going to focus this section around the Motorola MC68HC11. I will discuss alternative chips later in the article. The CPU core is the 'computer' part of the Microcontroller. Its job is to run the program supplied by the designer. It does this by using memory, some registers, and the program memory. As seen in the block diagram above, the M68HC11 CPU is called out as a subcomponent of the chip as a whole.

[Type text]

Basic Pins:PIN 9: PIN 9 is the reset pin which is used reset the microcontrollers internal
registers and ports upon starting up.

PINS 18 and 19: The 8051 has a built-in oscillator amplifier hence we need to
only connect a crystal at these pins to provide clock pulses to the circuit.

PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip
needs +5V 500mA to function properly, although there are lower powered versions like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.

PINS 29, 30 and 31: As described in the features of the 8051, this chip contains
a built-in flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If external memory is connected then PIN 31, also called EA/VPP, and should be connected to ground to indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which is used when multiple memory chips are connected to the controller and only one of them needs to be selected. We

[Type text]

Ports:There are 4 8-bit ports: P0, P1, P2 and P3. PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional functions associated with them based upon the context of their usage. PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter inputs, read and write pins for memory access. PORT P2 (pins 21 to 28) : PORT P2 can also be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P2 will act as an address bus in conjunction with PORT P0 to access external memory. PORT P2 acts as A8-A15, as can be seen from figure. PORT P0 (pins 32 to 39) : PORT P0 can be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P0 acts as a multiplexed address and data bus that can be used to access external memory in conjunction with PORT P2. P0 acts as AD0-AD7 Input/output Ports (I/O Ports) All 8051 microcontrollers have 4 I/O ports, each consisting of 8 bits which can be configured as inputs or outputs. This means that the user has on disposal in total of 32 input/output lines connecting the microcontroller to peripheral devices. A logic state on a pin determines whether it is configured as input or output: 0=output, 1=input. If a pin on the microcontroller needs to be configured as output, then logic zero (0) should be applied to the appropriate bit on I/O port. In this way, a voltage level on the appropriate pin will be 0. Similar to that, if a pin needs to be configured as input, then a logic one (1) should be applied to the appropriate port. In this way, as a side effect a voltage level on the appropriate pin will be 5V (as it is case with any TTL input). This may sound a bit confusing but everything becomes clear after studying a simplified electronic circuit connected to one I/O pin.

[Type text]

2.4 8051 Microcontroller Memory Organization


The microcontroller memory is divided into Program Memory and Data Memory. Program Memory (ROM) is used for permanent saving program being executed, while Data Memory (RAM) is used for temporarily storing and keeping intermediate results and variables. Depending on the model in use (still referring to the whole 8051 microcontroller family) at most a few Kb of ROM and 128 or 256 bytes of RAM can be used. HoweverAll 8051 microcontrollers have 16-bit addressing bus and can address 64 kb memory. It is neither a mistake nor a big ambition of engineers who were working on basic core development. It is a matter of very clever memory organization which makes these controllers a real programmers tidbit.

Program Memory
The oldest models of the 8051 microcontroller family did not have internal program memory. It was added from outside as a separate chip. These models are recognizable by their label beginning with 803 (for ex. 8031 or 8032). All later models have a few Kbytes ROM embedded, Even though it is enough for writing most of the programs, there are situations when additional memory is necessary. A typical example of it is the use of so called lookup tables. They are used in cases when something is too complicated or when there is no time for solving equations describing some process. The example of it can be totally exotic (an estimate of self-guided rockets meeting point) or totally common (measuring of temperature using non-linear thermo element or asynchronous motor speed control). In those cases all needed estimates and approximates are executed in advance and the final results are put in the tables.

How does the microcontroller handle external memory depend on the pin EA logic state?

[Type text]

EA=0
In this case, internal program memory is completely ignored, only a program stored in external memory is to be executed.

EA=1
In this case, a program from built-in ROM is to be executed first (to the last location). Afterwards, the execution is continued by reading additional memory. In both cases, P0 and P2 are not available to the user because they are used for data and address transmission. Besides, the pins ALE and PSEN are used too.

Data Memory
As already mentioned, Data Memory is used for temporarily storing and keeping data and intermediate results created and used during microcontrollers operating. Besides, this microcontroller family includes many other registers such as: hardware counters and timers, input/output ports, serial data buffers etc. The previous versions have the total memory size of 256 locations, while for later models this number is incremented by additional 128 available registers. In both cases, these first 256 memory locations (addresses 0-FFh) are the base of the memory. Common to all types of the 8051 microcontrollers. Locations available to the user occupy memory space with addresses from 0 to 7Fh. First 128 registers and this part of RAM are divided in several blocks. The first block consists of 4 banks each including 8 registers designated as R0 to R7. Prior to access them, a bank containing that register must be selected. Next memory block (in the range of 20h to 2Fh) is bit- addressable, which means that each bit being there has its own address from 0 to 7Fh.

Das könnte Ihnen auch gefallen