t.man
New Member
does it mean "banksel" is not executed?
when i build this code i get this message output for both
:
and
Message[302] ...... : Register in operand not in bank 0. Ensure that bank bits are correct.
the code:
is there a thing called internal oscillator in PIC16f877a?
when i build this code i get this message output for both
Code:
clrf TRISB ;make them all output
and
Code:
movwf OPTION_REG
Message[302] ...... : Register in operand not in bank 0. Ensure that bank bits are correct.
the code:
Code:
;toggle LED for each tmr0 overflow
;developer: ????
;version 0.0
;for PIC: 16f877a
;
;
processor 16f877A
include "p16f877A.inc"
__config _CP_OFF & _WDT_OFF & _PWRTE_ON & _RC_OSC
org 0x00
goto main
org 0x04
goto ISR
init
banksel TRISB
clrf TRISB ;make them all output
movlw b'10000100'; clock/32
banksel OPTION_REG
movwf OPTION_REG
banksel PORTB
clrf PORTB ;all output pins low
bsf INTCON, TMR0IE;tmr0 overflow
bsf INTCON, GIE;enable interrupts
return
main
call init;set up the PIC
loop
goto loop;do nothing, interrupt will take you out of here
ISR
xorlw 0x01
movwf PORTB;toggle LED
retfie
end
is there a thing called internal oscillator in PIC16f877a?