Migrating to MPASM


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    86


    Did you find this post helpful? Yes | No

    Default

    I'm using compiler version 2.47, maybe that is the problem. I see melabs updated some RAM issues with this chip. I don't know enough to know if the compiler will pass the code off to the PM assembler correctly but not to MPASM. My code has seemed to work correctly for quite a while, but perhaps I'm not pushing the right buttons to make it break.

    Thanks for checking for me Joe.

    Anyone else out there with 2.47 who can try to compile the above for me to see if they get the same results or not?

    David

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


    Did you find this post helpful? Yes | No

    Default

    The RAM issue is an easy fix. Open your 16F631.BAS file and change BANK0 $0020, $007F
    to BANK0 $0040, $007F. RAM on this one starts at $40 not $20. Save & exit.

    The EEPGD thing is due to the 16F631 not having this bit available, since it can't read/write
    to its own program memory. But the library functions for READ and WRITE use it.

    You can fix the READ/WRITE library routines:

    Open your pbppic14.lib, and scroll down to the READ library routine.

    Comment the bcf EECON1,EEPGD and add the clrf EECON1 just below it.
    Code:
     ;bcf  EECON1, EEPGD	; Read from data memory
      clrf  EECON1		; Read from data memory
    Scroll down a ways to the WRITE library routine, and do the same thing.

    I don't have a 16F631 to test, so let me know if this fixes it for you.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I am still using PBP2.5 and I get the ram errors also.

    The 16f631.bas currently has
    BANK0 $0040, $007F

    RAM END MUST BE DEFINED is the error.

    EDIT>>>
    I get the same errors with PM also... So it must not be a MPASM thing
    Last edited by mackrackit; - 13th August 2009 at 23:55.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    86


    Did you find this post helpful? Yes | No

    Default

    I had the RAM issue already fixed. I had forgotten Charles LEO helped with that back in 07 when I first started with this chip. I have since made the 2 changes to the read and write routines that Bruce gave and the errors went away. Now all that is left to do is to test it out. Thanks to everyone for your help

    David

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Luckyborg View Post
    I had the RAM issue already fixed. I had forgotten Charles LEO helped with that back in 07 when I first started with this chip. I have since made the 2 changes to the read and write routines that Bruce gave and the errors went away. Now all that is left to do is to test it out. Thanks to everyone for your help

    David
    How were the ram errors fixed?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    86


    Did you find this post helpful? Yes | No

    Default

    I had modified the file manually at Charles instructions. I originally emailed MELabs and they told me what to fix for the RAM bank problem. Bruce's instructions got rid of the 2 errors I originally posted. I never got the same error that you posted. I never had any problems with PM.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    That is interesting.
    I do not have that chip so I guess I will not worry about it on this version.

    Thanks.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Dave,

    I tried this with 2.50c and didn't get the error you show. Have you downloaded/installed
    the 2.50c patch?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. 16F914 and MPASM
    By jderson in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th February 2009, 04:21
  2. 12F675 MCLR directive MPASM
    By OLDSCHOOL in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th May 2008, 02:29
  3. MPASM 18F4550 getting started
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th September 2007, 00:59
  4. 18F8722 and MPASM confusion!
    By Jackson in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd April 2006, 02:24
  5. Converting to MPASM
    By btaylor in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2005, 02:35

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