Microcontroller Architecture

Posted by Unknown on Senin, 30 Mei 2011

Microcontroller and microprocessor

There are some basic things that differentiates between the microcontroller with the microprocessor include a hardware architecture and application.

1. Architectural hardware
Microprocessor is a Central processing unit (CPU) of the microcomputer system still requires additional units such as RAM, ROM, and so forth. While the microcontroller in single chip CPU, RAM, ROM and other supporting units have been integrated in it. In the picture below terintegral units in a microcontroller.


Block diagram of microcomputer system


2. Applications
Created as a CPU microprocessor of the microcomputer system which processes information in the system microcomputer while the microcontroller is made to application-oriented in terms of controlling a device Input / Output

Architecture AT89S8252
8051 family microcontroller originally developed by Intel, but in its development with several other companies to develop an 8-bit microcontroller is also like Atmel, Motorola, AMD, Fujitsu and Philips. In this training to use AT89S8252 microcontroller produced by Atmel.


The specialty of the microcontroller AT89S8252
These include:


• Compatible with MCS-51 microcontroller family
• 8K Bytes of In-system Reprogrammable Downloadable Flash Memory
• SPI serial interface to download the program
• Resilience: 1,000 times Read / Write
• 2K Bytes EEPROM with resilience 100,000 times read / write.
• 4.0V operating voltage until 6V
• Operates at 0 Hz to 24 MHz
• Three-level locking program memory
• 256 x 8-bit Internal RAM
• 32 programmable I / O Lines
• Three Timer / Counters 16-bit
• Nine Interrupt Sources
• UART channel programmable
• SPI serial interface
• Low Power Idle and Power Down Modes
• Programmable Watchdog Timer
• Dual Data Pointer
• Power Off Flag

configure pin AT89S52

AT89S8252 pin

AT89S8252 microcontroller has 24 pins are multifunctional such as I / O, control point or part of the addressing system or data bus

Port 0
Port 0, pins 32 are at -39, is a port that has many functions for a simple system that is a path I / O common. For systems that have a higher level then this port into a multiplexed address and data bus on the use of external memory

Port 1
Port 1, are on pins 1-8, marked with P1.0, P1.1, P1.n commonly used for interfacing with other devices outside the microcontroller.

Port 2
Port 0, pins 21 are at -28, is a port that has many functions for systems with a simple komplektisitas level as the path I / O common.

Port 3
This port has a wide variety of functions as I / O multifunctional within and also can be used as a Port I / O common


configure pin AT89S52


PSEN (Program Store Enable)

Being at Pin Pin No. 29, which is responsible for sending an output signal which served as a control that allows an external program (code) memory. Usually PSEN pin is connected to the EPROM in the Output Enable (OE) which allow to do the reading program in the EPROM

ALE (Address Latch Enable)

In the MCS-51 microcontroller ALE is used as a demultiplexing address and data lines. When Port 0 is used as a data point and the low byte of the address lines. ALE address latch signal to the external registers for half a cycle of memory and proceed with data transmission at half the next memory cycle. ALE pulse of 1 / 6 of the microcontroller oscillator frequency

EA (External Access)

In the EA pin there are 2 state of the state High (5 V) and Low (0 V). If the pin is in a high state of the microcontroller is executing a program of internal ROM while in case of low then the program is executing from external memory and does not enable the internal ROM

RST (Reset)

Located on the Pin No. 9. when activated RST the internal registers on the MCS-51 will be in the "load" on a particular value for start-ups.

Power Connections

Microcontroller MCS-51 uses a single +5 Volt power supply that is connected to Pin No. 40 and ground on pin 20.

Memory Organization

The structure of memory on the MCS-51 is separated into 2 parts, namely the data memory and code memory. Internal memory on the MCS-51 contains a memory "on-chip ROM" and "On-chip data RAM. " RAM itself has a variety of functions, namely:

1. General data storage
2. Storage bits that can dialamati
3. Bank register
4. Special function registers.

General Data Storage

In general storage RAM can be accessed freely using the method of addressing any direct or indirect addressing. Large RAM addressing system that is 80 btyes (from 30h - 7FH)

Direct Addressing: mov A, 45H
Indirect Addressing: mov R0, 45H
Mov A, @ R0

Storage Bits can Addressing

One of the bits that can dialamati location is in the public at 20h - 2FH this means there are 128 bits that can be given the address. Bits that can dialamati can we set our liking.
SETB 67H
Bank register

