Keil Logo

Configuration

CAN Hardware Configuration

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

  • PCLK (Peripheral CLocK) constant is used to calculate the correct communication speed (baudrate).
    #define PCLK             96000000
    

CAN Generic Configuration

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

  • USE_CAN_CTRL1 .. USE_CAN_CTRL2 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
    #define USE_CAN_CTRL2           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_LPC29xx.c edited with Configuration Wizard:

Configuration Wizard Window CAN_LPC29xx.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.