Maker Pro
Maker Pro

trouble with PICKit 2 44-pin demo board lessons

B

Brandon

Jan 1, 1970
0
I just bought a PICKit 2 with the 44-pin demo board and I get an error
"Register in operand not in bank 0. Ensure that bank bits are
correct." when I try to build the first lesson project "Hello
World" (see assembly code below). I tried all different values for
the STATUS register bits RP1 and RP0, but still get this error. Same
thing with the second lesson project. I really just want to see the
thing work at this point. Didn't think I would have to debug tutorial
code, so I assume I'm missing something obvious. Any help?


; PICkit 2 Lesson 1 - "Hello World"
;
; This turns on LED 0 on the 44-Pin Demo Board.
;
; *******************************************************************
; * See 44-pin Demo Board User's Guide for Lesson Information *
; *******************************************************************
#include <p16F887.inc>
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF &
_CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF &
_INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V

org 0
Start:
bsf STATUS,RP1 ; select Register Bank 1
bcf STATUS,RP0

bcf TRISD,0 ; make IO Pin RD0 an output
bcf STATUS,RP0 ; back to Register Bank 0
bsf PORTD,0 ; turn on LED RD0 (DS0)
goto $ ; wait here
end
 
I just bought a PICKit 2 with the 44-pin demo board and I get an error
"Register in operand not in bank 0. Ensure that bank bits are
correct." when I try to build the first lesson project "Hello
World" (see assembly code below). I tried all different values for
the STATUS register bits RP1 and RP0, but still get this error. Same
thing with the second lesson project. I really just want to see the
thing work at this point. Didn't think I would have to debug tutorial
code, so I assume I'm missing something obvious. Any help?

; PICkit 2 Lesson 1 - "Hello World"
;
; This turns on LED 0 on the 44-Pin Demo Board.
;
; *******************************************************************
; * See 44-pin Demo Board User's Guide for Lesson Information *
; *******************************************************************
#include <p16F887.inc>
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF &
_CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF &
_INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V

org 0
Start:
bsf STATUS,RP1 ; select Register Bank 1
bcf STATUS,RP0

bcf TRISD,0 ; make IO Pin RD0 an output
bcf STATUS,RP0 ; back to Register Bank 0
bsf PORTD,0 ; turn on LED RD0 (DS0)
goto $ ; wait here
end

Is it a warning or an error?
Put in
errorlevel -302
in your code
see if it goes away
 
B

Brandon

Jan 1, 1970
0
Is it a warning or an error?
Put in
errorlevel -302
in your code
see if it goes away- Hide quoted text -

Yeah, just a warning. Thanks.
 
F

Frank Buss

Jan 1, 1970
0
Brandon wrote:

I think this is the line which causes the warning:
bcf TRISD,0 ; make IO Pin RD0 an output

In general it is a good idea to write programs at the highest warning
level, without producing warnings. You could write it like this:

bcf TRISD - H'80', 0 ; make IO Pin RD0 an output
 
Top