Description: This clock timer uses a PIC16F628 microcontroller to display 3 and 1/2 digit time and control an external load. The clock includes a calendar with leap year and optional daylight savings adjustments. The timer output can be set from 1 to 59 minutes and manually switched on and off. The clock also has a correction feature that allows an additional second to be added every so many hours to compensate for a slightly slow running oscillator. The oscillator uses a common 32.768 KHz watch crystal and the frequency can be adjusted slightly with the 24pF capacitor on the right side of the crystal. More: There is a bug in this program that prevents the alarm from working if the minutes are set to zero. So, an alarm setting of 8:59 or 6:01 will work but 6:00 will not. The bug can be fixed by adding a program line to call the alarm routine after the hours are incremented. Current listing in the interrupt section is: call Alarm movlw d'60' xorwf MINUTES,0 btfss STATUS,2 ; Check for 60 minutes goto Done ; Jump out if not 60 clrf MINUTES incf HOURS,f New listing should be: call Alarm movlw d'60' xorwf MINUTES,0 btfss STATUS,2 ; Check for 60 minutes goto Done ; Jump out if not 60 clrf MINUTES incf HOURS,f call Alarm ; New line added here On bootup, the display should read 2:56 AM and other data can be displayed by toggling the advance switch (D). Each time the (D) switch is closed and opened, the display will advance to the next data. The order of displayed data and bootup values is as follows: Time --------------------------------------------- (2:56) Alarm --------------------------------------------- (6:30) Calendar --------------------------------------------- (3:07) Weekday (Sunday=1), Seconds ---------------------------- (1:Seconds) AM/PM (Alarm) (AM=0/PM=1), Timer Duration ------------- (0:45) AM/PM (Time) (AM=0/PM=1), Daylight Savings Disabled -- (0:00) Year (1 to 4) , Error Correction ---------- (2:18) There are 7 displays that advance each time the 'D' switch is toggled. To make adjustments, set the RA5 switch to the "B" position and then toggle the E and F switches to advance the data in the hours or minutes digits. Then toggle the "D" switch to move to the next data. After the 7th display, it will go back to the top and display the current time. Or, just press the time switch 'C' to get to the top at anytime. When done setting everything up, set the RA5 switch to the "A" position so the data cannot be accendentally changed. You can still view everything with the "D" advance key, but the E an F switches will just turn on or off the alarm at RB7. I use it with an external transistor to switch on and off a radio. The 'Daylight savings' setting (in the 6th display in the minutes digits) is used to enable daylight savings time adjustments, one hour ahead on the 2nd sunday in March, and one hour behind on the first sunday in November. The entry will be either 0, 1, or 3. 0 = Daylight savings time disabled (default). 1 = Savings time enabled and current time is standard time. 3 = Savings time enabled and current time is daylight savings time. The last 2 entries on the list (Year and Correction) is for the current year (1 to 4) (4 = Leapyear) so today's setting (2006) will be 2 since leapyear will be on year 4 which is 2 years from now. The correction setting will add a second every so many hours for fine adjustment to the oscillator frequency. My setting is 18 which adds a second every 18 hours. It's pretty accurate and only loses 3 seconds a month. You probably want to run it for a couple weeks to figure out what correction is needed for the crystal you have. Switch functions: RA0 (C switch) = Display Time RA1 (D switch) = Advance to next data (alarm, calendar, etc) RA2, RA3 (E and F switch) = Advance hours and minutes (in setup mode). RA2, RA3 (E and F switch) = Toggle alarm output on/off (in run mode) RA5 in the 'B' position (open) = Setup Mode
The described clock timer circuit integrates a PIC16F628 microcontroller, which serves as the central processing unit. The microcontroller interfaces with a 32.768 kHz watch crystal oscillator, providing the necessary timing signal for accurate clock operation. The circuit is designed to display time in a 3.5-digit format, alongside additional features such as a calendar, alarm, and daylight savings adjustments.
The timer output can be configured to operate between 1 to 59 minutes, with manual activation and deactivation capabilities. A correction feature is incorporated to adjust the oscillator's frequency by adding an additional second at specified intervals, ensuring long-term accuracy. This is facilitated by a 24pF capacitor connected to the oscillator, which allows for fine-tuning of the frequency.
The user interface consists of several switches: RA0 for displaying the current time, RA1 for advancing through various display modes (alarm, calendar, etc.), and RA2/RA3 for adjusting the hour and minute settings during setup. The RA5 switch determines the operational mode, with a position for setup and another for normal operation.
The alarm functionality is controlled through an interrupt routine, which has been noted to have a bug related to the zero-minute setting. A modification to the program code has been suggested to ensure the alarm operates correctly across all minute settings. The display sequence includes time, alarm, calendar, weekday, AM/PM settings for both the alarm and current time, and the daylight savings status.
The daylight savings feature allows the user to enable or disable adjustments based on the current time of year, with settings indicating whether daylight savings is active or not. The year and correction settings provide additional functionality to ensure the clock remains accurate, with the correction adjusting the timing based on the user's specific oscillator characteristics.
Overall, this clock timer circuit is a versatile and programmable solution for timekeeping, integrating various features to enhance user experience and accuracy.This clock timer uses a PIC16F628 microcontroller to display 3 and 1/2 digit time and control an external load. The clock includes a calendar with leap year and optional daylight savings adjustments. The timer output can be set from 1 to 59 minutes and manually switched on and off. The clock also has a correction feature that allows an additional second to be added every so many hours to compensate for a slightly slow running oscillator.
The oscillator uses a common 32.768 KHz watch crystal and the frequency can be adjusted slightly with the 24pF capacitor on the right side of the crystal. There is a bug in this program that prevents the alarm from working if the minutes are set to zero. So, an alarm setting of 8:59 or 6:01 will work but 6:00 will not. The bug can be fixed by adding a program line to call the alarm routine after the hours are incremented. Current listing in the interrupt section is:
call Alarm
movlw d'60'
xorwf MINUTES,0
btfss STATUS,2 ; Check for 60 minutes
goto Done ; Jump out if not 60
clrf MINUTES
incf HOURS,f
New listing should be:
call Alarm
movlw d'60'
xorwf MINUTES,0
btfss STATUS,2 ; Check for 60 minutes
goto Done ; Jump out if not 60
clrf MINUTES
incf HOURS,f
call Alarm ; New line added here
On bootup, the display should read 2:56 AM and other data can be displayed by toggling the advance switch (D).
Each time the (D) switch is closed and opened, the display will advance to the next data. The order of displayed data and bootup values is as follows:
Time --------------------------------------------- (2:56)
Alarm --------------------------------------------- (6:30)
Calendar --------------------------------------------- (3:07)
Weekday (Sunday=1), Seconds ---------------------------- (1:Seconds)
AM/PM (Alarm) (AM=0/PM=1), Timer Duration ------------- (0:45)
AM/PM (Time) (AM=0/PM=1), Daylight Savings Disabled -- (0:00)
Year (1 to 4) , Error Correction ---------- (2:18)
There are 7 displays that advance each time the 'D' switch is toggled. To make adjustments, set the RA5 switch to the "B" position and then
toggle the E and F switches to advance the data in the hours or minutes
digits.
Then toggle the "D" switch to move to the next data. After the
7th display, it will go back to the top and display the current time. Or, just press the time switch 'C' to get to the top at anytime. When done setting everything up, set the RA5 switch to the "A"
position so the data cannot be accendentally changed. You can still view
everything with the "D" advance key, but the E an F switches will just
turn on or off the alarm at RB7.
I use it with an external transistor to
switch on and off a radio. The 'Daylight savings' setting (in the 6th display in the minutes digits)
is used to enable daylight savings time adjustments, one hour ahead on the
2nd sunday in March, and one hour behind on the first sunday in November. The entry will be either 0, 1, or 3. 0 = Daylight savings time disabled (default). 1 = Savings time enabled and current time is standard time. 3 = Savings time enabled and current time is daylight savings time. The last 2 entries on the list (Year and Correction) is for the
current year (1 to 4) (4 = Leapyear) so today's setting (2006) will
be 2 since leapyear will be on year 4 which is 2 years from now.
The correction setting will add a second every so many hours
for fine adjustment to the oscillator frequency. My setting
is 18 which adds a second every 18 hours. It's pretty accurate
and only loses 3 seconds a month. You probably want to run it
for a couple weeks to figure out what correction is needed for
the crystal you have.
Switch functions:
RA0 (C switch) = Display Time
RA1 (D switch) = Advance to next data (alarm, calendar, etc)
RA2, RA3 (E and F switch) = Advance hours and minutes (in setup mode). RA2, RA3 (E and F switch) = Toggle alarm output on/off (in run mode)
RA5 in the 'B' position (open) = Setup Mode
After one cycle of operation, SCR1 will be activated, resulting in a low voltage being applied to the UJT emitter circuit, which interrupts the tuning function. When pushbutton SI is pressed, or a positive pulse is applied at point A,...
U1 is a 3817 integrated circuit produced by Fairchild Corporation. It is capable of directly driving a display and can operate in both 12-hour and 24-hour formats. Additionally, it can generate a clock sound and activate radios at scheduled times....
This device is a simple timer that keeps the headlights of a vehicle on for approximately 1 minute and 30 seconds, allowing access to dark areas without the need to manually switch off the lights. Activating switch P1 initiates the...
This circuit was developed since a number of visitors of this website requested a timer capable of emitting a beep after one, two, three minutes and so on, for jogging purposes. As shown in the Circuit diagram, SW1 is a...
This electronic clock comprises the LM8365 and the LDD640R displays. The LM8365 can show the hour/minute and month/day. Users can set two alarm outputs, AD1 and AD2, by pressing either the 12h or 24h button. The operating voltage range is...
This project is provided as a prototyping project as no PC board has been produced. The photographs show the project built on a matrix board using surface-mount components and very fine wire. The final design will require a double-sided board...
This timer was designed for people wanting to get tanned but at the same time wishing to avoid an excessive exposure to sunlight. A Rotary Switch sets the timer according to six classified Photo-types (see table). A Photo resistor extends...
The figure illustrates a preset outage timer circuit designed for an electric cooker. The timing range of the circuit extends from 1 hour to 12 hours, adjustable via a potentiometer (PR). The timing mode operates on a counting basis, and...
The timer start-pulse generator is a fast series-transistor coincidence circuit. The slope-gate generator is a one-shot multivibrator that prevents the 1N97A diode from passing the blocking oscillator's negative sync pulse until the multivibrator fires. This circuit is utilized to count...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more