PDA

View Full Version : Compiler Errors



Conspiracy Bro
- 1st November 2004, 10:51
I do not know what the problem is but i can't get rid of these compiler errors, would anyone have any idea? I am a beginner with programming PIC's. The errors are listed below following the code that the compiler does not like. Any help here would be greatly appreciated. I am using a PIC16F628

Message[302] C:\KEYPAD.ASM 36 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\KEYPAD.ASM 38 : Register in operand not in bank 0. Ensure that bank bits are correct.

BSF STATUS,5
MOVLW b'11111000'
MOVWF TRISA
MOVLW b'11100000'
MOVWF TRISB

Warning[205] C:\KEYPAD.ASM 290 : Found directive in column 1. (end)

Error[173] C:\KEYPAD.ASM 291 : source file path exceeds 62 characters (C:\KEYPAD.ASM)

Error[173] C:\KEYPAD.ASM 291 : source file path exceeds 62 characters (C:\P16F628A.INC)

mister_e
- 1st November 2004, 14:58
just a simple question here. wich software do you use to compile assembler ? MPLAB?

In case you use PicBasic your assembly language lines will not work insead you do not declare these lines as assembly section.

ASM
bsf PORTA.0
....
ENDASM

regards

Archilochus
- 1st November 2004, 15:25
Hi Conspiracy Bro,
On the"message 302"s - I think that's because TRISA and TRISB are both in memory bank 1.

The ASM command sets the bank to zero, so you'll have to set the bank back to 1 in your ASM section before modifying the TRIS registers.

Make sure to re-set the bank as needed before leaving the ASM section.


<<<EDIT>>>> Duhh - I now see you did that already...

mister_e
- 1st November 2004, 16:57
After a few try, i appear that you'll always get error when dressing to TRIS. there's another method and it will gives you also an error message

like this:
MOVLW b'11111000'
TRIS PORTA
MOVLW b'11100000'
TRIS PORTB


They will say that is not recomended...bla bla...

In your case

list p=16f628
include "p16f628.inc"
org 000H
goto start

ORG 005H

start CLRF PORTB
CLRF PORTA
BSF STATUS,RP0 ;SWITCH TO BANK1
MOVLW b'11111000'
MOVWF TRISA
MOVLW b'11100000'
MOVWF TRISB
BCF STATUS,RP0 ;RETURN TO BANK0

;place you code there
;

END



this is working but with error message bullsh... on BANK0 that we set correctly... as i expect.

regards