PDA

View Full Version : no acknowledgment from srf08


subot.robot
09-30-05, 08:54 AM
I modified the i2c routines given in the examples to add provision for checking the acknowledgment from srf08 and to check whether i2cbus is busy. I am not getting any acknowledgment from the sonar (srf08) after i have transmitted a byte to it. At what speed are we communicating in i2cbus? i2cbus can usually support maximum of 100khz speed. can u please guide me in this regard. i am using servopod . If we don't check for acknowledgment, the communication with the srf08 sonar is fine. But i want to find a way to find out whether sonar has stopped working, in the middle of operation after it has been mounted on the robot, either due to loose contact or some other reasons .

regards
subot.robot

nmitech
10-04-05, 01:01 PM
From the example on the 'Pod download page,
http://www.newmicros.com/isopod/appnotes/srf08.txt

There are two provided routines ACK.? and ACK.! . Those are consistent with the explanation of the I2C Acknowledge info from www.esacademy.com website. See the links below for more info,

(Getting Acknowledge from a slave)
http://www.esacademy.com/faq/i2c/busevents/i2cgetak.htm

: ACK.?
SDA+ ( MAKE LINE HIGH SO SLAVE CAN ACK WITH LOW
CLK.?
SDA+
; EEWORD


(Giving Acknowledge to a slave)
http://www.esacademy.com/faq/i2c/busevents/i2cgivak.htm

: ACK.!
SDA-
CLK.
SDA+
; EEWORD


As for the communication speed concerned, based on the clock routine provided in the example program. It will take 10uS to toggle the I/O port ON or OFF, so the fatest clock can be generated is about 50Khz.

: CLK.
SCL+
SCL-
; EEWORD