Using on-chip EEPROM (DATA) memory like serial memory - possible?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Using on-chip EEPROM (DATA) memory like serial memory - possible?

    Hello,

    I'm trying to find out how tu use the on-chip EEPROM (DATA) memory like a serial memory.

    It is not about reading one byte after another byte; this is obvious.

    No, actually, if I encode data in 5 bits and don't want to lose the 3 bits left, it will be tiresome to retrieve the data if I have to manipulate this byte by byte.

    In my case, I have a 16F88 where the data memory adresses are from $00 to $0FF (256 bytes) and I would like to read the first bit from the MSB in the first memory location to the last bit from the LSB in the last memory location; bitwise.

    Having a look at Melanie's thread about referencing (in the FAQ), I was imaginating some trick to realize this (creating a memory array or whatever).

    The datasheet sais "The EEPROM data memory allows single byte read and write".

    I've learned up to now that datasheet say what you can do but not always what you cannot do.

    So, is it or is it not possible?
    Roger

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hmmm, bitwise EEPROM,

    How bout ...
    Code:
    EEPROM 0,[0,1,2,3,4,5,6,7,8,9,0] ; Just some data to work with
    
    TheBit  VAR WORD  ; (256*8 = 2047 max)
    
    TheByte VAR BYTE
    BitMask VAR BYTE
    Result  VAR BYTE
    
    TheBit = 42
    GOSUB GetEEbit
    ; Result = 1 (bit 2 of byte 5)
    STOP
    
    GetEEbit:
        TheByte = TheBit / 8
        BitMask = DCD (TheBit // 8)
        READ TheByte, Result
        Result = Result & BitMask
        if Result then Result = 1
    RETURN
    DT

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default maths....

    Hello Darrel,

    Thanks a lot. It works absolutely perfect and it is just "upseting" me since this solution seems now so obvious; I have almost shame I have asked...

    Again (for me), it is a math problem; nothing to do with possible or not.

    Time to go back to my PC & breadboard and finish this project...

    Thank you very much.
    Roger

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Hello Darrel,

    Thanks a lot. It works absolutely perfect and it is just "upseting" me since this solution seems now so obvious; I have almost shame I have asked...

    Again (for me), it is a math problem; nothing to do with possible or not.

    Time to go back to my PC & breadboard and finish this project...

    Thank you very much.
    What about that post from Melanie awhile back about accessing variable arrays by the bits...

    http://www.picbasic.co.uk/forum/showthread.php?t=544

    It just might be even easier for you to use one of these methods

    EDIT TO THE EDIT-ee (which is me) --> WHOOPS! I just saw that you've already seen that one! My bad...

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Thanks a lot. It works absolutely perfect ...
    Excellent!

    Quote Originally Posted by flotulopex View Post
    ... since this solution seems now so obvious
    It's always easy when the answers right in front of you.
    It's before then, that's the problem.

    No sweat.
    <br>
    DT

Similar Threads

  1. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 02:46
  2. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  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