Skogsgurra
08-29-2007, 05:22 AM
Hello,
I had a real tough measurement task. Counting falling edges. With more than 20, but less than 100 nanoseconds t_fall. Tough, first, comparators fast enough are hard to find. At least if you are limited to a +5 V and 3.3 V supply. Second, because not many processors can handle that kind of temporal resolution.
The Propeller did it. Of course.
I am using two biased inputs so that one has +8 V threshold and one has +2 V threshold. I then use the /A&B mode for counter A in a separate cog. Since the /A&B is valid also for rising edges, I prequalify by looping until the signal gets above A pin (+8 V) and then I loop until the signal is below +2 V. Then, I read the counter contents and check to see if it is between 2 and 8, which is 25 and 100 nanoseconds (at 80 MHz).
If the edge is within those limits, I increase a counter in hub ram and after 1 second, I can output the result to the display. I had to meet a 10 000 edges/second specification. I had no problem doing 100 times better in assembler.
I have done this before. But then using a lot of hardware. All HW needed now is a simple R2R D/A and a series resistor. It can't get any better. There were quite a lot of dropped yaws when I presented the solution in a meeting only a few days ago.
You can't help it. The Prop: I'm loving it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Skogsgurra) : 8/29/2007 9:19:31 PM GMT
I had a real tough measurement task. Counting falling edges. With more than 20, but less than 100 nanoseconds t_fall. Tough, first, comparators fast enough are hard to find. At least if you are limited to a +5 V and 3.3 V supply. Second, because not many processors can handle that kind of temporal resolution.
The Propeller did it. Of course.
I am using two biased inputs so that one has +8 V threshold and one has +2 V threshold. I then use the /A&B mode for counter A in a separate cog. Since the /A&B is valid also for rising edges, I prequalify by looping until the signal gets above A pin (+8 V) and then I loop until the signal is below +2 V. Then, I read the counter contents and check to see if it is between 2 and 8, which is 25 and 100 nanoseconds (at 80 MHz).
If the edge is within those limits, I increase a counter in hub ram and after 1 second, I can output the result to the display. I had to meet a 10 000 edges/second specification. I had no problem doing 100 times better in assembler.
I have done this before. But then using a lot of hardware. All HW needed now is a simple R2R D/A and a series resistor. It can't get any better. There were quite a lot of dropped yaws when I presented the solution in a meeting only a few days ago.
You can't help it. The Prop: I'm loving it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Skogsgurra) : 8/29/2007 9:19:31 PM GMT