That’s 1MHz.
From your schematic it’s not clear what the crystal is supposed to clock at.
If I assume as fast as possible for that AVR (@5V) we’re looking at a clock rate of 20MHz.
According to DS of the AVR the I2C can do a max of 400kHz.
Without delving further into the details, I’d say you’ll not get much faster than 8kHz switching those LEDs with all that overhead (I2C needs at least 16 cycles to get the info to those MCP23017, which there are 3 of).
This means 400kHz / 16 / 3 ~ 8.3kHz.
I always miter the corners not only for sake of appearance, but also because it helps pack multiple traces into tight spaces. Some folks try to make arguments about how mitered corners reduce the overall trace length but I doubt the difference amounts to any measurable (much less, significant) electrical effects on the DC side of GHz. And a few folks will prattle on about “impedance discontinuities” at the vertices but here again I suspect there are more significant things to worry about unless you’re working on the Daylight side of GHz.
KiCAD creates its traces by “rolling a circle” along the path of the trace, so whenever the path changes direction there will not be a sharp exterior vertex. Instead, there is a radiused corner with the curvature set by the width of the trace.
That is a topic that can become complicated in unexpected ways. Your project is rather straightforward and I don’t anticipate layout-related problems.
For future reference, a signal’s nominal frequency is sometimes less of a problem than its edge rates (rise and fall times). That is, a 10 MHz sinusoid is much less troublesome than a 100 KHz switching signal.
Also remember that even though a microcontroller or other logic device is clocked at a rather low rate, it is CAPABLE of operating at higher rates. And, worse yet, it can respond to MUCH faster signals. A microcontroller that is rated for a clock speed of, say, 10 MHz or 20 MHZ, is often capable of responding to signals in the VHF range. A glitch of only a few nanoseconds can raise hell with an embedded system, especially if the glitch finds its way onto a RESET or INTERRUPT line. (Hint: If your system uses any form of interrupts, does the interrupt service routine recover gracefully if it can’t determine the origin of an interrupt?)
I am clocking the AVR at 16mhz (because I programmed it with arduino, I do not know how to program it in C). I guessed that I might not be running as fast on I2C as I said I was, that is just the delay between each message send command.
Thank goodness you caught that, that would be very bad if I missed that.
No interrupts are being used in the code, but there is a reset line. The reset line is of the type that is pulled low to trigger, so I am guessing that will not be a major issue?
As long as it does not interfere with UART or I2C, I will be happy.
Hm… you do know there is Atmel (now Microchip) AVR studio to program those MCUs with open source avr-gcc?
One particular helpful site I found when I was using those MCUs is http://www.avrfreaks.net/
Another site is www.mikrocontroller.net, and while they’re German they have the best tutorials on the matter IMHO.
PS: if this needs to go fast you won’t get around the fact that you need to do some stuff in assembler even.
PPPS: my last AVR project is 3 years back and nowadays I use STM32 chips, same price, same power draw, smae package sizes for similar features, little bit more complicated but much more Ooomph
Everything worked as planned when I tested it on a breadboard.
I am happy with the code, and now that I have had people look over my board, I am happy with that too and I suppose I will go ahead and order it. I just spread out a couple more of the wires, so I think I am good now, unless anyone thinks otherwise.
I am amazed, and disappointed. After 3 days, 230+ views, and 27 replies, other than an addressing conflict the only comments have been to make your tracks wider and add a revision number? Some people seem to have access to the schematic which I do not see a link to but just from looking at the gerbers there is plenty wrong with this board! I am referring to the controller board as I have only briefly looked at the LED board. Upon first glance the most glaringly obvious question is “Where are all the caps??”. There is not a decoupling cap in sight, nor any bulk capacitor. The ground plane is badly segmented and stitched back together with tracks here and there. The ground pins of some connectors connect to the ground plane through the tiniest slivers of copper which might not even be there after manufacturing. Some improvements to the routing would allow the ground plane to remain intact. There are many unnecessary vias and you seem obsessed with avoiding 90 degree connections to the point where even “T” connections are at an angle, which actually uses more space than a “T” connection would. Not to mention the trouble those wonky electrons with have negotiating those corners. (Sorry couldn’t resist that). I’m sure your power plane is just as bad but I haven’t spent much time checking that one.
I routed it myself, except for the connections between the three dip chips on top and their connections. But seeing as I am a beginner at this, I can see how someone confused my traces for the autorouter, if anything looks wrong, tell me, do not be afraid of saying something stupid to me.
I had a link set up, but I was told that people prefer to look at the gerbers, so I edited my first post. Look at the edit history if you want to see the link to the files.
Where would you advise I put them? Like I said, I am a beginner, and it all worked perfectly fine when I set it up on a breadboard without caps.
As I am a beginner, can you please explain to me exactly what the isssues with either of these are? I know that not using T connections was already discussed as just being a bit more personal, Those smaller T connections were before I made this forum post, and almost all boards I had seen avoided right angles, so I thought that there was a reason for avoiding them.
Can you give me some pointer to where that might be?
Having the schematic would greatly increase the range of advice that could be given depending on how full of a review someone was willing to conduct. A review based on gerbers alone for instance would never have revealed an addressing conflict.
It would be a good idea to post the schematic as an image or pdf however, to save everyone from having to load your project into Kicad.
You have no idea how common that is. I’m willing to bet that when you wired up your breadboard you used something close to 22 AWG wire. That has a cross sectional area of 0.3mm2 compared to your 10 mil PCB tracks which have an area of 0.009mm2. You also probably wired your power and ground with more of a star topology. So all of your ICs would have had a relatively low impedance connection to the power supply while the impedance on your PCB will be significantly higher. The same circuit on a PCB might not work at all or if it does it might not be very reliable. Your processor might reset every few minutes or hours. It might work fine until you change a piece of code, then you spend hours/days debugging your code when it is the hardware that is at fault. It might even be temperature dependent.
Forget everything you have ever heard about right angles on a PCB. When people talk about “right angles” they are usually referring to right angle corners, ie “L” shaped corners. While there are technical reasons to avoid “L” shaped corners they don’t apply to most layouts. Most people avoid them because they heard somewhere that they were bad or for aesthetic reasons. If you don’t like the look of right angle corners then miter them with a short 45 degree segment. But the same does not apply to “T” branches. If you are doing a layout where you need to avoid “T” branches for impedance reasons then branching at an angle is not going to help.
As for the vias, they take up more space than a track so it is always a good idea to avoid them. You also don’t want to be hopping from one layer to another any more than necessary.
If you look at your R3 & R2 you see a via next to the resistors through-hole pad. Obviously there is no need for the via. But even the track that connects to R1 switches layers when there is no need. There are several other such tracks. And if you clean some of them up your planes will become a little less segmented.
For a start examine the ground connections for J6, SW1 and J9.
@1.21Gigawatts Thanks, I just updated the OP with images of the schematics.
If I understand correctly, I should put a decoupling cap right next to the VCC pin on the atmega, and the caps legs should be between the VCC and GND copper pours. Should I have more decoupling caps anywhere else, and how do I figure out what rating the cap should be?
I will dig around for cleaning up vias and GND planes. Once I figure that out, and find out about decoupling caps, I will post new gerblook links as a reply.
1.- General rule: Do your traces as thick as possible. In your design ¿Is there a reason to make them that thin? No matter that your PCB manufacturer is able to deal with 3 mil traces, make them thicker than that.
2.- Are you going to use wave soldering or hand-soldering instead? The pad’s sizes depend on that. In your design, it seems to be wave-soldering. For hand-soldering the pad’s sizes should be larger (diameter >100 mil, 125mil works well).
3.- There are lot of space unused. Why don’t you fill it with polygons? Maybe for a ground plane.
4.- When possible use vertical traces on the bottom cupper side, whilst horizontal ones on the upper cupper side.
5.- Clearance seems to be ok, but as with traces, the more space among tracks, the better for your design and for your manufacturer’s tests.
The fastest way is to edit directly the footprint. There you can modify the pad’s sizes according to your needs (as said before, for me pad’s size is ok between 125 and 150 mils).
You can do that as this on your design:
1.- On the Footprint editor create a new component based on an existing one, for example, a LED, and give it a distinctive name.
2.- Back on your PCB, right click on one LED. Then Properties and Change footprint. Choose “Change footprints ‘LED’” (or whatever the LED footprint name has been given). Finally write the name you used on step 1 in the text-box “New footprint (FPID”. And voila! all LEDs footprints has been changed.
3.- Repeat the procedure for all components. Save them all on a common library for being used in the future.