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 slave driver and we are unable to get the break interrupt or RX interrupt on configured LIN Rx pin.

Part Number: TMS320F280049C
Other Parts Discussed in Thread: TLIN1021DEVM

Hi,

Greetings!!!

We are testing LIN slave driver and we are unable to get the break interrupt or RX interrupt on configured LIN Rx pin.
Please find the details related to hardware connection:
We are using LIN transceiver(TLIN1021DEVM) to established the communication between the launch board and the LIN master(in your case we are using Canoe interface for LIN master).We have connected the LIN transceiver RX pin with launch pad(LAUNCHXL -F280049C) RX pin i.e. PIN No.44 on launch board and Tx pin with launch board PIN NO.43.As per mentioned in manual as we are using BP so we have already make the switch S6 to BP selection and J101 jumper pins had been shorted.
Please find the details related to pin configuration that has been done from the software side :
Below is the LIN initialization api pseudo code description to configure LIN in a slave mode:

 

void LINDrv_Init(void)
{
/* Initialize LIN state to IDLE. */
g_LIN_State = LIN_STATE_IDLE;

EALLOW;

/* LIN Tx GPIO Configuration */
GPIO_setPinConfig(GPIO_28_LINA_TX);

//GPIO_setPadConfig(28,GPIO_PIN_TYPE_STD);

GPIO_setDirectionMode(28,GPIO_DIR_MODE_OUT);

GPIO_setQualificationMode(GPIO_28_LINA_TX, GPIO_QUAL_ASYNC);

/* LIN Rx GPIO Configuration */
GPIO_setPinConfig(GPIO_29_LINA_RX);

GPIO_setPadConfig(29,GPIO_PIN_TYPE_STD);

GPIO_setDirectionMode(29,GPIO_DIR_MODE_IN);


GPIO_setQualificationMode(GPIO_29_LINA_RX, GPIO_QUAL_ASYNC);

/* Reset the Module */
LIN_REG_SCIGCR0 |= LIN_SCIGCR0_RESET;

/* Reset the Software Reset Bit */
LIN_REG_SCIGCR1 &= ~(LIN_SCIGCR1_SWNRST);

/* Configure the LINRx and LINTx Pin */
LIN_REG_SCIPIO0 |= (LIN_SCIPIO0_RXFUNC | LIN_SCIPIO0_TXFUNC);

/* Select SCI Mode */
// LIN_REG_SCIGCR1 |= LIN_REG_SCIGCR1 & (~LIN_SCIGCR1_LINMODE);
LIN_REG_SCIGCR1 |= LIN_SCIGCR1_LINMODE;

/* Configure the LIN Module in Slave mode */
LIN_REG_SCIGCR1 |= LIN_SCIGCR1_CLK_MASTER;

/* Disable the ID4/ID5 bits for length control*/
LIN_REG_SCIGCR1 |= (LIN_SCIGCR1_TIMINGMODE);

/* Debug mode */
LIN_REG_SCIGCR1 |= (LIN_REG_SCIGCR1 & ~(LIN_SCIGCR1_CONT));

/* Configure the Parity */
LIN_REG_SCIGCR1 |= (LIN_REG_SCIGCR1 & ~(LIN_SCIGCR1_PARITYENA));

/* Configure the SCI Stop Bits */
LIN_setSCIStopBits(LINA_BASE,LIN_SCI_STOP_ONE);

/*Set character length as 8-bits*/
LIN_setSCICharLength(LINA_BASE, CHAR_LENGTH);

/* Frame Length */
LIN_setSCIFrameLength(LINA_BASE, FRAME_LENGTH);

/* Select Multi-buffer */
LIN_REG_SCIGCR1 |= (LIN_REG_SCIGCR1 & ~(LIN_SCIGCR1_MBUFMODE));

/* Disable LOOP-BACK Mode */
LIN_REG_SCIGCR1 |= (LIN_REG_SCIGCR1 &~(LIN_SCIGCR1_LOOPBACK));
//LIN_REG_SCIGCR1 |= LIN_SCIGCR1_LOOPBACK;

/* Synch break and synch delimiter additional bits */
// LIN_REG_COMP |= (LIN_SYNCH_BREAK_LEN | ((LIN_SYNCH_DELIMITER_LEN - LIN_CONST_NO_ONE) << LIN_COMP_SDEL_S));

/* Configure the BaudRate */
LINDrv_SetBuadRate(LIN_CONFIG_BAUDRATE);

/* Configure the Slave ID for message filtering */
LIN_REG_SCIGCR1 |= (LIN_REG_SCIGCR1 & ~(LIN_SCIGCR1_HGENCTRL));

/* Configure the Filter Compare ID */
//LIN_REG_ID |= ((uint32_t)LIN_MESSAGEID_COMPARE_CONFIG << LIN_CONST_NO_EIGHT);

/* Configure the Filter Mask */
LIN_REG_MASK |= ((uint32_t)LIN_RXMESSAGEID_FILTERMASK << LIN_CONST_NO_SIXTEEN);

/* Enable the Transmit */
LIN_REG_SCIGCR1 |= LIN_SCIGCR1_TXENA;

/* Enable the Receive */
LIN_REG_SCIGCR1 |= LIN_SCIGCR1_RXENA;

/* Enable Interrupt - Break Detection Interrupt,Wakeup Interrupt,
Timeout Interrupt,Tx INterrupt , RX interrupt ,
ID Interrupt , Parity Error Intrrupt,
Sync Frame Error Interrupt, Checksum Error Interrupt,
Bit Error Interrupt*/
LIN_REG_SCISETINT |= (LIN_SCISETINT_SETBRKDTINT | LIN_SCISETINT_SETWAKEUPINT |
LIN_SCISETINT_SETTIMEOUTINT | LIN_SCISETINT_SETTXINT |
LIN_SCISETINT_SETRXINT | LIN_SCISETINT_SETIDINT |
LIN_SCISETINT_SETPEINT | LIN_SCISETINT_SETISFEINT |
LIN_SCISETINT_SETCEINT | LIN_SCISETINT_SETBEINT);

/* Set the Interrupt Handler */
Interrupt_register(INT_LINA_0, &LINDrv_IntLevel0Handle);

/* Enable Global Interrupt */
LIN_REG_GLB_INT_EN |= LIN_GLB_INT_EN_GLBINT0_EN;

/* Clear the Global Interrupt Status */
LIN_REG_GLB_INT_FLG |= LIN_GLB_INT_CLR_INT0_FLG_CLR;

/* Reset the Software Reset Bit */
LIN_REG_SCIGCR1 |= (LIN_SCIGCR1_SWNRST);

EDIS;

/* Enable Interrupts */
Interrupt_enable(INT_LINA_0);

}

