Forum Rule: Always post complete source code & details to reproduce any issue!

1. FreqMeasure Libary Measure Voltage

Hello Board,

I have a question about the standard FreqMeasure Libary on a Teensy ++2.0 and I hope somebody can help!

On the input Pin 17, I have a rectangular curve between p-p +2V and +5V and I want to measure the frequency of it. Unfortunatly, it seems, that this libary can not detect any frequency, as long as the curve don't cross the voltage of around 1,3 V or less. (maybe low?)

My question is, can I change the libary so, that it detects a frequency at "HIGH" state? (means hit the 5 Volts)
Would be greate!!

Regards,
Ben

2. I don't think you'll have much luck finding a software-only solution as the FreqMeasure library needs signal transitions and I think those transition thresholds are fixed in the hardware of the I/O ports.

You could always use a capacitor and a couple of resistors to shift the signal down a volt or two. The values of the resistors and capacitor will depend on the input frequency.

3. Originally Posted by mborgerson

You could always use a capacitor and a couple of resistors to shift the signal down a volt or two. The values of the resistors and capacitor will depend on the input frequency.

Thats absolutely right, but the input Pin 17 is hard on VCC+5 volts and if i use a capacitor and resistors to pull it down, it ends in crazy distortion.
Left picture is the signal directly from 5 V OPA out into Pin 17
Right one is with capacitor in between and two resistor to pull it closer to 0V .

4. The values depend on the frequency, those values don't work down to the frequency you're using. Add a resistor in series with the input
pin too so that it won't be driven over or undervoltage too hard by the capacitor.

5. My original values worked OK for 500Hz. If you want to go down to 100Hz, you need larger resistors and capacitors. It will also depend on the value of the internal pullup resistors on Pin 17. I have no idea what the pullup might be for the T2.0++, as I work only with T3.X and T4.X boards.

MarkT's point about a current-limiting resistor between the level shifter and Pin 17 is also valid.

6. Would using just two diodes in series drop the voltage from between 5V and 2V down to about 3.6V and 0.6V ?

Pete

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•