Suggestion for a digital function:

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

cross mob
HuEl_264296
Level 5
Level 5
First like given 25 sign-ins First solution authored

Hi guys,

   

Something which I have wished for a couple of times is a logic function which converts an edge into a pulse.

   

 

   

This block could be very simple, taking one input (the edges) and one clock, which defines the length of the output pulse.

   

When the block sees an edge (can be configured to detect rising, falling or either), it outputs a pulse which lasts as long as one clock cycle.

   

 

   

Many thanks

   

Hugo Elias

0 Likes
7 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think you could do this with a timer. Just set it to single shot, 1 cycle, and start it with your signal.

0 Likes
HuEl_264296
Level 5
Level 5
First like given 25 sign-ins First solution authored

What will happen on the next edge? Wouldn't the timer need resetting?

0 Likes
Anonymous
Not applicable

Hi Hugo Elias,

   

 

   

What should be the duration of the pulse you need on every clock edge?

   

 

   

Regards,

   

dasg

0 Likes
Anonymous
Not applicable

Hi Hugo,

   

 

   

This requirement can be easily met with the use of a Timer Component available in PSoC3/5.

   

An example project is created which gives a pulse of 1ms upon falling egde on Trigger.

   

 

   

1) Timer Component is chosen with Resolution of 8-bit which is implemented in UDB. The period is set to 1ms with 1 PWM output.

   

 

   

   

 

   

 

   

2) The Run Mode is set to "One Shot with Multi Trigger" and the "Trigger Mode" is set to "Falling Edge". One shot with Multi Trigger will result in a pulse output on every falling edge on the trigger input. This is similar to a Monostable Multivibrator.

   

 

   

   

 

   

 

   

 

   

3) Pin is connected to the Trigger terminal of the Timer. Clock of 100KHz is used. The PWM output is connected to an output pin.

   

 

   

   

 

   

 

   

4) In this case, since the trigger is on Falling Edge, the Trigger_in is set to resistive Pull-Up.

   

 

   

   

 

   

 

   

5) The oscilloscope snap-shot is also shown below.

   

 

   

0 Likes
Anonymous
Not applicable

   

 

   

 

   

4) The Trigger_in pin is set to Resistive Pull-up mode as the trigger is Falling edge.

   

 

   

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

An oscilloscope snap-shot is as shown below:

   

 

   

   

 

   

 

   

 

   

The project is attached along with this comment.

0 Likes
Anonymous
Not applicable

   

 

   

The project is attached in the previous post.

0 Likes