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


Closed Thread
Results 1 to 5 of 5

Hybrid View

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

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    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

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

  4. #4
    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 : 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