Forum Discussion
This is part of a network time protocol server. The main.vhd is a bridge between a GPS interface which converts and parses time from the GPS to an NTP timestamp. It converts that time and periodically writes it to a real time clock. The design works perfectly until the addition of the functions getjulianday(), rtctontp(), and ntptortc(). The problem is I need to essentially convert a 32 bit vector representing seconds since 1901 to date and time, and back again. When I remove the functions and leave the states for converting RTC to NTP timestamp and vice versa blank, it compiles fine and functions correctly. I understand what you both mean by the problem with the dividers. But I'm unsure about the clock speed. My clock is 24.76Mhz and it works fine (without the functions for converting) on the board. How can I implement the algorithms without encountering the same problems?