Electronics-Related.com
Forums

Pulse stretcher circuit needed

Started by bitrex November 28, 2023
So I have a SPLC that's infrequently outputting ~ 100uS positive-going 
pulses on a few pins, and on two of the lines I'd like to stretch that 
pulse out to blink an LED for the user to confirm activity.

Here is my nice-to-have constraint, I have four comparators in the 
device (GreenPAK) that aren't currently being used for anything.

The non-inverting inputs are on a pin with configurable 
pull-up/pull-down/float, and the inverting input voltages can be 
adjusted, along with selectable hysteresis from a couple low mV-range 
values. And the outputs can be configured open-drain or push-pull, and 
out to a pin, also with configurable pull-up/pull-down/float.

Unfortunately it's not possible to configure them as inverting so easily 
so if this task can be done with just passives and non-inverting comps 
with those constraints and put those comps to a purpose, that'd be 
awesome, any suggestions appreciated!
On 2023-11-28 14:46, bitrex wrote:
> So I have a SPLC that's infrequently outputting ~ 100uS positive-going > pulses on a few pins, and on two of the lines I'd like to stretch that > pulse out to blink an LED for the user to confirm activity. > > Here is my nice-to-have constraint, I have four comparators in the > device (GreenPAK) that aren't currently being used for anything. > > The non-inverting inputs are on a pin with configurable > pull-up/pull-down/float, and the inverting input voltages can be > adjusted, along with selectable hysteresis from a couple low mV-range > values. And the outputs can be configured open-drain or push-pull, and > out to a pin, also with configurable pull-up/pull-down/float. > > Unfortunately it's not possible to configure them as inverting so easily > so if this task can be done with just passives and non-inverting comps > with those constraints and put those comps to a purpose, that'd be > awesome, any suggestions appreciated!
One approach would be to hang a parallel RC on one of the comparator's + input pin, drive the LED from its output to ground, and turn it on by transiently pulling the input high (use a second tristate pin if you can't make the comparator input a logic output once in awhile). ... 3state (cap discharged) output HIGH (100 us) 3state (cap discharges, LED ON) 3state (cap reaches threshold, LED OFF) 3state (cap discharges) ... Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com
tirsdag den 28. november 2023 kl. 20.47.00 UTC+1 skrev bitrex:
> So I have a SPLC that's infrequently outputting ~ 100uS positive-going > pulses on a few pins, and on two of the lines I'd like to stretch that > pulse out to blink an LED for the user to confirm activity. > > Here is my nice-to-have constraint, I have four comparators in the > device (GreenPAK) that aren't currently being used for anything. > > The non-inverting inputs are on a pin with configurable > pull-up/pull-down/float, and the inverting input voltages can be > adjusted, along with selectable hysteresis from a couple low mV-range > values. And the outputs can be configured open-drain or push-pull, and > out to a pin, also with configurable pull-up/pull-down/float. > > Unfortunately it's not possible to configure them as inverting so easily > so if this task can be done with just passives and non-inverting comps > with those constraints and put those comps to a purpose, that'd be > awesome, any suggestions appreciated!
diode into cap with pull-down, on comparator's + input
On 11/28/2023 3:05 PM, Phil Hobbs wrote:
> On 2023-11-28 14:46, bitrex wrote: >> So I have a SPLC that's infrequently outputting ~ 100uS positive-going >> pulses on a few pins, and on two of the lines I'd like to stretch that >> pulse out to blink an LED for the user to confirm activity. >> >> Here is my nice-to-have constraint, I have four comparators in the >> device (GreenPAK) that aren't currently being used for anything. >> >> The non-inverting inputs are on a pin with configurable >> pull-up/pull-down/float, and the inverting input voltages can be >> adjusted, along with selectable hysteresis from a couple low mV-range >> values. And the outputs can be configured open-drain or push-pull, and >> out to a pin, also with configurable pull-up/pull-down/float. >> >> Unfortunately it's not possible to configure them as inverting so >> easily so if this task can be done with just passives and >> non-inverting comps with those constraints and put those comps to a >> purpose, that'd be awesome, any suggestions appreciated! > One approach would be to hang a parallel RC on one of the comparator's + > input pin, drive the LED from its output to ground, and turn it on by > transiently pulling the input high (use a second tristate pin if you > can't make the comparator input a logic output once in awhile). > > > ... > 3state (cap discharged) > output HIGH (100 us) > 3state (cap discharges, LED ON) > 3state (cap reaches threshold, LED OFF) > 3state (cap discharges) > ... > > Cheers > > Phil Hobbs >
Yeah, that's a neat idea! I hadn't thought of twiddling with the 3 state pins. Pins can be configured as analog IO or digital IO but not analog in/digital out, but I think I have some spare 3 state digital IO lines I can abuse for that purpose. There are two-comparator solutions that I've seen that first use an open drain output to discharge a series RC but this saves some parts
bitrex <user@example.net> wrote:
> On 11/28/2023 3:05 PM, Phil Hobbs wrote: >> On 2023-11-28 14:46, bitrex wrote: >>> So I have a SPLC that's infrequently outputting ~ 100uS positive-going >>> pulses on a few pins, and on two of the lines I'd like to stretch that >>> pulse out to blink an LED for the user to confirm activity. >>> >>> Here is my nice-to-have constraint, I have four comparators in the >>> device (GreenPAK) that aren't currently being used for anything. >>> >>> The non-inverting inputs are on a pin with configurable >>> pull-up/pull-down/float, and the inverting input voltages can be >>> adjusted, along with selectable hysteresis from a couple low mV-range >>> values. And the outputs can be configured open-drain or push-pull, and >>> out to a pin, also with configurable pull-up/pull-down/float. >>> >>> Unfortunately it's not possible to configure them as inverting so >>> easily so if this task can be done with just passives and >>> non-inverting comps with those constraints and put those comps to a >>> purpose, that'd be awesome, any suggestions appreciated! >> One approach would be to hang a parallel RC on one of the comparator's + >> input pin, drive the LED from its output to ground, and turn it on by >> transiently pulling the input high (use a second tristate pin if you >> can't make the comparator input a logic output once in awhile). >> >> >> ... >> 3state (cap discharged) >> output HIGH (100 us) >> 3state (cap discharges, LED ON) >> 3state (cap reaches threshold, LED OFF) >> 3state (cap discharges) >> ... >> >> Cheers >> >> Phil Hobbs >> > > Yeah, that's a neat idea! I hadn't thought of twiddling with the 3 state > pins. Pins can be configured as analog IO or digital IO but not analog > in/digital out, but I think I have some spare 3 state digital IO lines I > can abuse for that purpose. > > There are two-comparator solutions that I've seen that first use an open > drain output to discharge a series RC but this saves some parts >
You can do a bunch of semi-analog things like that by bodging the pull up/down and 3state controls. It&rsquo;s sort of like the uC equivalent of the 555. ;) Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics
On 11/28/2023 5:01 PM, Phil Hobbs wrote:
> bitrex <user@example.net> wrote: >> On 11/28/2023 3:05 PM, Phil Hobbs wrote: >>> On 2023-11-28 14:46, bitrex wrote: >>>> So I have a SPLC that's infrequently outputting ~ 100uS positive-going >>>> pulses on a few pins, and on two of the lines I'd like to stretch that >>>> pulse out to blink an LED for the user to confirm activity. >>>> >>>> Here is my nice-to-have constraint, I have four comparators in the >>>> device (GreenPAK) that aren't currently being used for anything. >>>> >>>> The non-inverting inputs are on a pin with configurable >>>> pull-up/pull-down/float, and the inverting input voltages can be >>>> adjusted, along with selectable hysteresis from a couple low mV-range >>>> values. And the outputs can be configured open-drain or push-pull, and >>>> out to a pin, also with configurable pull-up/pull-down/float. >>>> >>>> Unfortunately it's not possible to configure them as inverting so >>>> easily so if this task can be done with just passives and >>>> non-inverting comps with those constraints and put those comps to a >>>> purpose, that'd be awesome, any suggestions appreciated! >>> One approach would be to hang a parallel RC on one of the comparator's + >>> input pin, drive the LED from its output to ground, and turn it on by >>> transiently pulling the input high (use a second tristate pin if you >>> can't make the comparator input a logic output once in awhile). >>> >>> >>> ... >>> 3state (cap discharged) >>> output HIGH (100 us) >>> 3state (cap discharges, LED ON) >>> 3state (cap reaches threshold, LED OFF) >>> 3state (cap discharges) >>> ... >>> >>> Cheers >>> >>> Phil Hobbs >>> >> >> Yeah, that's a neat idea! I hadn't thought of twiddling with the 3 state >> pins. Pins can be configured as analog IO or digital IO but not analog >> in/digital out, but I think I have some spare 3 state digital IO lines I >> can abuse for that purpose. >> >> There are two-comparator solutions that I've seen that first use an open >> drain output to discharge a series RC but this saves some parts >> > > You can do a bunch of semi-analog things like that by bodging the pull > up/down and 3state controls. > > It&rsquo;s sort of like the uC equivalent of the 555. ;) > > Cheers > > Phil Hobbs >
A hack I've used a couple times to squeeze a bit more logic out of these (they don't have much, and AFAIK there's no VHDL-like compiler for most of the chips so you're sometimes on your own on the minimization front), is use the 3 state control as some extra decode logic between a state machine and an open-drain output; the way these chips are if the product-of-sums equation for the active-high formulation of the logic has an isolated term, you can send that one to the the 3-state control and then make that term a "don't care" for some inputs of the active-low truth table.
On 11/28/2023 7:22 PM, bitrex wrote:
> On 11/28/2023 5:01 PM, Phil Hobbs wrote: >> bitrex <user@example.net> wrote: >>> On 11/28/2023 3:05 PM, Phil Hobbs wrote: >>>> On 2023-11-28 14:46, bitrex wrote: >>>>> So I have a SPLC that's infrequently outputting ~ 100uS positive-going >>>>> pulses on a few pins, and on two of the lines I'd like to stretch that >>>>> pulse out to blink an LED for the user to confirm activity. >>>>> >>>>> Here is my nice-to-have constraint, I have four comparators in the >>>>> device (GreenPAK) that aren't currently being used for anything. >>>>> >>>>> The non-inverting inputs are on a pin with configurable >>>>> pull-up/pull-down/float, and the inverting input voltages can be >>>>> adjusted, along with selectable hysteresis from a couple low mV-range >>>>> values. And the outputs can be configured open-drain or push-pull, and >>>>> out to a pin, also with configurable pull-up/pull-down/float. >>>>> >>>>> Unfortunately it's not possible to configure them as inverting so >>>>> easily so if this task can be done with just passives and >>>>> non-inverting comps with those constraints and put those comps to a >>>>> purpose, that'd be awesome, any suggestions appreciated! >>>> One approach would be to hang a parallel RC on one of the >>>> comparator's + >>>> input pin, drive the LED from its output to ground, and turn it on by >>>> transiently pulling the input high (use a second tristate pin if you >>>> can't make the comparator input a logic output once in awhile). >>>> >>>> >>>> ... >>>> 3state (cap discharged) >>>> output HIGH (100 us) >>>> 3state (cap discharges, LED ON) >>>> 3state (cap reaches threshold, LED OFF) >>>> 3state (cap discharges) >>>> ... >>>> >>>> Cheers >>>> >>>> Phil Hobbs >>>> >>> >>> Yeah, that's a neat idea! I hadn't thought of twiddling with the 3 state >>> pins. Pins can be configured as analog IO or digital IO but not analog >>> in/digital out, but I think I have some spare 3 state digital IO lines I >>> can abuse for that purpose. >>> >>> There are two-comparator solutions that I've seen that first use an open >>> drain output to discharge a series RC but this saves some parts >>> >> >> You can do a bunch of semi-analog things like that by bodging the pull >> up/down and 3state controls. >> >> It&rsquo;s sort of like the uC equivalent of the 555. ;) >> >> Cheers >> >> Phil Hobbs >> > > A hack I've used a couple times to squeeze a bit more logic out of these > (they don't have much, and AFAIK there's no VHDL-like compiler for most > of the chips so you're sometimes on your own on the minimization front), > is use the 3 state control
Or rather toggle the pin from an open-drain output to an input, which effectively also just makes it high impedance, if nothing is actually connected to the input internally
On Tuesday, November 28, 2023 at 11:47:00&#8239;AM UTC-8, bitrex wrote:
> So I have a SPLC that's infrequently outputting ~ 100uS positive-going > pulses on a few pins, and on two of the lines I'd like to stretch that > pulse out to blink an LED for the user to confirm activity.
Crude approach: use the positive pulse to charge a capacitor (through a diode), and bleed a microamp of capacitor current through a resistor to a darlington base (emitter grounded). The darlington collector then drives your LED until the capacitor goes flat (base resistor to GND recommended). Obviously, if V_pulse is high enough, the darlington could be an NMOS, or if it's low, the darlington could be one of those 1000-beta transistors that are in the catalogs but never useful.