Hi,
I have a question about the LIN module on the TMS570LS20216.
I use the KEIL MCBTMS570 board to develop a communication using LIN module.
I use the tms507.h and some files of example project (Blinky). I have only change the lin configuration as following :
void linInit(void)
{
linREG2->GCR0=1U; //The module is out of reset
linREG2->GCR1=(0<<7); //Software reset for configuration
/** - Setup Pin function */
linREG2->FUN=(1<<2) //LINTX is transmit pin
|(1<<1) //LINRX is receive pin
|(0<<0); //SCICLK is a general purpose digital I/O pin
/** - Select LIN mode */
linREG2->GCR1 |=(1<<6); //LIN mode is enable
/** - Master or slave mode */
linREG2->GCR1 |=(1<<5); //The node is in master mode
/** - Select the desired frame format */
linREG2->GCR1 |=(0<<11) //Classic checksum is used
|(1<<4) //Two stop bits are used
|(1<<3) //Even parity is used
|(0<<2) //ID field parity verification is disabled
|(0<<1) //This bit isn't effectived in LIN mode
|(0<<0); //ID4 and ID5 aren't used for length control
/** - Setup response length */
linREG2->LENGTH = (8U - 1U); //Length is set to 8 Bytes
/** - Setup LIN compare register */
linREG2->COMP = (0x3 << 9) //The synch delimiter is 4Tbit
|0x7; //The synch break has 7 additional Tbit=>20Tbit
/** - Select multi-buffer mode */
linREG2->GCR1 |=(1<<10); //The multibuffer mode is enable
/** - Setup maximum baud rate prescaler */
// linREG2->MBRSR = 4507U; //0x119B INITIAL VALUE
linREG2->MBRSR = 3600U; //0xE10
/** - Setup baud rate prescaler */
// linREG2->BRSR = 312U; //0x138 INITIAL VALUE
linREG2->BRSR = 3600U; //0xE10
/** - Set the CONT bit */
linREG2->GCR1 |=(1<<17); //When debug mode is entered the LIN continues to operate
/** - Set LOOP BACK */
linREG2->GCR1 |=(0<<16); //Loopback mode is disable
/** - Select the transmit and receiver enable */
linREG2->GCR1 |=(1<<25) //Enable transmit
|(1<<24); //Enable receive
/** - Setup RX and TX reception masks */
linREG2->MASK=(0xFFU<<16U) //Receive ID mask
|(0xFFU); //Transmit ID mask
/** - Setup TX and RX interruption */
linREG2->SETINT |=(1<<8) // Enable TX INT
|(1<<9); // Enable RX INT
/** - Setup TX and RX DMA */
linREG2->SETINT |=(1<<16) // Enable TX DMA
|(1<<17); // Enable RX DMA
/** - Finaly start LIN2 */
linREG2->GCR1 |=(1<<7); //Software out of reset
}
When I use the function linSendHeader, I can detect this first frame.
Just after calling this function I call the function linSend, but nothing occurs. I thing I missed something but I don't know what.
I would like to use DMA in order to avoid issue during transmitting but I don't understand how it works.
Please can someone can give me further information about transmitting.
Thank you very much,
BR