Showing posts with label clock. Show all posts
Showing posts with label clock. Show all posts
Sunday, October 27, 2013
Alarm Digital Clock
The circuit diagram on behalf of the digital watch. 2x16 LCD is connected to the docks 2 of AT89C51. P1.0 of uC force provide the SCL (entertainment in installments clock) and P1.1 SDA (serial data) for I2C message.
Nearby are four switches connected to the uC, having the status of given away within the think. Function of the keys are same as unmistakable from their names.
at what time the power supply is switched on it willpower confer you the default appointment and schedule, but anon you can convert it to the desired appraise. taking into account setting as soon as, the backup battery will keep the timepiece ticking even after the power is not near.
![]() |
| Alarm Digital Clock Schematic |
A trivial a propos I2C:
There are basically four most important conditions wearing I2C protocol.
1) Start Condition
2)block Condition
3)Data Validity
4)Acknowledgement
1)Start Condition:
while SCL is sharp and SDA H->L, force take place taken since start condition meant for the exchange of ideas.
2)Stop Condition:
once SCL is high and SDA L->H, will generate a stop condition.
3)Data Validity:
after SCL is high at hand must be refusal chande voguish SDA line lone followed by the data is legally binding, the data loose change be supposed to be there made only as SCL is low.
4)Acknowledgement:
taking into account transfer of lone byte of data the reciever has to acknowledge the sender pro the winning reception. for this the sender add up to the SDA line soaring and reciever pulls down the SDA low, which tells the sender so as to data has reached safely.
Monday, October 21, 2013
PIC Digital Clock Timer
his 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 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.
PIC Digital Clock Timer Circuit Diagram

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 todays 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. Its 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
Download asm file
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.
PIC Digital Clock Timer Circuit Diagram

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 todays 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. Its 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
Download asm file
Sunday, September 22, 2013
72 LED Clock
In the circuit below, 60 individual LEDs are used to indicate the minutes of a clock and 12 LEDs indicate hours. The power supply and time base circuitry is the same as described in the 28 LED clock circuit above. The minutes section of the clock is comprised of eight 74HCT164 shift registers cascaded so that a single bit can be recirculated through the 60 stages indicating the appropriate minute of the hour. Only two of the minutes shift registers are shown connected to 16 LEDs. Pin 13 of each register connects to pin 1 of the next for 7 registers. Pin 6 of the 8th register should connect back to pin 1 of the first register using the 47K resistor. Pins 2,9,8, 14 and 7 of all 8 minutes registers (74HC164) should be connected in parallel (pin 8 to pin 8, pin 9 to pin 9, etc.).
The hours section contains two 8 bit shift registers and works the same way as the minutes to display 1 of 12 hours. Pin 9 of all 74HCT164s (hours and minutes) should be connected together. For 50 Hertz operation, the time base section of the circuit can be modified as shown in the lower drawing labeled "50 Hertz LED Clock Time Base". You will need an extra IC (74HC30) to do this since it requires decoding 7 bits of the counter instead of 4. The two dual input NAND gates (1/2 74HC00) that are not used in the 50 Hertz modification should have their inputs connected to ground.
72 LED Clock Circuit Diagram

When power is applied, a single "1" bit is loaded into the first stage of both the minutes and hours registers. To accomplish this, a momentary low reset signal is sent to all the registers (at pin 9) and also a NAND gate to lock out any clock transitions at pin 8 of the minutes registers. At the same time, a high level is applied to the data input lines of both minutes and hours registers at pin 1. A single positive going clock pulse (at pin 8) is generated at the end of the reset signal which loads a high level into the first stage of the minutes register. The rising edge of first stage output at pin 3 advances the hours (at pin 8) and a single bit is also loaded into the hours register.
50 Hertz LED Clock Timebase

Power should remain off for about 3 seconds or more before being re-applied to allow the filter and timing capacitors to discharge. A 1K bleeder resistor is used across the 1000uF filter capacitor to discharge it in about 3 seconds. The timing diagram illustrates the power-on sequence where T1 is the time power is applied and beginning of the reset signal, T2 is the end of the reset signal, T3 is the clock signal to move a high level at pin 1 into the first register, T4 is the end of the data signal. The time delay from T2 to T3 is exaggerated in the drawing and is actually a very short time of just the propagation delay through the inverter and gate.
Two momentary push buttons can be used to set the correct time. The button labeled "M" will increment the minutes slowly and the one labled "H" much faster so that the hours increment slowly. The hours should be set first, followed by minutes.
The hours section contains two 8 bit shift registers and works the same way as the minutes to display 1 of 12 hours. Pin 9 of all 74HCT164s (hours and minutes) should be connected together. For 50 Hertz operation, the time base section of the circuit can be modified as shown in the lower drawing labeled "50 Hertz LED Clock Time Base". You will need an extra IC (74HC30) to do this since it requires decoding 7 bits of the counter instead of 4. The two dual input NAND gates (1/2 74HC00) that are not used in the 50 Hertz modification should have their inputs connected to ground.
72 LED Clock Circuit Diagram

When power is applied, a single "1" bit is loaded into the first stage of both the minutes and hours registers. To accomplish this, a momentary low reset signal is sent to all the registers (at pin 9) and also a NAND gate to lock out any clock transitions at pin 8 of the minutes registers. At the same time, a high level is applied to the data input lines of both minutes and hours registers at pin 1. A single positive going clock pulse (at pin 8) is generated at the end of the reset signal which loads a high level into the first stage of the minutes register. The rising edge of first stage output at pin 3 advances the hours (at pin 8) and a single bit is also loaded into the hours register.
50 Hertz LED Clock Timebase

Two momentary push buttons can be used to set the correct time. The button labeled "M" will increment the minutes slowly and the one labled "H" much faster so that the hours increment slowly. The hours should be set first, followed by minutes.
Subscribe to:
Posts (Atom)
