2020-03-10 12:21 AM
Hi, I am a beginner on STM32. I got assigned into a project where i'll use some MCUs from STM32 family (F103VE, F103CT, F303KB) to build a sensor grabber to get data from OBD-II of a vehicle and some sensor modules (Vibration, BMP280, IMU). My F103VE board has a CAN transmitter built-in, so i don't have to use a discrete module, but my F103CT and F303KB does not.
This is the CubeMX GPIO layout and CAN Settings. I did not utilize Timer because i am still not sure how to do it (if someone has a introduction to timers for CAN, please let me know)
I wish to use the SN65VD230 transceiver to request data from the OBD-II, save the data alongside sensors and transmit them to a PC via USB-to-CAN, but i can't seem to get the CAN communication to work. I connected the Transceiver as-is (without resistors) with
RX->PA11
TX->PA12
When i try to debug it in KEIL, it shows error of cannot initialize CAN.
I tried searching around, but haven't found a similar problem using the STM32F303 and SN65VD230 hardware. Can someone enlighten me of a solution to this problem and a general usage guide of CANBUS with discrete CAN Transmitter on STM32?
The code for main.c file is attached. Thank you very much in advance.
Cheers,
Satria
2020-03-10 01:58 AM
>> I tried searching around, but haven't found a similar problem using the STM32F303 and SN65VD230 hardware <<
Do you have schematic? Have you tried enable internal pullups for can tx/rx pins if the tranceivers is not connected to can network.
2020-03-22 07:33 AM
Hi, i'm sorry for such a late reply. Thank you for your advice.
My schematic is as following, and i had put together a small PCB to hold the modules together including the transceiver.
I also tried your suggestion to enable an internal pullup, and enabling internal pullup for the RX pin works...
CAN goes to LISTENING MODE, if the transceiver is not connected. However, when the transceiver is connected, it shows an errorcode of 0x00E0000.
Do i need an additional circuit in order to use the transceiver module? Or is there something i probably had missed?
Thank you in advance!
2020-04-06 09:40 AM
Hi, Can you make to funcionation this project? Because I want to make a similar project where I want to read and write through Can Bus?