[go: up one dir, main page]

0% found this document useful (0 votes)
34 views34 pages

Unit 5-Typed Notes

This document provides information on programming timers in 8051 microcontrollers. It discusses the two timers, Timer0 and Timer1, contained in the 8051 and how they are configured using registers. The timers count at a rate of 1MHz when using a 12MHz crystal. The document describes starting, stopping, and configuring the timers using various registers. It also explains using the timers via polling and interrupt methods, detailing the algorithms for each. Finally, it discusses the four timer modes - modes 0 through 3 - that are selected using bits in the TMOD register.

Uploaded by

Aparna durairaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views34 pages

Unit 5-Typed Notes

This document provides information on programming timers in 8051 microcontrollers. It discusses the two timers, Timer0 and Timer1, contained in the 8051 and how they are configured using registers. The timers count at a rate of 1MHz when using a 12MHz crystal. The document describes starting, stopping, and configuring the timers using various registers. It also explains using the timers via polling and interrupt methods, detailing the algorithms for each. Finally, it discusses the four timer modes - modes 0 through 3 - that are selected using bits in the TMOD register.

Uploaded by

Aparna durairaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

UNIT V INTERFACING MICROCONTROLLER

1. Programming 8051 Timers:


8051 Timers and registers
Microcontroller has two Timers designated as Timer0 and Timer1. Each of these timers is
assigned a 16-bit register. The value of a Timer register increases by one every time a timer
counts. Timer takes a time period of one machine cycle to count one. (Machine cycle is a unit
that refers to the time required by the microcontroller to execute instructions.) This means that
the maximum number of times a timer can count without repeating is 216, i.e., 65536. So the
maximum allowed counts in value of Timer registers can be from 0000H to FFFFH.
Since 8051 is an 8 bit controller, the registers of 8051 Timers are accessed as two different
registers; one for lower byte and other for higher byte. For example, register of Timer0 is
accessed as TL0 for lower byte and TH0 for higher byte. Similarly TL1 and TH1 are registers
assigned to Timer 1.

Fig. 1: Bit Values of Timer 0 and Timer 1 of 8051 Microcontroller


8051 Timer Issues

While using 8051 Timers certain factors need to be considered, like whether the Timer is to be
used for time keeping or for counting; whether the source for time generation is external clock or
the controller itself; how many bits of Timer register are to be used or left unused.
How a Timer functions
The registers of Timers are loaded with some initial value. The value of a Timer register
increases by one after every machine cycle. One machine cycle duration is the 1/12th of the
frequency of the crystal attached to the controller.
For example, if the frequency of the crystal is 12 MHz, then the frequency for Timer will be
1MHz (1/12 of crystal frequency) and hence the time (T = 1/f) taken by the Timer to count by
one is 1µs (1/1MHz). Similarly if an 11.0592 MHz crystal is used, operating frequency of Timer
is 921.6 KHz and the time period is 1.085 µs.
If no value is loaded into the Timer, it starts counting from 0000H.
When the Timer reaches FFFFH, it reloads to 0000H. This roll over is communicated to the
controller by raising a flag corresponding to that Timer, i.e., a flag bit is raised (set high) when
the timer starts counting from 0000H again. TF0 and TF1 are the Timer flags corresponding to
Timers 0 and 1. These flags must be cleared (set low) by software every time they are raised. The
Timer may terminate updating register values after a roll over or continue with its operation.

Fig. 2: Image showing Status of Timer Flag on Roll Over

Starting or stopping a Timer

For every Timer, there is a corresponding Timer control bit which can be set or cleared by the
program to start or stop the Timer. TR0 and TR1 are the control bits for Timers 0 and 1
respectively. Setting the control bit would start the Timer.
TR0 = 1; starts Timer 0
TR1 = 1; starts Timer 1

Clearing the control bit would stop the Timer.


TR0 = 0; stops Timer 0
TR1 = 0; stops Timer1
Configuring a Timer
A register called TMOD is used for configuring the Timers for the desired operation. TMOD is
an 8-bit register with following bit configuration:

Fig. 3: Bit Values of TMOD Register of 8051 Microcontroller

The lower four bits (TMOD.0 – TMOD.3) are used to configure Timer 0 while the higher four
bits (TMOD.4 – TMOD.7) are for Timer 1. When GATE is high, the corresponding Timer is
enabled only when there is an interrupt at corresponding INTx pin of AT89C51 controller and
Timer control bit is high. Otherwise only setting Timer control bit is sufficient to start the Timer.

If C/T is low, Timer is used for time keeping, i.e., Timer updates its value automatically
corresponding to 8051 clock source. When C/T is high, Timer is used as counter, i.e., it updates
its value when it receives pulse from outside the 8051 controller.
M1 and M0 bits decide the Timer modes. There are four Timer modes designated as Modes 0, 1,
2 and 3.
Modes 1 and 2 are most commonly used while working with Timers.
TMOD = 0x01; sets the mode1 of Timer0 used for timing
TMOD = 0x20; sets the mode2 of Timer1 used for timing
For more details, refer Different modes of Timer.

Programming 8051 Timers


The programming of 8051 Timers can be done by using either polling method or by using
interrupt. In polling, the microcontroller keeps monitoring the status of Timer flag. While doing
so, it does no other operation and consumes all its processing time in checking the Timer flag
until it is raised on a rollover. In interrupt method controller responds to only when the Timer
flag is raised. The interrupt method prevents the wastage of controller‘s processing time unlike
polling method.

Polling is mostly used for time delay generation and interrupt method is more useful when
waveforms are to be generated or some action has to be repeated in fixed delays.

(i) Polling Method

The polling method involves the following algorithm:

 Configure the Timer mode by passing a hex value into the TMOD register. This will tell
the controller about which Timer is be used; the mode of Timer; operation (to be used as
timer or counter); and whether external interrupt is required to start Timer.
 Load the initial values in the Timer low TLx and high THx byte. (x = 0/1)
 Start the Timer by setting TRx bit.
 Wait while the Timer flag TFx is raised.
 Clear the Timer flag. The Timer flag is raised when Timer rolls over from FFFFH to
0000H. If the Timer is not stopped, it will start updating from 0000H in case of modes 0
& 1 while with initial value in case of mode 2. If TFx is not cleared, controller will not be
able to detect next rollover.
 Stop the Timer by clearing TRx bit. If TRx bit is not cleared the Timer will restart
