Micro Controllers

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

1) 8085 Microcontroller

8085 is an 8-bit microcontroller. It is built with 40 pins DIP (dual inline package), 4kb of
ROM storage and 128 bytes of RAM storage, 2 16-bit timers. It consists of are four parallel
8-bit ports, which are programmable as well as addressable as per the requirement. An on-
chip crystal oscillator is integrated in the microcontroller having crystal frequency of 12
MHz.

The architecture of 8051 Microcontroller

In the following diagram, the system bus connects all the support devices to the CPU. The
system bus consists of an 8-bit data bus, a 16-bit address bus and bus control signals. All
other devices like program memory, ports, data memory, serial interface, interrupt control,
timers, and the CPU are all interfaced together through the system bus.

Architecture Detai The 8051 Microcontroller Architecture consists of the following major
components:
 Interrupt control: It supports five interrupt sources, which can interrupt the normal
program execution to handle specific events.

 Central Processing Unit (CPU): This is the brain of the microcontroller, which is
responsible for executing instructions and performing arithmetic and logical
operations. The 8051 CPU consists of an ALU, accumulator, registers, and a program
counter.

 Oscillator: It requires an external oscillator to provide a clock signal to the


microcontroller

 Bus control: The 8051 microcontroller includes a bus controller that manages data
transfer between the CPU and peripheral devices, such as memory or input/output
devices.

 4k byte ROM: The 8051 microcontroller architecture includes a 4 kilobyte (4k) read-
only memory (ROM) for storing the program instructions that are executed by the
CPU.

 128-byte RAM: The 8051 microcontroller also has a 128-byte random-access


memory (RAM) for storing data that is used by the program instructions during
runtime.

 Input/Output Ports: They have four 8-bit input/output (I/O) ports that can be
configured as either input or output.

 Timers and Counters: They have two 16-bit timers/counters that can be used for a
variety of tasks such as measuring time intervals, generating PWM signals, and
counting external events.

 Serial Communication Interface(SCI): It has a built-in serial port that can be used
for asynchronous serial communication.

8051 Pin Diagram

The 8051 microcontroller has a total of 40 pins arranged in four groups, namely Port 0, Port
1, Port 2, and Port 3. Here’s a brief explanation of each group:

 Port 0: Pins 32-39 are designated as Port 0 and are used for both input and output
operations. Port 0 can also be used for external memory interfacing.

 Port 1: Pins 1-8 are designated as Port 1 and are used for both input and output
operations. Port 1 also has built-in pull-up resistors that can be activated by writing a
1 to the corresponding bit.

 Port 2: Pins 21-28 are designated as Port 2 and are used for both input and output
operations. Port 2 can also be used for external memory interfacing, and some of its
pins have alternate functions, such as being used as a serial communication interface.

 Port 3: Pins 10-17 are designated as Port 3 and are used for both input and output
operations. Port 3 can also be used for external memory interfacing, and some of its
pins have alternate functions, such as being used as a timer/counter input.
 Vcc: This pin is used to supply power to the microcontroller and is typically
connected to a +5V power source.

 GND: This pin is used as the ground reference for the microcontroller and is typically
connected to the ground.

 XTAL1 and XTAL2: These pins are used to connect an external crystal oscillator
that provides the clock signal for the microcontroller.

 Reset: This pin is used to reset the microcontroller and is typically connected to a
push-button switch.

 ALE: This pin is used as the Address Latch Enable signal and is used to latch the
address from the program counter onto the external memory bus.

 PSEN: This pin is used as the Program Store Enable signal and is used to select the
external ROM for program execution.

 EA: This pin is used to enable/disable external memory interfacing. If this pin is
connected to Vcc, the microcontroller will fetch the program from the external
memory. if it is connected to GND, the microcontroller will fetch the program from
the internal ROM.

2) PIC Microcontroller
PIC (Programmable Interface Controllers) microcontrollers are the worlds smallest
microcontrollers that can be programmed to carry out a huge range of tasks. These
microcontrollers are found in many electronic devices such as phones, computer control
systems, alarm systems, embedded systems, etc. Various types of microcontrollers exist, even
though the best are found in the GENIE range of programmable microcontrollers. These
microcontrollers are programmed and simulated by a circuit-wizard software.

