I am planning to use ISP programmer to program my new AVR board. I use an 8 MHz crystal on my PCB to clock the micro (atmega328p-au). Now, as I understand the ISP programmer will provide its own clock to my board when programming. It occurs to me that this might pose an issue. I've read that using an SPI clock much slower than the system clock is the way to go, but haven't found any specific documentation. Any suggestions? Thanks!
-
\$\begingroup\$ Can you describe the issue you think may be happening? \$\endgroup\$– Ron BeyerNov 16, 2019 at 14:58
-
1\$\begingroup\$ IIRC, for most AVR controllers, ISP clock can be 1/4 system clock max. So having 8 MHz crystal, ISP has to be set to 2MHz or slower. But don't quote me on that. \$\endgroup\$– RevJan 19 at 7:54
-
1\$\begingroup\$ @Rev The AVR ISP User Guide confirms this: i.stack.imgur.com/Xp9Ae.png \$\endgroup\$– VelvetJan 19 at 8:25
2 Answers
ISP clock can't "interfere" with on-board clock. ISP clock is the clock for the ISP data. The MCU still needs a clock to run itself, and this clock needs to be high enough for the given ISP clock. Slower MCU clock needs slower ISP clock for sure, exact parameters are given in AVR datasheet.
The ISP clock is an SPI clock (for the purposes of serial programming which I am assuming)
So long as the ISP clock is not too fast for the ATMega to act as SPI slave there will be no problem.