free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
carlos_10111
Wed Nov 19 2008, 12:27AM
 User Offline
Registered Member #8376
Joined: Tue Jun 10 2008, 10:05PM

Posts: 26
Thanked 0 times in 0 posts
Hello every one, i've been strugling a bit with the use of interrupt when using C.
I'm using Multisim, which has HI-TECH compiler. If any one can help me on how to declare interrupt, and calling them using C.
I just wanted to use the in a small program. for instance, im flashing LEDs in a certain sequence, but when a certain switch is pressed, i want the sequence to change. i thought of using one of the external interrupts.

Your input will be apreciated.

Back to top


pdi33
Wed Nov 19 2008, 05:16AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 773
Thanked 186 times in 181 posts
declaring interrupts in C for AVRs is fairly simple use the following syntax:
CODE:

#include <avr/interrupt.h>

ISR(INT0_vect)
{
    // user code here
}

 


here the external interrupt int0 will be processed.u can get more info about the various definitions of the interrupts of AVRs from the documentation on this link;
http://www.nongnu.org/avr-libc/


[ Edited Wed Nov 19 2008, 05:16AM ]

* inspired to develop,developing to inspire *
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems