I2C write - value too big


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    Just the use of a word size variable, invokes PBP to read two bytes. It places the first byte in the var.highbyte and the second in the var.lowbyte. EDIT: Sorry, I didn't see that you were not writing, not reading - this is for reading)

    If this is not the order you want, you'll have to exchange the two bytes outside the I2C instruction. I'm not sure of all the techniques (like using PBP SWAP) will work, but it's a standard process that can be done using a temporary 'working' word size variable.

    temp.highbyte = var.lowbyte
    temp.lowbyte = var.highbyte
    var = temp
    Last edited by JD123; - 5th April 2008 at 16:41.
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. Replies: 5
    Last Post: - 29th May 2008, 18:03
  4. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  5. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33

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