WRITE routine for EEPROM writing


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by glaugle
    Thanks for your replies everyone
    By "everyone", I assume you mean me. Possibly a good guess since I'm the only one that replied.
    All I really wanted was to disable interrupts during the 5 critical instructions
    Then, Duh!, disable them...
    Code:
    INTCON.7 = 0
    But, since I never did get access to the guts of the PBP "WRITE" routine,
    Double Duh!, look in your PBP folder for PBPPIC18.lib, and then search for "WRITE"
    I just wrote my own routine. I called it "WRITE2", and it does what I need.
    Of course, we will never see the code.
    I tested it on my bench for many thousands of EEPROM writes, and it never fails. This is much preferred over the re-try scheme, because the re-try scheme would introduce a lot of non-deterministic timings into my program,
    non-deterministic timings, this must have some profound meaning, but just cant find it in the dictionary.
    Thanks for the effort though
    Oh sure, happy to not help, any time you want.
    DT

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


    Did you find this post helpful? Yes | No

    Default

    At any rate; you're better off making your own version to begin with instead
    of modifying a PBP library function.

    If you attempt to install most PBP patches, they'll fail if you've modified the
    library, and installing the latest PBP upgrade overwrites the library again, so
    your approach was probably still the best one in the end anyhow..;o}

    As Darrel pointed out, the library is there, and easy enough to modify. Just be
    sure you know what you're doing, and make a backup copy before tinkering
    with the original library file.
    Regards,

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

  3. #3
    glaugle's Avatar
    glaugle Guest


    Did you find this post helpful? Yes | No

    Default Very amusing

    Darrel, okay, I see that you are the only one who replied to me on this post, but I was originally referred to a different discussion group by PBP Help, and some people over there tried to give some advice too. As for your first "Duh", yes thank you, I knew how to do that, but I couldn't find out where. Your "Double-Duh" response answered that question for me. Thank you. If you read my original question, that is what I was looking for. I just needed to know where to find the libraries. As for my new routine, it's nothing special, and the reason I didn't post it is that anything I write is company-confidential, no matter how small or simple. As for "non-deterministic", it basically means that the code has the ability to do different things on different runs. For example, if I used a retry scheme for the EEPROM, then on one run, it may be able to write the EEPROM on the first try, but on the next run, it may not do it until the second try. Well, then the second run would be skewed by about 4mS longer than the first. This makes digital filters and controls very hard to manage.

    Anyway, you have helped me. In the future, if I need to hack a PBP library, now I know where they hide them. And, as Bruce pointed out, I'm probably better off leaving them alone, since an upgrade to PBP would wipe out my changes, in case I forget what I've done.

Similar Threads

  1. WRITE: One more PBP 2.60 Surprise ...
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 26th August 2009, 09:10
  2. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  3. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  4. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  5. Storing Strings using the Write command
    By BobP in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2005, 11:31

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