<?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>LPC MicrocontrollersのトピックCAN RECEPTION ISSUE LPC2129</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057285#M40930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LPC2129 not receiving CAN messages. I have attached the code below of reception.Please help&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;void can_rx()&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;{&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;unsigned int l,id;&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;int i;&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;unsigned int low,high;&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;while ((C1GSR &amp;amp; 0x01)!=0x01); &amp;nbsp; &amp;nbsp;// Checking if data is present in Rx buffer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;l=C1RFS; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Length of the Received data&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;id=C1RID; // Stores the Identifier of the Rx msg into id&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;low=C1RDA; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Received data is stored in d&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;high=C1RDB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;C1CMR=0x04; // Releases the Rx buffer&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;for(i=0;i&amp;lt;4;i++)&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;{&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;txdata[i]=low&amp;lt;&amp;lt;(i*8);&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;}&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;for(i=4;i&amp;lt;8;i++)&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;{&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;txdata[i]=high&amp;lt;&amp;lt;(i*8);&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;}&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;C1CMR=0x04; // Releases the Rx buffer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jul 2020 18:13:21 GMT</pubDate>
    <dc:creator>akhileshverneka</dc:creator>
    <dc:date>2020-07-16T18:13:21Z</dc:date>
    <item>
      <title>CAN RECEPTION ISSUE LPC2129</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057285#M40930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LPC2129 not receiving CAN messages. I have attached the code below of reception.Please help&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;void can_rx()&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;{&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;unsigned int l,id;&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;int i;&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;unsigned int low,high;&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;while ((C1GSR &amp;amp; 0x01)!=0x01); &amp;nbsp; &amp;nbsp;// Checking if data is present in Rx buffer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;l=C1RFS; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Length of the Received data&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;id=C1RID; // Stores the Identifier of the Rx msg into id&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;low=C1RDA; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Received data is stored in d&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;high=C1RDB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;C1CMR=0x04; // Releases the Rx buffer&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;for(i=0;i&amp;lt;4;i++)&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;{&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;txdata[i]=low&amp;lt;&amp;lt;(i*8);&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;}&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;for(i=4;i&amp;lt;8;i++)&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;{&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;txdata[i]=high&amp;lt;&amp;lt;(i*8);&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;}&lt;/SPAN&gt;&lt;BR style="color: #000000; font-size: 12.8px;" /&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;C1CMR=0x04; // Releases the Rx buffer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12.8px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 18:13:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057285#M40930</guid>
      <dc:creator>akhileshverneka</dc:creator>
      <dc:date>2020-07-16T18:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: CAN RECEPTION ISSUE LPC2129</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057286#M40931</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;I think you have to set up the CAN baud rate of LPC2129, set up the ID you want to accept.&lt;/P&gt;&lt;P&gt;Anyway, there is code bundle for the LPC2xxx, pls download the code and have a try.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc2000-arm7/single-chip-16-32-bit-microcontrollers-32-64-128-256-512-kb-isp-iap-flash-with-10-bit-adc-and-dac:LPC2138FBD64?fpsp=1&amp;amp;tab=Design_Tools_Tab" title="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc2000-arm7/single-chip-16-32-bit-microcontrollers-32-64-128-256-512-kb-isp-iap-flash-with-10-bit-adc-and-dac:LPC2138FBD64?fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;Single-chip 16/32-bit microcontrollers; 32/64/128/256/512 kB ISP/IAP flash with 10-bit ADC and DAC | NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 03:52:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057286#M40931</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-07-17T03:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: CAN RECEPTION ISSUE LPC2129</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057287#M40932</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;#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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;while((C1SR &amp;amp; 0x04 )!= 0x04); // wait till transmission is completed&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&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 style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;can_rx();&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;&amp;nbsp;&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;&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;Sir this is the complete code.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 16.5px;"&gt;Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 08:43:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CAN-RECEPTION-ISSUE-LPC2129/m-p/1057287#M40932</guid>
      <dc:creator>akhileshverneka</dc:creator>
      <dc:date>2020-07-17T08:43:51Z</dc:date>
    </item>
  </channel>
</rss>

