<?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: Trouble with CAN on LPC1788 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634498#M25028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice, you said good way to debug finding ACK signal on receiver side, I found the problems in HW and SW and now it works. Thank you very much for your helps.&lt;/P&gt;&lt;P&gt;The last problem was in Rs pin of the CAN transceiver, it should be same on both sides.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so mcuh&lt;/P&gt;&lt;P&gt;Behanm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2016 07:12:48 GMT</pubDate>
    <dc:creator>behnamshakibafa</dc:creator>
    <dc:date>2016-12-29T07:12:48Z</dc:date>
    <item>
      <title>Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634490#M25020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got in trouble with CAN bus on LPC1788. I used the sample code of KEIL v5 (functions in attachment) to initialize CAN1 and sending data. now I have two problems:&lt;/P&gt;&lt;P&gt;1. After three times, the process goes inside the Error Handler and I don't know why?!&lt;/P&gt;&lt;P&gt;2. But the device continue sending data for a while since it is corrupted data between A and B outputs (see the picture below)!&lt;/P&gt;&lt;P&gt;&amp;nbsp;Does anybody know what's wrong?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="173335_173335.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122677i8B154AB5D6870C6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="173335_173335.JPG" alt="173335_173335.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/1899iA374F2B7768420CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Behnam&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337996"&gt;LPC17xx-CAN.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 05:55:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634490#M25020</guid>
      <dc:creator>behnamshakibafa</dc:creator>
      <dc:date>2016-12-22T05:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634491#M25021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I found me second question answer. my Logoc Analyzer does not support differential signals, so i should use single ended method to monitor CAN.&lt;/P&gt;&lt;P&gt;But still, I don't know what happens in my code. The code stock in Error handler after three times I send data, but I can see data is on bus for ever!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my Send Data function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;int32_t CAN_send(uint8_t *data, uint8_t size){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int32_t&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;status = ptrCAN-&amp;gt;MessageSend(tx_obj_idx, &amp;amp;tx_msg_info, data, size);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Send data message with 1 data byte&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (status != 1U) { Error_Handler(); }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return status;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 05:50:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634491#M25021</guid>
      <dc:creator>behnamshakibafa</dc:creator>
      <dc:date>2016-12-24T05:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634492#M25022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A functioning CAN Bus needs at least 2 nodes (1 sending, and 1 answering with ACK) otherwise the sending Node will continuing sending his message until he reaches an internal error counter and goes in Bus-off state. I think that is was happening to You. Do You have a second node on Your CAN-Bus line? Please remember the termination on the bus has to be 2 x 120 Ohm.&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 10:07:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634492#M25022</guid>
      <dc:creator>MartinHo</dc:creator>
      <dc:date>2016-12-24T10:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634493#M25023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Martin&lt;/P&gt;&lt;P&gt;Yes I have second node that listening, but always receiving 0x00 for all 8 bytes. Also I can see NAK at the end of frames. I think the problems should be on my receiver side as you mentioned, but just don't know what is it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it is codes I added to sample code to receive packets on CAN bus&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp; memset(&amp;amp;rx_msg_info, 0U, sizeof(ARM_CAN_MSG_INFO));
