Keil Logo

Hardware Configuration

CAN Hardware Configuration

The following symbols specify CAN Hardware Configuration related parameters and are located in CAN_SAM7X.c file:

  • MCK_FREQ (Master Clock Frequency) constant is used to calculate the correct communication speed (baudrate). The value of this constant must be calculated manually and is dependent on the Power Management Controller (PMC) settings in the SAM7.s startup file.
    #define  MCK_FREQ     47923200
    

CAN Generic Configuration

The following symbols specify CAN Generic Configuration related parameters and are located in CAN_Cfg.h file:

  • USE_CAN_CTRL1 enables the CAN controller that will be used. To enable the CAN controller, set this value to 1.

    The RL-CAN uses this information to reserve the memory pool and the memory for software FIFO buffers, as well as to enable interrupts for handling transmission and reception of CAN messages on the specified CAN controller.

    #define USE_CAN_CTRL1           1
    
  • CAN_No_SendObjects specifies the size of the software message FIFO buffers for message sending. Each CAN controller reserves a specified size of software buffer to send messages.
    #define CAN_No_SendObjects     20
    
  • CAN_No_ReceiveObjects specifies the size of the software message FIFO buffers for message reception. Each CAN controller reserves a specified size of software buffer to receive messages.
    #define CAN_No_ReceiveObjects  20
    

Using Configuration Wizard

You can use the Configuration Wizard to select the parameters as shown in the picture below.

File CAN_SAM7X.c edited with Configuration Wizard:

Configuration Wizard Window CAN_SAM7X.c

File CAN_Cfg.h edited with Configuration Wizard:

Configuration Wizard Window CAN_Cfg.h

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.