Why can I not use subrutines in my interrupt rutine when I program in SX/B
Hi,
I'm trying to call a subrutine from my interrupt rutine but I get an error 16 UNKNOWN COMMAND.
Is it not possible to call a subrutine from the interrupt rutine, and if not, why?
I put in an example program below to illustrate the error I get.
-Atle
'
' Device Settings
'
DEVICE SX48, OSCHS3
FREQ 50_000_000
'
' Variables
'
Tmp1 VAR Byte
Tmp2 VAR Byte
'
INTERRUPT 2000
'
ISR_Start:
' ISR code here
TogglePin
ISR_Exit:
RETURNINT ' {cycles}
' =========================================================================
PROGRAM Start
' =========================================================================
'
' Subroutines / Jump Table
'
TogglePin SUB
'
' Program Code
'
Start:
' initialization code here
TogglePin
TogglePin
' main code here
GOTO Start
'
' Use: UpdateTimerArray TimerArrayPosition ChannelNr
SUB TogglePin
Toggle RA.1
ENDSUB
I'm trying to call a subrutine from my interrupt rutine but I get an error 16 UNKNOWN COMMAND.
Is it not possible to call a subrutine from the interrupt rutine, and if not, why?
I put in an example program below to illustrate the error I get.
-Atle
'
' Device Settings
'
DEVICE SX48, OSCHS3
FREQ 50_000_000
'
' Variables
'
Tmp1 VAR Byte
Tmp2 VAR Byte
'
INTERRUPT 2000
'
ISR_Start:
' ISR code here
TogglePin
ISR_Exit:
RETURNINT ' {cycles}
' =========================================================================
PROGRAM Start
' =========================================================================
'
' Subroutines / Jump Table
'
TogglePin SUB
'
' Program Code
'
Start:
' initialization code here
TogglePin
TogglePin
' main code here
GOTO Start
'
' Use: UpdateTimerArray TimerArrayPosition ChannelNr
SUB TogglePin
Toggle RA.1
ENDSUB
Comments
'
' Subroutines / Jump Table
'
TogglePin SUB
before the interrupt code.
regards peter
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
Post Edited (Bean (Hitt Consulting)) : 6/7/2008 8:20:47 PM GMT
Sorry about. Wasn't at a computer with the IDE.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
Thank you guys.
-Atle