UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor gursimar@08
Visitor
701 Views
Registered: ‎06-15-2018

Digital clock (or counter) design on Basys-3 board

Hello,

 

I wish to implement a digital clock that counts from 000000 to 240000 (hhmmss format) on Basys-3 board. I'm using Vivado 2016.4.

Can I get some help with the programming of the board, since I'm new to both Basys-3 and Vivado.

Besides that, I'm also looking for someone who can help me with the codes that would work fine when implementing the digital clock on the board.

 

Your kind help will be genuinely appreciated!!

 

Thanks,

Gursimar

0 Kudos
1 Reply
Highlighted
Contributor
Contributor
638 Views
Registered: ‎03-13-2017

Re: Digital clock (or counter) design on Basys-3 board

Hello,

You could define a 1MHZ CLOCK in your zynq processing system in your vivado proyect and you could creat a HLS core like this:

void DigitalClock(int& result){

#define SEC 1000000
#define MIN 60
#define HOUR 6000
#define DAY 240000

static unsigned long count=0; // count rstb

static int secc = 0;
static int minn = 0;
static int hourr = 0;


count++;

if(count==SEC)
{
secc++;
count=0;

if(secc==MIN)
{
minn=minn+100;
secc=0;

if(minn==HOUR)
{
hourr=hourr+10000;
minn=0;

if(hourr==DAY)
{
hourr=0;
minn=0;
secc=0;
}
}
}
}


result = hourr+minn+secc;

}



--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos