Ballistic chronograph using a Spartan 3E starter board

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

formatting link
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

Reply to
shadfc
Loading thread data ...

I'm probably not addressing the main problem here, but...

for an input, do you need specify SLEW and DRIVE?

(Indeed, does it make sense to do so?)

Correction invited.

-- Per ardua ad nauseam

Reply to
tersono

Probably not. I had it configured without them previously and the same problem existed then, so I just grabbed the relevant lines for each pin from the boards starter guide (UG320).

Reply to
shadfc

SLOW |

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 sheet 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

Reply to
John_H

These devices have schmitt transfers, so if it really is oscillating, check the powersupply decoupling. Being a high gain analog front end, It will need very good decoupling right at the device.

You will probably also need to shroud the sensor, as across-paint-ball distances are at the upper end.

-jg

Reply to
-jg

formatting link
photosensor by Fairchild which

I tried what you suggested and wired the LEDs so that half are on when the input is high and the other half are on when the input is low. With my gate circuit disconnected, the LEDs sit in the off (input low) state, but as soon as I connect my circuit, they all light up and are a little dimmer (meaning they are switching fairly quickly). Decoupling/bypassing but thats a new topic for me -- I dont have anything in the circuit to do that at the moment. I scavenged a 5V power converter from an old 802.11B linksys AP to run this circuit and found a compatible plug and soldered 2 leads onto it and stuck those into my breadboard.

Jay

Reply to
shadfc

shadfc schrieb:

Hi Jay, some more hints: Are you sure that the sensor device is a QSE156 (red mark) and not accidently a QSE158/9 (green/blue mark) The later ones have open collector outputs causing the open CMOS inputs to swing when used without a pullup.

You mentioned long wires. Are they shielded or at least twisted pair wires? Maybe some other device induces wrong signals to the input.

Do you have a scope around, to see how your sensor signal (and power) actually behave?

You also may try another input. Maybe your pcb is broken on that line causing the input to be open all the time. Invoking the internal pullup on the desired input should have some effect. Check it.

Good luck Eilert

Reply to
backhus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.