I2CRead & I2CWrite not working as expected


Closed Thread
Results 1 to 31 of 31

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by F1CHF View Post
    My question :
    Could we say this is a GOTO or a GOSUB command ?
    It would be a GOTO command. I suppose it's a question of how you read the manual.
    If the manual said 'If the optional Label is included, this label will be ----CALLED---- if an acknowledge is not received from the I2C device', then I would reasonably assume that it would be a goto...
    But, the manual says 'this label will be ----JUMPED TO---- if an acknowledge....'. That tells me it's a GOTO.

    If all else fails, check your .lst file and see what the compiler puts in there for you. Make a few 'special' labels so you can follow yourself thru the .lst file and search them in the file. You should be able to find what you need.

  2. #2
    Join Date
    Jan 2005
    Location
    France
    Posts
    97


    Did you find this post helpful? Yes | No

    Thumbs up I2Cwrite error label

    OK good, let assume this is a GOTO, that will explain my application
    was going on a dead loop with a return ..
    I must try to find a PBP Help File in FRENCH or read carrefully !
    thanks for this help
    Francois

    Quote Originally Posted by skimask View Post
    It would be a GOTO command. I suppose it's a question of how you read the manual.
    If the manual said 'If the optional Label is included, this label will be ----CALLED---- if an acknowledge is not received from the I2C device', then I would reasonably assume that it would be a goto...
    But, the manual says 'this label will be ----JUMPED TO---- if an acknowledge....'. That tells me it's a GOTO.

    If all else fails, check your .lst file and see what the compiler puts in there for you. Make a few 'special' labels so you can follow yourself thru the .lst file and search them in the file. You should be able to find what you need.

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


    Did you find this post helpful? Yes | No

    Default

    good luck to find it in french... unless you want to try GooGLE or else on-line translator that will'nt be better
    Steve

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

  4. #4
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    Code:
    SDA var PORTA.1
    SCL var PORTA.2 
    T1 var byte
    T1=15
    I2CAddress var word 'I2C address
    I2CDevice var byte 'I2C device add
    i2CDevice=$A0
    I2CAddress=8
    I2CWrite SDA,SCL,I2CDevice,I2CAddress,127
    pause 100
    i2cread SDA,SCL,I2CDevice,I2CAddress,T1
    LCDOUT $FE,$c0, "value ", dEC T1
    pause 1000 
    stop
    Ports are set to digital, analog and comparators turned off. 4.7K resistors in place, 24C32 chip is brand new and authentic.
    Only VDD/VSS and SDA/SCL pins are used, others are left floating, according to datasheet.
    The interesting thing is, that i2cread returns nothing - I mean, I added T1=15 just for test, so that 15 is displayed, instead of 127
    whole i2croutine doing nothing?

  5. #5
    Join Date
    Jan 2005
    Location
    France
    Posts
    97


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    hello
    start a TEST first to see if your I2C unit is OK
    let go here
    https://playground.arduino.cc/Main/I2cScanner/

    francois

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    Only VDD/VSS and SDA/SCL pins are used, others are left floating, according to datasheet.
    start a TEST first to see if your I2C unit is OK
    let go here
    or read the data sheet again and work out the consequences of floating address pins on the device address
    Warning I'm not a teacher

  7. #7
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    From the datasheet:


    DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1 and A0 pins are device address
    inputs that are hard wired or left not connected for hardware compatibility with
    AT24C16. When the pins are hardwired, as many as eight 32K/64K devices may be
    addressed on a single bus system (device addressing is discussed in detail under the
    Device Addressing section). When the pins are not hardwired, the default A2, A1, and A0
    are zero.
    WRITE PROTECT (WP): The write protect input, when tied to GND, allows normal write
    operations. When WP is tied high to VCC, all write operations to the upper quandrant
    (8/16K bits) of memory are inhibited. If left unconnected, WP is internally pulled down to
    GND.


    The A2, A1, and A0 pins use an internal proprietary circuit that biases them
    to a logic low condition if the pins are allowed to float.

Similar Threads

  1. I2cwrite - I2cread
    By savnik in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th July 2006, 01:12
  2. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th June 2006, 20:03
  3. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th June 2006, 18:32
  4. PFC8583 Connection and I2Cwrite I2cread!
    By uludere72 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 27th February 2006, 13:32
  5. I2CWRITE and I2CREAD
    By Tomas in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd April 2004, 02:30

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