SEAME-pt / HotWheels-Cluster

Instrument Cluster repository of the SEA:ME Project 2024/2025 for Team01 (HotWheels)
0 stars 0 forks source link

Research HW-184 converter #29

Closed reomelo closed 5 days ago

reomelo commented 6 days ago

Description: Study about the HW-184 converter. How does it work? Is it CAN compatible and ARDUINO compatible? Which signals does it input/output?


Definition of done: This issue is considered as done when the questions above have been clearly answered

t-pereira06 commented 5 days ago

What is the HW-184 controller?

The HW-184 is a CAN (Controller Area Network) Bus module designed for use in microcontroller projects, particularly with Arduino or ESP32 boards. It is based on the MCP2515 CAN controller and the TJA1050 transceiver, providing a bridge for devices to communicate using the CAN protocol, commonly used in automotive and industrial systems.


Key features of the HW-184 module:

CAN Communication:

Facilitates communication between devices via the CAN protocol, which is known for reliability in noisy environments.

Power Requirements:

Operates on a 5V power supply.

Integration:

Typically used with microcontrollers like Arduino or ESP32, and requires specific libraries (e.g., the MCP_CAN library) for implementation.

Usage:

Enables reading and sending data packets (CAN frames) for applications like automotive diagnostics, robotics, and home automation.


The module has pins for SPI (Serial Peripheral Interface) communication with the microcontroller and requires correct configuration for the crystal frequency and baud rates to ensure reliable communication​

To use it, we need to ensure proper wiring, terminate the CAN network correctly, and use compatible software libraries to initialize and manage communication.

Is it CAN and Arduino compatible?

Compatibility with CAN:

CAN Protocol Support:

The HW-184 is based on the MCP2515 CAN controller and TJA1050 transceiver, which are specifically designed to handle CAN communication. These components manage CAN messages, including arbitration, error handling, and message framing, making the module fully compliant with the CAN 2.0 standard.

Compatibility with Arduino:

SPI Communication:

The module communicates with Arduino boards via SPI (Serial Peripheral Interface), which is supported by most Arduino models (e.g., Uno, Mega, Nano).

Software Library:

To operate with Arduino, you can use the MCP_CAN library (available through the Arduino IDE Library Manager or GitHub). This library simplifies the initialization and usage of the CAN module.

Power Requirements:

The module runs on 5V, which aligns with most Arduino boards' operating voltage.

Which signals does it input/output?

Inputs and Outputs:

CAN_H (High) and CAN_L (Low)

These are the differential CAN signals on the CAN bus. They are the physical layer outputs that connect to the CAN network, allowing communication with other devices on the bus. The differential signaling improves noise immunity.

SPI Signals (for communication with a microcontroller like Arduino)

Interrupt Signal (INT)

The INT pin indicates when there is activity, such as received data or an error, allowing the microcontroller to respond promptly.

Power and Ground

Internal Signals (via MCP2515 and TJA1050 Chips)

CAN Data Frames:

The MCP2515 CAN controller interprets or generates CAN frames for transmission or reception. These include: Start of Frame, Identifier, Control Bits, Data Field, CRC, Acknowledgment, and End of Frame.

Transceiver Control:

The TJA1050 transceiver manages the conversion between the logical signals from the MCP2515 and the differential CAN_H/CAN_L signals.

Image on how to connect the converter to the Arduino?

https://how2electronics.com/interfacing-mcp2515-can-bus-module-with-arduino/ Image