How to write/read strings EEPROM/LCD


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Red face To quote Homer S

    Quote Originally Posted by g-hoot View Post
    Joe,



    What did you mean by "Also see select case instructions in the manual."...am I missing something there?
    Dohe!
    Well it's like this, these coke bottle thick glasses . . . I didn't see you had used select case already, Just ignorant of me, sorry.
    JS
    EDIT: You might check with Darrel, I think he has something that measures the code size for each bit of code, but understand this, my memory isn't worth much.
    Last edited by Archangel; - 29th January 2007 at 06:33. Reason: add
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    "the only thing you have to keep in your PIC is the EEPROM start address of your string"

    Ahh, I think it's starting to sink in to my thick melon. What I was trying to do was set up the alphabet in upper and lower case, and numbers and a few other characters in eeprom, and then call each one individually. I noticed in many places that people were looping through like this:
    for i = 0 to 7
    read i, LCDtext(i)
    next i

    but that wouldn't work with the alphabet deal since I had to jump around to different, non-sequential eeprom locations.
    So, what you are saying is that I would save each actual string in eeprom and then just give the loop the starting location of the string. I'm only using about 16 locations of eeprom right now, and this chip has 256, so that leaves me enough room for about thirty 8 character strings, so that should help a bunch. I'll give that a shot tonight.
    Thanks all,
    Gary

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


    Did you find this post helpful? Yes | No

    Default

    can you post your text string here?

    maybe there's some word you can use from one and merge into another... but will this worth?
    Steve

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

  4. #4
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    can you post your text string here?

    maybe there's some word you can use from one and merge into another... but will this worth?

    Hey Steve,
    I think you have got me thinking enough that I can get enough space free to add what I need. The code is pretty long so I just emailed you the code also, just to take a quick look at it if you want. Please don't spend too much time on it. Thank you very much for taking the valuable time to look at it.
    Gary

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    You might check with Darrel, I think he has something that measures the code size for each bit of code, but understand this, my memory isn't worth much.
    I think you talk about...

    How much code would a code hog hog
    http://www.picbasic.co.uk/forum/showthread.php?t=2418
    Steve

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

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Right-O

    Quote Originally Posted by mister_e View Post
    I think you talk about...

    How much code would a code hog hog
    http://www.picbasic.co.uk/forum/showthread.php?t=2418
    Yes Sir, Mister_e !
    That was what I saw!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    Man, this thing is a pain in the booty. Using eeprom works great until i get more that about 30 characters saven in it. Then my LCD just displays black rectangles/blanks. If I delete all of the charcters from eeprom and just leave about 50, it works fine? I dunno, maybe the pic nees a pause somewhere at startup to read the eeprom? Here's the sub:

    EEtext:
    LCDtextNm = 0
    For EEnum = EEnum TO EEnum+7
    Read EEnum, LCDtext[LCDtextNm]
    LCDtextNm=LCDtextNm+1
    Next EEnum
    LCDOut STR LCDtext
    Return

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


    Did you find this post helpful? Yes | No

    Default

    this one is dangerous and you trick the compiler
    Code:
    For EEnum = EEnum TO EEnum+7
    doing that you'll jump in an endless loop. i don't know what's around your sub but i think this one make much sense

    Code:
    EEtext:
        For CharAddress = EEnum TO EEnum+7
             Read CharAddress, Char
             LCDOUT Char
             Next 
        
        Return
    Steve

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

  9. #9
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    This is getting plain silly. If I have this:
    EEPROM 30,["R","e","a","d","y"," "," "," "]
    EEPROM 38,["D","e","l","a","y"," "," "," "]
    EEPROM 46,["1","5"," ","S","e","c"," "," "]
    EEPROM 54,["2","0"," ","S","e","c"," "," "]

    The run through the sub:

    EEtext:
    LCDtextNm = 0
    EnumC = EEnum
    For EEnum = EnumC TO EnumC+7
    Read EEnum, LCDtext[LCDtextNm]
    LCDtextNm=LCDtextNm+1
    Next
    LCDOut STR LCDtext
    Return

    Ready will display, but the other 3 strings produce a blank screen. If I replace the "e" in ready with a space " " then it works fine, except for the fact that it now says "R ady". ;-) I have had lots of strange happenings with the LCD, like for instance, I can't display a number ending in "0". Also can't display the name "MCKELLOP". Who knows?....
    Gary

  10. #10
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    Hold the phone! I added a Pause 10 right after the Read statement and it seems to be working now.

  11. #11
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Just curious

    G-HOOT!
    I like that handle, sounds very celtic, anyway on to business . . .
    I was curious, about the quantity of text strings you are attempting to store and recall, and how you intend to call them up, also curious what chip you chose to use. I made up a device which does essentialy this and I stored all my strings in codespace, using a 16f648A. In fact I still have not used eprom in a project yet. Still mastering the basics.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Parsing Strings...
    By TerdRatchett in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 15th February 2009, 05:13
  2. Please help with storing strings in codespace
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2008, 02:02
  3. Processing lengthy strings
    By sougata in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st March 2006, 06:27
  4. I2CWRITE writing Strings to EEPROM
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th March 2005, 20:45
  5. reading 2c strings
    By beto in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 22nd December 2004, 16:26

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