Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

error in hex file

Status
Not open for further replies.

Gaston

Member
i keep getting an error.

Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F628 "ledport7.asm" /l"ledport7.lst" /e"ledport7.err"
Message[302] C:\MPLAB\PROJECTS\LEDPORT7\LEDPORT7.ASM 19 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\MPLAB\PROJECTS\LEDPORT7\LEDPORT7.ASM 20 : Register in operand not in bank 0. Ensure that bank bits are correct.
Loaded C:\mplab\projects\ledport7\ledport7.COD.
BUILD SUCCEEDED: Sat Dec 23 20:30:06 2006


here is the peice of code it is refering to

bsf STATUS, RP0 ;select bank 1
movlw b'00000000' ;set PortB all outputs
----> movwf TRISA
movwf TRISB ;set PortA all outputs
bcf STATUS, RP0 ;select bank 0
clrf PORTA
clrf PORTB ;set all outputs low


the arrow points to the specific line
i checked the data sheet and TRISA ans TRISB is on bank 1. i even added a line

bcf STATUS,RP1
to see if RP1 wasn't set properly. i can't see whats wrong
 
You don't have an error as MPLAB stated "BUILD SUCCEEDED". The "messages" are not errors.

However, it would be simpler to do it this way.
Code:
  clrf  TRISA;set PortA all outputs
  clrf  TRISB;set PortB all outputs
 
If you find it annoying you can add the following line at the start of your code:
Code:
errorlevel  -302              ; suppress message 302 from list file
It is just a reminder to ensure that you have the correct bank bits set. I find it kind of silly because there is no warning for registers in bank0 and you could very well be in banks 1,2,3,etc and there would be no warning. If it was really smart it would only warn you if the bank bit were NOT set correctly instead of warning you about the possibility of it.
 
i was confused because it did say that it succeded but then like you said, it said there was something wrong not that there may be something wrong. and on top of that i keep getting an error that says Program Verify Error at Program Address 0x000. i'm going to start a new thread on that one
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top