WRITE data to EEPROM on PIC18F8621


Closed Thread
Results 1 to 15 of 15
  1. #1
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8

    Default WRITE data to EEPROM on PIC18F8621

    Has anyone had experiance using READ and WRITE on the 18F8621. Using READ I can read the values stored in the EEPROM but I cannot WRITE new values to the internal EEPROM. Why is this? It works on the 16F devices I used in the past.

    I guess this is probably not spacific to this device and assume its due to the migration from 16f to 18f.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dschafer View Post
    Has anyone had experiance using READ and WRITE on the 18F8621. Using READ I can read the values stored in the EEPROM but I cannot WRITE new values to the internal EEPROM. Why is this? It works on the 16F devices I used in the past.

    I guess this is probably not spacific to this device and assume its due to the migration from 16f to 18f.
    What version of PBP?

  3. #3
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    PicBasicPro version 2.4.6.0

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dschafer View Post
    PicBasicPro version 2.4.6.0
    Show us the program that's failing you...

  5. #5
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Show us the program that's failing you...
    Its a long program, but what i'm trying to do using READ and WRITE is as follows:

    'at the start of the program read these values from EEPROM and place in the variables'

    Read 0, trip_amount[0]
    Read 1, trip_amount[1]

    'so far so good, this works as per usual'

    If S1 = 1 Then
    Read 0, temperary[0]
    Read 1, temperary[1]
    If (trip_amount[0] <> temperary[0]) OR (trip_amount[1] <> temperary[1]) Then
    Write 0, trip_amount[0]
    Write 1, trip_amount[1]
    LCDOut $FE, 1
    LCDOut $FE, $C0 , " SAVING CHANGES"
    Pause 1000
    EndIf
    Goto Menue_2_0
    EndIf

    'I get a SAVING CHANGES on the LCD but the eeprom values dont change'

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    well that should work fine, must be something in the rest of the program that isn't being shown, maybe a variable declaration, changing the variable itself in another part of the program, etc.etc.

  7. #7
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    No, that is not the case, I have checked over the code many times.

    One thing I did notice is when I program the PIC the fuse settings for 'EEPROM table write protect' and 'CONFIG table write protect' are both DISABLED, But when I read the HEX, EEPROM, and fuse data back to the PIC programer both of those setting are ENABLED.

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


    Did you find this post helpful? Yes | No

    Default

    High likely it's down to your PIC programmer. Which one?
    Steve

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

  9. #9
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    High likely it's down to your PIC programmer. Which one?
    I use the DIY K128 v141204

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


    Did you find this post helpful? Yes | No

    Default

    and which software?
    Steve

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

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dschafer View Post
    No, that is not the case, I have checked over the code many times.
    Of course it's never the program writer's fault, is it?

    Quote Originally Posted by dschafer View Post
    One thing I did notice is when I program the PIC the fuse settings for 'EEPROM table write protect' and 'CONFIG table write protect' are both DISABLED, But when I read the HEX, EEPROM, and fuse data back to the PIC programer both of those setting are ENABLED.
    So set them so that the 'protect' options are enabled, read them back, see if they're disabled, and try the program again. Maybe the software for the programmer is bass-ackwards...

  12. #12
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    and which software?
    MPLAB IDE v7.21

    The K128 programer has its own software

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


    Did you find this post helpful? Yes | No

    Default

    maybe it worth to visit their forum and ask?
    http://www.websitetoolbox.com/tool/mb/diykit
    Steve

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

  14. #14
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mister_e View Post
    maybe it worth to visit their forum and ask?
    http://www.websitetoolbox.com/tool/mb/diykit
    I think you're on the right track.

    Just tried loading the program again, both settings disabled.
    did not power up the PIC
    read rom, eeprom, fuse data, and both setting are already enabled.

    also tried inverting these settings as you sugested but they read the same (enabled)

    will look further at the programmer K128 possibly require updated firmware.

    Thanks for all the help, will let you know how I go.

  15. #15
    Join Date
    Mar 2007
    Location
    Melbourne AUSTRALIA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Problem Solved

    Thanks very much for your help. You leed me in the right direction, the direction of the programmer itself. The DIY K128 programmer had a small bug. Installing DIYpack26b2 has fixed the problem.

    PS. Still very happy with the programmer, its a great unit!

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. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 02:46
  3. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  4. Internal EEPROM Read/write Addressing Errors with 18F PIC's
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 18
    Last Post: - 12th July 2005, 19:42
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

Members who have read this thread : 1

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