cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Communication using STM32F303KB (Nucleo) and SN65VD230 transceiver (help!)

Satria
Associate

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)

0693W000000TUnVQAW.jpg0693W000000TUnkQAG.jpg

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.0693W000000TUnQQAW.jpg

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

3 REPLIES 3
JoniS
Senior

>> 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.

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.

0693W000000USQlQAO.png

0693W000000USQqQAO.png

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.

0693W000000USRKQA4.jpg

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!

FNava.1
Associate II

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?