updating from 0000H after the rollover in case of modes 0 and 1 while with initial value
in case of mode 2.

(ii) Interrupt Method

The interrupt method makes use of a register called Interrupt Enable (IE) register. An 8051
microcontroller has 6 hardware interrupts. The interrupts refer to a notification, communicated to
the controller, by a hardware device or software, on receipt of which controller skips temporarily
whatsoever it was doing and responds to the interrupt.

The controller starts the execution of an Interrupt Service Routine (ISR) or Interrupt Handler
which is a piece of code that tells the processor or controller what to do on receipt of an
interrupt. After the execution of ISR, controller returns to whatever it was doing earlier (before
the interrupt was received).

The Interrupt Enable register has the following bits which enable or disable the hardware
interrupts of 8051 microcontroller.

Fig. 4: Bit Values of IE Register of 8051 Microcontroller


When EA (IE.7) is set (=1), interrupts are enabled. When clear (EA=0), interrupts are disabled
and controller does not respond to any interrupts.

ET0, ET1 & ET2 (IE.3, IE.4 & IE.5) are Timer interrupt bits. When set (high) the timer are
enabled and when cleared (low) they are disabled. (8052 controllers have three Timers, so ET2 is
its Timer 2 interrupt bit.) The ISR corresponding to these interrupts are executed when the TFx
flags of respective Timers are raised. For more details on other IE register bits, refer Interrupts
with 8051.

Note that IE register is bit addressable.

Timer programming using Timer interrupts involves following algorithm.

 Configure the Timer mode by passing a hex value to TMOD register.


 Load the initial values in the Timer low TLx and high THx byte.
 Enable the Timer interrupt by passing hex value to IE register or setting required bits of
IE register. For example,

IE = 0x82; enables Timer 0 interrupt

IE = 0x88; enables Timer 1 interrupt

or

EA = 1;

ET0 = 1; enables Timer 0 interrupt

IE^7 = 1;

IE^3 = 1; enables Timer 1 interrupt

Start the Timer by setting TRx bit.

 Write Interrupt Service Routine (ISR) for the Timer interrupt. For example,

ISR definition for Timer 0 :


void ISR_Timer0(void) interrupt 1
{
<Body of ISR>
}
ISR definition for Timer 1 :

void ISR_Timer1(void) interrupt 3


{
<Body of ISR>
}
 If the Timer has to be stopped after once the interrupt has occurred, the ISR must contain
the statement to stop the Timer.

For example,
void ISR_Timer1(void) interrupt 3
{
<Body of ISR>
TR1 =0;
}
 If a routine written for Timer interrupt has to be repeated again and again, the Timer run
bit need not be cleared. But it should be kept in mind that Timer will start updating
from 0000H and not the initial values in case of mode 0 and 1. So the initial values
must be reloaded in the interrupt service routine.
For example,
void ISR_Timer1(void) interrupt 3
{
<Body of ISR>
TH1 =0XFF; //load with initial values if in mode 0 or 1
TL1 = 0xFC;
}
Different modes of a Timer

There are four Timer modes designated as Modes 0, 1, 2 and 3. A particular mode is selected by
configuring the M1 & M0 bits of TMOD register.
Mode M1 M0 Operation
Mode 0 0 0 13-bit Timer
Mode 1 0 1 16-bit Timer
Mode 2 1 0 8-bit Auto Reload
Mode 3 1 1 Split Timer Mode

(i) Mode 0 : 13-bit Timer


Mode 0 is a 13 bit Timer mode and uses 8 bits of high byte and 5 bit prescaler of low byte. The
value that the Timer can update in mode0 is from 0000H to 1FFFH. The 5 bits of lower byte
append with the bits of higher byte. The Timer rolls over from 1FFFH to 0000H to raise the
Timer flag.
(ii) Mode 1 : 16-bit Timer
Mode1 is one of the most commonly used Timer modes. It allows all 16 bits to be used for the
Timer and so it allows values to vary from 0000H to FFFFH.
If a value, say YYXXH, is loaded into the Timer bytes, then the delay produced by the Timer
will be equal to the product :
[ ( FFFFH – YYXXH +1 ) x ( period of one timer clock ) ].
It can also be considered as follows: convert YYXXH into decimal, say NNNNN, then delay will
be equal to the product :
[ ( 65536-NNNNN ) x ( period of one timer clock ) ].
The period of one timer clock is 1.085 µs for a crystal of 11.0592 MHz frequency as discussed
above.
Now to produce a desired delay, divide the required delay by the Timer clock period. Assume
that the division yields a number NNNNN. This is the number of times Timer must be updated
before it stops. Subtract this number from 65536 (binary equivalent of FFFFH) and convert the
difference into hex. This will be the initial value to be loaded into the Timer to get the desired
delay.
The calculator application in Windows can be a handy tool to carry out these calculations.
Example code
Time delay in Mode1 using polling method

// Use of Timer mode 1 for blinking LED using polling method


// XTAL frequency 11.0592MHz
#include<reg51.h>
sbit led = P1^0; // LED connected to 1st pin of port P1
void delay();

main()
{
unsigned int i;
while(1)
{
led=~led; // Toggle LED
for(i=0;i<1000;i++)
delay(); // Call delay
}
}

void delay() // Delay generation using Timer 0 mode


1
{
TMOD = 0x01; // Mode1 of Timer0
TH0= 0xFC; // FC66 evaluated hex value for 1millis
econd delay
TL0 = 0x66;
TR0 = 1; // Start Timer
while(TF0 == 0); // Using polling method
TR0 = 0; // Stop Timer
TF0 = 0; // Clear flag
}

2. Serial Port Programming


One of the 8051‘s many powerful features -integrated UART, known as a serial port to easily
read and write values to the serial port instead of turning on and off one of the I/O lines in rapid
succession to properly "clock out" each individual bit, including start bits, stop bits and parity
bits.

 Setting the Serial Port Mode configures it by specifying 8051 how many data bits

Table: Definition of SCON SFR

