From: George M. <mcw...@os...> - 2006-02-09 20:17:23
|
Hi, I am not using the Robostix with a gumstix. I'm simply trying to communicate with a Devantech SRF10 ultrasonic sensor over i2c, but I seem to be having problems. I'm not exactly sure if my problem is in hardware or in software. The Robostix board has built-in pull-up resistors for the SDA and SCL lines, right? So I haven't added any external pull-up resistors. I'm sending the ultrasonic a command to start ranging (or pinging), and I can actually hear the sensor firing. However, when I try to read from the sensor, I'm always receiving a high signal. I'm trying to read two bytes, so I'm receiving 0xFFFF. Does anyone have any suggestions as to what I'm doing wrong? Is there anything else in hardware that I need to be doing? Thanks, George |
From: Chris D. <cg...@co...> - 2006-02-09 21:49:06
|
On 2/9/06, George McWilliams <mcw...@os...> wrote: > Hi, > > I am not using the Robostix with a gumstix. I'm simply trying to > communicate with a Devantech SRF10 ultrasonic sensor over i2c, but I seem= to > be having problems. I'm not exactly sure if my problem is in hardware or= in > software. > > The Robostix board has built-in pull-up resistors for the SDA and SCL lin= es, > right? So I haven't added any external pull-up resistors. I'm sending t= he > ultrasonic a command to start ranging (or pinging), and I can actually he= ar > the sensor firing. However, when I try to read from the sensor, I'm alwa= ys > receiving a high signal. I'm trying to read two bytes, so I'm receiving > 0xFFFF. > > Does anyone have any suggestions as to what I'm doing wrong? Is there > anything else in hardware that I need to be doing? George, I haven't used the SRF10, but I am familiar with the SRF08. The ranging operation on the '08 takes on the order of 65ms to complete; I'd assume there's similar latency for the '10. The SRF08, I know, does not respond to I2C while it's ranging, and thus trying to read any byte from it will result in 0xFF being returned. Are you waiting an appropriate amount of time before trying to read the result? Note that you don't have to hard-code in the delay -- the recommended procedure is to loop, reading the first register (IIRC, the software revision) until you get something that's not 255, and then read the ranging result. Are you doing something along these lines? -chris |