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.

Comments

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. boots

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. ExoSpecial

I am always looking for some free kinds of stuff over the internet. There are also some companies which give free samples. But after visiting your blog, I do not visit too many blogs. Thanks. Grosir adalah

There is no need to explain in detail how to launch the AWS LightSail instance because there is a complete guide on how to do this, which can be found at the end of this step. Lightsail

Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. PG SLOT

Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. สล็อต

Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also sbobet

You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. sagame88

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. k9win เครดิตฟรี

Thanks so much for this information. I have to let you know I concur on several of the points you make here and others may require some further review, but I can see your viewpoint. z8.com คือ

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. ufabet

 Hey, I am so thrilled I found your blog, I am here now and could just like to say thank for a tremendous post and all round interesting website. Please do keep up the great work. I cannot be without visiting your blog again and again. เว็บ ufabet

I am constantly surprised by the amount of information accessible on this subject. What you presented was well researched and well written to get your stand on this over to all your readers. Thanks a lot my dear. แทงบอล

I appreciate this article for the well-researched content and excellent wording. I got so interested in this material that I couldn’t stop reading. Your blog is really impressive. slot xo

Thank you for some other informative blog. Where else could I get that type of information written in such an ideal means? I have a mission that I’m just now working on, and I have been at the look out for such information. inceptial

Very efficiently written information. It will be beneficial to anybody who utilizes it, including me. Keep up the good work. For sure i will check out more posts. This site seems to get a good amount of visitors. Raptology

Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. Call Girls in Karachi

You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. Escorts in Lahore

Pages