Hi,
I’m working on a small 16f88 project in assembler
using the speakjet code as template…
*Can someone explain the use of SWITCHBANK_…?
I understand the banked system with pic18f… with BANKSEL variable
but I don’t know when to switch banks with a 16f88
my variable declarations:
shared_ram udata_shr
W_TMP res 1
STATUS_TMP res 1
FSR_TMP res 1
gpr0 udata
NOISE res 3
TMP1 res 1
…and the code without switches
IRQ_Handler_NoiseInt
;; noise generator
;; new bit = b18 exor b13
;; shift NOISE one to the left, insert new bit as LSB
; TMP1 = NOISE >> 2
rrf NOISE, W
rrf WREG, W
movwf TMP1
; WREG = NOISE+1 >> 4
rrf (NOISE+1), W
swapf WREG, W
; WREG = WREG exor TMP1
xorwf TMP1, W
; carry = LSB of WREG
rrf WREG, W
; three byte shift register
rlf (NOISE+2), f
rlf (NOISE+1), f
rlf NOISE, f
; ouput new shift register value to RA2
; the output value is in the carry flag from last shift
bc IRQ_Handler_NoiseInt_Out_1
bcf PORTA, 2
goto IRQ_Handler_NoiseInt_End
IRQ_Handler_NoiseInt_Out_1
bsf PORTA, 2
IRQ_Handler_NoiseInt_End
goto IRQ_End
*I also get a assembler error on WREG (symbol not defined)
does anybody knows how to solve this?
Michaël