Interrupts in 1280
Posted: 22 June 2009, 1:30 AM
Hi,
I need to use hardware interrupts for zx 1280. I went through the documentation for enabling the interrupts in Atmega 1280 datasheet. I tried the following** code but the code did not run until commented out the EIMSK register statement.
This code shows the debug statement in Main as long as I comment out the "Register.EIMSK = &H01" statement. It never enters the ISR, though I apply a corresponding trigger.
Kindly help me with this issue.
Also, I need to know as to what would happen if the H/W interrupt pin is open. That is, say if the interrupt is configured to trigger on logic 1, and the int pin on port D is open initially, would it trigger if I give logic 1 on open pin? Or do I have to ground the open pin when not in use?
Regards,
Angad.
[admin edit: added code tags]
I need to use hardware interrupts for zx 1280. I went through the documentation for enabling the interrupts in Atmega 1280 datasheet. I tried the following** code but the code did not run until commented out the EIMSK register statement.
Code: Select all
Sub Main()
Dim switch_input as Byte = 0
Main_loop:
call putpin(D.0,0)
call putpin(D.1,3)
Register.EICRA = &H01
Register.EIMSK = &H01
Register.SREG = &H80
debug.print "the code runs "
End Sub
ISR INT0()
for ijk = 1 to 10
debug.print "Reached ISR"
next ijk
End ISR
Kindly help me with this issue.
Also, I need to know as to what would happen if the H/W interrupt pin is open. That is, say if the interrupt is configured to trigger on logic 1, and the int pin on port D is open initially, would it trigger if I give logic 1 on open pin? Or do I have to ground the open pin when not in use?
Regards,
Angad.
[admin edit: added code tags]