Forgot your password?
No account? Register one!
March 22, 2013
Product DEV-10039 |
about a year ago
After banging my head against the wall trying to get this board to work with the Arduino Mega 2560, I finally figured it out. As was mentioned previously, you have to wire the SPI bus pins 10-13 of the shield to 50-53 of the Mega 2560 as follows:
But, the final trick to get the SKPang software to work properly was to modify the port assignments in file “defaults.h” as follows:
// Atmega 168/328 pin mapping
//#define P_MOSI B,3 // pin 11
//#define P_MISO B,4 // pin 12
//#define P_SCK B,5 // pin 13
//#define MCP2515_CS B,2 // pin 10
//#define MCP2515_INT D,2 // pin 2
//#define LED2_HIGH B,0 // pin 8
//#define LED2_LOW B,0 // pin 8
// Pins remapped to Arduino Mega 2560
#define P_MOSI B,2 // pin 51
#define P_MISO B,3 // pin 50
#define P_SCK B,1 // pin 52
#define MCP2515_CS B,0 // pin 53
#define MCP2515_INT E,4 // pin 2
#define LED2_HIGH H,5 // pin 8
#define LED2_LOW H,5 // pin 8
I did some reading here: http://www.arduino.cc/en/Reference/PortManipulation
It discusses the advantage of better speed of controlling I/O pins by writing directly to the ports, but the disadvantage is that it is not a portable design to other processor pin maps. Yup.
The 2 pin maps I found here, and corrected the mappings:
http://arduino.cc/en/Hacking/PinMapping168 (this is what the shield was designed to run with)
This works! Hallelujah!
Your info implies there might be more than one “standard” for the pinout of the DB-9 connector. If you look at the pinout dwg for the Sparkfun cable, it agrees with the board schematic: https://www.sparkfun.com/products/10087
I am just getting started using this shield with the Mega 2560 - any wiring connectivity help would be appreciated. I’ve seen some discussion about the use of different pins and wiring some pins to other locations, and I’m a noob, so a wiring diagram of what actually works would be great.
No public wish lists :(