Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

Hey all,

I have a project I'm working on for PSoC5LP where a typical TTL high/low signal (a POWER_OK signal) is generated by the PSoC after a hardware event (3 POWER_GOOD signals all logic high) occurs.  The catch is that the output signal must be delayed before outputting to a PSoC GPIO.  Not a quick delay like a debounce, but between 500ms and 1s from the signals all being high to PWR_OK asserting high.  Doing something like this in firmware would be pretty simple, but I wanted to accomplish this in hardware.  Here's what I came up with myself, using a control register to simulate the POWER_GOOD signals:

KyTr_1955226_0-1621869206837.png

KyTr_1955226_1-1621870612250.png

 

The above solution will delay both the rising/falling edge of the ANDed POWER_GOOD signals from appearing on PWR_OK until the timer period has elapsed, and seems to work well enough, although it's not completely in hardware (the timer must be enabled in firmware).  I'm curious if this is the best way to go about it, of if this could be done more simply or in a more flexible fashion (I.E. would it be possible to modify this so only the rising edge or falling is delayed, but the other is instant?).

Thought this might be an interesting problem to share and see what people can come up with.

0 Likes
1 Solution
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

Possible idea for delay on rising edge and no delay on falling edge.  Could be modified for the other way around (No delay on rising edge, delay on falling edge):

KyTr_1955226_0-1621959504636.png

 

View solution in original post

0 Likes
5 Replies
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Does the delay need to be configurable and/or precise?

If not, you could use a shift register running at every low frequency.

0 Likes

Interesting idea, I hadn't considered a Shift Register.  In this specific instance the accuracy is not vital, so long as it is a delay somewhere between 250ms and 1s.  The delay would be configured at build time, no need to change it at run time. 

I suppose I could get similar functionality from a debounce component with a very slow clock as well.

0 Likes

KyTr,

A Debouncer component is potentially very good solution.

If you place a 4Hz clock, you get a minimum 250ms signal output.  A 2Hz input, a 500ms output, etc.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

KyTr,

I looks like you came up with a workable circuit.   Yes TMR_SIG_DELAY needs to be started.  This is a very minor concession.   It is basically a near 100% HW solution.

Does this circuit need to implement a multi-trigger on the source input?

Rodolfo's suggestion about a shift register should allow you to eliminate the Start() function.

Rodolfo had some additional questions useful for alternate implementations. 

 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

Possible idea for delay on rising edge and no delay on falling edge.  Could be modified for the other way around (No delay on rising edge, delay on falling edge):

KyTr_1955226_0-1621959504636.png

 

0 Likes