Arm Mbed OS support forum

CAN bus on STM32F769I DISCO

Do I need to modify the STM32F769I DISCO board to run the CAN communication?
CAN I use the pin 10 and 6 on the connector 9?

Hello Gino,

Can I use the pin 10 and 6 on the connector 9 ?

Yes, you can use them (denoted as D15 and D13 on the connector CN9) for CAN communication.
In your code use PB_8 and PA_12. For example:

CAN myCAN(PB_8, PA_12);

Please notice that you cannot connect them to a CAN bus directly but rather over a CAN transceiver chip (for example TJA1040, MCP2551 etc.) as shown here. Although when the CAN devices are located close to each other, for example on the same card or in the same rack, you can try an alternative solution as explained here.

Thanks for your reply.

Since these HW lines are applicable for I2C also, do I need to alter any pull-up resistors on these lines?
Or directly I can connect to a transceiver breakout board?
Thanks in advance.

image

By default in Mbed the MCU IO pins are not initialized and connected to any peripheral of the MCU. The initialization (including connecting of internal pull up resistors) is done in the driver’s constructor. Hence, unless in your program you call an I2C constructor passing it the PB_8 pin (the PA_12 pin cannot be used for I2C) no internal pull up resistor will be connected to that line. So you can connect those pins directly to the CAN transceiver breakout board.

Thanks for your great support.

My concern was because I had seen an external pull-up on PB8 line. Attached the image.
I am not sure whether this pull-up can cause any issue for CAN communication or not.

For performance data have a look at the datasheet of the CAN transceiver installed on your breakout board. But I don’t think the external pull up resistor should be a problem. For example, in case of an MCP2551 the DC characteristics of the Receiver Data Output (RXD) are indicated at 5 mA current.

If you power the CAN transceiver with 5V (in this case make sure the the PB8 and PA12 pins are 5V tolerant!) the additional current over the pull up resistor at HIGH level is

I = U/R = (5 - 3.3) / 2700 ~= 0.6 mA

That doesn’t seem to be a significant contribution to reduce the performance.