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.

TMS570LC4357: Clarification required on how CAN selection between the functional and GIO modes is achieved.

Part Number: TMS570LC4357

Hello,

I am using the TMS570LC4357 and I have a question on the selection between functional mode and the GIO mode of the CAN module.
In the Technical Reference Manual TMS570LC43x 16/32-Bit RISC Flash Microcontroller (SPNU563A March 2018) section 27.17.34 CAN TX IO Control Register (DCAN TIOC)
Bit 3 Func has the following text:
    CAN_TX function. This bit changes the function of the CAN_TX pin.
    0 CAN_TX pin is in GIO mode.
    1 CAN_TX pin is in functional mode (as an output to transmit CAN data).
    Forced to 1, if Init bit of CAN control register is reset.
    
What does the final sentence "Forced to 1, if Init bit of CAN control register is reset." actually mean in practice?

Does it mean that if the Init bit of CAN control register is reset then the CAN module is forced to the functional mode even if it was initialised to the GIO mode?

Does it mean that if I want to operate the CAN in GIO mode then the Init bit of CAN control register has to be permanently set?

Thank you.

  • Hi Andrew,

    The DCAN TIOC register and RXOC register are used to set/clear the CANTX pin and CANRX pin (GIO mode).

    The values of the IO Control registers are only writable when Init bit of CAN Control Register is set.

    canREG1->CTL |= 0x00000001;
    canREG1->TIOC = (uint32)((uint32)1U << 18U )   /* CAN_TX pin*/
                                 | (uint32)((uint32)0U << 17U )
                                 | (uint32)((uint32)0U << 16U )
                                 | (uint32)((uint32)0U << 3U )     /*GIO mode*/
                                 | (uint32)((uint32)1U << 2U )     /*output*/
                                 | (uint32)((uint32)ti << 1U );       /*high*/

    canREG1->CTL &= 0xFFFFFFFE;

    Does it mean that if I want to operate the CAN in GIO mode then the Init bit of CAN control register has to be permanently set?

    Yes, the Init bit has to be set.