Additionally, it is necessary to define the function of SM0 and SM1 by an additional table: Table
SCON as serial Port
Table: Modes of SCON
The SCON SFR allows us to configure the Serial Port. The first four bits (bits 4 through 7) are
configuration bits:
Bits SM0 and SM1 is to set the serial mode to a value between 0 and 3, inclusive as in table
above selecting the Serial Mode selects the mode of operation (8-bit/9-bit, UART or Shift
Register) and also determines how the baud rate will be calculated. In modes 0 and 2 the baud
rate is fixed based on the oscillator‘s frequency. In modes 1 and 3 the baud rate is variable based
on how often Timer 1 overflows.
The next bit, SM2, is a flag for " Multiprocessor communication whenever a byte has been
received the 8051 will set the "RI" (Receive Interrupt) flag to let the program know that a byte
has been received and that it needs to be processed.

However, when SM2 is set the "RI" flag will only be triggered if the 9th bit received was a "1".
if SM2 is set and a byte is received whose 9th bit is clear, the RI flag will never be set .You will
almost always want to clear this bit so that the flag is set upon reception of any character.

The next bit, REN, is "Receiver Enable." is set indicate to data received via the serial port. The
last four bits (bits 0 through 3) are operational bits. They are used when actually sending and
receiving data--they are not used to configure the serial port.

The TB8 bit is used in modes 2 and 3. In modes 2 and 3, a total of nine data bits are transmitted.
The first 8 data bits are the 8 bits of the main value, and the ninth bit is taken from TB8. If TB8
is set and a value is written to the serial port, the data‘s bits will be written to the serial line
followed by a "set" ninth bit. If TB8 is clear the ninth bit will be "clear."

The RB8 also operates in modes 2 and 3and functions essentially the same way as TB8, but on
the reception side. When a byte is received in modes 2 or 3, a total of nine bits are received. In
this case, the first eight bits received are the data of the serial byte received and the value of the
nineth bit received will be placed in RB8.TI means "Transmit Interrupt."

When a program writes a value to the serial port, a certain amount of time will pass before the
individual bits of the byte are "clocked out" the serial port. If the program were to write another
byte to the serial port before the first byte was completely output, the data being sent would be
garbled. Thus, the8051 lets the program know that it has "clocked out" the last byte by setting
the TI bit.
When the TI bit is set, the program may assume that the serial port is "free" and ready to send the
next byte. Finally, the RI bit means "Receive Interrupt." It functions similarly to the "TI" bit, but
it indicates that a byte has been received. Whenever the 8051 has received a complete byte it will
trigger the RI bit to let the program know that it needs to read the value quickly, before another
byte is read.
 Setting the Serial Port Baud Rate
Once the Serial Port Mode has been configured, the program must configure the serial port‘s
baud rate. This only applies to Serial Port modes 1 and 3. The Baud Rate is determined based on
the oscillator‘s frequency when in mode 0 and 2. In mode 0, the baud rate is always the oscillator
frequency divided by 12. This means if you‘re crystal is 1.059 Mhz, mode 0 baud rate will
always be 921,583 baud. In mode 2 the baud rate is always the oscillator frequency divided by
64, so a 11.059Mhz crystal speed will yield a baud rate of 172,797.
In modes 1 and 3, the baud rate is determined by how frequently timer 1 overflows. The more
frequently timer 1 overflows, the higher the baud rate. There are many ways one can cause timer
1 to overflow at a rate that determines a baud rate, but the most common method is to put timer 1
in 8-bit auto-reload mode (timer mode2) and set a reload value (TH1) that causes Timer 1 to
overflow at a frequency appropriate to generate a baud rate.
To determine the value that must be placed in TH1 to generate a given baud rate, (assuming
PCON.7 is clear).

TH1 = 256 - ((Crystal / 384) / Baud)

If PCON.7 is set then the baud rate is effectively doubled, thus the equation becomes:

TH1 = 256 - ((Crystal / 192) / Baud)

For example, if we have an 11.059 Mhz crystal and we want to configure the serial port to

19,200 baud we try plugging it in the first equation: TH1 = 256 - ((Crystal / 384) / Baud)

TH1 = 256 - ((11059000 / 384) / 19200) TH1 = 256 - ((28,799) / 19200)


TH1 = 256 - 1.5 = 254.5
To obtain 19,200 baud on a 11.059Mhz crystal we‘d have to set TH1 to 254.5. If we set it to

254 we will have achieved 14,400 baud and if we set it to 255 we will have achieved 28,800
baud.
To achieve 19,200 baud we simply need to set PCON.7 (SMOD). When we do this we double
the baud rate and utilize the second equation mentioned above. Thus we have:

TH1 = 256 - ((Crystal / 192) / Baud) TH1 = 256 - ((11059000 / 192) / 19200) TH1 = 256 -
((57699) / 19200)
TH1 = 256 - 3 = 253
Therefore, to obtain 19,200 baud with an 11.059MHz crystal we must:
 Configure Serial Port mode 1 or 3.
 Configure Timer 1 to timer mode 2 (8-bit auto reload).
 Set TH1 to 253 to reflect the correct frequency for 19,200 baud.
4) Set PCON.7 (SMOD) to double the baud rate.

 Writing to the Serial Port

Once the Serial Port has been properly configured as explained above, the serial port is ready to
be used to send data and receive data.

To write a byte to the serial write the value to the SBUF (99h) SFR. For example, if you wanted
to send the letter "A" to the serial port, it could be accomplished as easily as: MOV SBUF, #‘A‘

Upon execution of the above instruction the 8051 will begin transmitting the character via the
serial port. Obviously transmission is not instantaneous--it takes a measureable amount of time to
transmit. And since the 8051 does not have a serial output buffer we need to be sure that a
character is completely transmitted before we try to transmit the next character.

The 8051 lets us know when it is done transmitting a character by setting the TI bit in SCON.
When this bit is set the last character has been transmitted and that send the next character, if
any. Consider the following code segment:
CLR TI; Be sure the bit is initially clear

MOV SBUF, #‘A‘; Send the letter ‗A‘ to the serial port

JNB TI,$;Pause until the RI bit is set.

The above three instructions will successfully transmit a character and wait for the TI bit to be
set before continuing. The last instruction says "Jump if the TI bit is not set to $"—

$, in most assemblers, means "the same address of the current instruction." Thus the 8051 will
pause on the JNB instruction until the TI bit is set by the 8051 upon successful transmission of
the character.

 Reading the Serial Port

Reading data received by the serial port is equally easy. To read a byte from the serial port one
just needs to read the value stored in the SBUF (99h) SFR after the 8051 has automatically set
the RI flag in SCON.

For example, if your program wants to wait for a character to be received and subsequently read
it into the Accumulator, the following code segment may be used:

JNB RI,$;Wait for the 8051 to set the RI flag


MOV A,SBUF; Read the character from the serial port

The first line of the above code segment waits for the 8051 to set the RI flag; again, the8051 sets
the RI flag automatically when it receives a character via the serial port. So as long as the bit is
not set the program repeats the "JNB" instruction continuously. Once the RI bit is set upon
character reception the above condition automatically fails and program flow falls through to the
"MOV" instruction which reads the value.

3. Interrupts Programming:
An interrupt is a signal to the processor emitted by hardware or software indicating an event that
needs immediate attention. Whenever an interrupt occurs, the controller completes the
execution of the current instruction and starts the execution of an Interrupt Service
Routine (ISR) or Interrupt Handler. ISR tells the processor or controller what to do when the
interrupt occurs. The interrupts can be either hardware interrupts or software interrupts.
Hardware Interrupt: A hardware interrupt is an electronic alerting signal sent to the processor
from an external device, like a disk controller or an external peripheral. For example, when we
press a key on the keyboard or move the mouse, they trigger hardware interrupts which cause the
processor to read the keystroke or mouse position.

Software Interrupt: A software interrupt is caused either by an exceptional condition or a special


instruction in the instruction set which causes an interrupt when it is executed by the processor.
For example, if the processor's arithmetic logic unit runs a command to divide a number by zero,
to cause a divide-by-zero exception, thus causing the computer to abandon the calculation or
display an error message. Software interrupt instructions work similar to subroutine calls.

Polling: The state of continuous monitoring is known as polling. The microcontroller keeps
checking the status of other devices; and while doing so, it does no other operation and consumes
all its processing time for monitoring. This problem can be addressed by using interrupts. In the
interrupt method, the controller responds only when an interruption occurs. Thus, the controller
is not required to regularly monitor the status (flags, signals etc.) of interfaced and inbuilt
devices.

Interrupts v/s Polling: Here is an analogy that differentiates an interrupt from polling −

Interrupt Polling

An interrupt is like a shopkeeper. If one The polling method is like a salesperson. The
needs a service or product, he goes to him salesman goes from door to door while requesting
and apprises him of his needs. In case of to buy a product or service. Similarly, the
interrupts, when the flags or signals are controller keeps monitoring the flags or signals
received, they notify the controller that they one by one for all devices and provides service to
need to be serviced. whichever component that needs its service.
Interrupt Service Routine: For every interrupt, there must be an interrupt service routine (ISR),
or interrupt handler. When an interrupt occurs, the microcontroller runs the interrupt service
routine. For every interrupt, there is a fixed location in memory that holds the address of its
interrupt service routine, ISR. The table of memory locations set aside to hold the addresses of
ISRs is called as the Interrupt Vector Table.

Interrupt Vector Table:


There are six interrupts including RESET in 8051.

Interrupts ROM Location (Hex) Pin

Interrupts ROM Location (HEX)

Serial COM (RI and TI) 0023

Timer 1 interrupts(TF1) 001B

External HW interrupt 1 (INT1) 0013 P3.3 (13)

External HW interrupt 0 (INT0) 0003 P3.2 (12)

Timer 0 (TF0) 000B

Reset 0000 9

 When the reset pin is activated, the 8051 jumps to the address location 0000. This is
power-up reset.
 Two interrupts are set aside for the timers: one for timer 0 and one for timer 1. Memory
locations are 000BH and 001BH respectively in the interrupt vector table.
 Two interrupts are set aside for hardware external interrupts. Pin no. 12 and Pin no. 13 in
Port 3 are for the external hardware interrupts INT0 and INT1, respectively. Memory
locations are 0003H and 0013H respectively in the interrupt vector table.
 Serial communication has a single interrupt that belongs to both receive and transmit.
Memory location 0023H belongs to this interrupt.
Steps to Execute an Interrupt: When an interrupt gets active, the microcontroller goes through
the following steps −
 The microcontroller closes the currently executing instruction and saves the address of
the next instruction (PC) on the stack.
 It also saves the current status of all the interrupts internally (i.e., not on the stack).
 It jumps to the memory location of the interrupt vector table that holds the address of the
interrupts service routine.
 The microcontroller gets the address of the ISR from the interrupt vector table and jumps
to it. It starts to execute the interrupt service subroutine, which is RETI (return from
interrupt).
 Upon executing the RETI instruction, the microcontroller returns to the location where it
was interrupted. First, it gets the program counter (PC) address from the stack by
popping the top bytes of the stack into the PC. Then, it start to execute from that
address.
Edge Triggering vs. Level Triggering: Interrupt modules are of two types − level-triggered or
edge-triggered.
Level Triggered Edge Triggered

A level-triggered interrupt module always An edge-triggered interrupt module generates an


generates an interrupt whenever the level interrupt only when it detects an asserting edge of
of the interrupt source is asserted. the interrupt source. The edge gets detected when
the interrupt source level actually changes. It can
also be detected by periodic sampling and
detecting an asserted level when the previous
sample was de-asserted.

If the interrupt source is still asserted Edge-triggered interrupt modules can be acted
when the firmware interrupt handler immediately, no matter how the interrupt source
handles the interrupt, the interrupt module behaves.
will regenerate the interrupt, causing the
interrupt handler to be invoked again.

Level-triggered interrupts are cumbersome Edge-triggered interrupts keep the firmware's code
for firmware. complexity low, reduce the number of conditions
for firmware, and provide more flexibility when
interrupts are handled.
Enabling and Disabling an Interrupt:: Upon Reset, all the interrupts are disabled even if they are
activated. The interrupts must be enabled using software in order for the microcontroller to
respond to those interrupts.
IE (interrupt enable) register is responsible for enabling and disabling the interrupt. IE is a
bitaddressable register.

Interrupt Enable Register

EA - ET2 ES ET1 EX1 ET0 EX0

 EA − Global enable/disable.
 - − Undefined.
 ET2 − Enable Timer 2 interrupt.
 ES − Enable Serial port interrupt.
 ET1 − Enable Timer 1 interrupt.
 EX1 − Enable External 1 interrupt.
 ET0 − Enable Timer 0 interrupt.
 EX0 − Enable External 0 interrupt.
To enable an interrupt, we take the following steps −
 Bit D7 of the IE register (EA) must be high to allow the rest of register to take effect.
 If EA = 1, interrupts will be enabled and will be responded to, if their corresponding bits