The architecture of PIC Microcontroller


Architectural Details:
1. CPU (Central Processing Unit):
PIC microcontroller’s CPU consists of

 Arithmetic logic unit (ALU)


 Memory unit (MU)
 Control unit (CU)
 Accumulator
ALU is used for arithmetic operations and for logical decisions. Memory is used for storing
the instructions after processing. Control unit is used to control the internal and external
peripherals which are connected to the CPU and accumulator is used for storing the results.

2. MEMORY ORGANIZATION:
PIC microcontroller memory module consists of mainly 3 types of memories:
 PROGRAM MEMORY:
It contains the written program after we burned it in microcontroller. Program Counter
executes commands stored in the program memory, one after the other. Pic microcontroller
can have 8K words x 14 bits of Flash program memory that can be electrically erased and
reprogrammed. Whenever we burn program into the micro, we erase an old program and
write a new one.

 DATA MEMORY:
It is a RAM type which is used to store the data temporarily in its registers. The RAM
memory is classified into banks. Each bank extends up to 7Fh (128 bytes). Number of banks
may vary depending on the microcontroller. PIC16F84 has only two banks. Banks contain
Special Function Registers (SFR) and General Purpose Registers (GPR). The lower locations
of each bank are reserved for the Special Function Registers and upper locations are for
General Purpose Registers.

General Purpose Registers (GPR):


These registers don’t have any special function. These are used for general purpose for
multiplying, addition or subtraction and then storing the results in other registers. CPU can
easily access the data in these registers.

Special Function Registers (SFR):


These registers are used for special purposes and they cannot be used as normal registers.
Their function is set at the time of manufacturing. They perform the function assigned to
them and user cannot change the function of SFR. Three important SFRs for programming
are:

STATUS register: It changes the bank

PORT registers: It assigns logic values 0 or 1 to the ports

TRIS registers: It is a data direction register for input and output

 DATA EEPROM:
This memory allows storing the variables as a result of burning the written program. It is
readable and writable during normal operation (over the full VDD range). This memory is not
directly mapped in the register file. It is indirectly addressed through the SFRs. There are six
SFRs which are used to read and write to this memory (EECON1, EECON2, EEDATA,
EEDATH, EEADR, EEADRH).

3. SERIAL COMMUNICATION:
The transfer of one bit of data at time consecutively over a communication channel is called
Serial Communication. There are three protocols of serial communication:

 USART: It stands for Universal synchronous and Asynchronous


Receiver and Transmitter which provides a serial communication in two
devices. In this protocol data is transmitted and received bit by bit through a
single wire according to the clock pulses. To send and receive data serially the
PIC microcontroller has two pins TXD and RXD.
 SPI Protocol: SPI stands for Serial Peripheral Interface. It is used to send data
between PIC microcontrollers and other peripherals like sensors, shift registers
and SD cards. Three wire SPI communications is supported in PIC
microcontroller between two devices on a common clock source. SPI protocol
has greater data handling capability than that of the USART.I2C
Protocol: I2C stands for Inter Integrated Circuit, and this protocol is used to
connect low speed devices like microcontrollers, EEPROMS and A/D
converters. PIC microcontroller support two wire Interface or I2C
communication between two devices which can work as both Master and
Slave device.
4. INTERRUPTS:
There are 20 internal interrupts and three external interrupt sources in PIC microcontrollers
which are related with different peripherals like ADC, USART, Timers, and CCP etc.

5. I/O PORTS:
Let us take PIC16 series, it consists of five ports, such as Port A, Port B, Port C, Port D and
Port E.

Port A:This port is 7-bit wide and can be used for both input and output. The
status of TRISA register decided whether it is used as input or output port.
 Port B:It is an 8-bit port. This port also can be used as input and output.
Moreover in input mode four of its bits are variable according to the interrupt
signals.
 Port C:It is also an 8-bit port and can be used as both input and output port
