LibreSolar / bms-firmware

Firmware for LibreSolar BMS boards based on bq769x0, bq769x2 or ISL94202
https://libre.solar/bms-firmware/
Apache License 2.0
146 stars 67 forks source link

bms-c1 v0.4: Fix CAN sending by deactivating RS485 transceiver #75

Closed pasrom closed 2 months ago

pasrom commented 2 months ago

When using CAN, it is necessary to deactivate the RS485 transceiver. This commit sets the DE and RE_NOT pins to the correct states to deactivate the transceiver as described in chapter "9.4 Device Functional Modes" in the "SN65HVD7x 3.3-V Supply RS-485 With IEC ESD protection" datasheet.

pasrom commented 2 months ago

Ah, hold on. We should move this to boards/riscv/bms_c1/bms_c1_0_4_0.overlay, as it only affects v0.4 board.

Yes, you are absolutely right.

I came across this thread and found that it's better to configure it via the device tree rather than in the code.