;********************************************************************************
ADCON1 is in bank1 and ADCON0 is in Bank0, a banksel is needed before movwf ADCON0
But if i compile this code:
#chip 16F876a, 20
ADCON1 = 128
ADCON0 = 128
I have this in asm:
;Start of the main program
movlw 128
banksel ADCON1
movwf ADCON1
movlw 128
banksel ADCON0
movwf ADCON0
BASPROGRAMEND
Now The banking is ok.
I have the same results with (0.9 16/6/2009)
but have correct banking with (0.9 24/1/2009)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Compiling this code with last update (0.9 9/8/2009):
#chip 16F876a, 20
my_sub
Sub my_sub
ADCON1 = 128
ADCON0 = 128
end sub
I have this in asm:
;********************************************************************************
MY_SUB
movlw 128
banksel ADCON1
movwf ADCON1
movlw 128
movwf ADCON0
banksel STATUS
return
;********************************************************************************
ADCON1 is in bank1 and ADCON0 is in Bank0, a banksel is needed before movwf ADCON0
But if i compile this code:
#chip 16F876a, 20
ADCON1 = 128
ADCON0 = 128
I have this in asm:
;Start of the main program
movlw 128
banksel ADCON1
movwf ADCON1
movlw 128
banksel ADCON0
movwf ADCON0
BASPROGRAMEND
Now The banking is ok.
I have the same results with (0.9 16/6/2009)
but have correct banking with (0.9 24/1/2009)
Interesting...
If i compile this code:
#chip 16F876a, 20 'modelo de pic y velocidad de reloj
my_sub
Sub my_sub
ADCON1 = 128
ADCON0 = 128
nop
end sub
I have the correct banking:
;********************************************************************************
MY_SUB
movlw 128
banksel ADCON1
movwf ADCON1
movlw 128
banksel ADCON0
movwf ADCON0
nop
return
;********************************************************************************
Not sure what was causing that, but I've rewritten the bank selection code (it had other problems), so that bug is now fixed in the latest update.
Right... bug fixed. thanks 1+