-
Notifications
You must be signed in to change notification settings - Fork 2
0. Choose the right platform
Depends on what you want to do with your device, you need to choose the right microcontroller platform to development with.
When choosing the development board, you should consider whether your platform:
- Provide enough IO and processing power to handle the peripheral (sensor, display, LCD, digital output, high speed counter, etc) you want to connect to it.
- Had adequate software library support for your peripheral.
- Be able to communicate with CAN network. To facilitate this, your microcontroller need a CAN controller and a CAN transceiver.
- Be able to handle the power supply on the robot. This is done by adding a buck converter.
Most likely, yes.
Some microcontroller will have a built-in CAN controller so only a transceiver like TJA1050 is needed. Others require an external controller like MCP2515. Pretty much all of the microcontroller on the market does not have built in transceiver.
| Microcontroller | Built-in controller | Built-in transceiver | Module to use |
|---|---|---|---|
| Arduino UNO | No | No | MCP2515+TJA1050 |
| Arduino Mega | No | No | MCP2515+TJA1050 |
| ESP32 | Yes | No | TJA1050 |
| Raspberry Pi | No | No | MCP2515+TJA1050 or CANAble |
| STM32 | Depends on model | No | Depends on model |
| PC | No | No | CANAble |
This is a combo module with MCP2515 being the CAN controller and TJA1050 being the CAN transceiver.
Be aware of the crystal oscillator value on your MCP2515 module! Your software needs to match the value on your actual module to work!
This is just the CAN transceiver. Even it says Tx and Tx it is not UART. When connecting wires, it is Tx to Tx and Rx to Rx. It is meant to be connected to a CAN controller. Usually buying these standalone transceiver module Means your micro controller has built in CAN controller.
The CANable 2.0 is a small low-cost open source USB to CAN adapter. This is especially useful if you want to connect Linux based co-processor.
These are cheap, everywhere and reliable. However, they don't come with built-in controller and transceiver. Therefore an external module is needed. Usually the go to choice is a MCP2515 + TJA1050 combo module.
These provide a bit more IO. External controller (MCP2515) is needed.
ESP32 provide way more processing power than Atmel. Also, most ESP32 have built-in CAN controller named Two-Wire Automotive Interface (TWAI). Therefore, only an external transceiver (TJA1050) is needed.
Now these run Linux. However, they do need external CAN controller. This could be done by adding a SPI based CAN Hat or a USB CAN adaptor like CANAble.
There is no standardized from factor of STM32. Depends on the exact choice of the model, some STM32 have built in CAN controller. However most would need external transceiver.
While you could also use Networktables, nobody would stop you from doing this. A USB CAN adaptor like CANAble will be needed. This might be especially useful if you want to use CTRE Phoenix on your co-processor.
Note: if you are using a CANivore on roboRIO and you want your co-processor to talk to CANivore Bus, the only way to do this is to have a second CANivore connected to your co-processor. If your CTRE devices is on roboRIO bus, you could use CANAble on roboRIO bus. Using CTRE devices with Linux is out of scope of this documentation that you should refer to CTRE presentation about it.