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
Submitted by seth65475 on Thu, 04/24/2025 - 07:26 Permalink
My friend told me about this
My friend told me about this hotel and I had to check it out. The rooms are so charming and full of character. It’s not just a hotel – it’s an experience. Hotel San Francesco a San Giovanni Rotondo
Submitted by seth65475 on Sat, 04/26/2025 - 07:52 Permalink
NetMirror is my new favorite
NetMirror is my new favorite site for binge-watching! Whether it's the latest Bollywood dramas or exciting thrillers, everything is just a click away. The streaming is smooth and the categories are perfectly organized. Netflix mirror
Submitted by seth65475 on Sat, 04/26/2025 - 07:52 Permalink
NetMirror is my new favorite
NetMirror is my new favorite site for binge-watching! Whether it's the latest Bollywood dramas or exciting thrillers, everything is just a click away. The streaming is smooth and the categories are perfectly organized. Netflix mirror
Submitted by seth65475 on Sun, 04/27/2025 - 02:05 Permalink
One of the biggest myths in
One of the biggest myths in gambling is the belief that if you keep playing, you're "due" for a win. In reality, every spin, roll, or deal is random and independent. No outcome is ever guaranteed. tangandewa login
Submitted by seth65475 on Mon, 04/28/2025 - 04:42 Permalink
Want to beat your competitors
Want to beat your competitors in Google rankings? You need strong backlinks. Professional backlinks services help you get there by connecting your site with high-authority pages. Smart link building is the key to long-term SEO success. jasa backlink berkualitas
Pages