Hi Guys,
OK I thought I had this working where I use a flag in the interrupt. Unfortunately its not now.
When its in the MAIN loop and i click on RB4 it interrupts (fine) and sets the flag bit 0 however when it returns to the loop again the btfss ignores the flag and it continues to loop... if I again hit the stimulus it now goes to that routine but when it does the FSR does not accept the value in W leaving the indirect address with H'00'.
I have included a video of it (including unknowingly some music)...
**broken link removed**
and I have also included the whole program including the two include files...
It would be much better to get this method to work rather than manage the functionality required from within the interrupt..
Kind Regards
Simon
OK I thought I had this working where I use a flag in the interrupt. Unfortunately its not now.
When its in the MAIN loop and i click on RB4 it interrupts (fine) and sets the flag bit 0 however when it returns to the loop again the btfss ignores the flag and it continues to loop... if I again hit the stimulus it now goes to that routine but when it does the FSR does not accept the value in W leaving the indirect address with H'00'.
Code:
SHIFT_KEYS
clrf FSR
SET_FSR
movf FCHAR_MAX,W
subwf FCHAR_STRT,W
movwf FSR ;FSR IS AT THE FIRST ADDRESS ENTERED.
movf FCHAR_MAX,W ;FCHAR_MAX IS OUR RUNNING COUNT.
movwf FCHAR_CNT ;WE CAN DEC THIS VAR WITHOUT SCREWING UP CHAR CNT.
btfss STATUS,Z ;CHECK FCHAR_CNT > 0?
goto EXCEED_MAX_FREQ? ;WE HAVE MORE THAN ONE CHARACTER IN OUR FREQ..
;ELSE ITS THE FIRST CHAR...
movf LAST_CHAR,W ;THIS IS THE FIRST CHAR SO CHECK IF ITS >"0".
btfss STATUS,C ;CHECK FCHAR_CNT = 0?
goto ZERO_ERROR ;DROP OUT. CANT HAVE "0" AS FIRST CHAR.
incf FCHAR_MAX ;YES ITS > "0" SO WE CAN NOW INC OUR COUNTERS.
incf FCHAR_CNT
movwf INDF ;[COLOR="Red"]Happens here INDF is not applied to address 027[/COLOR]
I have included a video of it (including unknowingly some music)...
**broken link removed**
and I have also included the whole program including the two include files...
It would be much better to get this method to work rather than manage the functionality required from within the interrupt..
Kind Regards
Simon