pic18f2321 reset vector wont build

Discussion in 'Embedded Systems and Microcontrollers' started by Dodgydave, Jul 19, 2013.

  1. Dodgydave

    Thread Starter Distinguished Member

    Jun 22, 2012
    4,988
    745
    I am having trouble with a template in mpasm, it just wont build if i put the reset vector in like it says

    org 0x000
    goto main

    i get these errors , so what is wrong???

    Error[113] C:\PIC_PROGS\18F2321TEST.ASM 86 : Symbol not previously defined (main)
    Error[118] C:\PIC_PROGS\18F2321TEST.ASM 86 : Overwriting previous address contents (0000)
    Error[118] C:\PIC_PROGS\18F2321TEST.ASM 86 : Overwriting previous address contents (0001)
    Error[118] C:\PIC_PROGS\18F2321TEST.ASM 86 : Overwriting previous address contents (0002)
    Error[118] C:\PIC_PROGS\18F2321TEST.ASM 86 : Overwriting previous address contents (0003)
    Halting build on first failure as requested.
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,548
    2,373
    Well the first I would say is that you do not have a label 'main' or you have assigned it as 'Main' (capital M)?
    Which of the two templates are you using?
    Max.
     
  3. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    Something, probably the template, has generated code at 0000h prior to your ORG. Your ORG resets the PC to 0000 and is clobbering that code. Search the .lst file for ORG and 0000 in the address field of the listing.
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Show us your code
     
  5. Dodgydave

    Thread Starter Distinguished Member

    Jun 22, 2012
    4,988
    745
    Fixed it, the reset vector was after the config set up. Doh!
     
Loading...