&amp;nbsp; rx_msg_info.id = ARM_CAN_STANDARD_ID(0x12);
&amp;nbsp; rx_msg_info.dlc = 0x08;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;int32_t CAN_read(uint8_t *data, uint8_t size){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int32_t&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;status = ptrCAN-&amp;gt;MessageRead(rx_obj_idx, &amp;amp;rx_msg_info, data, size);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (status != 8U) { Error_Handler(); }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return status;
}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 11:17:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634493#M25023</guid>
      <dc:creator>behnamshakibafa</dc:creator>
      <dc:date>2016-12-24T11:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634494#M25024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And just another point&lt;/P&gt;&lt;P&gt;When I use 120R on both two sides, the logic analyzer shows me corrupted packages, but with single ended 120R termination, one of signals is OK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 11:30:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634494#M25024</guid>
      <dc:creator>behnamshakibafa</dc:creator>
      <dc:date>2016-12-24T11:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634495#M25025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, when I understand right, You are using two LPC1788 as nodes, both nodes are set to the same baud-rate, but on the CAN-Buy You see only a Can signal on one of the two CAN Lines (CAN_H or CAN_L?) and with the 2 x 120 Ohm termination, You see corrupted data (Attention CAN-Signals are not TTL, see the datasheet of Your CAN-Driver). This is not OK, so probably you have to solve first a&amp;nbsp;HW problem.&lt;/P&gt;&lt;P&gt;What CAN-Driver do You use?&lt;/P&gt;&lt;P&gt;Do You have a common ground on both nodes?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have You tried to connect Your Logic-Analyzer to the CAN_TX and CAN_RX signals (CPU pin's) on both CPU?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Dec 2016 17:33:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634495#M25025</guid>
      <dc:creator>MartinHo</dc:creator>
      <dc:date>2016-12-25T17:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634496#M25026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Martin, Thank you for the help you are giving to me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, this is what really happening&lt;/P&gt;&lt;P&gt;- I'm using TI sn65hvd233 3.3v CAN PHY.&lt;/P&gt;&lt;P&gt;- I can see CAN_H single ended using the logic analyzer (can see in picture) and they said it's OK to see only one side, because the analyzer does not support differential.&lt;/P&gt;&lt;P&gt;- I changed one side hardware and now its OK with 120R terminations. But still gives NAK at the end of packet.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2819i483972BF19DA7BE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Channel 0 -&amp;gt; CAN_TX , Channel 1 -&amp;gt; CAN_H&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Yes, I have common GND to both boards.&lt;/P&gt;&lt;P&gt;- Yes, the signal on CAN_TX is exactly same (but inverted) as what I see on CAN_H&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems my receive side has a problem, but can't understand what is it?&lt;/P&gt;&lt;P&gt;May be in code? I can't find sample codes on new KEIL CMSIS API&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2016 05:53:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634496#M25026</guid>
      <dc:creator>behnamshakibafa</dc:creator>
      <dc:date>2016-12-26T05:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634497#M25027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think its normal to see the Data only on CAN_H, You should see the same signal as on CAN_TX on CAN_L (measured against GND, be award that the levels are about 2.3V (recessive) to 0.5V (dominant) only (or 2.3V to 3V on the CAN_H line)!&lt;/P&gt;&lt;P&gt;Do You have a Oscilloscope? As You use a fairly low bitrate (100 Kbit ?) even a 1 Mhz type will do the Job. To verify the effective waveform's?&lt;/P&gt;&lt;P&gt;An other test would be to connect Your Logic-Analyzer to the CAN_RX on the receiver side and see&amp;nbsp;if You receive the Message You are sending.&lt;/P&gt;&lt;P&gt;If this is OK the next thing, is to check the CAN_TX on the receiver, You should see only the ACK bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the ACK Bit is missing but the CAN_RX is OK then You have a SW problem on the Receiving node. Unfortunately I do n't use KEIL so I can't help You a lot with this, but there is a example in the LPCopen Library (&lt;A class="link-titled" href="http://www.nxp.com/products/software-and-tools/hardware-development-tools/lpcxpresso-boards/lpcopen-software-development-platform-lpc17xx:LPCOPEN-SOFTWARE-FOR-LPC17XX" title="http://www.nxp.com/products/software-and-tools/hardware-development-tools/lpcxpresso-boards/lpcopen-software-development-platform-lpc17xx:LPCOPEN-SOFTWARE-FOR-LPC17XX"&gt;LPCOpen Software for LPC17XX|NXP&lt;/A&gt;&amp;nbsp;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2016 07:09:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634497#M25027</guid>
      <dc:creator>MartinHo</dc:creator>
      <dc:date>2016-12-26T07:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with CAN on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634498#M25028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice, you said good way to debug finding ACK signal on receiver side, I found the problems in HW and SW and now it works. Thank you very much for your helps.&lt;/P&gt;&lt;P&gt;The last problem was in Rs pin of the CAN transceiver, it should be same on both sides.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so mcuh&lt;/P&gt;&lt;P&gt;Behanm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 07:12:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Trouble-with-CAN-on-LPC1788/m-p/634498#M25028</guid>
      <dc:creator>behnamshakibafa</dc:creator>
      <dc:date>2016-12-29T07:12:48Z</dc:date>
    </item>
  </channel>
</rss>

