Re: Single time execution intruction PIC18F87J60
Make code to read control and status registers of the RTC device.
If it is stopped, then start it, and set the time.
If it is already running, then let it continue.
If the time is wrong, then adjust it.
If the time is reasonable, then let it continue as it is running.
It is the same procedure as you do manually with any mechanical or electric clock.
If you build the program, and program the MCU connected to the RTC device at the same time,
then you may use __TIME__ and __DATE__ macro text strings from the compiler,
to make initial time settings.
Then there is no end to the possile complexitity to obtain time for adjustments.