

The CAN Bus BFF Add-On for QT Py is a compact and versatile board designed to add Controller Area Network (CAN) bus communication capabilities to the QT Py microcontroller. This add-on enables robust communication between multiple devices, making it ideal for automotive, industrial, and IoT applications. With its small form factor and seamless integration, the CAN Bus BFF is perfect for projects requiring reliable, high-speed data exchange in noisy environments.








The CAN Bus BFF Add-On is built to provide reliable and efficient communication. Below are its key technical details:
The CAN Bus BFF Add-On connects directly to the QT Py microcontroller. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| CAN_H | High line of the CAN bus |
| CAN_L | Low line of the CAN bus |
| GND | Ground connection for the CAN bus |
| SDA | I2C data line (connected to QT Py) |
| SCL | I2C clock line (connected to QT Py) |
| INT | Interrupt pin for MCP25625 alerts |
| 3V3 | Power supply from QT Py (3.3V) |
The CAN Bus BFF Add-On is easy to use with the QT Py microcontroller. Follow these steps to integrate it into your project:
Adafruit_MCP2515 library in your Arduino IDE or CircuitPython environment. This library provides functions to interface with the MCP25625 CAN controller.Below is an example code snippet to send a CAN message using the CAN Bus BFF Add-On:
#include <Adafruit_MCP2515.h>
// Create an MCP2515 object for the CAN controller
Adafruit_MCP2515 CAN;
// Define a CAN message structure
struct CANMessage {
uint32_t id; // Message ID
uint8_t data[8]; // Data payload (up to 8 bytes)
uint8_t length; // Length of the data payload
};
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for Serial Monitor to open
// Initialize the CAN controller at 500 kbps
if (!CAN.begin(CAN_500KBPS)) {
Serial.println("Error: CAN controller initialization failed!");
while (1);
}
Serial.println("CAN controller initialized successfully.");
}
void loop() {
// Create a CAN message
CANMessage message;
message.id = 0x123; // Set the message ID
message.length = 2; // Set the data length
message.data[0] = 0xAB; // First byte of data
message.data[1] = 0xCD; // Second byte of data
// Send the CAN message
if (CAN.sendMessage(&message)) {
Serial.println("Message sent successfully!");
} else {
Serial.println("Error: Failed to send message.");
}
delay(1000); // Wait 1 second before sending the next message
}
No Communication on the CAN Bus
Error: CAN Controller Initialization Failed
Message Not Sent
Can I use this add-on with other microcontrollers?
What is the maximum cable length for the CAN bus?
Does the add-on support CAN FD?
By following this documentation, you can successfully integrate the CAN Bus BFF Add-On for QT Py into your projects and enable reliable communication in your CAN-enabled systems.