18F1320 ... Strange Memory


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653

    Question 18F1320 ... Strange Memory

    Hi all,

    I wrote a nice piece of code ( 3200 hex lines ...) for a 16F648 an a 16F88 : Everything works OK ! ... thank you.

    BUUUUUT, Trying to use it aboard a 18F1320 ... things become quite funny :

    Let's see:

    Program runs ... but...

    I have to memorize in the EEPROM 8 values "in a row" ( from 1 to 8 ) and then Three others, one by one, at locations 10,11, and 12.

    The first 8 are well Stored ... but the 3 others never want to be stored !!!

    Somewhere else, after that, I can modify values 1 and 2 ...

    They are properly modified and stored !!!!

    So, shortly ... my 18F1320 seems to have only 8 addressable EEPROM registers.
    I tried to push the 3 lonesome values to $11, 12 and 13 ... no more result.

    Anyone understanding that ???

    ( Setting WREN to 1 doesn't modify anything ... )

    Alain
    Last edited by Acetronics2; - 4th April 2006 at 17:53.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Unhappy

    Hi, Mel

    No idea ???

    ( source has of course being written in PbP ... ~ 700 lines )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Disable interrupts when you write the internal EEPROM.
    (From the datasheet).

    Can you write a small PicBasic program that only
    write and read the byte at location 10?

    Can you write location 10 with a chip programmer and
    then read the same location with PicBasic?

    Can you write a small assembly program that only
    write and read the byte at location 10?
    (See datasheet).

    Best regards,

    Luciano
    Last edited by Luciano; - 5th April 2006 at 16:34.

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


    Did you find this post helpful? Yes | No

    Default

    Kinda difficult to comment without seeing the code that reads and writes to the EEPROM... really as Luciano states, create some simple code to write to EEPROM, then read it back and verify.

    What I normally do, is also read the EEPROM back in my Programmer (always assumining your has that capability) and doubly confirm what I've written is actually stored there. That way you can concentrate on debugging the READ or the WRITE part of your code.

    Of course you do have the latest PBP and MPLAB that has eliminated the internal EEPROM anomalies of the earlier versions?

  5. #5
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Is your PIC code protected

    Hi,

    I once found on a PIC18F452 that if I codeprotect the first 512 bytes (boot) of the chip then my eeprom storage would no longer work. Leaving it out and protecting the other pages did the trick.
    Regards

    Sougata

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Unhappy Nothing new at sight ...

    Hi, Mel and Luciano

    PbP is 2.46 "patched" release, and MPASM v 5.02 ... and ... no chance to use PM here !!! ( 18F1320 not supported ... it says)

    If you want, I send you the code ... no secrets there !!!

    There are no interrupts in this program ... I ever try not to use ... to avoid input parasitic signals difficulties ...

    I've read memory w/ my picstart ... that's how I found what was happening.

    The only thing I didn't try was to write into the memory not only 8 but, say, 20 values following each others...

    I changed the values types ... no more luck !!!

    And do not forget memory use is OK with 16F devices ...

    Thanks for your Help

    Alain
    Attached Files Attached Files
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Unhappy Waterloo , sad country ...

    Last news :

    I added a value at position 9 (0 ) and copied the "writes" from location 1 to 9 to 21 to 29 ...

    result : all values Written ... except value at loc.2 that has been overwritten by "FF" .... my three lonesome further values always aren't written.

    may be there are overwritten too ... i'll never know.

    one sure thing ... there's a writing problem !!!

    Alain

    Hi, SOUGATA

    All writing protections have been removed ... I have to program in two times : at first config , and then program. default configs locks the programming !!!
    Last edited by Acetronics2; - 5th April 2006 at 18:10.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Truth slowly raises from earth ...

    Hi, Mel

    What a nice Job .... "La Claaaasse" as we say here !!!

    just one comment: I noticed here memory locations were ERASED to FF instead of Written to expected values ...

    For my tests I programmed all EEPROM to zero .... and I read some "FF" 's

    see attachment for that.

    You're right ... result is the same. In this case not exactly !!! I did a little mistake Testing at the beginning unwritten Offsets as Words ( Declared as bytes ... no, not on the head, please ...).

    So, without this little mistake, I'd never had found this BUG ... my program would simply have locked at 2nd power-up !!!


    My Address is not a secret ...

    xxx

    FRANCE

    Close to DIEPPE or Le Tréport along the Channel, for your next visit to France ( at home coffee is free ...)

    Thanks one more time

    Alain


    Hi, Luciano

    Nice result from you too ... Microchip search engine can be upgraded, I didn't find anything in the knowledge base !!!

    This device is intended to be used on big scale flying models ...

    so, security first !!! ... no 18F1320 reference or soft will be published then ( I saw some, last year on another project ... gasp !!! ).

    I'll do a trail with BOR enabled to the lowest possible voltage to confirm ... as, to this day, std. 4.3v BOR enabled was equal to plane death !!!

    I'll wait for BUGS to be solved ... to use a 18F1320.

    As Mel has written, There's no "common people" way of identifying good and bad parts ... my Picstart didn't allow me to read DEVIDs ... ( restricted area !!! ) .

    Thanks a lot for your help ( in general on this forum ) and here for me.

    Alain
    Attached Files Attached Files
    Last edited by Acetronics2; - 15th May 2010 at 10:38. Reason: Deleted my own address ...
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Btw... I checked EEPROM WRITE on the good PIC all the way down to 2.15v Vdd and it works fine. It's on it's way to you first thing Monday morning.

    When you get it, send back one of your duds to me... they're more interesting to play with than working ones.

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default THE Thing

    Of course, the red servo is the master, and the black one, the ... slave.

    French humour must go on !!!

    Mel, I have a piece w/ pin B.0 "grilled" ( but processor running ) ... do you want it too ??? It has been socketed Upside Down ... during the 122 th trail !!!

    Alain
    Attached Images Attached Images   
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Luciano : 2 Points ...

    Hi, Luciano

    I've set BOR to ON ... then writing is correct !!!

    You're the winner of the day ...
    Attached Files Attached Files
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  12. #12
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Alain,

    Your chip is a D0 Silicon version. (Same date as Melanie).

    If I am the winner of the day, Microchip is the loser of the day because
    they will have to add this workaround also in the Errata Silicon D0 document.

    Glad to hear that things are moving forward!

    Best regards,

    Luciano

Similar Threads

  1. Strange pic 16f877a memory loss
    By DavyJones in forum General
    Replies: 23
    Last Post: - 6th July 2009, 20:27
  2. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  3. Replies: 4
    Last Post: - 2nd March 2007, 06:12
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 18:38

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