Compiler Errors


+ Reply to Thread
Results 1 to 4 of 4

Thread: Compiler Errors

  1. #1
    Conspiracy Bro's Avatar
    Conspiracy Bro Guest

    Default Compiler Errors

    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)
    Last edited by Conspiracy Bro; - 1st November 2004 at 12:12.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    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
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    May 2004
    Location
    New England
    Posts
    164

    Default

    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...
    Last edited by Archilochus; - 1st November 2004 at 16:29.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    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
    Code:
    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
    Last edited by mister_e; - 1st November 2004 at 17:59.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Compilation errors - strange
    By tetanus4 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th October 2009, 19:04
  2. Replies: 3
    Last Post: - 1st July 2008, 21:07
  3. compiler help!!!!
    By MINHLE in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th April 2008, 18:52
  4. Picbasic Pro Demo assembly errors
    By mikeRho in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd January 2008, 07:41
  5. Microcode Studio Plus compile/assmebly errors
    By mikehagans in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th February 2006, 22:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts