<?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 Need help getting mscan to sync in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Need-help-getting-mscan-to-sync/m-p/205683#M17233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're using a&amp;nbsp;&lt;SPAN&gt;DEMO9S08DZ60-ND. We followed the appnotes for the mscan on the hc12, and modified it a bit. But mscan keeps getting stuck on the while loop trying to sync. We tried different sample code found online, and still nothing. The pins are only outputting 0V too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void CANInit(void) {CANCTL0_INITRQ = 1; // enter initilization modewhile(!CANCTL1_INITAK); //wait until initialization mode is readyCANCTL1_CANE = 1; //enable mscan moduleCANCTL1_LOOPB = 1; //enable loopback modeCANCTL1_LISTEN = 0; //disable listen mode//set time segment 2 tq clock cycles to 3 CANBTR1_TSEG21 = 1;//set time segment 1 tq clock cycles to 6CANBTR1_TSEG12 = 1;CANBTR1_TSEG10 = 1;//set time quante of Synchronization jump width to 3 CANBTR0_SJW1= 1;// set clk prescale value to 3CANBTR0_BRP1 = 1; //disable identifier masking with don't cares. all messages received trigger interruptsCANIDMR0 = 0xFF;CANIDMR1 = 0xFF;CANIDMR2 = 0xFF;CANIDMR3 = 0xFF;CANIDMR4 = 0xFF;CANIDMR5 = 0xFF;CANIDMR6 = 0xFF;CANIDMR7 = 0xFF;CANCTL0_INITRQ = 0; // exit initialization modewhile(CANCTL1_SLPAK==1 &amp;amp;&amp;amp; CANCTL1_INITAK==1); //wait until initialization mode exit successfullywhile(CANCTL0_SYNCH==0); //wait until mscan syncs}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure where exactly we're going wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Feb 2012 07:20:35 GMT</pubDate>
    <dc:creator>boast</dc:creator>
    <dc:date>2012-02-13T07:20:35Z</dc:date>
    <item>
      <title>Need help getting mscan to sync</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Need-help-getting-mscan-to-sync/m-p/205683#M17233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're using a&amp;nbsp;&lt;SPAN&gt;DEMO9S08DZ60-ND. We followed the appnotes for the mscan on the hc12, and modified it a bit. But mscan keeps getting stuck on the while loop trying to sync. We tried different sample code found online, and still nothing. The pins are only outputting 0V too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void CANInit(void) {CANCTL0_INITRQ = 1; // enter initilization modewhile(!CANCTL1_INITAK); //wait until initialization mode is readyCANCTL1_CANE = 1; //enable mscan moduleCANCTL1_LOOPB = 1; //enable loopback modeCANCTL1_LISTEN = 0; //disable listen mode//set time segment 2 tq clock cycles to 3 CANBTR1_TSEG21 = 1;//set time segment 1 tq clock cycles to 6CANBTR1_TSEG12 = 1;CANBTR1_TSEG10 = 1;//set time quante of Synchronization jump width to 3 CANBTR0_SJW1= 1;// set clk prescale value to 3CANBTR0_BRP1 = 1; //disable identifier masking with don't cares. all messages received trigger interruptsCANIDMR0 = 0xFF;CANIDMR1 = 0xFF;CANIDMR2 = 0xFF;CANIDMR3 = 0xFF;CANIDMR4 = 0xFF;CANIDMR5 = 0xFF;CANIDMR6 = 0xFF;CANIDMR7 = 0xFF;CANCTL0_INITRQ = 0; // exit initialization modewhile(CANCTL1_SLPAK==1 &amp;amp;&amp;amp; CANCTL1_INITAK==1); //wait until initialization mode exit successfullywhile(CANCTL0_SYNCH==0); //wait until mscan syncs}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure where exactly we're going wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 07:20:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Need-help-getting-mscan-to-sync/m-p/205683#M17233</guid>
      <dc:creator>boast</dc:creator>
      <dc:date>2012-02-13T07:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting mscan to sync</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Need-help-getting-mscan-to-sync/m-p/205684#M17234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MSCAN is synchronized to the bus, when it receives valid message, send from different node. This probably won't&amp;nbsp;ever happen in loopback mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 13:03:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Need-help-getting-mscan-to-sync/m-p/205684#M17234</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-02-13T13:03:10Z</dc:date>
    </item>
  </channel>
</rss>

