Re: Ballistic chronograph using a Spartan 3E starter board



On Jan 22, 12:33 pm, shadfc <jay.winein...@xxxxxxxxx> wrote:
Hi,
    I'm trying to create a "chrono" to measure the muzzle velocity of
a paintball gun.  Basically, I'm just making a two gate system out of
some IR leds and photosensors which will hook into my Spartan 3E
Starter board. The FPGA will measure the time (clock ticks, really)
between gate changes and then do the division to arrive at the
velocity, which it will display on the LCD.
   I'm having some problems getting the inputs into the FPGA to
register correctly.  The gate circuit uses the QSE156 (http://www.fairchildsemi.com/ds/QS/QSE156.pdf) photosensor by Fairchild which
provides a TTL/LSTTL compatible output.  Following the Xilinx
guidelines for making 5V inputs safe, I've connected the TTL output to
the board through a 390Ohm series resister.
   I am using pin D7 on the J4 Header as a test input for a single
gate.  I have that pin specified in the UCF as follows:

        NET "gateA" LOC = "D7" | IOSTANDARD = LVTTL | SLEW = SLOW |
DRIVE = 6 ;

   Now, the problem I am having is that I cant get the input to be
stable on both high and low signals from the photosensor.  It appears
to oscillate at a fairly high frequency (MHz range). I tried to
debounce the input (with 16 bits) and then incremented a counter on
every rising edge of the stabilized input, but using the Spartans 8
LEDs to display the counter still was a blur.  So, by that, I surmised
that the input is oscillating between high and low.
   I would appreciate any input on this since I'm at a loss.  Do I
have my FPGA input settings correct?  Must I use a wire less than X
inches to connect the output of the photosensor to the board? Etc,
etc.  What am I missing?

thanks
Jay

The drive and slew are "don't cares" for the case of the input. The
oscillation is odd. Do you have a decoupling cap anywhere near your
sensor? I could see an issue if the sensor switches, causing the VCC
at the sensor to drop, causing the sensor to switch, and so on. The
switching time is specified in the data *** as microseconds
suggesting the device is completely unstable by your measurements.
The FPGA should be fine.

I'd suggest wiring the sensor input through the FPGA to two of your
LEDs: one to indicate "on" and one to indicate "off" such that two
LEDs of the same intensity indicate ~ 50% each way. It sure sounds
like you could use an oscilloscope.

- John_H
.