18F1320 ... Strange Memory


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    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 17:34.

  2. #2
    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?

  3. #3
    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

  4. #4
    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 " !!!
    *****************************************

  5. #5
    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 19: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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    	
    WRITE 2,NeutreC.lowbyte
    WRITE 1,NeutreC.highbyte
    WRITE 4,GaucheC.lowbyte
    WRITE 3,GaucheC.highbyte
    WRITE 6,DroiteC.lowbyte
    WRITE 5,DroiteC.highbyte
    WRITE 7,Invert   <<<<<<<<< Invert is declared as BIT
    WRITE 8,Side   <<<<<<<<< Side is declared as BIT
    I don't use PicBasic.

    Will "WRITE" support the BIT data type?
    Try to declare the variables Invert and Side as BYTE.

    Best regards,

    Luciano

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Luciano

    Bit is well written in the EEPROM ...

    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 " !!!
    *****************************************

  8. #8
    inteco's Avatar
    inteco Guest


    Did you find this post helpful? Yes | No

    Default

    I notice some problem with the programmer software too
    in writing the EEPROM data for the memory location.
    But seems melabs has corrected on their newer ver 3.31.
    I can tell from running debugging while reading the EEPROM
    data via rs232.

Similar Threads

  1. Strange pic 16f877a memory loss
    By DavyJones in forum General
    Replies: 23
    Last Post: - 6th July 2009, 21:27
  2. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 01:22
  3. Replies: 4
    Last Post: - 2nd March 2007, 07:12
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 03:37
  5. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 19: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