Read LEDClock.pdf text version

LED CLOCK PROJECT 9641 Project number : 9641

1. Project Description:

This project is a led watch controlled by the SX18ACDP or SX28ACDP. The progression of the minutes is symbolized by 59 LED's (3mms) disposed on a circle (with a diameter of 17 centimeters) and lighting on one by one every minutes. The hours are represented by 11 LED's(5mm) disposed on a circle (diameter 13,5 Cm) and lighting on one by one every hour. Every 5 seconds a other led lights on in a group of 11 LED's disposed on a square in the middle of the clock. Finally a group of 5 LED's simulate a beam, one of the 5 LED's lights on from the right to the left and then from left to right every half second.

2. Schematic:

The assembly consists on two parts : - to drive the 86 leds - to get a precise base of time Led driving : Each led is connected to an output of one of the eleven 74HC595 (8-Bit Serial-Input/Serial or Parallel-Output Shift Register with Latched 3-State Outputs). The serial clock and output shift from each of the eleven 74HC595 are connected together on 2 I/O pins of the SX18DP ( or SX28DP). A other I/O pin from the SX18DP is connected to the serial input of the first 74HC595, the serial output of this 74HC595 is connected to the serial input of the next 74HC595 and so on until the last 74HC595. The serial loading and clocking of the eleven 74HC595 is done by the SX program by holding account of the hardware implantation of components. When all the 74HC595 are loaded the program trigs the output to light or not the LEDS. Base of time getting and clock setting : To get the base of time we use a quartz of 32.768 HZ witch signal is divided by 2**14 through a CD4060(CMOS 14 Stage Ripple-Carry Binary Counter/Divider and Oscillator) and connected to an I/O pin of the SX18DP. Each state changing of this input is used to count the time. As we do not use the interrupt capabilities of the SX chip, the complete cycle of counting and driving the leds has to pass in less than 0,25 second. To set the time on the watch we use two other inputs one to set the hours, the other for the minutes. We use the internal 4Mhz clock of the SX, so no external quartz is necessary.

SX_DESIGN contest_le#FF57FF.doc

Page : 1/3


3. Block Diagram :

Base of time SX CPU Hour set Serial in Parallel out Minutes setting LEDS The schematic and the PCB where realized with the software WINSCHEM and WINTYPON. The schematic and the PCB in format PDF where added to this document under the name `HORLOGE_BALANCE_PCB.pdf' and `HORLOGE_BALANCE_schematic.pdf'. To equip the PCB we use a plate of plywood cut and bored using the Step-four CNC. To realize the drawing of the plate, we used the turbo-cad software. To power the system we use a 6volt DC transformer ( min 250 mA)

4. Source Code :

To generate the SX code we first write the source code using the basic stamp BS1 language. This commented code was added to the document under the name `HORLOGE_balance_eng.BAS'. In short we give a correspondence between each led and the time (Hours H1 à H11, minutes M1 à M59, group of 5 seconds G1 to G11, beam B1 to B5). The program uses this correspondence to load serially the 74HC595. The other part of the program counts the time each changing of the input from the base of time and then counts the position of the beam, the seconds, the minutes, the hours. To set the time we use two other inputs, one for the hours the other for the minutes. When the hours pushbutton is pressed the hour counter is incremented each changing of the input state of the base of time. In the same way for the minutes if the minutes pushbutton is pressed. To translate the BS1 CODE to SX assembling code, we use a compiler written in Java language. It took a long time to write this compiler that only understands some of the BS1 instructions and uses SX Macros. You'll find the generated code in the `WASMRES.src' document. The program is loaded on the SX processor using the SX-KEY.

SX_DESIGN contest_le#FF57FF.doc

Page : 2/3


5. Bill of Materials:

ID C3-C4 CI12-CI5-CI7CI9-CI4-CI3CI2-CI1-CI8CI11-CI6 CI14 CI15

D01 to D92 R01 to R92 BT1 BT2 R1, R88, R89 R13 R12 C1 Q1 REG1

Description 33pF ceramic capacitors (select to match XT1 load capacitance)

74HC595 8-Bit

Serial-Input/Serial or Parallel-Output Shift Register with Latched 3-State Outputs

SX28AC/DP ­ MCU, DIP28, internal 4Mhz clock CD4060 CMOS 14 Stage Ripple-Carry Binary Counter/Divider and Oscillator Leds 3 and/or 5 mms. The colour depends on the look you want to give the watch 470 Ohm Push button normal closed 10 K 10 Mega Ohm 220 KOhm 10 µF 25 V Quartz 32768 Hz 5 V regulator

SX_DESIGN contest_le#FF57FF.doc

Page : 3/3


3 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate


You might also be interested in