in IE are high. If EA = 0, no interrupts will respond, even if their associated pins in the
IE register are high.
Interrupt Priority in 8051: We can alter the interrupt priority by assigning the higher priority to
any one of the interrupts. This is accomplished by programming a register called IP (interrupt
priority).
The following figure shows the bits of IP register. Upon reset, the IP register contains all 0's. To
give a higher priority to any of the interrupts, we make the corresponding bit in the IP register
high.

- - - - PT1 PX1 PT0 PX0

- IP.7 Not Implemented.

- IP.6 Not Implemented.


- IP.5 Not Implemented.

- IP.4 Not Implemented.

PT1 IP.3 Defines the Timer 1 interrupt priority level.

PX1 IP.2 Defines the External Interrupt 1 priority level.

PT0 IP.1 Defines the Timer 0 interrupt priority level.

PX0 IP.0 Defines the External Interrupt 0 priority level.

Interrupt inside Interrupt: What happens if the 8051 is executing an ISR that belongs to an
interrupt and another one gets active? In such cases, a high-priority interrupt can interrupt a low-
priority interrupt. This is known as interrupt inside interrupt. In 8051, a low-priority interrupt can
be interrupted by a high-priority interrupt, but not by any another low-priority interrupt.

Triggering an Interrupt by Software: There are times when we need to test an ISR by way of
simulation. This can be done with the simple instructions to set the interrupt high and thereby
cause the 8051 to jump to the interrupt vector table. For example, set the IE bit as 1 for timer 1.
An instruction SETB TF1 will interrupt the 8051 in whatever it is doing and force it to jump to
the interrupt vector table.

4. LCD & Keyboard Interfacing:


Keypad and LCD interfaced with 8051 microcontroller – Project requirements

 16×2 lcd
 4×4,4×3 numericc keypad
 8051(89c51,89c52) Microcontroller
 Power supply(5 volts)
 Crystal Oscillator(11.0592 MHz)
 Bread board (To build circuit)
 Potentiometer(Variable Resistor) To adjust Lcd contrast

4×3 Keypad, 16×2 Lcd interfaced with 89c51 microcontroller – Project code
The circuit is of the project is simple. Just connect Port-1 of 89c51 microcontroller to your 16×2
lcd data pins(D0-D7). Connect Port-2 of 89c51 microcontroller to your keypad. Connect rows of
4×3 keypad to Port-2 pins 0,1,2,4. Connect coulombs of 4×3 keypad with Port-2 pins 5,6,7 of
89c51 microcontroller. Connect enable pin of LCD with Port-3 pin#6. RS (register select) pin of
lcd with Port-3 pin# 5. RW(read-write)pin of LCD to 8051 Port-3 pin#7. Rest of the connections
are manual which we do in our all circuits. Ground Pin 20. Apply 5 volts to pin 40 and 31.
Connect Oscillator with pin#18(XTAL-1) and 19(XTAL-2) of 8051 in parallel to two 30 pF
capacitors. Connect reset button with pin#9(reset) of 89c51 microcontroller.

16×2 lcd, 4×3 numeric keypad interfacing with 8051 microcontroller

Interfacing 4×4,4×3 keypad and 16×2 lcd with 8051(89c51,89c52) microcontroller

LCD keypad with 8051 microcontroller:


Coming to code. Code is written in c language and it is compiled in keil u vision 4. First the
initial s-bits are defined for rows and coulombs of 4×3 keypad. Enable, Register-select and Read-
Write pins are also defined as s-bit. Then a character array is initialized. This character array is
displayed on the first line of 16×2 lcd. delay() function is for providing necessary
delay. lcdcmd() function is for sending commands to 16×2 lcd. lcddata() function is sending data
to the lcd. lcdint() function is initializing our lcd. keypad() function scans the key pressed on the
keypad.
Main() function executes first. The first four statements of main function initializes Port-
1 as output, Port-3 as output, Port-2 upper nibble as input and lower nibble as output. Port-
2 upper nibble(4 bits) are connected to 4×3 keypad rows and lower nibble is connected with
coulombs of 4×3 numeric keypad. Since there are only three coulombs so pin(25 P2.4) of lower
nibble is left void. Then lcdint() function is called to initialize the 16×2 lcd. After initializing the
16×2 next comes the while() loop. lcd The while loop then prints ―KEYPAD WITH LCD‖ string
on first line of 16×2 lcd. lcdcmd (0xC0) command jumps the control to second line. Now the for
loop is running 16 times and calling the keypad() function 16 times. Actually i am using it to
print 16 characters on the second line of 16×2 lcd. Whats going on in keypad() function is
important.

Keypad key scanning function with 89c51 microcontroller code


When control is shifted to keypad() function it polls, scans and checks if any key on keyboard is
pressed. It first makes row-1 low and all other rows high. Now if any key on row-1 is pressed by
the user the associated coulomb with that pin also become low (Rows are declared output and
coulombs input). Checks the coulombs if anyone is low. If low than prints the character
associated with that button on 16×2 lcd. This system goes on for all rows.

Note: The the condition for checking rows and coulombs is placed in a while loop the while loop
condition runs until c=‘s‘, and i am making c=‘s‘ when any key is pressed. Thus the control will
stuck in to the while loop when no key is pressed. This logic is very important and you have to
learn it very deeply. If you are interested.

