05-28-2026 02:58 PM
I currently am working on a digital watch that tells time in hexadecimal. I have everything working on it even! The displays, switches, and even the duration of a minute is functioning. However, past a minute is where things get less than desirable...
Currently I have a 4 MHz crystal oscillator inputting into the microcontroller, a PIC16LF68. At the end of the code I have it set to increment a counter. It takes somewhere between 107 and a 108 loops for a second to pass. So after that many loops (just picking one at random) it will increment the second counter. Obviously after a long enough period of time has passed its fast or slow.
Is there a better way to implement this? I know I could try to make the code slower, so it lines up better with another count number, but that seems like is a rather sporadic solution.
05-28-2026 03:45 PM
This NI forum is mostly for National Instruments products and there is probably a better place elsewhere to ask your question.
05-29-2026 07:53 AM
SCNR