Code Problem - Strings/ LCD/ internal EEPROM


Closed Thread
Results 1 to 15 of 15
  1. #1
    Join Date
    Nov 2004
    Posts
    25

    Default Code Problem - Strings/ LCD/ internal EEPROM

    hi everybody ,
    I am using this forum for the last 2 years and i ve always encountered good technical info and fantastic answers with the "search" option...but this time unfortunately no...
    So i am posting for some help for me or others that came across with a problem like my own in the future:


    I developing a bit confusing program, meteorological station with lots of info, temperature, humidity , etc etc, and everything works ok.
    But now i ve to create a way to the user insert the name of the city/country , record it in the internal PIC eeprom and after display it ...with 2 buttons ( right ,left - change a letter & press both it records it in the EEPROM....
    The commands itself - accessing the eeprom, write /reading it is a walk in the park with PBP, reading from buttons also , lcd , ok , …but in a “global view” how to with 2 buttons and LCD can i do such a simple task that is a user to record a Country or city name ( and not from a pre-existent table) and after be able do display it directly from the eeprom in the LCD...

    Any “wiz kids” over there ;-) ?
    Thanks a lot for any help as i am going crazy by the "no Strings available in PBP"

    best regards,
    JPin

    PS: i ve tried array & ASCCI table and lookdown routines , etc ,etc , but always a not working routine so , any hint/advice/code by the pros ( and we always know their names (Melanie, Darrel , etc …) would be amazing for everyone that’s struggling with user defined messages to be stored and retrieved/displayed in the Lcd (Darrel already has great code for predefined messages , but those are pre-stored in the eeprom of the Pi c, with no user directly access/alter)
    Last edited by jorge; - 1st October 2006 at 22:30.

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


    Did you find this post helpful? Yes | No

    Default

    For the buttons stuff, you may find some tips on the following thread
    http://www.picbasic.co.uk/forum/show...utton+function

    For the strings... no need for that, just place the characters in a array, then send the whole array content to the internal EEPROM at a specific adress.

    Once you know where the data is located... you can access, read, write, modify etc etc.
    Steve

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

  3. #3
    Join Date
    Nov 2004
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    yep, as you say “part by part” it is easy , but when you need to have to scroll with 2 buttons ever the alphabet and send one by one the user selected character to eeprom , this isn’t as easy as it seems … this is where things get “dirty”.
    As for the rest, for example:

    Write:
    DATA $00,"Switch01",0
    Reading:
    For CounterA = 0 to 16
    Read CounterA,value
    If CounterA=0 then goto Main
    LCDOUT value
    Next CounterA

    Works ok , but as a whole …i´ve not been able and not seen anything working …
    The code for strings by Darrel is absolutely brilliant but it misses one point … all the strings are predefined ….not a single one can be user “ personalized”/edit/create (when pics´s in runtime) …this is where I am searching an answer.

    Anyway thanks a lot Mister_E :-)
    Last edited by jorge; - 1st October 2006 at 22:47.

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jorge
    y....

    Write:
    DATA $00,"Switch01",0
    Reading:
    For CounterA = 0 to 16
    Read CounterA,value
    If CounterA=0 then goto Main
    LCDOUT value
    Next CounterA

    Works ok , but as a whole …i´ve not been able and not seen anything working …
    How could that work? it would exit the loop the first time it starts running.
    CounterA=0 and then it exits FOR loop when CounterA=1.

    Any missing condition there? or was it supposed to be like If Value=0 then goto Main ?
    Last edited by sayzer; - 2nd October 2006 at 03:37.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Nov 2004
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    you are right but this was only a "coderip" out off context.
    the main problem was the one in the main post.
    rgds,
    Jorge

  6. #6
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Talking

    What is the problem ?

    String in an array ?

    Username var Byte(size_of_username)

    Writing to LCD ?

    LCDOUT STR Username\size_of_username

    Writing to EEPROM ?

    For I=0 to size_of_username:Write EEProm_Adress+I,Username[I]:Next I

    ???
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  7. #7
    Join Date
    Nov 2004
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    First of all thanks for your valuable hints.
    :-)
    I will sure try your approach
    Although, i was thinking about Darrel’s approach to strings and a way of manipulate , edit/create them...
    See the Darrels great post:
    http://www.pbpgroup.com/modules/wfse...p?articleid=10
    but it lacks user defined messages to be stored in EEPROM...like cruising the alphabet and selecting/creating letter by letter the new text....or something like that.

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


    Did you find this post helpful? Yes | No

    Default

    Thanks jorge,

    But, as you've already noticed. They are two different things entirely.

    I think you should stick with BigWumpus' idea for getting things in and out of the EEPROM, but the editing of the text is going to be a bit harder.

    And, like Melanie said in the post that mister_e pointed out. It's going to be easier with 3 buttons.

    Sorry, not much help.
    <br>
    DT

  9. #9
    Join Date
    Nov 2004
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Thanks a lot for every post !
    One more question:
    can i increment letters as I do with numbers ( using ASCII & char vars...?)
    for example if had to select number i could cycle between then like
    if keypress = 1 then
    number = number +1 ,
    ….
    but with letters " letter = letter +1 " would it give me "D" char if it was in the "C" before pressing the button ? using the reference ASCII number?
    Or is there another and more efficient way ?!?

  10. #10
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Check Lookup & Lookdown examples.


    -------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jorge
    hi everybody ,

    But now i ve to create a way to the user insert the name of the city/country , record it in the internal PIC eeprom and after display it ...with 2 buttons ( right ,left - change a letter & press both it records it in the EEPROM....
    The commands itself - accessing the eeprom, write /reading it is a walk in the park with PBP, reading from buttons also , lcd , ok , …but in a “global view” how to with 2 buttons and LCD can i do such a simple task that is a user to record a Country or city name ( and not from a pre-existent table) and after be able do display it directly from the eeprom in the LCD...
    jorge,
    <h3>Hi, I'm not an expert of any kind, or a whiz kid.</h3> I too have attemped to use 2 buttons held down for a third effect and concluded it was not something to be done with a PIC, what I did was go back to discrete logic using a BCD decoder, as I remember a 7442 I think. to give 3 outputs with 2 buttons. Yes it requires 3 pic pins this way but still only 2 switches.
    Joe

  12. #12
    Join Date
    Nov 2004
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    The button select & save problem is already working ( there ´s a post by Melanie with good info and a single button  …) so with I feel almost “over button” with 2…
    Now I am battling with the scrolling routine to select the letters & after recording them is EEPROM using ASCII…lets see what happen.
    Thanks for your advice although!

  13. #13
    Join Date
    Nov 2007
    Location
    Bohol, Philippines
    Posts
    4


    Did you find this post helpful? Yes | No

    Default pls help me!the same problem but I used pic16f877a

    i cannot read or write on the internal eeprom

    is there a need of interrupt disable to access the eeprom?

  14. #14
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kindred22 View Post
    i cannot read or write on the internal eeprom
    is there a need of interrupt disable to access the eeprom?
    So, what time of day is it? The internal EEPROM of a PIC only works on NON leap years during a full moon on wednesday nights with 3 pineapples within 200 meters and a fork standing on one tine......................................

    If you would like some REAL help, you may want to post some code, maybe a quick description of something like, oh I don't know----which compiler/assembler you are using, etc.etc...

    And also, have you read the datasheet concerning the internal eeprom of the PIC you are using? Pretty much every PIC out there has the same types of restrictions when using the internal EEPROM (except for a couple of examples) as far as interrupts go. There is a need to do some disabling...the datasheets will tell you when...

  15. #15
    Join Date
    Nov 2004
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    So, what time of day is it? The internal EEPROM of a PIC only works on NON leap years during a full moon on wednesday nights with 3 pineapples within 200 meters and a fork standing on one tine......................................

    If you would like some REAL help, you may want to post some code, maybe a quick description of something like, oh I don't know----which compiler/assembler you are using, etc.etc...

    And also, have you read the datasheet concerning the internal eeprom of the PIC you are using? Pretty much every PIC out there has the same types of restrictions when using the internal EEPROM (except for a couple of examples) as far as interrupts go. There is a need to do some disabling...the datasheets will tell you when...
    well when i begun this thread it was like 3 !!! years ago !!!! even i dont know how i make it work...but the RFM seems to be the best help now ;-) as skimask said ...or at least print an exemple of your code to others chk it out ...

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Problem runing my code
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 1st December 2009, 20:36
  3. problem with my code
    By civicgundam in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd February 2008, 01:52
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

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