2020-02-20 05:29 AM
Hello,
I am using STM32F103 for my project and it requires CAN most of the time however if a USB connector is plugged in, it should behave like a virtual COM port.
CAN_R and CAN_T pins are connected to PA11 and PA12
together with USB_DP and USB_DM pints.
Below image is the circuit I used to disable CAN transceiver when USB 5V exist.
MCU_USBV comes from the USB 5V and USB_DP is pulled up.
This circuit didn't work for me.
What need to be changed?
2020-02-26 06:52 AM
Hi @KYou.1 ,
You find the answer to your question and the required explanation in this knowledge article: https://community.st.com/s/article/FAQ-Concurrent-use-of-USB-and-CAN-with-STM32F103.
In the article page, please answer the question "Was this article helpful?"
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2020-02-28 12:33 AM
Hi @Amel NASRI ,
as CAN and USB share pins, it does not appear that the problem is in trying to use both modules simultaneously.
I believe the main problem is in how the CAN transceiver is "disabled" - floating its GND pin is not a proper way, as the chip gets parasitically supplied from its other pins through the protection diodes.
A multiplexer or a three-stating gate (e.g. 74HC125) or a transmission-gate (e.g. 74HC4016) should be used to isolate the CAN transceiver's D and R from the USB DP/DM terminals.
JW