Just a general question - I mount the crystal adjacent to the XTAL legs and close to the DIP package of the ATmega. I realise that's purely out of tradition rather than knowledge, granted every Arduino I see does that.
Since the oscillator is a source of EMR I had presumed it is somehow better placed there for reduced EMR interference with the ATmega/ATtiny. Again that's a presumption only. I couldn't see anything in the ATmega328 datasheet to confirm this.
So, my question is if the PCB had a ground plane flood could we locate the crystal and its capacitors under the board, between the DIP package's legs ?
Or is there some other factor at play here that makes placement elsewhere inferior?
Thanks - that makes it especially clear. I'm glad I asked.
Finally, the importance of the physical location of the resonator in relation to the AVR should be stressed. Always place the resonator as close to the AVR as possible and shield the resonator by surrounding it with a ground plane
The parts about protecting SPI lines with resistors from the ISP pins, and putting a cap on the reset line I hadn't seen before either.
strykeroz:
The parts about protecting SPI lines with resistors from the ISP pins...
Works great when whatever is connected to the processor cannot be made high-impedance and the programmer does not have series resistors. I used 51k resistors on a board with an ATtiny84 processor and a TLC5940 LED driver. The LEDs go crazy while programming but that is a small price to pay for in-system programming!
Can you point me to an example where the slaves are ATtiny too? I have a project where I was just going to leave the ISP header off because of multiple ATtiny SPI slaves but potentially I could switch the SS to choose which uC to program with a dip switch or simple jumper, but these protective resistors would then be in the path of the ISP too presumably. Is that a bad thing?
strykeroz:
Thanks for the tip on the resistor value.
It is based on the maximum source/sink for TLC5940 signal pins.
Can you point me to an example where the slaves are ATtiny too?
I cannot. But, if you post a schematic, I suspect you will be offered some opinions.
I have a project where I was just going to leave the ISP header off because of multiple ATtiny SPI slaves but potentially I could switch the SS to choose which uC to program with a dip switch or simple jumper...
Switching SCK will probably work better.
...but these protective resistors would then be in the path of the ISP too presumably. Is that a bad thing?
No. Most commercial programmers include series resistors. 1k seems to be a popular value.
You are of course correct. And thanks for being diplomatic with my half-formed thought above. There's no SS on the ISP header to switch so that may have presented a challenge
This thread has been very illuminating - thanks guys!
Geoff
In the project I mentioned above there's an ATmega328 which acts as SPI master, with 6x ATTiny84 slaves. The net SPI-SCK leads to the ATmega328 pin 19 (Arduino D13) and SPI-SCK-0 through -5 are pin 9 on each of the 6 slaves. My thoughts were 3 rows of 7 pins, with 7 jumpers either in the left (run) or right (program) position which hooks up SCK with the uC to be programmed. MISO & MOSI are connected to all 7 uCs.
At least this would mean for the cost of some headers and 7 jumpers I don't have to keep popping ICs in and out of sockets to program, and leaves the door open for surface mount 84's with ISP updatable firmware down the track. I'm open to suggestions though, as this still feels like there must be a less clunky answer.