March 2007

You are currently browsing the monthly archive for March 2007.

I’ve got a GP2D02 IR ranger from Sharp (very well described here). It has a decicated board (IR Ranger board) and it’s used in the SirBot Ranger. But since I’ve started to migrate my Asm code to Jal, I can’t get it working anymore… I just don’t know why.

SirProbe to the rescue !!!

SirProbe is a digital probe, used to record logical levels. Actually, I’ve built SirProbe for two main reasons:
  1. debug my IR ranger, because the first time I tried to make it work, I needed an oscilloscope (thanks…) to see the wavefronts, and I was pretty sure seeing the wavefronts again would help me a lot…
  2. because having such a piece of digital probe is funny and useful, even more when it actually works nice :)
So, starting to record, the output levels from the PIC show… nothing. Nothing comes out from the pin. Arrr… I’ve just forgotten to declare the direction of the pins…
-- defines in/out pins for the ranger
var volatile bit ranger_pin_in is pin_a0
var volatile bit ranger_pin_out is pin_a1
pin_a1_direction = input
pin_a0_direction = output
include sb_gp2d02

Now, there’s something coming from the pins:

Yeah, that’s better :) We can see the 8 peaks sent by the PIC to drive the reading (each wavefront means “read one bit from the ranger”). The peaks look like “triangles”, because we’re getting at the limit of SirProbe’s efficiency. Previous results showed SirProbe was able to record up to 20 000 levels / second (that’s 1 level / 50µs). Outputs from the PIC come every 100µs, that’s close to the 50µs. Here, we have approx. 1 level / 70µs, so that’s explain why we don’t have “square” wavefronts.

Anyway, these results shows defining pins direction is useful (!), but still, there’s no distance value coming from the ranger. At least, sometimes, there’s one distance value, then nothing. That’s debugging time… Looking again and again at the GP2D02 specs finally shows an important step is missing: deactivation of the ranger, or it won’t be able to produce distance values anymore…

Now, it’s working nice. Deativating the ranger kind of resets it, so it’s available for the next measure.

Even if we’re closed to the SirProbe’s performances, it’s still useful and can produce important clues to understand what’s going on.

SirProbe to the rescue !!!