2019-09-12 01:11 AM
I have two blackpill boards with STM32F103C6 MCU's on them, I want to explore using can bus between those two units and am wondering if I need to add termination to the cables or if those pins are internally terminated when configured for CAN.
All the tutorials I have found doing CAN on stm32 just use usart to communicate with a CAN transreceiver IC, but to clarify, I want to use the integrated CAN functionality on pins PB9 and PB8.
Thanks!
2019-09-12 01:46 AM
> ... and am wondering if I need to add termination to the cables or if those pins are internally terminated when configured for CAN.
The CAN peripheral contains definitely no termination. This needs to be added AFTER the transceiver (i.e. in the transceiver<-->transceiver cabling) not at logic level.
The CAN peripheral contains no transceiver either - you have to add it externally. Not sure if the blackpill boards have them.
To get started, you could connect two CAN devices (like separate STM32 boards) on logic level directly (crossing Rx and Tx), without transceiver and termination. If you keep the cabling short.
2019-09-12 02:02 AM
Thank you for the answer, I do have two boards and short jumper cables I can use to connect them.
I might have misunderstood something though. I thought the STM32 had an internal transreceiver connected to CAN_rx(PB8) and CAN_tx(PB9) pin, otherwise why are they specially marked like that?
If I'm going to use an external transreceiver I could just connect it to any USART pin, right?
2019-09-12 02:37 AM
No, the STM32 part does not have an internal transceiver.
Typically you would want to do:
The jumper JP allows you to connect the termination resistor or not. If you have multiple devices connected to the CAN bus you would typically fit the jumper on the boards at each end of the bus but,
The transceiver only drives the signal levels on the bus it does not do the CAN protocol so no, you cannot connect the transceiver to a UART.
HTH
Andy