<?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: CAN PROTOCOL IN LPC2129  in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050868#M40716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jul 2020 04:13:08 GMT</pubDate>
    <dc:creator>akhileshverneka</dc:creator>
    <dc:date>2020-07-16T04:13:08Z</dc:date>
    <item>
      <title>CAN PROTOCOL IN LPC2129</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050866#M40714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;SPAN&gt;Sir I am working on Implementation of CAN protocol for LPC2129 board.Sir,When I&amp;nbsp; select CAN RX and CANTX&amp;nbsp; pin then the CAN TX line is Idle.But when I select only CAN TX then I get correct output.Please help me solve this issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;SPAN&gt;I have attached the code below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;#include&amp;lt;lpc21xx.h&amp;gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;BR /&gt;char a[100]={1,3,5,7,9,11,13,15};&lt;BR /&gt;char b[100]={2,4,6,8,10,12,14,16};&lt;BR /&gt;char rxdata[8]={0,0,0,0,0,0,0,0};&lt;BR /&gt;char txdata[8]={0,0,0,0,0,0,0,0};&lt;BR /&gt;int flag=1;&lt;BR /&gt;unsigned int l,id;&lt;BR /&gt;unsigned int low,high;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;BR /&gt;void can_init()&lt;BR /&gt;{&lt;BR /&gt;PINSEL1 |= 0x00040000; can1 rx&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;AFMR=0x02; // All messages are received&lt;BR /&gt;C1MOD=0x01; // CAN is set to reset mode&lt;BR /&gt;C1IER=0x00; // Disabling all interrupts&lt;BR /&gt;C1RFS=0x00003000;&lt;BR /&gt;C1BTR=0x00270004; // Setting Baud rate to 500kbps , Baudrate Prescalar&lt;BR /&gt;C1MOD=0×00; // CAN is set to normal mode&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;void can_tx(char a[])&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C1TFI1=0X00080000; // Data length code = 3 is set, RTR =0;&lt;BR /&gt;C1TID1=0X92; // Identifier is set to 34(dec)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C1TDA1=(a[0]) | (a[1]&amp;lt;&amp;lt;8) | (a[2]&amp;lt;&amp;lt;16) | (a[3]&amp;lt;&amp;lt;24); // 4 bytes of data is added&lt;BR /&gt;C1TDB1=(a[4]) | (a[5]&amp;lt;&amp;lt;8) | (a[6]&amp;lt;&amp;lt;16) | (a[7]&amp;lt;&amp;lt;24); //&lt;BR /&gt;C1CMR=0X21; // Transmission request and Transmitter buffer 1 is selected;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while((C1SR &amp;amp; 0x04 )!= 0x04); // wait till transmission is completed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;void can_rx()&lt;BR /&gt;{&lt;BR /&gt;int i;&lt;BR /&gt;//while ((C1GSR &amp;amp; 0x00000010)!= 0x000000010)&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;flag=0;&lt;BR /&gt;// Checking if data is present in Rx buffer&lt;BR /&gt;if((C1RFS &amp;amp; 0x00000008)!=0x00000008)&lt;BR /&gt;{&lt;BR /&gt;l=C1RFS; // Length of the Received data&lt;BR /&gt;id=C1RID; // Stores the Identifier of the Rx msg into id&lt;BR /&gt;low=C1RDA; // Received data is stored in d&lt;BR /&gt;high=C1RDB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for(i=0;i&amp;lt;4;i++)&lt;BR /&gt;{&lt;BR /&gt;txdata[i]=low&amp;lt;&amp;lt;(i*8);&lt;BR /&gt;}&lt;BR /&gt;for(i=4;i&amp;lt;8;i++)&lt;BR /&gt;{&lt;BR /&gt;txdata[i]=high&amp;lt;&amp;lt;(i*8);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;C1CMR=0x04; // Releases the Rx buffer&lt;BR /&gt;}&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;can_init();&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;can_tx(a);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2020 13:56:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050866#M40714</guid>
      <dc:creator>akhileshverneka</dc:creator>
      <dc:date>2020-07-15T13:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: CAN PROTOCOL IN LPC2129</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050867#M40715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Akhilesh,&lt;/P&gt;&lt;P&gt;First of all, you have to connect a CAN transceiver and have at least two CAN nodes so that they can communicate each other.&lt;/P&gt;&lt;P&gt;BTW, the LPC2129 is a bit old, I suggest you use the latest LPC family.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 03:40:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050867#M40715</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-07-16T03:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: CAN PROTOCOL IN LPC2129</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050868#M40716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 04:13:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-PROTOCOL-IN-LPC2129/m-p/1050868#M40716</guid>
      <dc:creator>akhileshverneka</dc:creator>
      <dc:date>2020-07-16T04:13:08Z</dc:date>
    </item>
  </channel>
</rss>

