Commit 0f1d68c 1 parent 3a81bac commit 0f1d68c Copy full SHA for 0f1d68c
File tree 2 files changed +10
-22
lines changed
2 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,13 @@ Binary Clock
3
3
4
4
This repo contains the source files for my self made binary clock. It uses a TI
5
5
BQ32000 real-time clock chip for time keeping, a TI TLC5928 LED driver for the
6
- LEDs and an Atmel AtTiny24A microcontroller to control it. I plan on writing a
7
- blog post on my website with more details about it soon. I will add a link
8
- here as soon as I finish.
6
+ LEDs and an Atmel AtTiny24A microcontroller to control it.
9
7
10
8
The pcb/ folder contains the schemtaic and board layout (made with EAGLE). The
11
9
firmware and source code for the Atmel microcontroller can be found in the code/
12
10
folder.
13
11
14
- The v1 board layout contains some errors. The footprint for the LDO is wrong and
15
- connects +3V3 to GND. Also I forgot to add a decoupling capacitor for the RTC.
16
- You can work around this by isolating the big tab of the LDO from GND, the RTC
17
- functions without decoupling. Version 2 fixes those errors.
12
+ The v1 board layout contains some errors. The footprint for the LDO is wrong
13
+ and connects +3V3 to GND. Also I forgot to add a decoupling capacitor for the
14
+ RTC. You can work around this by isolating the big tab of the LDO from GND, the
15
+ RTC functions without decoupling. Version 2 fixes those errors.
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ uint8_t btns_prev;
80
80
ISR (PCINT0_vect ) {
81
81
uint8_t btns = PINA ^ btns_prev ;
82
82
btns_prev = PINA ;
83
-
83
+
84
84
if ((PINA & (1 << PA2 )) == 0 && (btns & (1 << PA2 )) != 0 ) {
85
85
/* S1 pressed */
86
86
s1 ();
@@ -94,7 +94,7 @@ ISR(PCINT0_vect) {
94
94
s3 ();
95
95
}
96
96
}
97
-
97
+
98
98
ISR (TIM1_COMPA_vect ) {
99
99
tick ();
100
100
}
@@ -146,8 +146,7 @@ void set_time() {
146
146
}
147
147
148
148
149
- int main (void )
150
- {
149
+ int main (void ) {
151
150
/* disable /8 system clock prescaler */
152
151
CLKPR = 0x80 ;
153
152
CLKPR = 0x00 ;
@@ -185,24 +184,15 @@ int main(void)
185
184
ADMUX = (1 << MUX0 );
186
185
ADCSRA = (1 << ADEN ) | (1 << ADSC ) | (1 << ADIE ) | (1 << ADPS2 ) | (1 << ADPS1 ) | (1 << ADPS0 );
187
186
ADCSRB = (1 << ADLAR );
188
- // DIDR0 = ~((1 << ADC1D) | (1 << ADC0D));
189
187
190
188
/* enable global interrupts */
191
189
sei ();
192
190
193
-
194
-
195
- /*while (1) {
196
- update_time();
197
- _delay_ms(100);
198
- }*/
199
-
200
- while (1 );
201
- return 0 ;
191
+ while (1 );
192
+ return 0 ;
202
193
}
203
194
204
195
205
-
206
196
/* application logic */
207
197
208
198
void s1 () {
You can’t perform that action at this time.
0 commit comments