FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5707 Discussions

Cyclone V, System Time after Reset

Honored Contributor II

hi everybody, 


I've got a Cyclone V Dev.- Board (Model: E), with a NIOS 2 Processor. 

I want to read out the System Time from the Dev- Board, and want to set the System Time to the Dev- Board, that the Dev's time is the actual Date and Time. 

After i reset the Board, the kit should show me the actual date and time via c-code. 

Often i tried things like settimeofday() and gettimeofday() in different variants (tried "localtime" too), but doesnt work (i can show you the code if relevant) 


After a power down and a power up again, the Board just showed me the first january 1970, 0:00:00. There is plugged a new CR2032 Battery under the LCD- Screen. 

The NIOS 2 Processor is not configurated for the systemTime, but i think, it doesnt matter. 

My next idea would be, that i set the system time via the altera BTS, but Its not sure, if the BTS supports the set- method. 


Does anybody have an idea? 


Thank you. 

Best regards, 

0 Kudos
1 Reply
Honored Contributor II

+Additionaly to above: I am using a single- Thread - System, not a multithreading system. System in C- Code is creating via NIOS II 14.0 


Now i found out that in "System.h" there is a Define called SYSTEM_TIMER_ALWAYS_RUN. Maybe, this should be enabled? It's set to 0 at the moment. 


Other idea: Normally you should start the avalon timer once, set the actual time in the avalon_timer, then set SYSTEM_TIMER_ALWAYS_RUN to 1, and you could ask for the actual seconds, so you get the time. 

Is this way right?
0 Kudos