AN-1121 A GreenPAK™ based Digital Clock

This application note describes how to make a digital clock based on 3 GreenPAKs (SLG46620V), an external crystal, four 7-segment displays and 60 LEDs to display seconds. It is capable of operating via an internal battery when the main power is lost, and shutting down the display for battery power savings. It also includes an internal every-hour buzzer which can be turned OFF.

Figure 1 shows the completed device’s appearance.

External appearance of a completed clock

Figure 1. External appearance of a completed clock

Clock Schematic Analysis

The entire clock schematic can be divided into a few parts. The main power supply (not described here) is responsible for transforming 100-250VAC down to 7-15VDC; DC power supply which includes a 5V LDO, 3V battery (CR2032), 2 Schottky diodes, a voltage divider (R3 and R4) and 3 capacitors for proper LDO operation. The voltage divider creates a PwrDet signal which monitors the main power (5V). If the main power is present, the clock operates in normal mode. If the main power is absent (clock is not plugged to the wall), the clock operates using the internal battery (3V), but the time information is not displayed on the 7-segment displays and LEDs to conserve battery life. The clock oscillator source includes a 32.768 kHz crystal oscillator, two resistors and two capacitors. This scheme is based on the Pierce oscillator, and component values are chosen for the best accuracy. The clock includes 3x SLG46620V chips which communicate with each other. Each chip corresponds to some part of the functionality. The clock has 4 buttons; 3 of them are simple (unfixed) and correspond to setting time, whereas 1 button is fixed and corresponds to turning the buzzer ON/OFF.

Typical application circuit schematic

Typical application circuit schematic

Figure 2. Typical application circuit schematic

The 7-segment displays with common anode are connected to the main chip (hours) and the second chip (minutes). The third chip (sec) controls the 6x10 LED matrix. The first digits of the minutes information and the hours information are controlled by transistor Q1. The second digits of the minutes information and the hours information are controlled by transistor Q2. These two transistors are responsible for dynamic switching and are controlled by the main chip.

Main Chip (Hours)

All chips communicate between each other and each chip has its own functions. The main chip (hours) corresponds to the hours information; an external 32.768 kHz crystal is connected to it. CNT1 divides 32.768 kHz by 214 and DFF8 makes the last division by 2 to make 1s and 50% duty cycle of the main clock which is transmitted through PIN3 to the other 2 chips. This chip includes a 4-bit state machine (based on DFF0, DFF1, DFF2 and Pipe Delay0, which counts from 0x1111 to 0x0110) and a 2-bit state machine based on DFF6 and DFF7 (which counts from 0x11 to 0x01). The 4-bit state machine is reset by 3-bit LUT7 at transitions 9-10, 19-20 and 23-0. Also, this chip controls the 2 transistors (Q1 and Q2) to make a dynamic switching between first and second digits for hours and minutes information. LF OSC is used for this purpose and its frequency is ~108Hz. Also, this signal is transmitted through PIN4 to another chip (minutes) to synchronize the operations of both chips. Switching hours (+1 hour) occur by the button (PIN15) being pushed and/or by external signal (PIN5) from chip (minutes). PIN2 corresponds to turning OFF all the 7 segment displays and buzzer.

If it detects a LOW level, PIN9 and PIN10 will go LOW and turn the transistors (Q1 and Q2) OFF. The last function which includes this chip beeps every 10ms and it can be turned OFF.

Main Chip Block Diagram

Figure 3. Main Chip Block Diagram

Second Chip (Minutes)

The main part of this chip is 2 state machines. A 4-bit state machine based on DFF0, DFF1, DFF2 and Pipe Delay0, which counts from 0x1111 to 0x0110 (from 0 to 9 decimal) and a 3-bit state machine based on DFF6, DFF7 and DFF8 which counts from 0x111 to 0x010 (from 0 to 5 decimal). PIN14 receives a clock signal from the main chip (hours) and multiplexes the signals between the 2 state machines to show minutes information. The 4-bit state machine is reset by 2-bit LUT2, DLY2, P DLY0 and INV0 at transition 9-0. The 3-bit state machine is reset by the 2-bit LUT6 at transition 5-0. PIN15 receives 1s pulses from main chip (hours) and divides this frequency by 60 to make 1 minute transitions on the 4-bit state machine. After every 10 transitions, the 4-bit state machine resets and sends a signal to the 3-bit state machine as a clock. The 3-bit state machine counts to 6 and sends this signal through PIN13 to the main chip (hours) as a 1 hour timer. Also, the minutes information can be changed manually by the button connected to PIN3 (+1 minute). PIN5 receives a signal from the button and with PIN12, corresponds to resetting 3rd chip (sec) and turning it OFF when the main VDD is absent. If the button is pushed, PIN16 produces a short pulse (LOW) and the chip (sec) decodes this signal as a RESET. The Chip (sec) can be reset only when PIN12 is HIGH. If PIN12 detects a LOW signal, then PIN16 goes LOW and the chip (sec) will turn OFF all LEDs until PIN12 goes HIGH.

Second Chip Block Diagram

Figure 4. Second Chip Block Diagram

Third Chip (Seconds)

The third chip (sec) has only 1 function – to display seconds’ information on 60 LEDs where each LED turns ON during 1s and is responsible for the appropriate second. It has only 2 inputs and 16 outputs. The best way to control 60 LEDs using 16 outputs is to use a 6x10 matrix.

This chip includes a 4-bit state machine based on DFF6, DFF7, DFF8 and Pipe Delay1, which counts from 0x1111 to 0x0110 (from 1 to 10 decimal) and a 3-bit state machine based on DFF0, DFF1 and DFF2 which counts from 0x111 to 0x010 (from 0 to 5 decimal). PIN3 receives a 1 second signal from the main chip (hours), and this signal is a clock for a 4-bit state machine.

The 4-bit state machine counts to 10 and resets by the 3-bit LUT15. Also, this LUT operates as a clock for the 3-bit state machine. PIN2 has 2 functions: the reset and the power down functions respectively. This PIN receives an active LOW signal from the second chip (minutes). If PIN2 goes LOW for less than 10 milliseconds, then it causes 1sec reset for 4-bit and 3-bit state machines. After this, the LEDs turn on starting from the first LED. If PIN2 goes LOW for more than 10 milliseconds, then it turns all LEDs OFF, but the chip keeps on operating as previously.

Third Chip Block Diagram

Figure 5. Third Chip Block Diagram

Conclusion

This application note describes how to make a fully functional digital clock based on 3 GreenPAKs SLG46620V and an external crystal. Also, this device can be simplified to 2 chips by removing the third chip and 60 LEDs. This application demonstrates some of the capabilities and the flexibility of the GreenPAK family of CMIC’s.

About the Author

Name: Oleg Basovych

Background: Oleg Basovych graduated from Lviv Polytechnic University in 2011, studying at the Institute of Computer Science, department of Automatic Control Systems. He has 5 years of experience working as an engineer and his particular sphere of interest includes microcontrollers, the construction of high-end acoustic systems and amplifiers. At the moment, he is working with the analog and digital circuits and investigating the specifics of its application.

Contact: appnotes@silego.com

 

Files



See full list of Application Notes