NACK problem on SRF08

Discussion in 'Embedded Systems and Microcontrollers' started by jag1972, Mar 30, 2012.

  1. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    I am experiencing a lot of difficulty in using a SRF08 ultra-sonic sensor using the I2C bus on a PIC microcontroller. I can write to the sensor as I can change the address from E0 to another at will, however cannot read. The result I receive is FF. I have attached a special logic probe to it and it states that I am getting a NACK when trying to read from the E1 register. I have tried to sensors thinking if I can write why not read. It was not the sensor, the problem is my firmware. Can someone please help me as its doing my head in. I am looking at the values using watch windows. My code is below.

    Jag.
     
  2. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    I have been looking on other forums and some folk have had simmilar problems. Their problems point to voltage logic levels. I am using a PIC18F4520 target board, I am taking the SDA and SCL pins from a D-socket on the board. Connecting 1.8 kohm pull up resistors to those pins and 5 volts to other side. The target board has a 9 volt supply and converts that into 5 volts using a 7805 voltage regulator, I am driving the SRF08 and pull up resistors with a seperate 5 volts, have connected all grounds together. Any advice will be helpfull, I am getting very frustrated with it. :(
     
Loading...