<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem to send 13 bit LIN Break! in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-to-send-13-bit-LIN-Break/m-p/1574602#M23618</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use mc9s08dz96. I wrote the corresponding registers to create a break at the beginning of the data LIN frame. The data frame is sent correctly, but the problem is that the break part is not 13 bits. I set the break registers like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  if (SCI1S1_TDRE == 0U) {            
    return ERR_TXFULL;              
  }
  SCI1C2_SBK = 0x01U;                
  SCI1C2_SBK = 0x00U;                &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I send 0x55 and ID:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;while(1){
  if (SCI1S1_TDRE == 0U) {       
    return ERR_TXFULL;            
  }
  SCI1C2_SBK = 0x01U;             
  SCI1C2_SBK = 0x00U;                 

  delayy(10);
  c=AS1_SendChar(Sync_);
  delayy(10);
  c=AS1_SendChar(ID_);
  delayy(333);
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I initialized these registers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void AS1_Init(void)
{
  SerFlag = 0x00U;                     /* Reset flags */
  /* SCI1C1: LOOPS=1,SCISWAI=0,Rsrc=1,M=0,WAKE=1,ILT=0,PE=0,PT=0 */
  setReg8(SCI1C1, 0xA8U);              /* Configure the SCI */ 
  /* SCI1C3: R8=0,T8=0,TXDIR=1,TXINV=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
  setReg8(SCI1C3, 0x20U);              /* Disable error interrupts */ 
  /* SCI1C2: TIE=0,TCIE=0,RIE=0,ILIE=0,TE=0,RE=0,RWU=0,SBK=0 */
  setReg8(SCI1C2, 0x00U);              /* Disable all interrupts */ 
  /* SCI1S2: LBKDIF=0,RXEDGIF=0,??=0,RXINV=0,RWUID=0,BRK13=1,LBKDE=0,RAF=0 */
    setReg8(SCI1S2, 0x04U);               
SCI1BDH = 0x00U;                     /* Set high divisor register (enable device) */
    SCI1BDL = 0x1AU;                     /* Set low divisor register (enable device) */
    SCI1C2_TE = 0x01U;                  /* Enable transmitter */
    SCI1C2_RE = 0x01U;}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;BRK13&amp;nbsp;defines for us that the break length is 13.&amp;nbsp;If you have noticed in the registers above, I have set it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setReg8(SCI1S2, 0x04U);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Finally, the frame LIN is like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mehdializadeh_0-1672053275696.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/205463iA582CEE8EA3F885F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mehdializadeh_0-1672053275696.png" alt="mehdializadeh_0-1672053275696.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Break is correctly sent, also 0x55, 0x34 for sync and ID, respectively. But the break length is not 13 bits. what is the reason?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2022 11:20:46 GMT</pubDate>
    <dc:creator>mehdializadeh</dc:creator>
    <dc:date>2022-12-26T11:20:46Z</dc:date>
    <item>
      <title>Problem to send 13 bit LIN Break!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-to-send-13-bit-LIN-Break/m-p/1574602#M23618</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use mc9s08dz96. I wrote the corresponding registers to create a break at the beginning of the data LIN frame. The data frame is sent correctly, but the problem is that the break part is not 13 bits. I set the break registers like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  if (SCI1S1_TDRE == 0U) {            
    return ERR_TXFULL;              
  }
  SCI1C2_SBK = 0x01U;                
  SCI1C2_SBK = 0x00U;                &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I send 0x55 and ID:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;while(1){
  if (SCI1S1_TDRE == 0U) {       
    return ERR_TXFULL;            
  }
  SCI1C2_SBK = 0x01U;             
  SCI1C2_SBK = 0x00U;                 

  delayy(10);
  c=AS1_SendChar(Sync_);
  delayy(10);
  c=AS1_SendChar(ID_);
  delayy(333);
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I initialized these registers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void AS1_Init(void)
{
  SerFlag = 0x00U;                     /* Reset flags */
  /* SCI1C1: LOOPS=1,SCISWAI=0,Rsrc=1,M=0,WAKE=1,ILT=0,PE=0,PT=0 */
  setReg8(SCI1C1, 0xA8U);              /* Configure the SCI */ 
  /* SCI1C3: R8=0,T8=0,TXDIR=1,TXINV=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
  setReg8(SCI1C3, 0x20U);              /* Disable error interrupts */ 
  /* SCI1C2: TIE=0,TCIE=0,RIE=0,ILIE=0,TE=0,RE=0,RWU=0,SBK=0 */
  setReg8(SCI1C2, 0x00U);              /* Disable all interrupts */ 
  /* SCI1S2: LBKDIF=0,RXEDGIF=0,??=0,RXINV=0,RWUID=0,BRK13=1,LBKDE=0,RAF=0 */
    setReg8(SCI1S2, 0x04U);               
SCI1BDH = 0x00U;                     /* Set high divisor register (enable device) */
    SCI1BDL = 0x1AU;                     /* Set low divisor register (enable device) */
    SCI1C2_TE = 0x01U;                  /* Enable transmitter */
    SCI1C2_RE = 0x01U;}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;BRK13&amp;nbsp;defines for us that the break length is 13.&amp;nbsp;If you have noticed in the registers above, I have set it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setReg8(SCI1S2, 0x04U);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Finally, the frame LIN is like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mehdializadeh_0-1672053275696.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/205463iA582CEE8EA3F885F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mehdializadeh_0-1672053275696.png" alt="mehdializadeh_0-1672053275696.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Break is correctly sent, also 0x55, 0x34 for sync and ID, respectively. But the break length is not 13 bits. what is the reason?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 11:20:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-to-send-13-bit-LIN-Break/m-p/1574602#M23618</guid>
      <dc:creator>mehdializadeh</dc:creator>
      <dc:date>2022-12-26T11:20:46Z</dc:date>
    </item>
  </channel>
</rss>

