Discussion in "8051 Discussion Forum" started by    kirangowle    Jan 1, 2011.
Sat Jan 01 2011, 04:46 AM
#1
Hi,

I m finding difficulty in explaining the function of interrupts in 8051, How shall i demonstrate them the use of interrupt, advantage, efficiently etc.
Do you have any ideas or programs with interrupt and with out interrupts to show how interrupt efficiently works.
Sat Jan 01 2011, 05:51 AM
#2
hi kirangowle

How shall i demonstrate them the use of interrupt, advantage, efficiently etc.


interrupt is the most important part of controller any controller without interrupt is nothing interrupt make the machine most useful
basic purpose of interrupts are multitasking
there are 6 interrupt sources in 8051
1) reset interrupt
2) external interrupt 0
3) timer 0 interrupt
4) external interrupt 1
5) timer 0 interrupt
6) serial interrupt
first interrupt is controlled by hardware software can't control it
if u connect the pin9 RST to Vcc for a while then controller will reset
other 5 interrupts are controlled by software
by default its priority is in the same way as i write above
u can changed it by using IP (Interrupt Priority) register
interrupts can be enabled by using IE(Interrupt Enable) register
let say u nned a application in which u need 7-segment multiplexing with serial communication then if u use polling method then in one time u can do one job only
but in interrupt u can do now two jobs
if u check the RI flag in serial port then u has to wait on a line while(RI==0);
but in interrupt when data come in SBUF an interrupt generate and control goes to interrupt function so we not need to check the flag and wait on a line

now let say u want 7-seg multiplexing on any port u can use timer interrupts set the timer interval and mode and run it when it overflow it raise the flag high and interrupt occur in interrupt function u can refresh ur display
if u want to count specific no of pulses using timer as a counter then u also can do that using timer interrupt too configure that as a counter just

external interrupt0 and 1 uses to check is some one press a key or not or any sensor give low output or not
lt say u make a digital clock and u want to set its time u can use push button on interrupt pin that is P3.2 and P3.3 as this pin goes low interrupt occur and there u can set ur clock time
interrupt is an emergency case it is just like an ambulance that has permission to break the laws of signals in case of emergency
controller leave the main function when any interrupt occur and go to the relevant interrupt function after that it come back to main so in this way controller can do multitasking that is useful thing when ur doing coding
in fact interrupt is the best way of coding

Do you have any ideas or programs with interrupt and with out interrupts to show how interrupt efficiently works.


let say we discuss serial interrupt only here basic idea is same for all type of interrupts
without interrupt in c
#include <reg51.h>
void main (void)
{
unsigned char a;
SCON=0X50;    //9600 bps @ 11.0592MHZ 
TMOD=0X20;
TH1=0XFD;
TL1=0XFD;
TR1=1;
while(1)
{
while(RI==0);  // wait here to raise the flag
a=SBUF;
RI=0;
// other functions are called here
conv();
read();
display();
;
;
;
;
}
}


using interrupt in c
#include <reg51.h>
unsigned char a;
void serial (void) interrupt 4
{
if(RI==1)
{
a=SBUF;
;
;
;
RI=0;
}
else
{
TI=0;
}

}

void main (void)
{
SCON=0X50;    //9600 bps @ 11.0592MHZ 
TMOD=0X20;
TH1=0XFD;
TL1=0XFD;
TR1=1;
IE=0X90;   //enable global interrupt along with  serial
while(1)
{
conv();
read();
display();
;
;
;
;
}
}
Sat Jan 01 2011, 06:37 AM
#3
Hi Mojaka,

Thanks, Very nicely stated about the interupts.
Sat Jan 01 2011, 08:52 AM
#4
Good explanation majoka... write your own book.... I will do publicity for you
Sat Jan 01 2011, 11:32 AM
#5
@ kirangowle
welcome dear
@ coolmirza143
i want to write a book in which practical interfacing is described
not a theory practical based
Mon Jan 03 2011, 12:07 AM
#6
Hi mojaka,

