After a few months of off-and-on work, I finally have version 2.0 of the CanShield ready! I received some good feedback from users and had several ideas of my own I wanted to implement. Now called FazCAN to differentiate from any other CAN shields, there are several improvements to the new shield.
There are now two RJ-45 terminals on the board, making it much easier to connect your own CAN network. Each terminal on the board connects to one neighboring board using ethernet or phone cables. Since each board can have two neighbors, any number of boards can be daisy-chained together into a network. The electrical connections to the RJ-45 terminals are built into the board, which means no more manual wiring. This makes it easier to set up a CAN network quickly, and is less susceptible to failure.
The connections to the D-Sub terminal are also built into the board. However, the connections to the CAN lines on the board pass through 0-ohm resistors (jumpers), which are placed when the board is assembled. All of the pins from the terminal are brought out to pads on the board, so the jumpers can be used to fit any required cabling scheme. The markings on the board indicate the the most common wiring scheme. The pads that the pins from the terminal are brought out to are 0.1-inch spaced, so if you need more configurability, you can solder a 9-pin header here instead of the jumpers. Then you can make manual wired connections between the pins and the CAN lines.
Of course the screw terminal is still available to connect to any other type of cabling.
The INT line from the MCP2515 is now brought out to a pin on the Arduino. The software does not require this line to be connected, though, and the line is connected by a jumper, which can be omitted. The this allows the pin to be used for other purposes if needed.
The 120-ohm bus termination resistor is now connected to the CAN bus by a switch. The two shields at the either end of the CAN bus need to have their switches set such that their resistors form the electrical ends of the bus. The middle shields (if any) should have their switches set such that their resistors are not connected to the bus. When connecting to an existing CAN network, the bus is already properly terminated, so the shield should be configured as a “middle” node.
There are some software improvements too. Some users requested the ability to use speeds other than those predefined in the library. I’ve added the ability to specify the bus speed by the length of each bit (bit time). This allows the shield to operate at nearly any speed. Also, multiple data types can now be packed and unpacked from a single CAN message, minimizing the number of CAN messages that need to be sent. This also allows for easier integration with existing CAN networks. The library has been updated for the Arduino 1.0 environment, and will no longer work with older environments. However, there should be no problem using the newest version of software on the original CANShield. It is likely that the library will also work with other MCP2515-based CAN shields on the market.
The documentation for the library has been greatly improved, and I’ve generated a documentation page generated with Doxygen to make it easier to understand and use the library.
Thanks, everyone, for your support on the first shield, and the great feedback that has helped me develop version 2.0. Further design details, build instructions, usage information, and more are available on the product page.