<?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 1 Mb/s CAN ? in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589098#M12943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the S12ZVC Evaluation board. I'm trying to get CAN working at 1 Mbit/ s baud rate; 500 kbit/s works fine, transmitting and receiving. I can even get 800 kbit/s; but I can't get 1000 kbit/s (1Mb/s).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using both Processor Expert and coding by hand - I can get the lower baud rates working by both methods. Processor expert sometimes says the baud rate is not achievable when you first start a project but if you save, exit and retry it lets you select 1Mb/s using high speed mode and the external clock.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the project at 1000kbit/ s it doesn't send or receive; it's like CAN is off or the bus is off. I'm assuming it's because that baud rate is unachievable with this board but it should be.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There aren't many details that came with the board, like whether there is an external oscillator and what the clock rate is and I don't know which settings to use in processor expert: internal clock or external. Any help in configuring the clock and the registers would be appreciated..I'm attaching screen shots of my processor expert settings below.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'd prefer to do it by hand rather than processor expert: at least by hand, you get bus errors but it still transmits. With processor expert the tx is just dead.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2016 11:51:02 GMT</pubDate>
    <dc:creator>mahtabsarwar</dc:creator>
    <dc:date>2016-07-19T11:51:02Z</dc:date>
    <item>
      <title>1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589098#M12943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the S12ZVC Evaluation board. I'm trying to get CAN working at 1 Mbit/ s baud rate; 500 kbit/s works fine, transmitting and receiving. I can even get 800 kbit/s; but I can't get 1000 kbit/s (1Mb/s).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using both Processor Expert and coding by hand - I can get the lower baud rates working by both methods. Processor expert sometimes says the baud rate is not achievable when you first start a project but if you save, exit and retry it lets you select 1Mb/s using high speed mode and the external clock.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the project at 1000kbit/ s it doesn't send or receive; it's like CAN is off or the bus is off. I'm assuming it's because that baud rate is unachievable with this board but it should be.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There aren't many details that came with the board, like whether there is an external oscillator and what the clock rate is and I don't know which settings to use in processor expert: internal clock or external. Any help in configuring the clock and the registers would be appreciated..I'm attaching screen shots of my processor expert settings below.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'd prefer to do it by hand rather than processor expert: at least by hand, you get bus errors but it still transmits. With processor expert the tx is just dead.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 11:51:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589098#M12943</guid>
      <dc:creator>mahtabsarwar</dc:creator>
      <dc:date>2016-07-19T11:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: 1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589099#M12944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: I can now send CAN messages by switching on the physical layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; #ifdef CP0CR&lt;/P&gt;&lt;P&gt; CP0CR_CPE = 1;&lt;/P&gt;&lt;P&gt; CP0CR_SPE = 0;&lt;/P&gt;&lt;P&gt; #endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the messages are still not being recognized at 1Mbit/s...also not receiving messages at 1 Mbit/ s either..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 13:31:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589099#M12944</guid>
      <dc:creator>mahtabsarwar</dc:creator>
      <dc:date>2016-07-19T13:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: 1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589100#M12945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;As first, please go to CPU settings and select External Clock as the clock source for bus clock.&lt;/P&gt;&lt;P&gt;This will enable external oscillator (The external oscillator is disabled by default).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PE-External Clock.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37719i0D27D0C8F42C6F97/image-size/large?v=v2&amp;amp;px=999" role="button" title="PE-External Clock.png" alt="PE-External Clock.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After that, please set Time segment 1 as 1, Time segment 2 as 4, RSJ as 2, One sample per bit:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PE-CAN-1MHz.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37720iBDACA0C454853CAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="PE-CAN-1MHz.png" alt="PE-CAN-1MHz.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Finally, please open Bit rate settings, select External Clock as CAN clock source and choose 1000kbit/s as bit rate.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PE-CAN-BitTime.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37721iF46514091E7988F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="PE-CAN-BitTime.png" alt="PE-CAN-BitTime.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached simple CAN bit rate calculator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 09:06:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589100#M12945</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-07-20T09:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: 1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589101#M12946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radek and thanks for the answer - I tried your settings - well, as close to them as possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CPU settings 1.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37900i4980BB11A8FDEB16/image-size/large?v=v2&amp;amp;px=999" role="button" title="CPU settings 1.PNG" alt="CPU settings 1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CAn settings 1.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37994i3B4E59880D97D90A/image-size/large?v=v2&amp;amp;px=999" role="button" title="CAn settings 1.PNG" alt="CAn settings 1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And still get the same problem: messages are not transmitted and I'm assuming it's a timing error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, the ext clock frequency is 50 Mhz - that's not possible on the evaluation board is it ? The schematic for the evaluation board shows a 4 Mz crystal, are the setting different ? I can select a 4Mhz ext clock frequency in the CPU settings and then adjust the CAN timing settings but I get the same problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 09:34:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589101#M12946</guid>
      <dc:creator>mahtabsarwar</dc:creator>
      <dc:date>2016-07-20T09:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: 1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589102#M12947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, got it, it works: because the ext crystal on the evaluation board is 4Mz, the correct settings are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CPU Settings correct.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/38013i377950147FAFFA1F/image-size/large?v=v2&amp;amp;px=999" role="button" title="CPU Settings correct.PNG" alt="CPU Settings correct.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and, using the internal bus clock in the CAN timing high speed mode enables 1 Mbit/s to work correctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="MSCAN correct clock setting.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/38044i206D5D0C1B6CFDAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="MSCAN correct clock setting.PNG" alt="MSCAN correct clock setting.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 10:13:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589102#M12947</guid>
      <dc:creator>mahtabsarwar</dc:creator>
      <dc:date>2016-07-20T10:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: 1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589103#M12948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;I didn’t test it on HW.&lt;/P&gt;&lt;P&gt;You are right, the external crystal on board is just 4MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid that 1Mbit/s bit rate is not possible to achieve with 4MHz clock source – It is out of CAN standard compliant bit time segment settings.&lt;/P&gt;&lt;P&gt;You should use at least 8MHz clock source for 1Mbit CAN bit rate.&lt;/P&gt;&lt;P&gt;So, you may use bus clock&amp;gt;=8MHz as CAN clock source for debugging purpose. However, I would like to strongly recommend use the external crystal with frequency 8MHz or more for real production and take this clock as CAN module clock source.&lt;/P&gt;&lt;P&gt;The PLL cannot fulfill CAN standard requirements for the clock source.&lt;/P&gt;&lt;P&gt;For example: for 8MHz clock source and described settings you need clock source with tolerance better than 0.48% …&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 11:49:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589103#M12948</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-07-20T11:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: 1 Mb/s CAN ?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589104#M12949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you're absolutely right and that's great advice. I'm only using the evaluation board for testing; for production a faster clock would be required. Thanks for your help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 07:28:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/1-Mb-s-CAN/m-p/589104#M12949</guid>
      <dc:creator>mahtabsarwar</dc:creator>
      <dc:date>2016-07-21T07:28:01Z</dc:date>
    </item>
  </channel>
</rss>