which is determined by the status of the TRISC register.
 Port D:This 8-bit port, unlike Port A, B and C is not an input/output port, but
is used as acts as a slave port for the connection to the microprocessor When
in I/O mode Port D all pins should have Schmitt Trigger buffers.
 Port E:It is a 3-bit port which is used as the additional feature of the control
signals to the A/D converter.
6. CCP MODULE:
A CCP module works in the following three modes:

 Capture Mode: In this mode time is captured when a signal is arrived, or we


can say that, when the CCP pin goes high it captures the value of the Timer1.
 Compare Mode: It works same as an analog comparator, which means that
when timer 1’s value reaches some reference value it will give an output
signal.
 PWM Mode: This mode provides a 10 bit resolution pulse and duty cycle that
is programmable.
7. Timers:
Timers and counters are important as timers can tell the time and count. PIC microcontroller
can have up to four timers (depending upon the family) Timer0, Timer1, Timer2 and Timer3.
Timer0 and Timer2 are of 8-bits while the Timer1 and Timer3 are of 16-bits, which can also
be used as a counter. These timers work according to the selected modes.

8. D/A CONVERTER:
There are no analog outputs in PIC Microcontroller. To get analog output we have to use
external Digital-to-Analog Converter (DAC). It can convert 8 bits of digital number from the
eight digital outputs of PIC microcontroller.
9. A/D CONVERTER:
It converts the analog voltage levels to digital voltage values. In PIC Microcontroller, ADC
has 8-channels and has resolution of 10-bit, which means that if we have to convert an analog
voltage between 0V to 5V the converter will divide it to 2^10 levels (1024 levels). The
special function registers ADCON0 and ADCON1 control the operation of ADC. The
converter stores the lower 8 bits in ADRESL register and the upper bits in the ADRESH
register. Reference voltage of 5V is required for the operation of the converter.
3) Motorola 68HC11 Microcontroller
The 68HC11[1] (also abbreviated as 6811 or HC11) is an 8-bit microcontroller. Internally,
the HC11 instruction set is backward compatible with the 6800 and features the addition of a
Y index register.[a] It has two eight-bit accumulators, A and B, two sixteen-bit index registers,
X and Y, a condition code register, a 16-bit stack pointer, and a program counter. In addition,
there is an 8 x 8-bit multiply (A x B), with full 16-bit result, and fractional/integer 16-bit by
16-bit divide instructions. A range of 16-bit instructions treat the A and B registers as a
combined 16-bit D register for comparison (X and Y registers may also be compared to 16-
bit memory operands), addition, subtraction and shift operations, or can add the B
accumulator to the X or Y index registers. Bit test operations have also been added,
performing a logical and function between operands, setting the correct conditions codes, but
not modifying the operands.

Different versions of the HC11 have different numbers of external ports, labeled
alphabetically. The most common version has five ports, A, B, C, D, and E, but some have as
few as 3 ports (version D3). Each port is eight bits wide except for D, which is six bits (in
some variations of the chip, D also has eight bits). It can be operated with an internal program
and RAM (1 to 768 bytes) or an external memory of up to 64 kilobytes. With external
memory, B and C are used as address and data bus. In this mode, port C is multiplexed to
carry both the lower byte of the address and data.

Architectural Details:

68HC11 has a number of pins. Some of these pins are used to control the micro-controller's
operating mode, clock logic, special interrupts, or power. The majority of the pins, however,
have been organized into four 8-bit input/output ports. These ports have the logical
names PORTA, PORTB , PORTC, and PORTD. It is through these four ports that the
68HC11 channels most of its interactions with the outside world.

As mentioned earlier, a micro-controller is often distinguished by the fact that its input/output
devices are directly mapped into RAM. This is also true of the I/O ports in the 68HC11. The
logical names for the I/O ports are associated with absolute addresses in RAM and these
addresses are in turn tied to hardware registers. When an input pin, for example, is set to a
high logical level, then that logic level directly sets the value in the port's hardware register.
Since that hardware register is mapped directly into the micro-controller's address space, a
program can then directly read that register's value by accessing memory.

