Difference between revisions of "STM32 CAN"

From Stm32World Wiki
Jump to navigation Jump to search
Line 5: Line 5:
  
 
== Loopback Example ==
 
== Loopback Example ==
 +
 +
 +
 +
The source for this example is here: [https://github.com/STM32World/firmware/tree/master/mcustm32f405_can_loopback]
  
 
=== CubeMX Config ===
 
=== CubeMX Config ===

Revision as of 13:06, 23 December 2023

Introduction

Most STM32 MCUs are equipped with one or more CAN peripherals.

Loopback Example

The source for this example is here: [1]

CubeMX Config

The clock is configured to maximum speed using the external crystal:

Can loopback example clock.png

Notice the APB1 bus is running at 42 MHz. The CAN peripherals are connected to this bus.

Can loopback example pinout.png

We can now configure the CAN1 periopheral:

Can loopback example can1.png Can loopback example can nvic.png

Real CAN bus example

To be added

Miscellaneous Links

To be added