Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

INTERRUPTS and TImers in 8051

Status
Not open for further replies.

prodigyaj

Member level 2
Joined
Jan 10, 2007
Messages
50
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,591
interrupts and timers in 8051

I have been using 8051 and programming it by C.
I have no knowledge about its assmbly code.

I wld like to know wether i can use the interrupts and the timer in the 8051 by using C ?

are these functions accessible only by assembly of the 8051 ?
 

8051 timer interrupt

Which C Compiler do you use, different compiler use different syntax for interrupt handling.
 

keil c 8051 timer interrupt

i use keil c compiler
 

interrupt using c 8051 code

if ur using keil compiler u can use interrupts and timers....u can refer mazidi text book for further references where he has clearly explained the concept of interrupts and timers using c language in keil compiler
 

8051 using interrupt c

i am actually unable to get this book ... been trying for a long time !! can u help me out online as this is really urgent for me
 

8051 interrupts

these are the function prototype for time0 and timer1 interrupt service routine
Code:
void timer0(void) interrupt 1; 
void timer1(void) interrupt 3;
don't forget to initialize timer and enable interrupt mechanism at the beginning of your main() function.
 

interrupts in 8051

There isone book named C51 Primer in the upload section of edaboard.

You will find it very usefull if you are on keil.

picstudent
 

timers in 8051

The 8051 can be simulatable in EDWinXP's Mixed mode simulator with interrupts
 

interrupts timer 8051

i hv made line tracking robos where i give the code

while(1)
{
linetrack()
{
P0= forward;

if(P1_1==1) // a software interupt that goes high on
detecing sensor high

{
P0=right
}

if(P1_2==1) //similar s/w interrup for left snsor
{
P0=left;
}
}
}

how do i use 8051 hardware interuppts for the same code
 

8051 interrupt handle using c

void INT0(void) interrupt 0
{
P0=right;
}

void INT1(void) interrupt 2
{
P0=left;
}
 

8051 interrupt c

you have not specified the port where the interrupts are to be recieved

like my sensors are in port 1.....

what if it had been in port 2 ? ?

what is change that i have to bring in order to use the interrupt in port 2 ?
 

interrupts and timers

Hi

You cant assign external interupts to whichever pins you like.
I think INT0 and INT1 are the only two external interupt pins avilable in generic 8051.(at least on atmel) and they are in PORT3.

keil C51 assigns interupt numbers to each specific interupt available for that particular chip.(You have to refer keil manual or C51 primer to assign correct numbers to specific interupts.


aupa is using that numbers in the above post

I am uploading C51 Primer here.

To moderators
(searched on the ebooks section, but cant find it there. If already there, I will delete it)

Hope this helps


picstudent
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top