EEROM problems in 16F877A


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default EEROM problems in 16F877A

    I have a system with a 12 way rotary switch. The switch position is read by the ADC and the result converted to a number 0 to 11. That switch position then generates an index to an array of 12 entries, each of 18 bytes, stored in the EEROM. The array first byte is "Valu" and the second byte is "Scale". The next 16 characters are a message to be displayed to the user for that switch position. The user can increment or decrement "Valu" and when he presses ENTER the new number for "Valu" is written to the EEROM.

    I should be able to write a total of 18 characters including the 16 character message to every one of the twelve array locations but I get EEROM collision error messages for all the values where index/2 is an odd number. In these locations, I can only write a total of 17 characters to these locations.

    When I run the program and display the 18 characters stored at each array location, every instance of Valu and of Scale are correct. The message strings however are only correct if index/2 is even. For all where index/2 is odd, the message starts with a different (stray) character.

    Has anyone seen this before? Is there a problem in PBP 2.47? I seem to recall an upgrade/patch to PBP a few revisions ago to allow EEROM writing to odd locations. I have checked the Melabs site but can't find anything related to PBP 2.47.

    The code is attached.

    Cheers
    Brian
    Attached Files Attached Files
    Last edited by BrianT; - 30th April 2007 at 06:56. Reason: sense

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Brian,

    I think it's the dollar signs in your data statements.
    They shoud be @ signs, like the rest of them.
    <br>
    DT

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Or simply remove all of them + @ signs. Still possible to use Labels to point to the start address of the Message string you want. 'Embedded string in codespace' is another approach.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4


    Did you find this post helpful? Yes | No

    Default Thanks - my mistake in the code

    Thanks for the replies. Amazing and annoying that I missed the very obvious $ instead of @ in some of the data statements. It compiles without any error message.

    I can't put the text in code space until I change assemblers from PM to MPASM but that is probably not far off.

    Cheers
    Brian

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 00:52
  2. 16F877 vs. 16F877A
    By DavyJones in forum General
    Replies: 12
    Last Post: - 11th April 2009, 18:22
  3. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  4. 16F877A stack problems
    By rocketman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st October 2004, 16:54
  5. Problems with 16F877A code
    By NightHawk2 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th August 2003, 01:36

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