Topic : Interruptions with Timers in C

Forum : 8051

Original Post
Post Information Post
July 18, 2007 - 5:14pm
Guest

Hello to everybody!

I'm posting here to ask a question about interruptions.
I made a program in Ride with the Assembly language.
This program has an interruption with Timer0 that is called every 1 second.

My question is:
How can I make interruptions in C language?
Could anyone help me please?
I'm using the 8951.
Thanks a lot!!!
Bye!

Replies
Post Information Post
+1
0
-1
July 23, 2007 - 4:07pm
Guest

Hello,

everything is written in RC51 documentation. To make an interrupt routine, declare a void(void) function and use the specific keyword 'interrupt'. Example :

void Timer0_Routine(void) interrupt 2
{
}

I don't know the interrupt number of Timer 0 on your device, so I've put 2 as an example. This number will be used to calculate the interrupt vector address where to locate the interrupt routine.

regards
Lionel

+1
0
-1
July 24, 2007 - 5:54pm
Guest

Ok, thanks lionel ^^