Arduino Nano and SPI

hi, I'm seeing a "freeze" when I've uploaded code to an Arduino Nano if it uses SPI. Specifically, if I configure the SPCR register the programme will not run correctly.

I noticed this thread, which linked a similar problem on earlier Arduino boards to the LED on pin 13.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1163734586/7#7

Looking at the Nano schematic, LED3 is connected to pin 17 of the Atmega168 (Arduino digital I/O 13) through a 680 ohm resistor, would this cause a similar problem?

Is so, is it worth taking off LED3 to see if the SPI problem is resolved?

hi, I'm seeing a "freeze" when I've uploaded code to an Arduino Nano if it uses SPI. Specifically, if I configure the SPCR register the programme will not run correctly.

I noticed this thread, which linked a similar problem on earlier Arduino boards to the LED on pin 13.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1163734586/7#7

Looking at the Nano schematic, LED3 is connected to pin 17 of the Atmega168 (Arduino digital I/O 13) through a 680 ohm resistor, would this cause a similar problem?

Is so, is it worth taking off LED3 to see if the SPI problem is resolved?

You might be correct about the 680 ohm resistor for LED3. We had a similar problem with the prototype freeduino boards, not being able to program the atmega168 using ICSP and we increased the value to 1K or 1.5K to solve the problem. You experienced the problem while uploading a sketch or using a programmer throught ICSP?

Hi, I'm uploading a sketch.

Here's a nugget from the other post I mentioned about SPI issues on early NG boards:

The SPI issue is definitely there, though. A bit of circuit analysis indicates that output pin 13 will never see more than about 2V, because the LED is like a zener diode and clamps the voltage. R13 should be tied directly to the Atmel's pin 19 (i.e., on the other side of R7) to avoid this scenario.

While it was not so clear if ICSP programming was an issue, SPI was a real problem. It's even noted on the "Arduino Boards" page http://www.arduino.cc/en/Main/Boards:

It also has a built-in LED on pin 13 (which may interfere with SPI communication). Later NG's shipped with an ATmega168 instead of an ATmega8, though either chip can be used with any board

Have others had SPI issues with the Nano?

If so, any ideas about the best board-mod to fix things?

I don't have a Nano, but it looks like it should be OK. The Nano uses the Diecimila circuit, which I happen to know works with SPI; I built a circuit with a couple of MCP3208 SPI interfaced ADCs last week.

The thread you reference is about the Arduino NG, which had a completely different circuit on the pin 13 LED. The problem described in that thread didn't result in a lockup - it just didn't work (because the clock signal never reached the peripheral's high threshold).

-j

OK I have SPI working well with MAX6952 LED drivers - it was a software problem.

Funny how positive confirmation from others can provide the confidence to look elsewhere!

Thanks all for your posts...

1 Like