I2CWRITE "Label" option - what does it do?


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    916

    Default I2CWRITE "Label" option - what does it do?

    I'm working on a piece of code I found in another thread about a DS3231 RTC.

    Unfortunately, the used I2CWRITE command has an optional label to jump to.

    I don't get what the label is there for.

    The manual says If the optional Label is included, this label will be jumped to if an acknowledge is not received from the I2C device.

    Okay, but, what does it mean?

    Code:
    .....
    DS3231:
    
    GetTime:
         RtcI2cNack = 0
         I2CRead RTC_SDA,RTC_SCL,$D0,RtcTimeReg,[RtcMin,RtcHour],I2CNACK
    
    I2CNACK:
         RtcI2cNack = 1
         RETURN
    .....
    Roger

  2. #2
    Join Date
    Sep 2009
    Posts
    749


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE "Label" option - what does it do?

    Exactly what is writen in manual
    I2C Slave send 1 bit response after each byte received. If that bit is missing, then command will jump to label. If label is not present, it will just ignore it, and keep sending data...

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,970


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE "Label" option - what does it do?

    If you want, you may include that label in case the I2C device fails to communicate. So you can give the user a message that something was wrong.

    Ioannis

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    916


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE "Label" option - what does it do?

    I2C Slave send 1 bit response after each byte received.
    I was missing this.

    Thanks for the info guys
    Roger

Similar Threads

  1. How to do the "SerIN" and "SerOut " for the usb ?
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th March 2015, 02:01
  2. Replies: 0
    Last Post: - 14th November 2013, 03:32
  3. Replies: 3
    Last Post: - 15th October 2012, 08:06
  4. Compile error & syntax error on the word "loop:" as a label?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2010, 04:14
  5. Error[115]...duplicate label..."debug"
    By Brian J Walsh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th April 2008, 09:29

Members who have read this thread : 9

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