Skip to content

Commit 0f1d68c

Browse files
committed
Minor cleanup
1 parent 3a81bac commit 0f1d68c

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ Binary Clock
33

44
This repo contains the source files for my self made binary clock. It uses a TI
55
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.
97

108
The pcb/ folder contains the schemtaic and board layout (made with EAGLE). The
119
firmware and source code for the Atmel microcontroller can be found in the code/
1210
folder.
1311

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.

code/BinaryClock.c

+5-15
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ uint8_t btns_prev;
8080
ISR(PCINT0_vect) {
8181
uint8_t btns = PINA ^ btns_prev;
8282
btns_prev = PINA;
83-
83+
8484
if ((PINA & (1 << PA2)) == 0 && (btns & (1 << PA2)) != 0) {
8585
/* S1 pressed */
8686
s1();
@@ -94,7 +94,7 @@ ISR(PCINT0_vect) {
9494
s3();
9595
}
9696
}
97-
97+
9898
ISR(TIM1_COMPA_vect) {
9999
tick();
100100
}
@@ -146,8 +146,7 @@ void set_time() {
146146
}
147147

148148

149-
int main(void)
150-
{
149+
int main(void) {
151150
/* disable /8 system clock prescaler */
152151
CLKPR = 0x80;
153152
CLKPR = 0x00;
@@ -185,24 +184,15 @@ int main(void)
185184
ADMUX = (1 << MUX0);
186185
ADCSRA = (1 << ADEN) | (1 << ADSC) | (1 << ADIE) | (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
187186
ADCSRB = (1 << ADLAR);
188-
// DIDR0 = ~((1 << ADC1D) | (1 << ADC0D));
189187

190188
/* enable global interrupts */
191189
sei();
192190

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;
202193
}
203194

204195

205-
206196
/* application logic */
207197

208198
void s1() {

0 commit comments

Comments
 (0)