Originally Posted by Charles Linquis
I hate to sound dumb, but...
It has been a long time since I wrote ASM code for PICs.
My code is basically as below-
TOP:
IF TMR0 rollover then gosub TASK_SCHEDULER
IF PIR1.5 = 1 then gosub INPUT_ROUTINE
GOTO TOP
TASK_SCHEDULER:
(normally calls a bunch of very short routines - 300uSec max)
but- every once in awhile calls OUTPUT_ROUTINE
RETURN
INPUT_ROUTINE:
HSERIN stuff
RETURN
OUTPUT_ROUTINE:
HSEROUT [...]
RETURN
---------------------------------------
Questions:
Do I just put the address of 'TOP' in the interrupt vector?
> If TOP: is the label of your interrupt stubb ... yes. but, think to disable the asm interrupts while being in your receive section ...
> BUT the receive section MUST end with a GOTO, and not a RETURN ( Return address is totally false, here !!! )
Is there a way to automatically do this in PBP -
> It would have already been done, I think !!!
> Question has to be asked to Melabs or Mel Labs ( !!! ) ... I'm just a poor lonesome engineer !!! at this time, answer for me is no ...
some way that I don't have to look at the listing and find out what the actual address of 'TOP' is, and manually write that to address 0x08 (something like INT_VECTOR = TOP)?
> I do not know if labels can work here ( bi-directionnal translation ??? hex to asm and asm to hex ... hum ...) ... it's to try. But remember : you can't add or kill program lines at this step ...
Do I have to save/restore any other registers (STATUS or W, for example?)