HELP!

Status
Not open for further replies.

davepusey

Member
I am using the MPLAB simulator to test my program but when it compiles i get error "Register in operand not in bank 0. Ensure that bank bits are correct."

Below is my code. The lines highlighted in red is where it says the error is occuring!

BSF STATUS,5 ;Switch to Bank 1
MOVLW B'11100' ;Bitmask for port A pins (0 is Output 1 is Input)
MOVWF TRISA ;Set port A pins
MOVLW B'00001111' ;Bitmask for port B pins (0 is Output 1 is Input)
MOVWF TRISB ;Set port B pins
BCF STATUS,5 ;Switch back to Bank 0
 
You will get this warning (it is a warning, not an error) every time, even when your code is corrent, it just warns you to make sure you switched banks, because TRISA is not in bank 0...

if you dont want these errors add:

ERRORLEVEL -302

to the top of youre code
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…