EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: paulca on February 10, 2018, 09:06:32 pm
-
So I've been trying to learn KiCad as my schematic tool.
This is my first attempt at a project using it.
It's a binary clocked based on an ATMega328P MCU and TLC59282 LED Driver with a RS1302 real time clock.
(http://i.imgur.com/F1CFgYw.png) (https://imgur.com/F1CFgYw)
Power supply is not shown, current plan is an 18650 with Wemos battery shield (basically a TP4056 + 5V boost).
I'm not showing the attempt at the PCB yet. I had to do messed up things like reverse the bit order of the LEDs to stop whole groups of tracks crossing. I can handle that in code, just shift the byte out in reverse order.
EDIT: Just noticed, I haven't put the setting buttons on there yet. Don't want to have to get the ISP programmer out to set the clock.
-
You don't need a LED driver. Just connect the hours and minutes together directly to the controller and and multiplex them. Then connect the other LEDs to the remaining pins. The controller can handle 40mA per pin and 200mA total, which is plenty for simple indicator LEDs.
-
.... Except that at 7:31:31 PM there will be 3 + 5 + 5 +1 = 14 LEDs lit at the one time.
* Thinks *
* does some numbers *
But - that's still 14mA per LED - which should be more than enough.
-
I considered multiplexing, but decided not to.
Also remember the LED driver means I don't need 17 current limiting resistors. Although, I believe with multiplexing I can share them and need less of them.
Anyway, I already have the BOM at hand.
-
.... Except that at 7:31:31 PM there will be 3 + 5 + 5 +1 = 14 LEDs lit at the one time.
No, there wouldn't be. It would be multiplexed, so there'd be a max of 9 LEDs on at the same time
-
Also... if I multiplex the hours and minutes do I not need to common ground each bank to a MCU pin in order to select which bank?
Does that not mean I have the current of 6 LEDs sinking through a single pin?
Unless you mean to double multiplex like a grid. Meh. Too much hassle.
I could mosfet the sink pins... but this is why they made the LED Driver chip!
-
I considered multiplexing, but decided not to.
Also remember the LED driver means I don't need 17 current limiting resistors. Although, I believe with multiplexing I can share them and need less of them.
Anyway, I already have the BOM at hand.
You'd actually only need 6 resistors if you multiplexed them all on the same 5 lines.
-
.... Except that at 7:31:31 PM there will be 3 + 5 + 5 +1 = 14 LEDs lit at the one time.
No, there wouldn't be. It would be multiplexed, so there'd be a max of 9 LEDs on at the same time
:palm:
I'm still on my first caffeine for the day....
-
If you want your clock to have a 24-hour display mode, you need another LED for the hours.
You've got a number of +5 spots on the schematic that are annoying to look at because they're connected directly to a cap without any visual sign of an input, such as an unconnected line with a label to indicate where it comes from. It's a legibility thing, not a functional thing.
-
Also... if I multiplex the hours and minutes do I not need to common ground each bank to a MCU pin in order to select which bank?
Does that not mean I have the current of 6 LEDs sinking through a single pin?
Unless you mean to double multiplex like a grid. Meh. Too much hassle.
I could mosfet the sink pins... but this is why they made the LED Driver chip!
You have the current on the driver set to 5 mA per LED. If that's the brightness you want, you could easily sink 5 LEDs (the max on for a line) directly into an IO pin to direct multiplex all the LEDs on the same set of 6 lines.
They made the driver chip for sinking more than 5mA per LED. Otherwise, it's a waste.
You could just increase the current limit to take advantage of the higher current handling and make the chip no longer pointless.
-
You could just increase the current limit to take advantage of the higher current handling and make the chip no longer pointless.
I was considering replacing the iRef resistor with a pot.
-
If you want your clock to have a 24-hour display mode, you need another LED for the hours.
You've got a number of +5 spots on the schematic that are annoying to look at because they're connected directly to a cap without any visual sign of an input, such as an unconnected line with a label to indicate where it comes from. It's a legibility thing, not a functional thing.
Thanks for the feedback. It's a 50/50 thing with the 12 hour + am/pm light versus 24 hour with 5 binary digits for hours. Same number of LEDs, but I'm going for an AM/PM light under control of the MCU
On labelling +5V is there a standard way of denoting the source of the label? Obvious, to me, the power connector +5V with large decoupling cap is the source, but I do understand that isn't obvious without prior knowledge and that power connector could just as easily be an output to another board.
-
This covers some of the most common voltage node symbols, although just having a labeled dead-end line is understood too. Without that visually unconnected line, it's ambiguous. Sort of like text without punctuation, you have to stop and figure it out. https://learn.sparkfun.com/tutorials/how-to-read-a-schematic (https://learn.sparkfun.com/tutorials/how-to-read-a-schematic)
Decoupling caps can be a distraction on dense schematics, and may get placed off to the side since schematics aren't about physical layout. Placement only becomes important when you actually lay out the board. Example: https://www.bigmessowires.com/nibbler-schematic.png (https://www.bigmessowires.com/nibbler-schematic.png)
-
Decoupling caps can be a distraction on dense schematics, and may get placed off to the side since schematics aren't about physical layout. Placement only becomes important when you actually lay out the board. Example: https://www.bigmessowires.com/nibbler-schematic.png (https://www.bigmessowires.com/nibbler-schematic.png)
Ah, I noticed when laying out the board that it didn't matter at all which of the decoupling caps I lifted and moved, because they are connecting two very wide nets, +5V and GND they could legally be placed anywhere.
It then makes sense to see the decoupling caps all paralleled up in the corner too. Of course it then tells you absolutely nothing about what has and what has not got a decoupling cap on it. For that you would need to look at the PCB layout. You could assume that all ICs have decoupling caps and that power rails probably have somewhere, but others might be less obvious. Caps on ADC inputs to filter off HF noise or stabilise/smooth the reading etc.