Please let us know is there are any pin configuration that has to be taken care or anything that we need to configure related to SCI mode /LIN mode selection to invoke the interrupt.

As we are at critical stage of project so it will be helpful if you provide your valuable inputs on the same.

Thank you for the consideration and waiting for the response from your side.

Thanks and Regards,
Tanya Singh

  • Tanya, 

    The subject matter expert is out of office. Please expect a response by Wednesday.

    Thanks.

  • Hi Tanya,

    Thank you for your patience during the US holiday. 
    For this issue, I think it will be useful to narrow down the issue using process of elimination. So if you could do the following and let me know where it stops working, that will help to narrow down hardware vs runtime code vs configuration code issues:

    1. First try without slave mode and without being connected to any other device. Just see if the TX pin can transmit data as a master. If TX pin will correctly send data, then at least the LIN module chosen (A vs B vs C, etc.) is configured correctly and hardware OUTPUT is good.
    2. Next see if RX pin of the device is receiving valid data from the master by taking a scope capture of the RX pin of the C2000 device when it is receiving data. Please make sure we can determine the width of a bit from the data using the capture, want to make sure the baud rate is correct.
    3. If both of the above work properly, then there likely is a configuration issue that needs to be debugged. My recommendation would be to start with a known good LIN slave example code. That example code is available in these forums, and I can send the link to you if you cannot find it.

    Regards,

    Vince