by
Published on - 26th September 2011 04:29
Need to know the time - accurately for your next project?
The code below allows your PIC to log into a network timeserver and it (eventually) writes the time to a Dallas RTC (code not supplied).
The PIC checks the NET TIME every power-up and thereafter every 4 hours. If it doesn't make connection, it tries an alternate time server. If THAT doesn't work (after retries) it gives up and tries again 4 hours later. A Lantronix XPort handles the connection to the net.
...
Re: GOTO vs RETURN after a GOSUB
Also, using GOSUB reduces code size as this Sub can be called from various points of the program to do the same job, maybe with some parameters passing to it.
Ioannis Today, 20:24Keeps things structured.
Ioannis