Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

data latch for 200msecs

Status
Not open for further replies.

sherakram

Newbie level 4
Joined
Feb 13, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
hi,
i have a flag, say stop_flag.i want it to be latched for 200msec, i.e i want that flag to be active for 200msec. my clock is 10Mhz. any help regarding this is mostly gratifying.

thanks in advance
 

dpaul

Advanced Member level 4
Joined
Jan 16, 2008
Messages
1,473
Helped
307
Reputation
614
Reaction score
301
Trophy points
1,373
Location
Germany
Activity points
11,013
I would try it out in this way...
Using a counter and the 10MHz clk, generate a signal that is HIGH for 100ms and LOW for the next 100ms, that gives us 200ms. Use this signal as clk input to the stop_flag register.
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,058
Helped
2,075
Reputation
4,167
Reaction score
2,028
Trophy points
1,393
Activity points
39,048
NO. dont use generated signals as clocks (its bad design practice in FPGAs)
Use a counter as dpaul suggest, but make it high for 1 clock cycle every 100ms. Then use this as a clock enable on the stop_flag register.
 

sherakram

Newbie level 4
Joined
Feb 13, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
I would try it out in this way...
Using a counter and the 10MHz clk, generate a signal that is HIGH for 100ms and LOW for the next 100ms, that gives us 200ms. Use this signal as clk input to the stop_flag register.

hi dpaul,
Thank you for your help, actually my requirement is, i will get a pulse (of 0.1usec) only once , i need to generate a logic high signal after 200msec of this 0.1usec pulse is occurred. i.e I want to generate a delay of 200msec after that pulse is occurred. So my design should start with that pulse and after 200msecs it should stop by setting a flag high.
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,804
Helped
1,809
Reputation
3,628
Reaction score
1,768
Trophy points
1,393
Location
USA
Activity points
58,893
hi dpaul,
Thank you for your help, actually my requirement is, i will get a pulse (of 0.1usec) only once , i need to generate a logic high signal after 200msec of this 0.1usec pulse is occurred. i.e I want to generate a delay of 200msec after that pulse is occurred. So my design should start with that pulse and after 200msecs it should stop by setting a flag high.

You want a pulse stretcher...

synchronizer (if required)
edge detector
synchronous set/reset flip-flop, the out_pulse (set on edge detector, clear on terminal count value)
counter (clear when out_pulse is 0, count when out_pulse is 1)

That should do the trick, though if you need to extend the pulse if another input pulse occurs or if you need to "save" input pulses and produce the same number of output pulses, those implementations are left as an exercise for the reader.
 

sherakram

Newbie level 4
Joined
Feb 13, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
You want a pulse stretcher...

synchronizer (if required)
edge detector
synchronous set/reset flip-flop, the out_pulse (set on edge detector, clear on terminal count value)
counter (clear when out_pulse is 0, count when out_pulse is 1)

That should do the trick, though if you need to extend the pulse if another input pulse occurs or if you need to "save" input pulses and produce the same number of output pulses, those implementations are left as an exercise for the reader.

thank you ads-ee, it worked.
 

sherakram

Newbie level 4
Joined
Feb 13, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,318
data latching on every rising edge of clk

hi.........,
i need a design in which a signal should be in logic high state at rising edge of clk and it should retain that state for 100ns then shift to logic low state n should retain that logic low state till next rising edge occurred. any help regarding this is mostly apreciable.

thanks in advance.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,266
Helped
14,224
Reputation
28,709
Reaction score
12,917
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,523
Re: data latching on every rising edge of clk

In synchronous logic every action is scheduled by clock edges, e.g. timing a signal for 100 ns. Means you'll want a sufficient fast clock. There's no other way to generate a delay.

- - - Updated - - -

P.S.: I noticed that you already started a similar thread. The answers given therein apply more or less for the 100 ns pulse width.
 

XBD

Newbie level 1
Joined
Apr 1, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Sydney, Australia
Activity points
7
Hi,
I'm doing such things by creating state machine with states
Waiting, Delay,
condition Waiting => Delay is any sort of triggering event you have,
While in delay set flag to '1'. while in Waiting set flag to '0'
condition Delay => Waiting is counter value equals to number of ticks you want to wait.
Counter is incrementing every tick when state machine is in Delay state, reset on transition Waiting => Delay

If you need help, let me know, I will send you code for that.

Cheers,
XBD
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top