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.

TMS320F280049C: LIN register IODFTCTRL bit28(ISFERRENA)

Part Number: TMS320F280049C


Hi Team,

The IODFTCTRL register is used to simulate various error and test conditions, with bit 28 used to create ISF errors.
When IODFT mode is enabled (IODFTENA=1010), the bit width in the synchronization field changes in LIN mode.
The ISF error is not set when sending data, but the corresponding error standard bits are set only after CERRENA/PBERRENA/BERRENA is enabled.
How to use this function?

--

Thanks & Regards

  • Hi Yale,

    Thanks for your question.

    The ISF error is not set when sending data, but the corresponding error standard bits are set only after CERRENA/PBERRENA/BERRENA is enabled.

    I believe this is expected, because when you enable ISF, it will TRANSMIT with the inconsistent sync-field. You have to receive that data, either by loopback or by another means, so that an error is generated on C2000. You could optionally send to another device to test this too. You also may need to enable the interrupt for this:

    Regards,

    Vince

  • Hi Vince,

    Thanks for your reply. Here's the reply from the customer:

    The problem is that after enabling ISFERRENA and turning on the analog loopback to pass the sending pin, the corresponding flag bit is not set.
    I captured the signal using a logic analyzer and found that the sync fields were the same as normal.

      baud rate 20k

    __interrupt void level0ISR(void);
    __interrupt void level1ISR(void);
    void lin_enable_int(LIN_InterruptLine INTERRUPT_LINEx,uint32_t intFlags);
    void main()
    {
        uint16_t txID;
        txID = 0x10 ;
        txID = LIN_generateParityID(txID);
    
        Device_init();
        Device_initGPIO();
    
        GPIO_setPinConfig(GPIO_37_LINA_TX);
        GPIO_setPadConfig(37, GPIO_PIN_TYPE_STD | GPIO_PIN_TYPE_PULLUP);
        GPIO_setQualificationMode(37, GPIO_QUAL_ASYNC);
        GPIO_setDirectionMode(37U, GPIO_DIR_MODE_OUT);
    
        GPIO_setPinConfig(GPIO_35_LINA_RX);
        GPIO_setPadConfig(35, GPIO_PIN_TYPE_STD);
        GPIO_setQualificationMode(35, GPIO_QUAL_ASYNC);
        GPIO_setDirectionMode(35U, GPIO_DIR_MODE_IN);
    
    
        Interrupt_initModule();
    
        Interrupt_initVectorTable();
        EINT;
        ERTM;
        Interrupt_register(INT_LINA_0, &level0ISR);
        Interrupt_register(INT_LINA_1, &level1ISR);
    
        Interrupt_enable(INT_LINA_0);
        Interrupt_enable(INT_LINA_1);
    
        LIN_initModule(LINA_BASE);
         //波特率20K
        LIN_setBaudRatePrescaler(LINA_BASE, 312U, 0U);
        //设置ISF中断
        lin_enable_int(LIN_INTERRUPT_LINE0,LIN_INT_ISFE);
        LIN_disableIntLoopback(LINA_BASE);
        //创建isf错误 
        // Clear the IO DFT Enable Key
        HWREGH(myLIN_BASE + LIN_O_IODFTCTRL) &= ~(LIN_IODFTCTRL_IODFTENA_M);
        // Enable write access
        HWREGH(myLIN_BASE + LIN_O_IODFTCTRL) |= (LIN_IO_DFT_KEY <<LIN_IODFTCTRL_IODFTENA_S);
        //HWREG_BP(myLIN_BASE + LIN_O_IODFTCTRL) |= LIN_ISF_ERROR;
        HWREG_BP(myLIN_BASE + LIN_O_IODFTCTRL) |= LIN_ISF_ERROR|0x2;//模拟回环通过发送引脚  
    
        while(!LIN_isTxReady(LINA_BASE));
        //发送数据
        LIN_sendData(LINA_BASE, txData);
        LIN_setIDByte(LINA_BASE, txID);
    
        while(1);
    }
    void lin_enable_int(LIN_InterruptLine INTERRUPT_LINEx,uint32_t intFlags)
    {
        LIN_enableInterrupt(LINA_BASE, intFlags);
    //INT0
        if(INTERRUPT_LINEx==LIN_INTERRUPT_LINE0)
        {
            //仅在LIN模式下,将各个中断源映射到 INT0 线
            LIN_setInterruptLevel0(LINA_BASE, intFlags);
            //使能全局中断0
            LIN_enableGlobalInterrupt(LINA_BASE, LIN_INTERRUPT_LINE0);
            //失能全局中断1
            LIN_disableGlobalInterrupt(LINA_BASE, LIN_INTERRUPT_LINE1);
            //清除全局中断标志位
            LIN_clearGlobalInterruptStatus(LINA_BASE, LIN_INTERRUPT_LINE0);
        }
    //INT1
        else
        {
            //仅在LIN模式下,将各个中断源映射到 INT1 线
            LIN_setInterruptLevel1(LINA_BASE, intFlags);
            LIN_enableGlobalInterrupt(LINA_BASE, LIN_INTERRUPT_LINE1);
            //失能全局中断0
            LIN_disableGlobalInterrupt(LINA_BASE, LIN_INTERRUPT_LINE0);
            LIN_clearGlobalInterruptStatus(LINA_BASE, LIN_INTERRUPT_LINE1);
        }
    }
    __interrupt void level0ISR(void)
    {
        level0Count++;
        if(LIN_getInterruptStatus(LINA_BASE)& LIN_FLAG_ISFE)
        {
            vectorOffset = LIN_getInterruptLine0Offset(LINA_BASE);
            LIN_clearInterruptStatus(LINA_BASE, LIN_INT_ISFE);
        }
        if(LIN_getInterruptStatus(LINA_BASE)& LIN_FLAG_CE)
        {
            vectorOffset = LIN_getInterruptLine0Offset(LINA_BASE);
            LIN_clearInterruptStatus(LINA_BASE, LIN_INT_ISFE);
        }
           
            vectorOffset = LIN_getInterruptLine0Offset(LINA_BASE);
            LIN_clearGlobalInterruptStatus(LINA_BASE, LIN_INTERRUPT_LINE0);
            Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP8);
    }
    
    __interrupt void level1ISR(void)
    {
    
    }

  • Hi Yale,

    Can you have customer try without loopback mode enabled? This should work with loopback, but something may not be working with loopback.

    Regards,

    Vince

  • Hi Vince,

    After the customer turns off the internal loopback mode and the analog loopback mode, they only enable ISFERRENA. The waveform sent out is similar to the picture above, and the synchronization field has not changed.
    They wasn't sure if this was a code configuration issue.
    Could you please help them debugging in launchPad in your side?

    --

    Thanks & Regards

  • Hi Yale,

    That's definitely a bit strange. Just to sanity check, you have IODFTENA key set right?

    That's required here. Needs to be 0xA.

    Regards,

    Vince