Ethernet shields, SPI and Macchina

This post will describe how to get Macchina talking with SPI shields, including Ethernet shields.

But first some Background:

When the Arduino Mega was introduced, for some reason, the SPI lines where in a different physical location than the Arduino UNO. This meant that several SPI-dependant shields were not compatible with both the Mega and the UNO without using some jumper wires.

MEGA SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).

UNO SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).

Our solution to get around this, and allow for more compatibility between the Macchina and shields, was to add some solder-jumpers to the Macchina board. Now one can easily swap the SPI lines depending on what sort of shield is attached.

Flash forward a few years and the SPI pins have not moved, BUT it seems as though the official solution to this was to use a down-ward facing 2X3 ICSP header to make connection to SPI pins on ALL Arduino boards.

While laying out Macchina, we moved the ISCP header to make room for all the extra automotive interface stuff. This alone would not be an issue, except for the fact that some new shields (the Arduino Ethernet Shield for example) ONLY has these SPI pins on the down-ward facing ISCP header and no where else. This is an issue, a known issue.

Work-arounds are as follows:

1. If using the Official Ethernet shield: Need to add jumper wires to make correct connections. There are many ways to accomplish this including this solution that connects wires from the ICSP header to the side headers. Some soldering required.

2. Is using SEEEDSTUDIO's Ethernet Shield: Need to re-route the SPI lines by using the easier-to-do-than-soldering-wires method shown here:

Side note: Both of these boards are sold at Radioshack (!?) for about $32.

3. If using the Sparkfun-branded Ethernet Shield: No modifications necessary since wires are going directly to the SPI pins on the side headers.

Regardless of which of these shields are used, the solder jumpers on the Macchina must be set as follows:

Once hardware modifications are done, plug the shield into the Macchina and get coding!

A good first test would be to try out is the built-in example called "WebServer" that comes with the standard Arduino IDE.

Lastly, a note regarding SPI:

The CAN interface also uses SPI to communicate with the microcontroller. While the hardware is set up correctly (SS (chip select) for the CAN controller is connected to a un-used pin on microcontroller, special care must be taken with the code to ensure communication between Ethernet Microcontroller and CANBUS Microcontroller is handled correctly.


Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! Tuinontwerpen

I visit your blog regularly and recommend it to all of those who wanted to enhance their knowledge with ease. The style of writing is excellent and also the content is top-notch. Thanks for that shrewdness you provide the readers! Ramen deuren plaatsen

You have beaten yourself this time, and I appreciate you and hopping for some more informative posts in future. Thank you for sharing great information to us. seo

You have a real talent for writing unique content. I like how you think and the way you express your views in this article. I am impressed by your writing style a lot. Thanks for making my experience more beautiful. 토토사이트

I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... 안전놀이터

Thank you for this fascinating post, I am happy I observed this website on Google. Not just content, in fact, the whole site is fantastic. joker gaming

Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. slotxo auto

An fascinating discussion is value comment. I think that it is best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. Cheers betflix thailand

An fascinating discussion is value comment. I think that it is best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. Cheers betflix thailand

I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. หวยจีน

This article is an appealing wealth of useful informative that is interesting and well-written. I commend your hard work on this and thank you for this information. I know it very well that if anyone visits your blog, then he/she will surely revisit it again. ruay

This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates. listesi

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. 77 evoสล็อต

It is included in my habit that I often visit blogs in my free time, so after landing on your blog. I have thoroughly impressed with it and decided to take out some precious time to visit it again and again. Thanks. hangi burç