Converting to MPASM


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Posts
    41

    Default Converting to MPASM

    I have never used MPASM, always PM that comes with PBP. I have a 500 line program that compiles and runs perfectly under MicroCode Studio Plus with PBP 2.46 and PM but when I try and use MPASM my system falls apart. The PBP program using PM compiles to 2512 words - with MPASM it generates 3444 errors. That is an average of 5 errors per line of program code. Not what I had in mind.

    I downloaded MPASM v02.15 from the MicroChip site & unzipped it to its own directory. I pointed MCSP to the appropriate directory in View/Compile and Programme Options. I read the MCSP help. I checked the MPASM notes in the PBP manual. Still got 3444 errors.

    Can someone please point me at the basics of using MPASM? Are there settings outside MCSP that need tweaking? Must all commands be in upper case? Do I need a blank at the start of evry line? There has to be a fundamental something I am missing.

    For example the following few lines work in PM.

    @ Device pic16F877, HS_OSC, BOD_OFF, PWRT_ON, WDT_ON, PROTECT_OFF

    trisa = %11111111
    trisb = %11111111
    trisc = %10011111

    But in MPASM I get the following error messages (text abbreviated)
    16F877.inc..unknown processor (16F877)
    Cannot open file (include file "16F877.INC" not found)
    Processor type is undefined
    Duplicate label ("_PORTL"..........)
    Symbol not previously defined PORTC
    Symbol not previously defined TRISB
    Symbol not previously defined TRISC

    I have started reading the MPASM manual but at 278 pages that will take a while.

    Any tips greatly appreciated.

    thanks
    Brian
    Last edited by btaylor; - 3rd November 2005 at 05:09.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Pretty much the ONLY difference between PM and MPASM are the Configuration Fuse Definitions. There is a thread in the FAQ section on this topic. Get those right and you're in business.

  3. #3
    Join Date
    Mar 2003
    Posts
    41


    Did you find this post helpful? Yes | No

    Default MPASM help

    Hi Melanie,

    Thank you for the prompt assistance. I had in fact read your post on configuration fuses in the FAQ prior to my message. I should have mentioned that. Sadly it did not cut it for me.

    For example I took the line in PBP
    @ Device pic16F876A, HS_OSC, BOD_OFF, PWRT_ON, WDT_ON, PROTECT_OFF

    and re-wrote it to suit MPASM as
    @_config_HS_OSC &_BOD_OFF &_PWRT_ON &_WDT_ON &_PROTECT_OFF

    The error count on compiling under MPASM jumped from 3444 errors to 6259 errors - hardly a leap forwards.

    Must I cover EVERY fuse in the chosen controller? Can some be left as don't cares or whatever the default is?

    Can I explicitly declare the processor type in the @_config_ line in MPASM? A project at the moment has three separate interacting parts with three different processors and jumping between them occasionally calls up the wrong controller. PM lets me know - can MPASM do that?

    Is there some magic at the start of the @_config line? Is it @__config or @ __config. Must it start in the first or second column or what?

    Cheers
    Brian
    Last edited by btaylor; - 3rd November 2005 at 09:25.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Firstly, it's really ONLY the CONFIG settings... so nail those and your problems will disappear. If you comment-out all your defines, you'll probably find that the chances are you'll compile without error with a set of defaults. Now, Microchip are changing their config declaration syntax, so this all depends on the version of MPLAB/MPASM you've got. So that we're playing in the same ball-game, go download the LATEST version of MPLAB/MPASM, then come back, tell me you've done it and also tell me the Config Setup's you need. I'll then walk you through it with that example...

  5. #5
    Join Date
    Mar 2003
    Posts
    41


    Did you find this post helpful? Yes | No

    Default MPASM version issues

    Melanie, Thanks for the prompt response. I first went to microchip and on their home page typed MPASM into their search bar. It took me to a page where I downloaded what appeared to me to be the latest versions of MPASM. MPASM™ Assembler Last Updated: 7/21/03

    Following your advice, I have now tried again to find MPASM but this time went into the QuickLinks search bar and clicked on the development software area where I can find MPLAB IDE ver 7.20 and 7.22 but no direct reference to MPASM. I am downloading this monster now, but it will take a while.

    I did try commenting out the @_config_ line earlier but no joy. You are probably right in suggesting a version issue. The MPASM I am downloading is version 5.00 which is included in MPLAB 7.22. Does this look like the right version?

    Cheers
    Brian

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    MPASM is a component part of MPLAB. MPLAB 7.22 is the latest at this time containing MPASM 5.0 of 30 September 2005.

Similar Threads

  1. Help setting up MPASM with MicroCode studio
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 23rd November 2008, 05:12
  2. 12F675 MCLR directive MPASM
    By OLDSCHOOL in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th May 2008, 01:29
  3. MPASM vs PM
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th October 2007, 01:29
  4. MPASM 18F4550 getting started
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th September 2007, 23:59
  5. 18F8722 and MPASM confusion!
    By Jackson in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd April 2006, 01:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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