8051 microcontroller has a register bank at 00 - 07H. This register bank from R0 - R7. The use of registers is very quick and effective than the same instruction using direct addressing

Mov A, R5; Operation 1 byte
Mov A, 05H; Operations 2 bytes

Special Function Regiter

Program Status Word

• Carry Flag
It has 2 uses a bit that holds the flag on mathematical operations as well as "boolean accumulator"

Ex: Add A, # 1; A = FFH
Then CY = 1

ANL C, 22h

• Auxiliary Carry Flag
When adding the value of "binary coded decimal. " Auxiliary Carry Flag (AC) would be worth 1 if the results at the lower nibble is in the range 0AH - 0FH

• Flag 0
Flag 0 (F0) is a bit flag which has the generic functions that are available for user applications

• Bank Select Register
Register Bank Select bit (RS 0 and RS1) function to determine the active register bank. RS 0 and RS1 on the "clear" after a system reset or changed through the software

• Overflow flag
Overflow flag will terset if the arithmetic operation produces an overflow produces numbers

• Parity Bit
This bit will automatically terset or are "clear" on each machine cycle to produce even parity to the accumulator. Parity bit is most often used in serial communication.

Register B

Used in multiplication and division operations. Command 8-bit MUL AB multiplies the value of A and B produces the value 16 in A (low-byte) and B (high - bytes). DIV AB instruction divides the value of A with B and generate integers in A and the remainder in register B

Stack Pointer

Stack pointer is an 8 bit register which is located at 81H. Data storage means adding value on the stack stack stack pointer and retrieve data will reduce the value of the stack pointer
Stack initialization process carried out for the bank registers available, this initialization process can be done in software
Example: mov SP, # 5FH; stack will start at 60H

Data Pointer

Data Pointer is used to perform the access code / data memory externally. Data Pointer (DPTR) is a 16-bit registers.
Example: mov A, # 44H
Mov DPTR, # 1000H
Mov @ DPTR, A
Port Register

All ports are bits that can be given the address, it is certainly easier for users to exercise control. To give instructions to by accessing the port address or the dot operator
Example: SETB P1.7, # 1
SETB 97H

Timer Register

AT89S8252 microcontroller consists of three 16 bit timer that functions as an interval timer or an event count of timer 0, timer 1 and timer 2. The operation timer is set by the Timer Mode Register (TMOD) and Timer Control (TCON).


Serial Register
MCS-51 microcontroller is equipped with facilities to enable microcontroller to communicate with other devices in a serial. Register on the MCS-51 Microcontroller Serial data buffer (SBUFF) Serves as a registry that handles the process of sending and receiving data. Write data on SBUFF means we will menstransmisikan serial data while reading the data on SBUFF means we receive serial data
Serial communication setting is set in register SCON

Interrupt register

Interruptions will be active if we set the interrupt enable register. Priority interrupt can be set via register interrupt Priority Register (IP)

Power Control Register

Maca contains various control bits include:

• Idle Mode
In Idle mode the internal clock will be closed to the CPU but not to interrupt, timer and serial port function. Idle mode can be terminated by interrupt or reset system

• Power Down Mode
If this mode is run it will have implications:
1. On-chip Oscillator stop
2. all functions stop
3. All contents of the On-chip RAM is stored
4. Port Pin arrested at their respective logic levels - each

External Memory
MCS-51 microcontroller didasain to be able to expand into a variety of additional devices. One of these devices are external memory. When accessing external memory Port 0 can not be used as an I / O to other devices because it is used as multiplexed address and data lines.

ROM (Read Only Memory)
This ROM contains the programs to be run by the microcontroller. ROM can be read not only be written at the time of execution of the program. To remove a program in ROM there are various ways to suit the type of ROM, for example:
• For EPROM (Eraseable Programmable ROM) can be removed by using Ultra Violet light for about 15 minutes. After the EPROM can be written using the program EPROM programmer.
• To EEPROM (Electric Eraseable Programmable ROM) can be removed by giving 5 volts for a few moments at a certain distance, after which it can be rewritten by using the EEPROM or EPROM programmers.

In mirkontroller AT89S8252 ISP has included technology (In System Programming) so pengahapusan and charging can be done without using EEPROM programmer. To fill the program in ROM, AT89S8252 microcontroller is connected with a parallel interface to the computer and the program can be downloaded by using software AEC_ISP.

{ 0 comments... read them below or add one }

Posting Komentar