RSS

Using External Interrupts INT0 and INT1

20 Jun

‘*******************************************************************************
‘—————External Interrupts INT0 and INT1 check Software—————-
$regfile = “m16def.dat”
$crystal = 8000000
‘————————-PORT configuration————————————
Config Portc = Output
Config Pind.7 = Output
Config Pind.6 = Output
‘————————Interrupt Configure————————————
Config Int0 = Low Level
Config Int1 = Low Level
‘—————————Enabling interrupts———————————
Enable Interrupts
Enable Int0
Enable Int1
‘———————-Reserving routines on interrupts————————-
On Int0 Abhi
On Int1 Abhishek
‘————————Main Body———————————————-
Do
Portc = &B00000001
Waitms 300
Portc = &B00000010
Waitms 300
Portc = &B00000100
Waitms 300
Portc = &B00001000
Waitms 300
Portc = &B00010000
Waitms 300
Portc = &B00100000
Waitms 300
Portc = &B01000000
Waitms 300
Portc = &B10000000
Waitms 300
Loop
End                                                         ‘end program
‘———Interrupt Service Routine (ISR) Abhi———————————-
Abhi:
Set Portd.7
Waitms 200
Reset Portd.7
Waitms 200
Set Portd.7
Waitms 200
Reset Portd.7
Return
‘———Interrupt Service Routine (ISR) Abhishek——————————
Abhishek:
Set Portd.6
Waitms 200
Reset Portd.6
Waitms 200
Set Portd.6
Waitms 200
Reset Portd.6
Return
‘*******************************************************************************

Advertisements
 
Leave a comment

Posted by on June 20, 2010 in AVR

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: