Symbol not previously defined (B’00000000’) error in my first program...

Discussion in 'Embedded Systems and Microcontrollers' started by umitse, Oct 24, 2010.

  1. umitse

    Thread Starter New Member

    Oct 24, 2010
    1
    0
    Hi,

    I'm pretty new to programming and just wanted to put this sample program into my 16f84 to see if everything is ok with my programmer device, my pic and other stuff..

    but when i "build all" it gives these three error;

    Error[113] C:\USERS\UMIT SEDGI\DESKTOP\PROJECTS\MPFIRST.ASM 46 : Symbol not previously defined (B’00000000’)
    Warning[224] C:\USERS\UMIT SEDGI\DESKTOP\PROJECTS\MPFIRST.ASM 47 : Use of this instruction is not recommended.
    Error[113] C:\USERS\UMIT SEDGI\DESKTOP\PROJECTS\MPFIRST.ASM 49 : Symbol not previously defined (B’00000001’)

    Helps are highly appreciated in advance...

    thanks




    ; File: LEDOn.asm
    ; Date: June 1,2006
    ; Author: Julio Sanchez
    ; Processor: 16F84A
    ;
    ; Description:
    ; Turn on LED wired to Port-B, line 0
    ;===========================
    ; switches
    ;===========================
    ; Switches used in __config directive:
    ; _CP_ON Code protection ON/OFF
    ; * _CP_OFF
    ; * _PWRTE_ON Power-up timer ON/OFF
    ; _PWRTE_OFF
    ; _WDT_ON Watchdog timer ON/OFF
    ; * _WDT_OFF
    ; _LP_OSC Low power crystal occilator
    ; * _XT_OSC External parallel resonator/crystal oscillator
    ; _HS_OSC High speed crystal resonator (8 to 10 MHz)
    ; Resonator: Murate Erie CSA8.00MG = 8 MHz
    ; _RC_OSC Resistor/capacitor oscillator
    ; |
    ; |_____ * indicates setup values
    processor 16f84A
    include <p16f84A.inc>
    __config _XT_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF
    ;========================================================
    ; variables in PIC RAM
    ;========================================================
    ; None used
    ;========================================================
    ; m a i n p r o g r a m
    ;========================================================
    org 0 ; start at address 0
    goto main
    ;=============================
    ; space for interrupt handler
    ;=============================
    org 0x04
    ;=============================
    ; main program
    ;=============================
    main:
    ; Initialize all line in Port-B for output
    movlw B’00000000’ ; w = 00000000 binary
    tris PORTB ; Set up Port-B for output
    ; Turn on line 0 in Port-B. All others remain off
    movlw B’00000001’
    ; ———-|
    ; | |____ Line 0 ON
    ; |________ All others off
    movwf PORTB
    ; Endless loop intentionally hangs up program
    wait:
    goto wait
    end
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    You need to replace the ’ with '
    The one you are after is on the same key as @ on my keyboard, might vary with region.
    Ignore the remaining warning, it should work fine.
     
  3. lihle

    Active Member

    Apr 12, 2009
    83
    3
    okay.
    first of all i will refer you to the forum rules that you have to read before posting. this is because your code is not easy to read. what you can do is to download PDF that will help you to convert the text to PDF then attached it.

    here is a simple solution:
    configure your 16f84 as follows.

    Initialise
    org 0x 0000
    goto main
    org 0x006

    main :
    bsf STATUS,RP0 ;select bank
    movlw b'00000000'
    movwf TRIS B ;make port B output.
    bcf STATUS,RP0

    end

    hope this will help you begin your project.

    lihle
     
Loading...