Guidance on detecting external pulses, digital input voltages and comparators

Status
Not open for further replies.

rbrockman

Active member
I am looking for some guidance on reliably detecting external pulses with the Teensy 3.1. I'm using an ISR to detect a pin state change and this is all working well.
The question is about interfacing with the Teensy digital input.

The application is to sense when a normally high signal (2v) momentarily pulses low (1.2v). I'm using voltage divider now to adjust to this voltage level from 13v high, 8v low, but it's not super reliable. Note that the signal never gets to 0v.

The datasheet I'm looking at says that:
VIH HIGH = .70 * 3.3Vdd = 2.31 min for a logic high
VIL LOW = .35 * 3.3Vdd = 1.15 max for a logic low

I measure the digital input voltages at 1.5v = logical low, 1.6v = logical high on the Teensy 3.1. However I understand that perhaps I can't count on this and need to use the datasheet values.

I'm starting to learn about comparators, but it looks like Teensy 3.1 only supports 2 and I would need 4 of these.

Perhaps I need to use an external comparator IC? Trying to keep this simple.

Thanks for any input
 
Last edited:
I'm using voltage divider now to adjust to this voltage level from 13v high, 8v low, but it's not super reliable. Note that the signal never gets to 0v.

Is the 8V "low" voltage the same as some low impedance power supply? If so, you may have some good options for easily converting it to a signal relative to GND using a transistor. If not, a comparator chip is probably the best way.
 
No. The signal is normally 13v, and then pulses low to 8v for about 10uS, before going back to 13v. I need to reliably detect this pulse.
 
You can use the compare function of the ADC and use the adcX_isr when the value is below/above the desired threshold. If you use Teensy 3.1 you have 2 comparators and 2 ADC, so it looks that it's possible to have 4 signals.
 
Status
Not open for further replies.
Back
Top