--- Andy Armstrong wrote:> > Once they're right you'll just keep using the known good header > though so in the long run it's probably better to keep them separate :) > > -- > Andy Armstrong, hexten.net I'll say! Final(?) ver of the programme below. Calling the ISR as a subroutine in its entirety ---> //bad idea// :( Saw it in a piclist example, thought it was a good way to compact one's code. Changed my mind now. :| I'm building up a lib of standard macros/subs that I tend to use all the time so I guess keeping the main programme itself in a "standard form" is the way to go too. Thankz guys! Debbie __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON org 0x00 start goto main org 0x04 intrpt: goto alert ;********************************************************* ;INCLUDED SUBROUTINES ;********************************************************* include "can_dly.asm" ;Delays for the IR wave train include "ir_codes.inc" ;MACROs for IR wave train. ;********************************************************** ;Main Programme .. begin from upper half of Bank #0. ;********************************************************** main: clrw ; Make sure PIC OUTPTs are LOW, Set i/p's HIGH ; => MAX232 o/p is LOW (inverted) movwf PORTB clrw ;Set all PORTA low movwf PORTA BANK_1 movlw CONFIG_B ;See PIN ASSIGNMENTS movwf TRISB movlw CONFIG_A movwf TRISA BANK_0 clrf FSR IR_LED_OFF ;Make sure the IR LED is OFF ;****************************************************************** ;Configure the interrupts ;****************************************************************** setint: BANK_1 movlw b'10011111' ; Works with b7=1! movwf OPTION_REG BANK_0 PAGE_0 movlw b'00011000' ;Disable interrupts for now. GIE=0 movwf INTCON <.. clear registers etc ..> loop: ;Get ready to watch .... <.. housekeeping subroutine calls ..> movf PORTB,w ;Read PORTB and then bsf INTCON,GIE ;Enable the interrupts nop sleep ;Shut down and wait for a bandit nop bcf INTCON,GIE goto loop ;Go back to watch mode ... <..Inline subroutines - lots of ...> ;the interrupt handler, code now inline => NOT a subroutine! alert: PUSHSTATUS ;Save current configuration int_break01: ;Breakpoint for de-bugging <... isr code : calls subroutines from main programme.> int_break02: ;End of ISR de-bug breakpoint POPSTATUS retfie end ____________________________________________________ Do you Yahoo!? Listen to over 20 online radio stations and watch the latest music videos on Yahoo! Music. http://au.launch.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist