Assembly language Compiling problem...pls help

Discussion in 'Embedded Systems and Microcontrollers' started by melathj, Apr 21, 2009.

  1. melathj

    Thread Starter Member

    Apr 21, 2009
    12
    0
    I,ve been doing a project which requires programming of Microcontroller. I got the program from a site http://www.hamradio.cc/projects/morse_code_decoder/picmrsrc.asm

    When I went to burn this program to Microcontroller (PIC 16F84), technician told me that program shows error related to memory mapping (He says memory assigned is not enough). He doesnt know more about assembly language programming. So guys if any of u have program for compiling this, please help me by correcting the mistake (Email ID is mjamsheed@gmail.com)...or atleast suggest a person from whom I can get help...thanks.
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,692
    901
    First, the program is written for the 16F84A; you are trying to use a 16F84. At a minimum, you need to change the header.

    Second, be sure your programmer can program the 16F84.

    Finally, check page 78 or so of the 16f84A datasheet for a table of differences (http://ww1.microchip.com/downloads/en/devicedoc/35007b.pdf). There also used to be a migration document to go from the 16F84 to the 16F84A that described the differences. I did not find it right off, though.

    John
     
  3. melathj

    Thread Starter Member

    Apr 21, 2009
    12
    0
    John, thanks for the reply. I'm using 16F84A only.
     
  4. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    If you go to the page that links to your code http://www.hamradio.cc/projects/Morse_Code_Decoder_Circuit.php you will see that the original assembler code has become scrambled. The poster identified one area of duplicated code and removed it but as far as I can gather he has not actually tested this modified code so there is no guarantee that is does not contain more errors.

    The code is written in very poorly commented assembler and would take a lot of time and effort to unravel the author's intentions and then debug the actual code. Certainly more more time and effort than I would be prepared to devote to it.
     
    Last edited: Apr 22, 2009
  5. melathj

    Thread Starter Member

    Apr 21, 2009
    12
    0
    Thanks for the reply. Once I compiled this, it specifically shown that error was related to memory mapping. So can any one please check only that memory mapping?
     
  6. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    I got the program to compile but whether its going to work is anybodies guess.

    The problem is in the RAM allocation, line 43 "org 0x0c" should read "udata 0x0c".
    Also make sure that in the menu "Project > Build Options > Project" under the MPASM tab, you select the "Generate relocatable code" button.
     
  7. melathj

    Thread Starter Member

    Apr 21, 2009
    12
    0
    Thanks a lot Alex. It was a great help.
     
Loading...