EEPROM / interrupts


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default EEPROM / interrupts

    I see that in PBPPIC18.LIB the line -

    ifdef WRITE_INT then
    (disable interrupts)

    and enable after the WRITE.


    Does this mean that it is no longer necessary to disable INTs before an EEPROM write?
    And does the routine enable interrupts even if they weren't enabled when the routine was entered?
    Charles Linquist

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I should have read my earlier post before I sent it. Too early.

    I see that in PBPPIC18.LIB (PBP2.60)

    **************************************
    ;* WRITE : Write data to on-chip EEPROM
    *************************************

    ifdef WRITE_INT then
    (disable global interrupts)
    (WRITE EEPROM)
    ...
    ifdef WRITE_INT then
    (enable global interrupts)


    Does this mean that it is no longer necessary to disable INTs before an EEPROM write?
    And does the routine enable interrupts even if they weren't enabled when the routine was entered?
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    Hi Charles,

    Does this mean that it is no longer necessary to disable INTs before an EEPROM write?
    Yes. WRITE will automatically clear GIE for you if you have DEFINE WRITE_INT 1 declared.

    And does the routine enable interrupts even if they weren't enabled when the routine was entered?
    Yes. It sets GIE to re-enable global interrupts whether you're actually using interrupts or not. It assumes you are if you include this define.
    Regards,

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

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Bummer!

    Too bad it doesn't save INTCON, clear it, then restore it after the WRITE.

    I'm turning INTs on and off a lot of places in my program.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    Hey Charles,

    I hear you. But it's really easy to modify your PBP libraries. Just make sure you keep a copy of your library mods, since the next update will overwrite everything you've changed.

    And, if it's a patch, you'll get that dreaded "hey .. no-can-do since you have a modified library..;o)

    Still the best compiler on the planet.
    Regards,

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

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I didn't want to admit it, but I have already made about a dozen changes to the library.
    I made the change I described about an hour ago. It even works!
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    I didn't want to admit it
    I kind of figured you had, but I didn't want to tip-off the PBP police...;o)

    You still using those HUGE 18F parts for everything?
    Regards,

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

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I would use an 18F8723 running at 40 to blink a LED!

    Those big parts were the reason I had to start modifying the libraries in the first place. I needed to access the upper half of memory using PBP 2.47. By setting TBLPTRU to *my* variable (usually "1") instead of clearing it, WRITECODE, READCODE, ERASECODE became a lot more usable - and no LONGs were needed. Setting it to $30 is fun, too. I clear it when I exit the routine so that I don't make PBP mad.


    My latest concoction uses two '8723s strapped together (for more I/O and processing power), with a 12F675 also on the board for good measure.

    Intel is up to 4 cores, but I'm catching up!
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    I would use an 18F8723 running at 40 to blink a LED!
    I thought so. You're just like my best friend who drives a ferrari to pick up hamburgers
    for our football game get-togethers.

    He also drives an el-cheapo Ford truck, but only to pick up rocks for his landscaping....;o)
    Regards,

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

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  3. 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
  4. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

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