Need help detecting 20 nanosecond wide Xray pulses as data
laser-vector
Posts: 118
Hi,
I have a project where i need to send data via Xrays.
First things first, i am building a way to measure the bandwidth from my various configurations.
This is basically my configuration:
So to break it down:
1. Propeller sends data to an LED driver (Green Channel)
2. Xrays are created while led is on
3. a detector on the other end receives xrays (as single photon events - very narrow pulses)
4. a comparator/opamp driver then converts these pulses to a TTL 3.3vdc signal (Blue Channel)
5. the same propeller is connected to to detector and interpenetrates xray pulses as logic 1 and no xray pulses as logic 0
6. the propeller already knows what data it was sending and what data it "should" be receiving. if output does not equal input then add 1 to the error count.
ok, so the concept looks good on paper. I have made a little protoboard that does just this and it works pretty well when i connect the output straight to the input (basically pin 0 to pin 1 with a wire)
but in the configuration in the drawing i run into a real problem!
If you look closely at the blue channel it is actually a bunch of very fast (~20ns) rise/fall events.
looking even closer we see that the majority of the logic 1 is just dead space (0.0vdc)
in my spin code i wrote this little routine that loops around a few times waiting for photon events (even a single photon event will register as a logic 1 - which i know is not the best method but background noise is not much of an issue right now..)
so i have found that im getting a large number of errors because of the massive dead space in between photon events, as this loop cycles around until the clock reaches some value and then moves on i believe that the propeller is simply just missing some of the pulses and registering what should be a 1 as a 0 instead. now im not getting a 100% fail rate. and it depends much on the Speed variable. obviously the larger Speed is the more chances it has of seeing an event. even when i set the Speed variable to the smallest size possible i still get some small success rate.
NOW FOR THE QUESTION:
instead of looping around and around while hoping that there might be a pulse pulling the prop's Pin 1 high durring the time that the IF command is checking Pin 1, is there a way that in the prop to trigger on a rising edge (within a certian window of time)? or something that the pulses can set HIGH and then that later be reset and repeat??
I hope ive explained this issue thoroughly enough but if there are any question please feel free to ask!
Thank you for any help to resolve this issue.
I have a project where i need to send data via Xrays.
First things first, i am building a way to measure the bandwidth from my various configurations.
This is basically my configuration:
So to break it down:
1. Propeller sends data to an LED driver (Green Channel)
2. Xrays are created while led is on
3. a detector on the other end receives xrays (as single photon events - very narrow pulses)
4. a comparator/opamp driver then converts these pulses to a TTL 3.3vdc signal (Blue Channel)
5. the same propeller is connected to to detector and interpenetrates xray pulses as logic 1 and no xray pulses as logic 0
6. the propeller already knows what data it was sending and what data it "should" be receiving. if output does not equal input then add 1 to the error count.
ok, so the concept looks good on paper. I have made a little protoboard that does just this and it works pretty well when i connect the output straight to the input (basically pin 0 to pin 1 with a wire)
but in the configuration in the drawing i run into a real problem!
If you look closely at the blue channel it is actually a bunch of very fast (~20ns) rise/fall events.
looking even closer we see that the majority of the logic 1 is just dead space (0.0vdc)
in my spin code i wrote this little routine that loops around a few times waiting for photon events (even a single photon event will register as a logic 1 - which i know is not the best method but background noise is not much of an issue right now..)
LoopCntr := cnt + Speed Repeat while cnt < LoopCntr If INA[1] == 1 Temp := %00000000_00000000_00000000_00000001
so i have found that im getting a large number of errors because of the massive dead space in between photon events, as this loop cycles around until the clock reaches some value and then moves on i believe that the propeller is simply just missing some of the pulses and registering what should be a 1 as a 0 instead. now im not getting a 100% fail rate. and it depends much on the Speed variable. obviously the larger Speed is the more chances it has of seeing an event. even when i set the Speed variable to the smallest size possible i still get some small success rate.
NOW FOR THE QUESTION:
instead of looping around and around while hoping that there might be a pulse pulling the prop's Pin 1 high durring the time that the IF command is checking Pin 1, is there a way that in the prop to trigger on a rising edge (within a certian window of time)? or something that the pulses can set HIGH and then that later be reset and repeat??
I hope ive explained this issue thoroughly enough but if there are any question please feel free to ask!
Thank you for any help to resolve this issue.
Comments
-Phil
A simple D flip-flop could be used. These usually have an edge triggered clock. The D input is tied to logic high and the clock edge loads this into the flip-flop. The Propeller would have an input pin connected to the flip-flop's 1 output and an output pin connected to the flip-flop's clear input to be able to reset it. Something like this should work.
The 1N4148 will switch in 4 ns. Pick values for R and C that will yield a time constant of 100 ns or more.
-Phil
just so happened to have a 1N4148 laying around, built your circuit and got a much nicer waveform!
now my error rate is around 10% at high speed. still have to do some work and i like the idea of using the cogs counters (havnt had much experience in using them though..) but this is progress! thanks :-)
[edit]
0.1% error rate at 7Kbs
http://www.analog.com/static/imported-files/Data_Sheets/AD8561.pdf
-Phil
The output of the photodiode amp is buffered:
So it's driven both ways.
-Phil
What am I missing here? Should I finish my coffee first?
You're right, assuming that the pulses are square and are always high enough long enough to guarantee catching at least one clock. It's not clear from the scope traces, though that they're square, which means that they might not be higher than Vdd/2 for more than 12.5 ns. Of course, this perception may just be a bandwidth limit of the scope itself.
But, yes, if they're honest 20 ns digital pulses, they do not need to be stretched.
-Phil
-Phil
-Phil
-Phil