Feature 3: Control external high-side switch and FO-LED (D2) over CAN bus via sending following CAN frame
into the shield:
−CAN-ID: 0x102 (not extended)
−MSG[0] = High-side switch / Charge-Pump on/off (0=off, 1=on)
−MSG[1] = FO-LED (D2) on/off (0=off, 1=on)
Feature 4: Red blinking of all LEDs by sending random CAN frames into the shield:
−CAN-ID: any
−MSG: any
Feature 5: Shield will send out CAN frame in case of high-to-low or low-to-high event on the WK-input
crossing approx. 3V threshold. Following CAN frame can be received by external CAN node:
−CAN-ID: 0xAA
−MSG[0]: 0xAA
2.2 CAN-PN example
This example is a demonstration how to use the CAN Partial-Networking feature. CAN Partial-Networking is
used to wake-up selected automotive control units by just sending a “magic” wake-up frame (WUF) over the
CAN bus. The SBC is in sleep-mode for current saving purposes and also Arduino is shut down by keeping the
reset low at any time. In case, the “magic” CAN message is send over the bus, the SBC wakes up and releases
the reset for the Arduino to start.
To use the example, please connect an external CAN communication node to the CANH/CANL of the shield.
Please ensure that the grounds of the shield and the external CAN communication node are connected
together and that the CAN bus is terminated correctly.
The SBC CAN-PN module is sensitive to following “magic-frame”:
Speed: 250 kBaud/s
ID: 0x2D (extended ID feature used)
Message: (Byte 7) 0xDE 0xAD 0xC0 0xDE 0xC0 0xDE 0xBA 0x5E (Byte 0)
After startup, the above mentioned CAN-PN configuration is written to the SBC and the LEDs will light up in
green. The SBC is waiting now for a first CAN frame on the bus so that the internal CAN protocol handler can get
in sync. This can be any CAN message on 250 kBaud/s bus speed except the “magic-frame” above. Please
ensure that the “magic-frame” is not sent at the beginning (as long as SBC protocol handler is not in sync).
If the SBC protocol-handler is in sync, the code-example initiates directly the SBC sleep-mode and the LEDs will
turn off.
If the “magic-frame” mentioned above is sent, the SBC wakes up from sleep-mode and releases the reset of the
Arduino. Now, the LEDs light up in green once again and the SBC protocol handler can get in sync again.
Please have in mind that the CAN-PN feature doesn’t use the MCP2515 on the board. So the CAN frames on the
board must be acknowledged by an external node. The CAN frame is decoded by an integrated protocol
handler which is only usable for the CAN-PN feature and not for standard CAN communication.
Note: Additional Info: In case, the “magic-frame” is sent before the transition to SBC sleep-mode, the
CAN-PN configuration is not valid anymore. Thus, the transition to SBC sleep-mode will fail. See
datasheet for more information.