#include<reg52.h>
sbit r0=P2^0; //Rows Declared
sbit r1=P2^1;
sbit r2=P2^2;
sbit r3=P2^3;
sbit c0=P2^5; //Coulombs declared
sbit c1=P2^6;
sbit c2=P2^7;
sbit en=P3^6; //Lcd control pins declared
sbit rs=P3^5;
sbit rw=P3^7;
char t1[]="KEYPAD WITH LCD"; //String displayed on 16x2 lcd screen
void delay(unsigned int no) //Delay function generating variable delay
{
unsigned int i,j;
for(j=0;j< =no;j++)
for(i=0;i< =10;i++);
}
lcdcmd(unsigned int command){ //Lcd command function
P1=command;
rw=0;
rs=0;
en=0;
delay(3000);
en=1;
delay(3000);
en=0;
}
lcddata(char data1) //Lcd data function
{
P1=data1;
rw=0;
rs=1;
en=0;
delay(3000);
en=1;
delay(3000);
en=0;
}
lcdint() // Lcd initializing function
{
lcdcmd(0x30); delay(3000); lcdcmd(0x30); delay(3000); lcdcmd(0x30); delay(3000);
lcdcmd(0x30); delay(3000); lcdcmd(0x30); delay(3000); lcdcmd(0x38); delay(3000);
lcdcmd(0x01); delay(3000); lcdcmd(0x0F); delay(3000); lcdcmd(0x80); delay(3000);
}
void keypad() //Lcd keypad scanning function
{
char c='a';
while(c!='s'){
r0=0;r1=1;r2=1;r3=1;
if(c0==0){lcddata('1');P0=0xF0;delay(20000);c='s';}
if(c1==0){lcddata('2');P0=0xF0;delay(20000);c='s';}
if(c2==0){lcddata('3');P0=0xF0;delay(20000);c='s';}
r0=1;r1=0;r2=1;r3=1;
if(c0==0){lcddata('4');P0=0xF0;delay(20000);c='s';}
if(c1==0){lcddata('5');P0=0xF0;delay(20000);c='s';}
if(c2==0){lcddata('6');P0=0xF0;delay(20000);c='s';}
r0=1;r1=1;r2=0;r3=1;
if(c0==0){lcddata('7');P0=0xF0;delay(20000);c='s';}
if(c1==0){lcddata('8');P0=0xF0;delay(20000);c='s';}
if(c2==0){lcddata('9');P0=0xF0;delay(20000);c='s';}
r0=1;r1=1;r2=1;r3=0;
if(c0==0){lcddata('*');P0=0xF0;delay(20000);c='s';}
if(c1==0){lcddata('0');P0=0xF0;delay(20000);c='s';}
if(c2==0){lcddata('#');P0=0xF0;delay(20000);c='s';}
}
}
void main() //Projecct main function
{
unsigned int i=0;
P1=0x00;
P2=0xF0;
P3=0x00;
lcdint(); //Initialize 16x2 Lcd
while(t1[i]!='\0') //Display well come message on 16x2 lcd sccreen
{
lcddata(t1[i]);
i++;
}
i=0;
lcdcmd(0xC0); //Control transfer to second row of lcd
for(i=0;i<=15;i++)
keypad();
}

5. ADC, DAC & Sensor Interfacing:

Interfacing ADC to 8051: ADC (Analog to digital converter) forms a very essential part in
many embedded projects and this article is about interfacing an ADC to 8051 embedded
controller. ADC 0804 is the ADC used here and before going through the interfacing procedure,
we must neatly understand how the ADC 0804 works.

ADC0804 is an 8 bit successive approximation analogue to digital converter from National


semiconductors. The features of ADC0804 are differential analogue voltage inputs, 0-5V input
voltage range, no zero adjustment, built in clock generator, reference voltage can be externally
adjusted to convert smaller analogue voltage span to 8 bit resolution etc. The pin out diagram of
ADC0804 is shown in the figure below.

ADC0804 pinout
The voltage at Vref/2 (pin9) of ADC0804 can be externally adjusted to convert smaller input
voltage spans to full 8 bit resolution. Vref/2 (pin9) left open means input voltage span is 0-5V
and step size is 5/255=19.6V. Have a look at the table below for different Vref/2 voltages and
corresponding analogue input voltage spans.
Vref/2 (pin9) (volts) Input voltage span (volts) Step size (mV)

Left open 0–5 5/255 = 19.6

2 0–4 4/255 = 15.69

1.5 0–3 3/255 = 11.76

1.28 0 – 2.56 2.56/255 = 10.04

1.0 0–2 2/255 = 7.84

0.5 0–1 1/255 = 3.92

Steps for converting the analogue input and reading the output from ADC0804:

 Make CS=0 and send a low to high pulse to WR pin to start the conversion.
 Now keep checking the INTR pin. INTR will be 1 if conversion is not finished and INTR
will be 0 if conversion is finished.
 If conversion is not finished (INTR=1) , poll until it is finished.
 If conversion is finished (INTR=0), go to the next step.
 Make CS=0 and send a high to low pulse to RD pin to read the data from the ADC.

Circuit diagram:

Interfacing ADC to 8051: The figure above shows the schematic for interfacing ADC0804 to
8051. The circuit initiates the ADC to convert a given analogue input, then accepts the
corresponding digital data and displays it on the LED array connected at P0. For example, if the
analogue input voltage Vin is 5V then all LEDs will glow indicating 11111111 in binary which
is the equivalent of 255 in decimal. AT89s51 is the microcontroller used here. Data out pins (D0
to D7) of the ADC0804 are connected to the port pins P1.0 to P1.7 respectively. LEDs D1 to D8
are connected to the port pins P0.0 to P0.7 respectively. Resistors R1 to R8 are current limiting
resistors. In simple words P1 of the microcontroller is the input port and P0 is the output port.
Control signals for the ADC (INTR, WR, RD and CS) are available at port pins P3.4 to P3.7
respectively. Resistor R9 and capacitor C1 are associated with the internal clock circuitry of the
ADC. Preset resistor R10 forms a voltage divider which can be used to apply a particular input
analogue voltage to the ADC. Push button S1, resistor R11 and capacitor C4 forms a debouncing
reset mechanism. Crystal X1 and capacitors C2, C3 are associated with the clock circuitry of the
microcontroller.

Program:

ORG 00H
MOV P1,#11111111B // initiates P1 as the input port
MAIN: CLR P3.7 // makes CS=0
SETB P3.6 // makes RD high
CLR P3.5 // makes WR low
SETB P3.5 // low to high pulse to WR for starting conversion
WAIT: JB P3.4,WAIT // polls until INTR=0
CLR P3.7 // ensures CS=0
CLR P3.6 // high to low pulse to RD for reading the data from ADC
MOV A,P1 // moves the digital data to accumulator
CPL A // complements the digital data (*see the notes)
MOV P0,A // outputs the data to P0 for the LEDs
SJMP MAIN // jumps back to the MAIN program
END

