jsharlan wrote:I'm using (5) SRF02s on the same I2C bus in a star configuration. I can read all sensors in a round robin mode when the time between pings is >= 70 ms as you would expect. This gives me a total loop time of 350ms, I would like to reduce this time. My program sequence is: ping(0), read(1), delay(70), ping(1), read(2), delay(70)... ping(4), read(0), delay(70), ping(1).... the reads are going into a Ranges array. In theory I should be able to sequence through all 5 sensors within a 100ms cycle and get back to read the first one within the minimum time. When I try to reduce the delay(70), I start to get bad numbers. I have isolated the sensors from each other to eliminate interference without success. When viewed with a scope, the I2C signals are just where they should be. I'm using an ATmega32(16MHz) and am reading the Ranges array via the serial port at 19200 connected to a PC.
Any ideas on the subject would be appreciated.
Gerry wrote:The "ping" takes 60-70mS to fade away to the point where it will not interfere with the next ranging. During this time it is bouncing around all over the place. If you start the next SRF02 too soon, it will detect this fading echo giving the bad results. You need to wait 60-70ms between rangings - OR ....
Gerry wrote:You could try firing all 5 SRF02's at the same time (no delay at all). i.e.
ping(0), ping(1) ... Ping(4)
then wait 70mS
then read(0), read(1) ... read(4).
Users browsing this forum: No registered users and 1 guest