Internal EEPROM Read/write Addressing Errors with 18F PIC's


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    10


    Did you find this post helpful? Yes | No

    Default On Board EEPROM - Read {address} above 255

    Hi Melanie,
    I was wondering if you could recommend a way to read an EE with an address above 255. It appears that the Read function is limited to 1 byte addressing. Even though I declare it a word. Have you found this to be true? F.Y.I. I am using 18f2620, And loving it.

    Thanks ash
    Sorry to bring up an old post.

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


    Did you find this post helpful? Yes | No

    Default

    it will work if you declare the Address variable as a word sized.
    Steve

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

  3. #3
    Join Date
    Jun 2005
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Hi Mr. E,
    I tried that but it did not work. It still loops back after address 255.

    I preload My eeprom with the EEPROM *reserved word

    eeprom 192,["11"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 208,["12"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 224,["13"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 240,["14"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 256,["15"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 272,["16"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 288,["17"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]
    eeprom 304,["18"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]

    Im sending each line to an lcd and it works fine but i cannot reach EEPROM 256. Even though my address is 256 or above. and again my address varible is a WORD, not a BYTE.



    Thanks Ash
    Last edited by atillotson; - 4th July 2005 at 17:09.

  4. #4
    Join Date
    Jun 2005
    Posts
    10


    Did you find this post helpful? Yes | No

    Default That fixes it.

    Oh, Well guess what?

    ReadMenuData:
    x = 2
    for Z = Index4 to Index4 + 15
    read Z,sendlcd[x]
    x = x + 1
    next Z
    return

    Index4 is a word like i said but Z was a byte.
    I changed it to a word and wha-la

    Thanks for your help.
    That was a really stupid mistake on my part sorry for your troubles.

    ashman

  5. #5
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Cool Preloading the EEprom with the DATA Command is a problem

    Hi Melanie,

    Just thought I'd throw in my 2 cents on this topic. If someone wants to preload the EEprom during the programming phase using PBP's DATA command, there is a PIC18F series problem. Dummy bytes (0) need to be inserted, and the address needs to be doubled (see below).
    Code:
    DATA @0,$08,0,$FE,0,$0F     ' ATTR #00
    DATA @6,$03,0,$FE,0,$0F     ' ATTR #01
    DATA @12,$02,0,$80,0,$0F    ' ATTR #02
    DATA @18,$04,0,$0E,0,$0C    ' ATTR #03
    Although this looks kinda weird, it will compile properly into the EEprom. This is only a problem with the preload function, and only with the PIC18F series (as far as I know).

    This is a known bug by MEL, and they have acknowledged its existance.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The 18F EEPROM problem was fixed in v2.45 and with the latest releases of MPLAB (MPASM). You need to upgrade BOTH. See very first post on this thread.

  7. #7
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Question

    Melanie,

    Not to say that you aren't having success, and yes I did read your original post, and no I can't run your example because I have no LCD. However I do run a rather extensive EEprom preload of my own, and it doesn't work if I use sequential addressing with the DATA command.

    Here is my system:

    PBP ver 2.45A
    Epic ver 2.44
    MPASM ver 4.01
    MicroCode Studio Plus ver 2.2.1.1
    Windows 2000 Professional

    Here is the code that does work (non sequential addressing w/dummy bytes):
    Code:
    'Text Generator 0 - Color and Enhanced Feature Attributes
    
    DATA @0,$00,0,$FE,0,$0F     ' ATTR #00
    DATA @6,$00,0,$FE,0,$0F     ' ATTR #01
    DATA @12,$00,0,$80,0,$0F    ' ATTR #02
    DATA @18,$00,0,$0E,0,$0C    ' ATTR #03
    DATA @24,$00,0,$8E,0,$0F    ' ATTR #04
    DATA @30,$00,0,$70,0,$0C    ' ATTR #05
    DATA @36,$00,0,$F0,0,$0F    ' ATTR #06
    DATA @42,$00,0,$7E,0,$0C    ' ATTR #07
    DATA @48,$00,0,$48,0,$0E    ' ATTR #08
    DATA @54,$00,0,$B0,0,$0F    ' ATTR #09
    DATA @60,$00,0,$28,0,$0C    ' ATTR #10
    DATA @66,$00,0,$16,0,$0F    ' ATTR #11
    DATA @72,$00,0,$30,0,$0C    ' ATTR #12
    DATA @78,$00,0,$9E,0,$0C    ' ATTR #13
    DATA @84,$00,0,$28,0,$0C    ' ATTR #14
    DATA @90,$00,0,$28,0,$0C    ' ATTR #15
    
    'Text Generator 1 - Color and Enhanced Feature Attributes
    
    DATA @96,$00,0,$FE,0,$0F    ' ATTR #00
    DATA @102,$00,0,$FE,0,$0F   ' ATTR #01
    DATA @108,$00,0,$80,0,$0F   ' ATTR #02
    DATA @114,$00,0,$0E,0,$0C   ' ATTR #03
    DATA @120,$00,0,$8E,0,$0F   ' ATTR #04
    DATA @126,$00,0,$70,0,$0C   ' ATTR #05
    DATA @132,$00,0,$F0,0,$0F   ' ATTR #06
    DATA @138,$00,0,$7E,0,$0C   ' ATTR #07
    DATA @144,$00,0,$48,0,$0E   ' ATTR #08
    DATA @150,$00,0,$B0,0,$0F   ' ATTR #09
    DATA @156,$00,0,$28,0,$0C   ' ATTR #10
    DATA @162,$00,0,$16,0,$0F   ' ATTR #11
    DATA @168,$00,0,$30,0,$0C   ' ATTR #12
    DATA @174,$00,0,$9E,0,$0C   ' ATTR #13
    DATA @180,$00,0,$28,0,$0C   ' ATTR #14
    
    'Text Generator 0 - Highlight, lowlight, and shadow color attributes
    
    DATA @186,$FF,0,$01         ' HighLight
    DATA @190,$DB,0,$00         ' LowLight1
    DATA @194,$49,0,$00         ' Lowlight2/Shadow/Border
    
    'Text Generator 1 - Highlight, lowlight, and shadow color attributes
    
    DATA @198,$FF,0,$01         ' HighLight
    DATA @202,$DB,0,$00         ' LowLight1
    DATA @206,$49,0,$00         ' Lowlight2/Shadow/Border
    
    'Horizontal and Vertical Start Position
    
    DATA @210,$10,0,$08         ' Horizontal - Vertical Offset
    
    'Overlay Hue Setting
    
    DATA @214,$76               ' Hue (Text Generator 2 - Dac4)
    
    'Fader Transparency and Time variables
    
    DATA @216,$63,0,$00         ' T_Level and B_Level
    DATA @220,$32,0,$32         ' UP_Time and DN_Time
    
    'RTCC Time and Date Mode variables
    
    DATA @224,$00,0,$00         ' TimeMode and DateMode
    And here is the code that doesn't work (sequential addressing):
    Code:
    'Text Generator 0 - Color and Enhanced Feature Attributes
    
    DATA @0,$00,$FE,$0F     ' ATTR #00
    DATA @3,$00,$FE,$0F     ' ATTR #01
    DATA @6,$00,$80,$0F     ' ATTR #02
    DATA @9,$00,$0E,$0C     ' ATTR #03
    DATA @12,$00,$8E,$0F    ' ATTR #04
    DATA @15,$00,$70,$0C    ' ATTR #05
    DATA @18,$00,$F0,$0F    ' ATTR #06
    DATA @21,$00,$7E,$0C    ' ATTR #07
    DATA @24,$00,$48,$0E    ' ATTR #08
    DATA @27,$00,$B0,$0F    ' ATTR #09
    DATA @30,$00,$28,$0C    ' ATTR #10
    DATA @33,$00,$16,$0F    ' ATTR #11
    DATA @36,$00,$30,$0C    ' ATTR #12
    DATA @39,$00,$9E,$0C    ' ATTR #13
    DATA @42,$00,$28,$0C    ' ATTR #14
    DATA @45,$00,$28,$0C    ' ATTR #15
    
    'Text Generator 1 - Color and Enhanced Feature Attributes
    
    DATA @48,$00,$FE,$0F    ' ATTR #00
    DATA @51,$00,$FE,$0F    ' ATTR #01
    DATA @54,$00,$80,$0F    ' ATTR #02
    DATA @57,$00,$0E,$0C    ' ATTR #03
    DATA @60,$00,$8E,$0F    ' ATTR #04
    DATA @63,$00,$70,$0C    ' ATTR #05
    DATA @66,$00,$F0,$0F    ' ATTR #06
    DATA @69,$00,$7E,$0C    ' ATTR #07
    DATA @72,$00,$48,$0E    ' ATTR #08
    DATA @75,$00,$B0,$0F    ' ATTR #09
    DATA @78,$00,$28,$0C    ' ATTR #10
    DATA @81,$00,$16,$0F    ' ATTR #11
    DATA @84,$00,$30,$0C    ' ATTR #12
    DATA @87,$00,$9E,$0C    ' ATTR #13
    DATA @90,$00,$28,$0C    ' ATTR #14
    
    'Text Generator 0 - Highlight, lowlight, and shadow color attributes
    
    DATA @93,$FF,$01        ' HighLight
    DATA @95,$DB,$00        ' LowLight1
    DATA @97,$49,$00        ' Lowlight2/Shadow/Border
    
    'Text Generator 1 - Highlight, lowlight, and shadow color attributes
    
    DATA @99,$FF,$01        ' HighLight
    DATA @101,$DB,$00       ' LowLight1
    DATA @103,$49,$00       ' Lowlight2/Shadow/Border
    
    'Horizontal and Vertical Start Position
    
    DATA @105,$10,$08       ' Horizontal - Vertical Offset
    
    'Overlay Hue Setting
    
    DATA @107,$76           ' Hue (Text Generator 2 - Dac4)
    
    'Fader Transparency and Time variables
    
    DATA @108,$63,$00       ' T_Level and B_Level
    DATA @110,$32,$32       ' UP_Time and DN_Time
    
    'RTCC Time and Date Mode variables
    
    DATA @112,$00,$00       ' TimeMode and DateMode
    I have compiled it both ways several times, and the sequential addressing example fails to work every single time (when I view the configuration menu that is part of my main program, I can see that the EEprom data is all messed up, also the video characteristics which are based on this data do not function properly).

    I have also read the readme files that came with PBP 2.45, and no where is it mentioned that the EEprom problem was fixed in this version. However on the MEL upgrade page under the PBP ver 2.44 it lists: Changes PIC18Fxxxx DATA and EEPROM to allow odd locations (This would seem to suggest that the problem was fixed in ver 2.44 and not in ver 2.45, although the wording is strange).

    Once again, I'm not saying you are wroung, but please tell me why you think it doesn't work in my situation.

    Thank you,

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, 15:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 04:17
  3. Read/write variable into PIC internal eeprom
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th August 2008, 08:06
  4. Multiple Pics accessing single EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd February 2008, 18:22
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 20: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