TMS320F280037C: LIN SCI mode baud rate divisor example is confusing

Guru 56308 points

Part Number: TMS320F280037C
Other Parts Discussed in Thread: C2000WARE

Hello,

Theses are similar questions to previously answered ones but more relative to adding 1 bit and the tables when more than 10 bits exist in a single frame. The example below shows 11 bits when no multiprocesor feild address bit time is required.

image.png

Why do the other tables below not show an typical 11 bit field frame as to keep consistent with the very first frame layout Fig 30-3. This why there is so much confusion! Does the Lin mode 2 frame example Fig. 30-4 (Majority Vote) require we configure 2 frames lengths for LIN module, (LINRX) total of 16 bits for SCI mode emulation?

image.png

Are we to assume odd/even parity relates to 0 /1 respectively? And Addr 0 means ignore in the sub fractional bit modulation M divisor table 30-2? I assume BRS 31:28 is 2h for 11 bits? These TRM examples are very confusing relative to Lin.h module LIN_setBaudRatePrescaler(). 

SYSCLK for the LIN peripheral clock = 120mHz and need to match RX frames of another MCU UART 9600, 8, even, 1 stop or 11 bits. Table 30-2 is it a fixed frame layout on each line or dynamic relative to total bits being used in Figure 30-5?

image.png

One extra bit (10 +1) makes these tables very confusing: And d=1 / 11 = 0.090909090909~

The above table lead me to believe also need to subtract the extra Addr bit when SCICom mode is Idle line? Seem to recall with Even parity the high order bit is set and Odd parity bit would be clear?  Does one stop bit need to be subtracted too from Fig. 30-5 from maxium configuration table or again is table 30-2 fixed, non modifiable. LIN_setSCICommMode(LINA_BASE, LIN_COMM_SCI_IDLELINE); 

image.png 

  • Hi Genatco,

    I am looking into your question and will get back to you as soon as I can.

    Best Regards,

    Delaney

  • Hi Delaney,

       Today disabled SCI parity and still have OE, FE error flags and no ASCII data being read in SCIRX non-blocking mode. The LIN examples seem to use only OSC2 10mHz SYSCLK and one example sets 115,207 BPS, P=26, M=2. Need 9600 baud and it seems we can multiply the OSC2 clock for our 20mHz PLL speed 120mHz SYSCLK. The lin.h (LIN_setSCIFrameLength) relates to a response field number of characters, not being well documented by TRM. That function name makes it appear as if setting RX/TX data frame lengths. Does the word response relate to LIN packets rather than data frames in SCI mode? Either way the same results occur no matter the frame length being set 1, 2 or 8 bytes/char but the SCIFORMAT[2:0] states are bits, seems a typo. Seems the wording infers CHAR bit field but 2:0 could mean the current three LENGTH bits in SCIFORMAT register.zany face  

    Adding HWREG code to clear the SCIFLR flags and the same OE, FE errors occur after being cleared during 1ms polling cycle of LINRX non-blocking register, similar to SCIB non-blocking polling code that is working but no pin exists x37c as pin 19 (X1) input we have 20mHz single ended clock source working just fine.  

    BTW: There is no function in lin.c or lin.h to clear the SCI flag bits in SCIFLR and the LIN sci loopback other example/s F2800x3 MCU are not using the PLL clock speeds C2000ware 5.04 and earlier. Wonder is there a loopback example that uses PLL SYSCLK 120mHz in later C2000ware updates?

    Even tried multibuffered, line, address modes and holding off LIN software reset until the polling begins but that made no difference. The OE, FE flags are being cleared as indicated in CCS debug below. So it seems the data bit rate is the primary cause for framing error though the RX wakeup flag keeps toggling and only should do that in LIN address mode but is clear for multibuffered mode.   

    Used multiplication to program the LIN bit clock for 120mHz SYSCLK given P=26 * 6 and M=2 * 6 should produce 9600 BPS for SCI?

  • Hi Genatco,

    I still haven't had a chance to look into your questions; I will reply back when I do.

    Best Regards,

    Delaney