I'm building custom made Arduino board, with SPI header.

SPI pins on Atmega328 are 13,12,11 Arduino pins which I use in my project already. Can other components conected on these ports interfer with programer during bootstrap ?

Here are mentioned resistors separating Arduino from other components, are my 1k R[6-8] resistors enough to prevent such interference ?

BTW This is my first board, any ideas are welcome :)

EDIT : Image in high resolution http://i.imgur.com/tHznP2L.png

enter image description here

  • \$\begingroup\$ With the resistors, the transistor bases shouldn't interfere with programming [disclaimer though: I'm not an AVR expert.] On a different note. You have resistors in series only with the red LEDs. What about the others? How are you going to limit the current? Are you going to do bit-banged PWM? \$\endgroup\$ – Nick Alexeev Sep 22 '13 at 19:29
  • \$\begingroup\$ Presumably the green and blue LEDs are connected to OC0A and OC0B. \$\endgroup\$ – Ignacio Vazquez-Abrams Sep 22 '13 at 20:05
  • \$\begingroup\$ Vcc is 3.3v. He's relying on the typical Blue/Green forward voltage of 3.2~3.6v, as well as the CE voltage drop (~0.2v typical). Not ideal, but as long as VCC doesn't rise unexpectedly, it should work, right? \$\endgroup\$ – Passerby Sep 22 '13 at 22:05
  • \$\begingroup\$ Exactly, board will be powered from 3.7V Li-Ion battery and it works fine on breadboard \$\endgroup\$ – user29467 Sep 24 '13 at 21:51

Attached devices to the SPI can definitely interfere with ISP. Typically 2 problems need to be prevented:

1) (not your problem as shown) One needs to prevent slave devices from inadvertently responding to ISP, with the ATmega has not initialized its pins and potential Chips Selects that would normally negate slaves are floating.

2) General loading of the ISP pins. In your case the R[6-8] are loaded down through the Vbe of T[1-3] to affect the pins. Where I expect the ISP programmer has additional series protection Resistors. Which in combination creates a voltage divider of the signal levels as seen by the ATmega SCK and MISO. Resulting in failure of the ISP.


simulate this circuit – Schematic created using CircuitLab

Increase the R[7,8] (6 should be fine) to 3K. You can play with the simulation. Assuming the protection resistor is something like 470ohms. This and your 1K yields 2.4v at the MISO and SCK. which is almost good enough. Where changing R7 to 3K yield 2.9V (much better). AM1 changes from 1.7mA to 0.7mA, and AM2 remains 4.6mA.

  • \$\begingroup\$ 2.4 is within both 0.6*Vcc and 0.7*Vcc for a logic high. Shouldn't need to make the resistors smaller. Only issue is if the ISP actually is 3.3v or 5v, then there would be a problem when programming the 3.3v powered ATmega 5v spi signals, or if vcc is 5v which would probably blow his blue and green leds if the transistor is enabled. \$\endgroup\$ – Passerby Sep 22 '13 at 22:11
  • \$\begingroup\$ Thank you for nice explanation. Despite the 'voltage divider' effect you described it should work without resistors you recommend. For example Jeenode uses ISP with RFM-12 on same pins as well jeelabs.net/attachments/download/331/jlpcb-128.pdf \$\endgroup\$ – user29467 Sep 24 '13 at 21:58
  • \$\begingroup\$ Case 2 (voltage divider) is not realavent to JeeNode's circuit. Rather, I would be concerned about case 1. In that the RFM12B could inadvertently respond to ISCP messages and collide. Where as it is likely it works for two reasons. First, The RFM12B's SEL is active LOW, where PB2 likely floats high during ISCP. And if not the RFM12 likely does not recognize and respond to any of the ISCP messages. And such likely supports ICSP, purely by coincidence. A simple pull-up on SEL would assure it. It is best not to leave such default/reset/initial conditions as an after thought. \$\endgroup\$ – mpflaga Sep 27 '13 at 19:11
  • \$\begingroup\$ The answer to your question: "Can other components conected on these ports interfer with programer during bootstrap ?" is YES. \$\endgroup\$ – mpflaga Sep 27 '13 at 19:12
  • \$\begingroup\$ Simple test of its interference potential. Is to remove it all and try programming it alone. It may be a fusing issue. \$\endgroup\$ – mpflaga Sep 27 '13 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.