Having issues with Read and Write Fcn's


Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Having issues with Read and Write Fcn's

    Lots of problems.
    The max value a word variable can store is 65536,
    so what's this supposed to do:
    Code:
    d0 = (d0-48)*100000
    Any value in other than zero in d0 will result in at least 1000000
    which severely overflow that variable, and then you do it again and again.
    and yes, I see you are subtracting from an ASCII value to acquire a real value.

    It looks like you're also only reading and writing one byte to EEPROM
    which might be fine as long as the value is always less than 256.
    The long you are trying to write is likely four bytes.

    Is there really a long variable type in PBP now?
    Something like this might work if there is:
    Code:
    long j = 0;
    
    long = long + (d0-48)*100000
    long = long + (d1-48)*10000
    long = long + (d2-48)*1000
    long = long + (d3-48)*100
    long = long + (d4-48)*10
    long = long + (d5-48)
    Depending on which var the left side of the sum is calculated in,
    otherwise you'll need to be more creative.
    Last edited by Art; - 7th June 2013 at 04:02.

Similar Threads

  1. PLEASE HELP...read write issues
    By nomad77 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th March 2011, 15:39
  2. Read Write Problem
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th June 2009, 20:03
  3. Write. Read. (How hard can it be?)
    By Meriachee in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th January 2009, 22:57
  4. I2C Read and Write
    By DerekMacom in forum mel PIC BASIC
    Replies: 14
    Last Post: - 21st April 2008, 16:44
  5. Write and Read from eeprom
    By savnik in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 9th June 2007, 15: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