UNO R4 minima CAN bus Support

Hello folks,

I’m trying to understand the D4 and D5 pins on the minima board. It mentions CAN Communication, but it also requires a breakout board. Does the D4 and D5 pins support CAN?

For my project, I’m using the UNO R4 minima to control a few MKS-SERVO42D-CAN. Would I need the breakout board in this situation? The CAN support outlined here: https://docs.arduino.cc/tutorials/uno-r4-minima/can/

Hi @mmmtea.

Yes.

Yes. A CAN transceiver is required to interface the UNO R4 Minima board with the CAN bus.

I’m curious, what would happen if I connected D4 and D5 directly to the CAN BUS wires? Is the UNO R4 minima in a read only mode or something?

Nothing will happen, it's the wrong signal and the transceiver (as the name suggests) will convert it into the correct signal. Keep in mind that for whatever reason neither of Uno R4s have an external oscillator that Renesas says is required to drive the CAN peripheral. The internal oscillator may work but is less accurate and IIRC tops out around 500 kbps.

I'd expect you would have better luck with a hat that includes its own CAN controller and transceiver.

Did Arduino fails advertised the minima's CAN ability?

It's like saying I speak German but I need to hire a guy for translation. But, yes I speak German.

The documentation clearly states that a transceiver is required:

Please note that CAN controller requires an external transceiver to function.

To communicate with other CAN devices however, you need a transceiver module.

Because a transceiver is required? No. That requirement is stated pretty clearly a few times.

Because they omitted the requisite hardware to accurately generate a CAN signal? Probably. If you look at the current version of the Renesas HAL (FSP) it will return an error if initialized with the Arduino clock configuration. It's possible that the ancient version of FSP that Arduino-Core uses allowed this, but given the reference manual I doubt that.

I hope this helps:
The Arduino Uno R4 Minima uses the Renesas RA4M1 microcontroller, which includes an on-chip CAN controller. However, the board does not include a CAN transceiver.

So you must use an external transceiver, such as:

  • MCP2551 (5 V, older but widely used)
  • SN65HVD230 (3.3 V)
  • MCP2562 (modern 5 V)
  • TJA1051 (modern 5 V)

The CAN controller pins are brought out to headers on the UNO R4 Minima, so you simply connect:

RA4M1 CAN_TX ---> TXD of transceiver
RA4M1 CAN_RX ---> RXD of transceiver

Transceiver CANH ---> CAN bus
Transceiver CANL ---> CAN bus

Note: The CAN controller and the CAN transceiver perform two different functions. The controller generates and receives CAN frames, while the transceiver converts those logic-level signals into the differential CANH/CANL signals used on the bus.

If you connect the CAN controller directly to the CAN bus without a transceiver, communication will not work. In some cases, you may also risk damaging the controller if it is exposed to the voltages present on the CAN bus.

A CAN transceiver is a required part of a CAN network, not an optional one.
Note: there are different CAN physical layers with different electrical characteristics.

So an Arduino UNO supports CAN protocol, by that logic. It just requires to buy a CAN HAT/Shield for it? :rofl:

I think you can get by for much less, I use these modules and find them on sale for under a buck. So far they all have been good. Be careful you need ones that operate on 3V3, many of the earlier ones had 5 V parts.


This shows up as $0.97 but watch the shipping charges. I got mine when they were running a free shipping schedule.

No, you need a 5 volt transceiver for the Uno R4.

Not quite. A hat would combine a transceiver and controller.

There are two issues. One is that the Uno R4 only has a CAN controller. This is pretty typical where you have limited GPIO pins and don't want to dedicate any to CAN. If you want an Arduino compatible board that you can just connect to a CAN bus Adafruit has their Feather M4 (specifically the one with the onboard transceiver).

The other is that the Uno R4 does not have an accurate (enough) clock. The Renesas reference manual states that you need to either use a peripheral clock driven by the PLL (which is in turn can only be driven by an external oscillator) or an external oscillator. The Uno R4 does not have an external oscillator and thus cannot drive the RA4M1's PLL so what the folks at Arduino did was configure the CAN controller to use the peripheral clock driven by a less accurate internal oscillator. In ideal circumstances this may work at lower speeds. Last I checked FSP (which is what ArduinoCore uses) explicitly disallows this configuration.

A CAN hat that combines everything (accurate clock, controller, and transceiver) and then communicates via SPI or I2C will be a more reliable way to connect your Uno to a CAN bus. As a concept the Uno R4 had a ton of potential.

Sorry about the 5V but the transceiver I suggested works on 5V as well as 3V3. The 5V units do not work reliably on 3V3. You can get one of these for not much more:

I use these as well and they work great. I use Cory Fowler's mcp-can library without any problems. I use them at 250K but they tested well to 1M.

This is a note for the Arduino product development: this tiny board or any other transceiver board should be built into the Minima R5 board!

The problem is that this would require the price of the board to be increased. My guess is that only 1% of users of the board are interested in working with a CAN bus, so this would mean that 99% of users have to pay for electronics components they don't need.

Additional components can also have technical impacts in some cases. For example, they might interfere with other use of the pins or increase the power consumption.

I personally prefer the modular approach, where the Arduino board only contains the microcontroller and essential support circuitry, then the user adds additional electronic capabilities as needed for a specific project by attaching shields and modules. Arduino has certainly created some boards that are more on the "kitchen sink" side of the spectrum in recent years, but the Minima (as well as the even more recent Nano R4) is a good example of the type of Arduino board that serves as a very flexible foundation for a nearly infinite number of possible projects. In fact, the board's name specifically reflects the nature of its design.

That picture is a board with a CAN controller and transceiver that communicates via SPI which is pretty much what I was referring to as a hat. These work regardless of what sort of onboard CAN controller is included. A proper "hat" would come in a form factor that lets you plop it right on top of an Uno.

We use the term "shield" instead of "hat" in the Arduino world ("hat" is the equivalent term in the Raspberry Pi world). There are various CAN shields for the Arduino UNO form factor. For example:

That's a pretty unsatisfying answer especially when you're talking about components that cost less than a dollar from reputable vendors. The larger problem is that Arduino touts features (CAN, RTC, timers/delays) that are poorly/improperly implemented on the R4.

Much like with the Due the ArduinoCore library for the R4 feels like it's not tested because it's not getting used. e.g.

In an ideal world an update a.k.a. an R5 board would have a more modern processor (e.g. RA4L1 if you were to stick with Renesas), the missing ancillary hardware, and a more thoroughly tested and maintained software library. But I digress.

The Arduino UNO R4 Minima is open source hardware. If you believe there is a market for a variant with an on-board CAN transceiver, feel free to make one and reap the profits.

I've already stated that I don't think an onboard CAN transceiver makes sense because it will tie up GPIO pins unnecessarily. But to argue that a $0.65 chip is prohibitively expensive on a $25+ board comes across as disingenuous.