- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I met a problem that my software cannot generate an 500ms counter, see my code and picture, can you help me? https://alteraforum.com/forum/attachment.php?attachmentid=13466&stc=1
/********************Test01***********************
Project Name: Test01;
Function: Just test my FPGA board
Version: 0.1
Editor: Vincent Li
Date: 2017-04-03
clk=50MHz
*************************************************/
module test01( clk, nRST, LED );
input clk,nRST;
output LED;
parameter T500MS = 25'd24_999_999;
reg rLED;
reg Count;
always@(posedge clk or negedge nRST)
if(!nRST)
Count <= 25'd0;
else
Count <= Count + 1'b1;
always@(posedge clk or negedge nRST)
if(!nRST)
rLED <= 4'd1;
else if(T500MS==25'd24_999_999)
rLED <= {rLED,rLED};
assign LED = rLED;
endmodule
QQ??20170403232713.png
(Virus scan in progress ...)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the problem:
else if(T500MS==25'd24_999_999) This is always true - I think you meant count?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tricky,
thank you for your reply, yes you are correct...I had corrected this morning and it works. Br
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page