This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48 Halcogen dcan configuration: How to disable status change interrupt?

Other Parts Discussed in Thread: HALCOGEN

Hi

Is it possible to influence (disable) the status change interrupt of a dcan module with halcogen? Halcogen (version 03.03.01) generates the following code:

    /** @b Initialize @b CAN1: */

    /** - Setup control register
    *     - Disable automatic wakeup on bus activity
    *     - Local power down mode disabled
    *     - Disable DMA request lines
    *     - Enable global Interrupt Line 0 and 1
    *     - Disable debug mode
    *     - Release from software reset
    *     - Enable/Disable parity or ECC
    *     - Enable/Disable auto bus on timer
    *     - Setup message completion before entering debug state
    *     - Setup normal operation mode
    *     - Request write access to the configuration registers
    *     - Setup automatic retransmission of messages
    *     - Disable error interrupts
    *     - Disable status interrupts
    *     - Enter initialization mode
    */
    canREG1->CTL = 0x00000000U | 0x00000000U | 0x00000005U | 0x00020043U;

According to the comment, the status interrupts should be disabled! However, the generated code seems to activate the status interrupt ( SIE Bit of CTL-Register is set to 1)!

Best regards

Fabian

  • Fabian,

    I have forward your question to Halcogen experts. They will get back to you shortly.

    Thanks and regards,

    Zhaohong

  • Hi Fabian,

    The comments just gives details of each bit field in the Setup control register and does not reflect the actual bit set in the below line..
    I agree that it is bit confusing, the bit values are dependent on the GUI selection made.

    I have given this feedback to HALCoGen team.

    Regards
    Prathap

  • Hi Prathap,

    thank you for your fast reply. Could you give me a hint which gui selection in halcogen has to be made to switch off the status change interrupt for a CAN Module?

    Regards

    Fabian

  • Hi Fabian,

    I looked at the HALCoGen CAN driver,  following has to be noted

    1) IEO and IE1 are always Enabled when CanInit() is called.  ( No option to disable). 
    2) Using GUI each mailbox has option to chose to enable Interrupt and choose IE0 or IE1 ( High / Low).
    3) Error Interrupts are by default disabled when CanInit() is called, but using "canEnableErrorNotification()" and "canDisableErrorNotification()" APIs user can enable or disable
    4) Currently "Status Change Interrupt" is Disabled by default and not supported in HALCoGen Driver.

    So the Comments above line " canREG1->CTL = 0x00000000U | 0x00000000U | 0x00000005U | 0x00020043U;" is correct. Status Change Interrupt is Disabled. 

    Other than Mailbox interrupt Enable there is no CAN Interrupt GUI selection is supported in HALCoGen. 

    Regards
    Prathap 

  • Hi Prathap,

    0x00000005U equals 101 in binary which in my opinion enables the SIE bit (bit position 2) in CTL register (see SPNU503A Figure 23-19). That means the status change interrupt is enabled!

    Regards

    Fabian

  • Fabian,

    I checked with HALCoGen developer,  he mentioned that there is a Bug already filled in HALCoGen. The fix is mentioned below and will be rolled out in upcoming HALCoGen release.

    canREG1->CTL = 0x00000000U 
                                   | 0x00000000U 
                                   | (0x00000005U // Parity Enable
                                   | 0x00020043U;    

    has to be replaced with below line 

    canREG1->CTL = 0x00000000U
                                   | 0x00000000U
                                   | (0x00000005U << 10U ) // Parity Enable 
                                   | 0x00020043U;

    Sorry for the inconvenience caused. Time being you have to generate the code and do this fix manually.

    Regards
    Prathap