DAC Interface:
The Digital to Analog converter (DAC) is a device, that is widely used for converting digital
pulses to analog signals. There are two methods of converting digital signals to analog signals.
These two methods are binary weighted method and R/2R ladder method. In this article we will
use the MC1408 (DAC0808) Digital to Analog Converter. This chip uses R/2R ladder method.
This method can achieve a much higher degree of precision. DACs are judged by its resolution.
The resolution is a function of the number of binary inputs. The most common input counts are
8, 10, 12 etc. Number of data inputs decides the resolution of DAC. So if there are n digital input
pin, there are 2n analog levels. So 8 input DAC has 256 discrete voltage levels.
The MC1408 DAC (or DAC0808)
In this chip the digital inputs are converted to current. The output current is known as Iout by
connecting a resistor to the output to convert into voltage. The total current provided by
the Iout pin is basically a function of the binary numbers at the input pins D0 - D7 (D0 is the LSB
and D7 is the MSB) of DAC0808 and the reference current Iref. The following formula is
showing the function of Iout
IOut=Iref⟮D72+D64+D58+D416+D332+D264+D1128+D0256⟯IOut=Iref⟮D72+D64+D58+D41
6+D332+D264+D1128+D0256⟯

The Iref is the input current. This must be provided into the pin 14. Generally 2.0mA is used as
Iref
We connect the Iout pin to the resistor to convert the current to voltage. But in real life it may
cause inaccuracy since the input resistance of the load will also affect the output voltage. So
practically Iref current input is isolated by connecting it to an Op-Amp with Rf = 5KΩ as
feedback resistor. The feedback resistor value can be changed as per requirement.
Generating Sinewave using DAC and 8051 Microcontroller
For generating sinewave, at first we need a look-up table to represent the magnitude of the sine
value of angles between 0° to 360°. The sine function varies from -1 to +1. In the table only
integer values are applicable for DAC input. In this example we will consider 30° increments and
calculate the values from degree to DAC input. We are assuming full-scale voltage of 10V for
DAC output. We can follow this formula to get the voltage ranges.

Vout = 5V + (5 ×sinθ)
Let us see the lookup table according to the angle and other parameters for DAC.

Angle(in θ ) sinθ Vout (Voltage Magnitude) Values sent to DAC

0 0 5 128

30 0.5 7.5 192

60 0.866 9.33 238

90 1.0 10 255

120 0.866 9.33 238

150 0.5 7.5 192

180 0 5 128

210 -0.5 2.5 64

240 -0.866 0.669 17


Angle(in θ ) sinθ Vout (Voltage Magnitude) Values sent to DAC

270 -1.0 0 0

300 -0.866 0.669 17

330 -0.5 2.5 64

360 0 5 128

Circuit Diagram −

Source Code

#include<reg51.h>
sfr DAC = 0x80; //Port P0 address
void main(){
int sin_value[12] = {128,192,238,255,238,192,128,64,17,0,17,64};
int i;
while(1){
//infinite loop for LED blinking
for(i = 0; i<12; i++){
DAC = sin_value[i];
}
}
}
Output
The output will look like this −

6. External Memory Interface:


Types of Computer Architecture: Basically, Microprocessors or Microcontrollers are classified
based on the two types of Computer Architecture: Von Neumann Architecture and Harvard
Architecture.
Von Neumann Architecture: Von Neumann Architecture or Princeton Architecture is a
Computer Architecture, where the Program i.e. the Instructions and the Data are stored in a
single memory.
Since the Instruction Memory and the Data Memory are the same, the Processor or CPU cannot
access both Instructions and Data at the same time as they use a single bus.

This type of architecture has severe limitations to the performance of the system as it creates a
bottleneck while accessing the memory.
Harvard Architecture
Harvard Architecture, in contrast to Von Neumann Architecture, uses separate memory for
Instruction (Program) and Data. Since the Instruction Memory and Data Memory are separate in
a Harvard Architecture, their signal paths i.e. buses are also different and hence, the CPU can
access both Instructions and Data at the same time.

Almost all Microcontrollers, including 8051 Microcontroller implement Harvard Architecture.

8051 Microcontroller Memory Organization


The 8051 Microcontroller Memory is separated in Program Memory (ROM) and Data Memory
(RAM). The Program Memory of the 8051 Microcontroller is used for storing the program to be
executed i.e. instructions. The Data Memory on the other hand, is used for storing temporary
variable data and intermediate results.

8051 Microcontroller has both Internal ROM and Internal RAM. If the internal memory is
inadequate, you can add external memory using suitable circuits.

Read this interesting post: 8051 MICROCONTROLLER PROJECTS FOR ENGINEERING


STUDENTS.

Program Memory (ROM) of 8051 Microcontroller


In 8051 Microcontroller, the code or instructions to be executed are stored in the Program
Memory, which is also called as the ROM of the Microcontroller. The original 8051
Microcontroller by Intel has 4KB of internal ROM.

Some variants of 8051 like the 8031 and 8032 series doesn‘t have any internal ROM (Program
Memory) and must be interfaced with external Program Memory with instructions loaded in it.

Almost all modern 8051 Microcontrollers, like 8052 Series, have 8KB of Internal Program
Memory (ROM) in the form of Flash Memory (ROM) and provide the option of reprogramming
the memory.
In case of 4KB of Internal ROM, the address space is 0000H to 0FFFH. If the address space i.e.
the program addresses exceed this value, then the CPU will automatically fetch the code from the
external Program Memory.

For this, the External Access Pin (EA Pin) must be pulled HIGH i.e. when the EA Pin is high,
the CPU first fetches instructions from the Internal Program Memory in the address range of
0000H to 0FFFFH and if the memory addresses exceed the limit, then the instructions are
fetched from the external ROM in the address range of 1000H to FFFFH.
There is another way to fetch the instructions: ignore the Internal ROM and fetch all the
instructions only from the External Program Memory (External ROM). For this scenario, the EA
Pin must be connected to GND. In this case, the memory addresses of the external ROM will be
from 0000H to FFFFH.

Data Memory (RAM) of 8051 Microcontroller


The Data Memory or RAM of the 8051 Microcontroller stores temporary data and intermediate
results that are generated and used during the normal operation of the microcontroller. Original
Intel‘s 8051 Microcontroller had 128B of internal RAM.

But almost all modern variants of 8051 Microcontroller have 256B of RAM. In this 256B, the
first 128B i.e. memory addresses from 00H to 7FH is divided in to Working Registers (organized
as Register Banks), Bit – Addressable Area and General Purpose RAM (also known as
Scratchpad area).

In the first 128B of RAM (from 00H to 7FH), the first 32B i.e. memory from addresses 00H to
1FH consists of 32 Working Registers that are organized as four banks with 8 Registers in each
Bank.
The 4 banks are named as Bank0, Bank1, Bank2 and Bank3. Each Bank consists of 8 registers
named as R0 – R7. Each Register can be addressed in two ways: either by name or by address.

