I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Default I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131

    I'm trying to set up the sensor in by puting it in command mode. This is to enable reading humidity with alarms set up in this mode.

    to start:

    power on of the sensoris done first.

    I2CWRITE PORTA.1, PORTC.1, $4E, $A0, [$00, $00] Noack ' starts command mode
    The 4E is the address (27 plus a write bit=0) The A0 is the command to enter command mode. The 00s are required per Honeywell . Port A.1 is SDA, PortC.1 is the CPIN.

    I delay 1 ms to allow the sensor power on reset time. The message always is NACKed after the first byte (the address) If I skip the command mode for test purposes and try to enter measurment mode, the same happens, NACK of the first byte.

    Does anyone know of a resolution? I need your help.

    Joe Rapoza (joerap)

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131

    I don't have an answer for you Joe, but this thread has a link to I2C material that might help:
    http://www.picbasic.co.uk/forum/showthread.php?t=16067

    Robert

  3. #3
    Join Date
    Feb 2012
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131

    Hi Demon,

    I read the material at the link and used the info to create I2C communication using SHIFTIN and SHIFTOUT. This method transmits all the required info and can be seen on the 'scope. The sensor in use, still NACKs each byte. This method allows you to ignore the NACKs but the info received is not meaningful. I'm still at a loss to communicate with the sensor. My project is not going well. Hope someonecan help.

    Joe Rapoza

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131

    If the first byte is always nack'ed, then there is definetely something wrong. The first byte should always be ACKed if the slave part is functioning and the address is correct. Do you have pullups on the two I2C lines?

    Also the PIC Basic Pro manual recommends not using a constant for the address byte. So either skip the address or use a byte variable.

    i.e. I2CWRITE PORTA.1, PORTC.1, $4E, , [$A0, $00, $00]
    Tim Barr

  5. #5
    Join Date
    Feb 2012
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131

    Hi Tim,

    I tried the variable byte for the command. ie skipping the command byte and putting it in the data fields. (I2CWRITE PORTA.1, PORTC.1, $4E, [$A0, $00, $00] )

    It does transmit the $4e , the $A0 and one $00. It does however, NACK all bytes. It does not go into command mode. Only status data when trying to retrieve alarm info is returned with a 0x02 meaning it was NACKed.

    Still at a loss.

    Joe Rapoza

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: I2C Communication, PIC 16F616 to Honeywell humiditysensor HIH6131

    EDIT: I finally found Melanie's thread:
    http://www.picbasic.co.uk/forum/showthread.php?t=587

    Use variables instead of constants.


    Typical start-up time is 50 ms by the way.

    (sample code from PBP v2.60 manual, bottom p.96)


    Referring to datasheet from here:
    http://tinyurl.com/7d8jwk9

    PBP manual says 4K7 pull-up resistors on both I2C lines. The datasheet says 2K2 pull-up resistors.

    PBP supports 100kHz I2C devices up to 8MHz. You need DEFINE I2C_SLOW 1 to run above that.

    Robert
    Last edited by Demon; - 9th February 2012 at 18:09. Reason: merged post from below, added Melanie's thread

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