From 32136b90c390b28002ec9532f8baceebebd84e57 Mon Sep 17 00:00:00 2001 From: Paul Guenette Date: Sun, 24 Oct 2021 14:52:05 -0400 Subject: [PATCH] Add Danfoss wiring page link to CAN guide --- docs/can-guide.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/can-guide.md b/docs/can-guide.md index 827d36355..e008e940f 100644 --- a/docs/can-guide.md +++ b/docs/can-guide.md @@ -10,8 +10,12 @@ Borrowing from [Wikipeda](https://en.wikipedia.org/wiki/CAN_bus): In simple terms, CAN is a way of communicating between many devices over a single twisted pair of wires. The signal is transmitted as the difference in voltage between the two wires (differential signalling), which makes it very robust against noise. Instead of using a unique address (like I2C) or a select pin (like SPI), CAN *messages* have a unique ID that also acts as the priority. At the beginning of a message frame, all devices talk and read at the same time. As the message ID is transmitted, the lowest value "wins" and that message will be transmitted (ID **0** has the *highest* priority). All other devices will wait for the next chance to send. If two devices send the same message ID at the same time, they will conflict and a bus failure may occur. Make sure your devices can never send the same message ID at the same time! +See also this great article from Danfoss that quickly describes how to put together the wiring for a CAN bus https://danfosseditron.zendesk.com/hc/en-gb/articles/360042232992-CAN-bus-physical-layer + ![CAN picture](screenshots/CAN_Bus_Drawing.png) + + ## Why use CAN? CAN is convenient for its simple and robust Physical Layer (PHY) that requires only a twisted pair of wires and a 120ohm termination resistor at each end. It has low jitter and low latency, because there is no host computer. It is relatively fast (CAN 2.0b supports 1 Mbps). Messages are easy to configure and load with data. Transceivers and controllers are inexpensive and widely available, thanks to its use in automotive. @@ -131,4 +135,4 @@ Instead of manually writing values into the data, we can create a dictionary of The [CAN DBC Example](../tools/can_dbc_example.py) script shows you how this can be used. This is the recommended method of serializing and deserializing. -If you're using C++, then you can use the [CANHelpers](..firmware/communication/../../../Firmware/communication/can/can_helpers.hpp) single-header library to do this instead, although the DBC file isn't used. \ No newline at end of file +If you're using C++, then you can use the [CANHelpers](..firmware/communication/../../../Firmware/communication/can/can_helpers.hpp) single-header library to do this instead, although the DBC file isn't used.