Mikroelektronika MIKROE-724 データシート

ページ / 726
144
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
For the sake of backward compatibility, user may write also:
sub procedure int1() org IVT_ADDR_U1RXINTERRUPT
asm 
  nop
end asm
end sub
which is equivalent to:
sub procedure int1() iv IVT_ADDR_U1RXINTERRUPT
asm 
  nop
end asm
end sub
Is is recommended that interrupts are handled in this way for the sake of better readability of the user projects.
Interrupt Example
Here is a simple example of handling the interrupts from 
Timer1
 (if no other interrupts are allowed):
//-------------- Interrupt routine
sub procedure Timer1Int iv IVT_ADDR_T1INTERRUPT
  ‘** it is necessary to clear manually the interrupt flag:
  IFS0 = IFS0 and $FFF7   ‘ Clear TMR1IF
  ‘** user code starts here
  LATB = not PORTB        ‘ Invert PORTB
  ‘** user code ends here
end sub