The I/O ports and other device pins are connected to special subsystems in the 68HC11. The
subsystems shown in figure 3 are briefly described below:

 EPROM: Some versions of the 68HC11 have as much as 4 kilo-bytes of internal


EEPROM. If your program is sufficiently small, then your micro-controller system
would not need external memory chips and could be operated in single-chip mode.
 RAM: The version of the 68HC11 in your MicroStamp11 has 256 bytes of internal
RAM. As mentioned above, some of these bytes are mapped into hardware registers
that are used to control the micro-controller. In reality the MicroStamp11 programmer
only has 192 bytes of RAM that can be used for program variables.
 Serial Peripheral Interface (SPI): This subsystem allows the 68HC11 to
communicate with synchronous serial devices such as serial/parallel slave devices.
 Serial Communication Interface (SCI): This subsystem allows the 68HC11 to
communicate with asynchronous serial devices. The SCI interface is used to
communicate with laptop computers.
 Parallel I/O Interface: This subsystem is generally used to provide the 68HC11 with
a way of writing digital data in parallel to an external device. The usual parallel
device is a memory device. Recall that the 68HC11 has a very limited amount of
internal program memory. If we need to augment the EEPROM in the micro-
controller with additional memory, we use the parallel I/O interface to address, read,
and write data to this external memory chip. When we do this we usually operate the
chip in so-called expanded mode. Running the chip in expanded mode greatly
reduces the number of I/O Ports available to the system. This is because PORTB and
PORTC are connected to the memory chip and hence are unavailable for other
external devices. Since the MicroStamp11 uses an external memory chip, it is running
the 68HC11 in expanded mode and hence only PORTA and PORTD can be used by
the programmer for interfacing with the external world.
 Mode Selection System: This subsystem selects whether the 68HC11 runs in
expanded or single-chip mode. In single chip mode, the 68HC11 allows the user to
have complete control over all four I/O ports. In expanded mode, the 68HC11 uses
ports B and C to address, read, and write to external memory, hence the programmer
can only use PORTA and PORTD. In the MicroStamp11 module, the chip is usually
in expanded mode.
 Clock logic: An important feature of micro-controllers is that they work in real-time.
By real-time, we mean that instruction executions are completed by specified time
deadlines. This means that the micro-controller needs a clock. The clock logic
subsystem provides the real-time clock for the 68HC11. The rate of the clock is
determined by a crystal that is connected to the clock logic pins. The MicroStamp11
has a crystal on the module, so these pins are not available to the programmer.
 Interrupt Logic: Micro-controllers must be able to respond quickly to asynchronous
events. The interrupt logic subsystems provides three pins that can be used to trigger
hardware interrupts. A hardware interrupt automatically transfers software execution
to a specified memory address in response to the hardware event (such as the pin's
logic state going low). We say that this interrupt is generated asynchronously because
the event can occur between ticks of the system's real-time clock. Hardware interrupts
provide a means for assuring that micro-controllers respond in a timely manner to
external events.
 Timer Interrupts: This subsystem generates interrupts that are associated with an
internal timer. Remember that the 68HC11 executes instructions in step with a clock
tick provided by the clock logic subsystem. With each tick of the clock, an internal
register called a timer is incremented. This timer is memory mapped to an address in
RAM with the logical name TCNT. SO at any instant you can fetch the current count
(time) on the timer by simply reading TCNT.

There are two types of interrupts associated with TCNT. An input-compare (IC)
interrupt is generated with a specified input pin changes state. When the IC interrupt
occurs, then the value in TCNT is stored in an input-compare register. This register is
also memory mapped so the programmer can easily read the clock tick when the input
event occurred. Input compare events are often used to make very precise timing
measurements.

The other type of timer interrupt is called an output compare (OC) interrupt. The
output compare event occurs when TCNT matches the value stored in an output
compare register. The output compar register is also memory mapped, so its value can
be easily set by the programmer. Output compare events are often used to force the
micro-controller to respond to timed events.

You might also like