trouble with PICKit 2 44-pin demo board lessons

Feb 04, 2008 3 Replies

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 __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

Yeah, just a warning. Thanks.

I think this is the line which causes the warning:

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

Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required