how to get an output off a debouncer.

A

Amit

Hi group,

I need to code a debouncer which is done however, I have to connect
its output to a johnson counter. I'm thinking of implementing the
johnson counter as a PROCESS. (hope I'm on a right track).

Now, can I define the counter as following?

jcounter: PROCESS(Debounced_Switch)
BEGIN
....
END PROCESS;

Your comment is appreciated.

Regards.
 
M

Mike Treseler

Amit said:
I need to code a debouncer which is done however, I have to connect
its output to a johnson counter. I'm thinking of implementing the
johnson counter as a PROCESS. (hope I'm on a right track).

I would use a single synchronous process for this design.

architecture synth of my_design is
begin
main : process(reset, clock) is
-- declarations
begin -- process template
if reset = '1' then
init_regs; -- clear debouncer and counter regs
elsif rising_edge(clock) then
update_regs; -- update debouncer and counter regs
end if;
update_ports; -- wire output regs to ports
end process main;
end architecture synth;

See
http://home.comcast.net/~mike_treseler/
for related examples.

-- Mike Treseler
 
A

Amit

I would use a single synchronous process for this design.

architecture synth of my_design is
begin
main : process(reset, clock) is
-- declarations
begin -- process template
if reset = '1' then
init_regs; -- clear debouncer and counter regs
elsif rising_edge(clock) then
update_regs; -- update debouncer and counter regs
end if;
update_ports; -- wire output regs to ports
end process main;
end architecture synth;

See
http://home.comcast.net/~mike_treseler/
for related examples.

-- Mike Treseler



Hi Mike,

Thanks for your link and sample. I assume the code you posted is for
debouncer handling. Right? I'm a little confused. Let's say I have it
as:

entity mydebouncer is

--here goes inputs/outputs

end mydebouincer;

architecture of beh of mydebouincer
begin

--process for debouncer
main: process
begin

end process;
end beh;


Now are you saying I must place a code for johnson counter in this
process? would you please give me some hints?

Thanks,
ak
 
M

Mike Treseler

Amit said:
Thanks for your link and sample. I assume the code you posted is for
debouncer handling. Right?

I posted a template, not the the full code.
I said I would combine the two processes,
but you don't have to.

You could use two synchronous processes and
wire them together with signals.

Post your counter code.

-- Mike Treseler
 
A

Amit

I posted a template, not the the full code.
I said I would combine the two processes,
but you don't have to.

You could use two synchronous processes and
wire them together with signals.

Post your counter code.

-- Mike Treseler



Hi,

Thanks again for your response. I think I didn't explain it well. My
problem is that I don't know how to connect them together (debouncer
and counter).

I have coded (both)and I will post the code as soon as I get at my
desk. However, I don't know how to direct debouncer's output
to the counter. Currently I have two different projects. I don't want
this.

I need to learn how to use them in a signle file using PROCESS. Just
tell me how I can connect the output of debouncer to counter.

thanks.
ak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top