<?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 Re: How to send data using Local Interconnect Network(LIN)? in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1574317#M23617</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Thank you so much for your kind reply.&lt;/SPAN&gt;&lt;BR /&gt;I think that my problem is the&amp;nbsp;synchronizing the S08’s Internal Clock for LIN or registers. But I set these.&lt;BR /&gt;This is my init function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void AS1_Init(void)
{
  /* SCI1C1: LOOPS=1,SCISWAI=0,Rsrc=1,M=0,WAKE=1,ILT=1,PE=0,PT=0 */
  setReg8(SCI1C1, 0xACU);              /* 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);               
  AS1_SetHigh();                       /* Initial speed CPU mode is high */
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have this function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static void HWEnDi(void)
{
  if (EnMode) {                        /* Enable device? */
  SCI1BDH = 0x00U;                     /* Set high divisor register (enable device) */
  SCI1BDL = 0x1AU;                     /* Set low divisor register (enable device) */
    SCI1C2_TE = 0x01U;                  /* Enable transmitter */
    SCI1C2_RE = 0x01U;                  /* Enable receiver */
  } else {
    SCI1C2_RE = 0x00U;                  /* Disable receiver */
    SCI1C2_TE = 0x00U;                  /* Disable transmitter */
    SCI1BDH = 0x00U;                   /* Set high divisor register to zero (disable device) */
    SCI1BDL = 0x00U;                   /* Set low divisor register to zero (disable device) */
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for you to view the file I have attached? I really appreciate it.&lt;/P&gt;</description>
    <pubDate>Sat, 24 Dec 2022 14:24:24 GMT</pubDate>
    <dc:creator>mehdializadeh</dc:creator>
    <dc:date>2022-12-24T14:24:24Z</dc:date>
    <item>
      <title>How to send data using Local Interconnect Network(LIN)?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1572544#M23614</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;SPAN&gt;I use mc9s08dz96.&lt;/SPAN&gt;To send data in the form of the LIN protocol, I have set the CodeWarrior settings to asynchronous mode.&amp;nbsp;According to the frame LIN protocol, I have defined and sent the data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BurstProgram.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/205009i338A603144E02127/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BurstProgram.PNG" alt="BurstProgram.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;This is my data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;byte break_1={0x00};
byte break_2={0x00};
byte Sync_={0x55};
byte ID_={0x11};
byte data1={0x80};
byte data2={0x29};
byte chsum={0x56};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Then in main I sent these data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;AS1_Init();

Enable_Lin = 1;
while(1){
c=AS1_SendChar(break_1);
c=AS1_SendChar(break_2);
c=AS1_SendChar(Sync_);
c=AS1_SendChar(ID_);
c=AS1_SendChar(data1);
c=AS1_SendChar(data2);
c=AS1_SendChar(chsum);
delayy(5000);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data sending function is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;byte AS1_SendChar(AS1_TComData Chr)
{
  if (!EnMode) {                       /* Is the device disabled in the actual speed CPU mode? */
    return ERR_SPEED;                  /* If yes then error */
  }
  if (SCI1S1_TDRE == 0U) {             /* Is the transmitter full? */
    return ERR_TXFULL;                 /* If yes then error */
  }
  SCI1D = (byte)Chr;                   /* Store char to the transmitter register */
  return ERR_OK;                       /* OK */
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, 010 is added between each byte of data that I send with the above codes, which causes the receiving device to misread the data. What do you suggest to remove this 010?&lt;BR /&gt;The file is attached.&lt;BR /&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 13:12:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1572544#M23614</guid>
      <dc:creator>mehdializadeh</dc:creator>
      <dc:date>2022-12-20T13:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to send data using Local Interconnect Network(LIN)?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1572761#M23615</link>
      <description>&lt;P&gt;PLease check the LIN stack&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 class="item-title"&gt;&lt;A href="https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW-LIN2X-J2602-D" target="_self"&gt;&lt;SPAN&gt;LIN2.x and SAE J2602 Stack&lt;/SPAN&gt;&amp;nbsp;&lt;/A&gt;&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check the application note&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN3756.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN3756.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 00:26:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1572761#M23615</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2022-12-21T00:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to send data using Local Interconnect Network(LIN)?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1574317#M23617</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you so much for your kind reply.&lt;/SPAN&gt;&lt;BR /&gt;I think that my problem is the&amp;nbsp;synchronizing the S08’s Internal Clock for LIN or registers. But I set these.&lt;BR /&gt;This is my init function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void AS1_Init(void)
{
  /* SCI1C1: LOOPS=1,SCISWAI=0,Rsrc=1,M=0,WAKE=1,ILT=1,PE=0,PT=0 */
  setReg8(SCI1C1, 0xACU);              /* 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);               
  AS1_SetHigh();                       /* Initial speed CPU mode is high */
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have this function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static void HWEnDi(void)
{
  if (EnMode) {                        /* Enable device? */
  SCI1BDH = 0x00U;                     /* Set high divisor register (enable device) */
  SCI1BDL = 0x1AU;                     /* Set low divisor register (enable device) */
    SCI1C2_TE = 0x01U;                  /* Enable transmitter */
    SCI1C2_RE = 0x01U;                  /* Enable receiver */
  } else {
    SCI1C2_RE = 0x00U;                  /* Disable receiver */
    SCI1C2_TE = 0x00U;                  /* Disable transmitter */
    SCI1BDH = 0x00U;                   /* Set high divisor register to zero (disable device) */
    SCI1BDL = 0x00U;                   /* Set low divisor register to zero (disable device) */
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for you to view the file I have attached? I really appreciate it.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 14:24:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-send-data-using-Local-Interconnect-Network-LIN/m-p/1574317#M23617</guid>
      <dc:creator>mehdializadeh</dc:creator>
      <dc:date>2022-12-24T14:24:24Z</dc:date>
    </item>
  </channel>
</rss>

