Continue to Site

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.

Verilog code for counting pulses in 555timer

Status
Not open for further replies.

SURAJ7

Newbie level 2
Joined
Dec 9, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
12
hey everybody,
I wish to write a verilog code for counting pulses from 555timer in fpga...can anybody help
 

Yes , definitely, But please post your efforts first.
 


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module pwm(clock,switches,pwm);
parameter sd = 195;//step delay in pulse
input clock;
input [7:0]switches;
output pwm;
reg pwm;
reg [15:0] counter=0;
 
always@(posedge clock)
begin
counter=counter+1;
if(counter<=switches*sd)
pwm=1;
else 
pwm=0;
if(counter>=50000)
counter=0;
end;
endmodule

 
Last edited by a moderator:

Hi,

So where exactly you are facing your problem ?.. also you need to re arrange your if else conditions.
I mean, error, or understanding wise , A good formatted question will avoid such delay.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top