To address the register by name, first the corresponding Bank must be selected. In order to select
the bank, we have to use the RS0 and RS1 bits of the Program Status Word (PSW) Register (RS0
and RS1 are 3rd and 4th bits in the PSW Register).

When addressing the Register using its address i.e. 12H for example, the corresponding Bank
may or may not be selected. (12H corresponds to R2 in Bank2).

The next 16B of the RAM i.e. from 20H to 2FH are Bit – Addressable memory locations. There
are totally 128 bits that can be addressed individually using 00H to 7FH or the entire byte can be
addressed as 20H to 2FH.

For example 32H is the bit 2 of the internal RAM location 26H.

The final 80B of the internal RAM i.e. addresses from 30H to 7FH, is the general purpose RAM
area which are byte addressable.

These lower 128B of RAM can be addressed directly or indirectly.

The upper 128B of the RAM i.e. memory addresses from 80H to FFH is allocated for Special
Function Registers (SFRs). SFRs control specific functions of the 8051 Microcontroller. Some of
the SFRs are I/O Port Registers (P0, P1, P2 and P3), PSW (Program Status Word), A
(Accumulator), IE (Interrupt Enable), PCON (Power Control), etc.
The following image shows the block diagram of interfacing 64KB of External RAM and 64KB
of External ROM with the 8051 Microcontroller.

In this tutorial, we have seen the 8051 Microcontroller Memory Organization, Internal ROM and
RAM and how to interface external ROM and RAM with 8051 Microcontroller.

7. Stepper Motor Interface:

Stepper motors are used to translate electrical pulses into mechanical movements. In some disk
drives, dot matrix printers, and some other different places the stepper motors are used. The main
advantage of using the stepper motor is the position control. Stepper motors generally have a
permanent magnet shaft (rotor), and it is surrounded by a stator.

Normal motor shafts can move freely but the stepper motor shafts move in fixed repeatable
increments.
Some parameters of stepper motors −
 Step Angle − The step angle is the angle in which the rotor moves when one pulse is
applied as an input of the stator. This parameter is used to determine the positioning of a
stepper motor.
 Steps per Revolution − This is the number of step angles required for a complete
revolution. So the formula is 360° /Step Angle.
 Steps per Second − This parameter is used to measure a number of steps covered in
each second.
 RPM − The RPM is the Revolution Per Minute. It measures the frequency of rotation.
By this parameter, we can measure the number of rotations in one minute.
The relation between RPM, steps per revolution, and steps per second is like below:

Steps per Second = rpm x steps per revolution / 60


Interfacing Stepper Motor with 8051 Microcontroller: We are using Port P0 of 8051 for
connecting the stepper motor. HereULN2003 is used. This is basically a high voltage, high
current Darlington transistor array. Each ULN2003 has seven NPN Darlington pairs. It can
provide high voltage output with common cathode clamp diodes for switching inductive loads.
The Unipolar stepper motor works in three modes.
 Wave Drive Mode − In this mode, one coil is energized at a time. So all four coils are
energized one after another. This mode produces less torque than full step drive mode.
The following table is showing the sequence of input states in different windings.

Steps Winding A Winding B Winding C Winding D


1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1

 Full Drive Mode − In this mode, two coils are energized at the same time. This mode
produces more torque. Here the power consumption is also high
The following table is showing the sequence of input states in different windings.

Steps Winding A Winding B Winding C Winding D


1 1 1 0 0
2 0 1 1 0
3 0 0 1 1
4 1 0 0 1
 Half Drive Mode − In this mode, one and two coils are energized alternately. At first,
one coil is energized then two coils are energized. This is basically a combination of
wave and full drive mode. It increases the angular rotation of the motor
The following table is showing the sequence of input states in different windings.

Steps Winding A Winding B Winding C Winding D


1 1 0 0 0
2 1 1 0 0
3 0 1 0 0
4 0 1 1 0
5 0 0 1 0
6 0 0 1 1
7 0 0 0 1
8 1 0 0 1

The circuit diagram is like below: We are using the full drive mode.

Example

#include<reg51.h>
sbit LED_pin = P2^0; //set the LED pin as P2.0
void delay(int ms){
unsigned int i, j;
for(i = 0; i<ms; i++){ // Outer for loop for given milliseconds value
for(j = 0; j< 1275; j++){
//execute in each milliseconds;
}
}
}
void main(){
int rot_angle[] = {0x0C,0x06,0x03,0x09};
int i;
while(1){
//infinite loop for LED blinking
for(i = 0; i<4; i++){
P0 = rot_angle[i];
delay(100);
}
}
}
8. Comparison of Microprocessor, Microcontroller, PIC and ARM
processors

 Microprocessor & Microcontroller:

 PIC and ARM processors:


Main Difference between AVR, ARM, 8051 and PIC Microcontrollers

Paremeter
8051 PIC ARM
32-bit mostly also
8-bit for standard core 8/16/32-bit available in 64-bit
Bus width
UART, USART, LIN,
I2C, SPI, CAN, USB,
Communication UART, USART,SPI,I2C PIC, UART, USART, Ethernet, I2S, DSP,
Protocols LIN, CAN, Ethernet, SAI (serial audio
SPI, I2S interface), IrDA

12 Clock/instruction 4 Clock/instruction 1 clock/ instruction


cycle cycle cycle
Speed
Flash, SDRAM,
ROM, SRAM, FLASH SRAM, FLASH EEPROM
Memory
CLSC Some feature of RISC RISC
ISA
Von Neumann Modified Harvard
Memory architecture Harvard architecture architecture
Architecture
Power Average Low Low
Consumption
PIC16,PIC17, PIC18,
8051 variants PIC24, PIC32 ARMv4,5,6,7 and series
Families
Vast Very Good Vast
Community
NXP, Atmel, Silicon Apple, Nvidia,
Labs, Dallas, Cyprus, Qualcomm, Samsung
Infineon, etc. Microchip Average Electronics, and TI etc.
Manufacturer
Cost (as
compared to
features
provide) Very Low Average Low

High speed operation

Vast

Known for its Standard Cheap


Other Feature
PIC18fXX8, LPC2148, ARM
PIC16f88X, Cortex-M0 to ARM
Popular AT89C51, P89v51, etc. PIC32MXX Cortex-M7, etc.
Microcontrollers

You might also like