Practical interfacing means ADC, 7 segment, RTC etc..
Do it for all the interfacing should be on same board, along with the programmer, There is huge demand in collages as well as corporate world also to train the freshers.
Mon Jan 03 2011, 12:55 AM
#7
hi kirangowle

Practical interfacing means ADC, 7 segment, RTC etc..


yes ur r right adc ,RTC ,steeper, servo,lcds,keypads,eeproms,pc key board ..... and many more

Do it for all the interfacing should be on same board, along with the programmer, There is huge demand in collages as well as corporate world also to train the freshers.


yes all can be done on same board
but it need sources , time and many more its in fact a team work
Mon Jan 03 2011, 01:27 AM
#8


hi kirangowle

Practical interfacing means ADC, 7 segment, RTC etc..


yes ur r right adc ,RTC ,steeper, servo,lcds,keypads,eeproms,pc key board ..... and many more

Do it for all the interfacing should be on same board, along with the programmer, There is huge demand in collages as well as corporate world also to train the freshers.


yes all can be done on same board
but it need sources , time and many more its in fact a team work

majoka



Majoka never feel alone... i am with you start your work i will help you as much i could....


off topic:

I am visiting Islamabad in next week will come in sector H-8 and G-4 in AIOU and HEC offices.... hope to meet you there...
Mon Jan 03 2011, 02:00 AM
#9
thank u coolmirza143
Mon Jan 03 2011, 02:04 AM
#10
you are welcome my friend...

Get Social

Information

Powered by e107 Forum System

Conversation

Wed Jun 03 2020, 05:21 AM
Katherine Hoag
No cost advertising for your website here: https://bit.ly/freeadsubmission
scena
Tue May 19 2020, 06:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 03:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 09:39 AM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 06:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 08:55 AM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 12:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 11:58 AM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 05:12 AM
Pearl Olin
Hello,
Wed Jan 22 2020, 01:16 PM
MINU CHAUDHARY
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.

Downloads

Comments

Davidthils
Thu May 21 2020, 08:44 AM
Jakeror
Wed May 20 2020, 09:28 PM
motorCar
Wed May 20 2020, 03:05 PM
Vordrync
Wed May 20 2020, 07:52 AM
JadenjiT
Wed May 20 2020, 03:15 AM
scena
Tue May 19 2020, 06:08 PM
CodySiz
Tue May 19 2020, 02:22 PM
ClaireSat
Mon May 18 2020, 09:50 PM

Online

Guests: 105, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 01:37 AM

Members: 38211
Newest member: Davidthils
Forum Activity
xrxx Avatar
Posted By xrxx
Thu Apr 30 2020, 06:59 AM
BCD MULTIPLICATIONAssume that you have to 2 BCD nu...
liqian Avatar
Posted By liqian
Tue Apr 28 2020, 05:26 AM
I happened to see your post and I got many useful ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 28 2020, 04:21 AM
The code is hard to read.Please zip it and attach ...
rogermado Avatar
Posted By rogermado
Sun Apr 26 2020, 01:53 AM
@ExperimenterUK, thanks for your reply. You'll fin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Apr 25 2020, 05:42 PM
Some simulators handle displays better than others...
rogermado Avatar
Posted By rogermado
Sat Apr 25 2020, 03:59 PM
Hello everyone, sorry in advance if i'm not in the...
PHANTOM28 Avatar
Posted By PHANTOM28
Fri Feb 28 2020, 10:25 AM
Hi.I hope you all can help me. I am relatively ne...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 21 2020, 05:05 PM
ajay_bhargav Avatar
Posted By ajay_bhargav
Fri Feb 21 2020, 04:45 AM
Yes you can do that.1. Create a channel @Thingspea...
ananyagupta Avatar
Posted By ananyagupta
Thu Feb 20 2020, 03:58 AM
With regards to the particular characters sent to ...