write -read problem?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Location
    Ankara -Turkey
    Posts
    27

    Default write -read problem?

    Hi.

    I am using Pic 16F628A for my project.And I am using PBP 2.5.

    when I want to write and than read second item to eeprom second item is not writing on epprom memory and ı can not read it .

    Code is as below:

    ....
    ..
    ..
    A var word
    B var Word
    AB var word
    CD var word
    ------------------
    ..
    ..
    ..
    ----------------
    AB=A+B
    Write 0,AB.Byte 0
    Write 1,AB.Byte 1
    ..
    ..
    ---------------------
    ..
    ..
    CD =B-A

    Write 0,CB.Byte 0
    Write 1,CB.Byte 1
    ----------------------
    ..
    Read 0,AB.Byte 0
    Read 1,AB.Byte 1
    Read 0,CB.Byte 0
    Read 1,CB.Byte 1

    LCDOUT ,"adrste"#AB,"rtrefrt",#CB

    -------

    Question is;
    When I use write and read code for only AB item no problem code (entire code not sample) works fine.
    But when I use Write and Read for AB and CB items .AB items value is good but CB value is alltime 0 (zero) .it means CB value not writing and reading by code on eeprom.

    How can I solve this problem .?Is there anybody to help me THanks.
    Last edited by turkuaz; - 29th August 2009 at 23:29.
    Birbirimize yardım için buradayız.
    We are here to help each other....

  2. #2
    Join Date
    Feb 2007
    Posts
    55


    Did you find this post helpful? Yes | No

    Default

    hi

    you have CD declared as a word variable and also :

    CD =B-A

    did you mean CB and not CD ?

  3. #3
    Join Date
    Mar 2006
    Location
    Ankara -Turkey
    Posts
    27


    Did you find this post helpful? Yes | No

    Default sory

    Hi.
    Sory for miss writing it must be CD Not CB .
    Thanks.

    ------
    CD =B-A

    Write 0,CD.Byte 0
    Write 1,CD.Byte 1
    ----------------------
    ..
    Read 0,AB.Byte 0
    Read 1,AB.Byte 1
    Read 0,CD.Byte 0
    Read 1,CD.Byte 1

    LCDOUT ,"adrste"#AB,"rtrefrt",#CD

    -----------
    Maybe this code mustbe as;??????

    CD =B-A

    Write 2,CB.Byte 0
    Write 3,CB.Byte 1
    ----------------------
    ..
    Read 0,AB.Byte 0
    Read 1,AB.Byte 1
    Read 2,CB.Byte 0
    Read 3,CB.Byte 1

    LCDOUT ,"adrste"#AB,"rtrefrt",#CB
    Last edited by turkuaz; - 30th August 2009 at 00:59.
    Birbirimize yardım için buradayız.
    We are here to help each other....

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Code:
    Write 2,CB.Byte 0
    Write 3,CB.Byte 1
    That looks correct now. Is it working?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Mar 2006
    Location
    Ankara -Turkey
    Posts
    27


    Did you find this post helpful? Yes | No

    Default OK!

    Yes now it is working .
    Thanks
    Birbirimize yardım için buradayız.
    We are here to help each other....

Similar Threads

  1. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  2. Read Write Problem
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th June 2009, 19:03
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. problem to read write 24LC512
    By edysan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th February 2008, 21:46
  5. Read Modify Write problem?
    By markedwards in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th November 2005, 21:02

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