Newbe how to save srtrings


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Location
    morocco
    Posts
    16

    Default Newbe how to save srtrings

    how to save string in eeprom ?
    string ex: "hello world" and each time i get different string i want to save it

    Code:
    SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
    B0 =  B0 [ ARRAYVAR + 1]  ?????
    WRITE B0,ARRAYVAR
    I NEED HELP I KNOW ITS WRONG THIS CODE THANKS
    SORRY FOR MY EMGLISH

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Your code will only write to eeprom once.

    Code:
    SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
    B0 =  B0 [ ARRAYVAR + 1]  ?????
    WRITE B0,ARRAYVAR
    try this maybe? Not sure if this works but should

    Code:
    index var byte
    code_index var word
    ArrayVar var byte[64]
    code_index = 0
    SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
    for index = 1 to 64
    WRITE code_index,ArrayVar[index]
    code_index = code_index + 1
    next
    Last edited by InitialDriveGTR; - 22nd January 2010 at 16:59. Reason: fix code

  3. #3
    Join Date
    Jan 2010
    Location
    morocco
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by InitialDriveGTR View Post
    Your code will only write to eeprom once.

    Code:
    SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
    B0 =  B0 [ ARRAYVAR + 1]  ?????
    WRITE B0,ARRAYVAR
    try this maybe? Not sure if this works but should

    Code:
    index var byte
    code_index var word
    ArrayVar var byte[64]
    code_index = 0
    SERIN2 PORTB.0,16780,[WAIT(J),STR ArrayVar\n]
    for index = 1 to 64
    WRITE code_index,ArrayVar[index]
    code_index = code_index + 1
    next
    thank you DriveGTR for help i will try it and post result

Similar Threads

  1. long countdown timer, how to save power?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 15th November 2008, 05:15
  2. Using serial eeprom to save data ?
    By iugmoh in forum General
    Replies: 4
    Last Post: - 8th February 2008, 08:36
  3. Replies: 5
    Last Post: - 29th January 2008, 09:19
  4. how to save value in pic16f84a
    By ibra in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th August 2007, 13:22
  5. 12F629 won't erase and bandgap save?
    By Keith55555 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th April 2004, 01:28

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