<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックMSCAN driver problems</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155422#M4438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm working with MCF51AC microcontroller, and I found some problems when I tried to use the MSCAN drivers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interrupts (CAN_TransmitISR, CAN_ReceiveISR, CAN_WakeupISR) aren't executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found an error in the function "CAN_QueueMB", when the transmitted interrupt flag is setting on (CANTFLG register):&lt;/P&gt;&lt;P&gt;if (MB_MSCAN[0] == 0xff)&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ......&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ......&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CANTFLG = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ......&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;This is wrong, the interrupt flag enable when TX buffer 0 is full (loaded with a message due for transmission ) is:&lt;BR /&gt;CANTFLG = 0x06;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the register value, the CAN_TransmitISR is executed, but the transmission is not correct. I'll have to find the problem :-(( .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also, I have problems with receiver canbus data, the data fills the bufferCANRX (@ffff989f) and seems to be OK, but&amp;nbsp;the tx interrupt isn't executed (the address filter is all FF)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my MSCAN test code:&lt;/P&gt;&lt;P&gt;UINT8 data[] = {8,0,0,7,0,0,4,0,1};&lt;BR /&gt;UINT8&amp;nbsp; status[2];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCU_init();&lt;BR /&gt;Config_ports();&lt;BR /&gt;EnableInterrupts; /* enable interrupts */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;CAN_Init(FAST);&lt;BR /&gt;CAN_ConfigMB (1,&amp;nbsp; TXDF, 1);&lt;BR /&gt;CAN_ConfigMB (0,&amp;nbsp; RXDF, 0);&lt;/P&gt;&lt;P&gt;///receive data&lt;BR /&gt;/*do{&lt;BR /&gt;&amp;nbsp; (void)CAN_CheckStatusMB( 0, status );&lt;BR /&gt;&amp;nbsp; }while ( status[0] != NEWDATA);&lt;BR /&gt;&amp;nbsp; CAN_ReadDataMB(0,data );&lt;BR /&gt;&amp;nbsp;*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/// transmit data&lt;BR /&gt;CAN_LoadMB(1, data);&lt;BR /&gt;CAN_TransmitMB(1) ;&lt;BR /&gt;do{&lt;BR /&gt;&amp;nbsp; (void)CAN_CheckStatusMB(1, status);&lt;BR /&gt;&amp;nbsp;} while(status[0] != TRANSMITTED);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Morrison.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Morrison on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-02-23&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;03:10 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2009 23:09:25 GMT</pubDate>
    <dc:creator>Morrison</dc:creator>
    <dc:date>2009-02-23T23:09:25Z</dc:date>
    <item>
      <title>MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155422#M4438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm working with MCF51AC microcontroller, and I found some problems when I tried to use the MSCAN drivers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interrupts (CAN_TransmitISR, CAN_ReceiveISR, CAN_WakeupISR) aren't executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found an error in the function "CAN_QueueMB", when the transmitted interrupt flag is setting on (CANTFLG register):&lt;/P&gt;&lt;P&gt;if (MB_MSCAN[0] == 0xff)&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ......&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ......&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CANTFLG = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ......&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;This is wrong, the interrupt flag enable when TX buffer 0 is full (loaded with a message due for transmission ) is:&lt;BR /&gt;CANTFLG = 0x06;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the register value, the CAN_TransmitISR is executed, but the transmission is not correct. I'll have to find the problem :-(( .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also, I have problems with receiver canbus data, the data fills the bufferCANRX (@ffff989f) and seems to be OK, but&amp;nbsp;the tx interrupt isn't executed (the address filter is all FF)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my MSCAN test code:&lt;/P&gt;&lt;P&gt;UINT8 data[] = {8,0,0,7,0,0,4,0,1};&lt;BR /&gt;UINT8&amp;nbsp; status[2];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCU_init();&lt;BR /&gt;Config_ports();&lt;BR /&gt;EnableInterrupts; /* enable interrupts */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;CAN_Init(FAST);&lt;BR /&gt;CAN_ConfigMB (1,&amp;nbsp; TXDF, 1);&lt;BR /&gt;CAN_ConfigMB (0,&amp;nbsp; RXDF, 0);&lt;/P&gt;&lt;P&gt;///receive data&lt;BR /&gt;/*do{&lt;BR /&gt;&amp;nbsp; (void)CAN_CheckStatusMB( 0, status );&lt;BR /&gt;&amp;nbsp; }while ( status[0] != NEWDATA);&lt;BR /&gt;&amp;nbsp; CAN_ReadDataMB(0,data );&lt;BR /&gt;&amp;nbsp;*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/// transmit data&lt;BR /&gt;CAN_LoadMB(1, data);&lt;BR /&gt;CAN_TransmitMB(1) ;&lt;BR /&gt;do{&lt;BR /&gt;&amp;nbsp; (void)CAN_CheckStatusMB(1, status);&lt;BR /&gt;&amp;nbsp;} while(status[0] != TRANSMITTED);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Morrison.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Morrison on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-02-23&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;03:10 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 23:09:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155422#M4438</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2009-02-23T23:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155423#M4439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CANTFLG = 1; will clear CANTFLG bit 0 and shedule TX buffer 0 for transmission&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CANTFLG = 6; will clear CANTFLG bits 1 and 2 and shedule TX buffers 1 and 2 for transmission&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using some ready to use software driver, the you should name it properly. Others may have no idea what driver you are using.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 00:08:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155423#M4439</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-02-24T00:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155424#M4440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry,..., we are talking about the MSCAN driver, and MCF51AC256 microcontroller&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was lost when I spoke about a mistake in the MSCAN code, ... when you write 1 in CANTFLG, clears flag, and when you write 0 is ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to sent or receive a message, ISR's aren't executed because CAN controller doesn't put the flags in CANRFLG and CANTFLG registers, for example, when I try to receive&amp;nbsp;data, the RX CAN buffer fills up with&amp;nbsp;the correct&amp;nbsp;identifier, data, timestamp, but the CAN RX flag in the CANRFLG register stills to 0, and, of course, the receive ISR isn't executed,&amp;nbsp;Why????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 19:01:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155424#M4440</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2009-02-24T19:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155425#M4441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Is&amp;nbsp;acceptance filters setup OK? RXF flag is set only when&amp;nbsp;received message passes through one of acceptance filters.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 20:37:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155425#M4441</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-02-24T20:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155426#M4442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank's for your help.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aceptance filters are setup to "FF".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define ID_CODE0_CAN 0xFF&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;define ID_CODE7_CAN 0xFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define ID_MASK0_CAN 0xFF&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;define ID_MASK7_CAN 0xFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to configure the loopback selt test mode in CANCTR1 register, and it works correctly, I can transmit and receicer my own messages, but when I try to receive or transmit a external message to another can bus node, fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I captured with a scope the TXcan and RXcan data frame's, and seems to be ok .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a usb-canbus interface (&lt;A href="http://www.canusb.com/"&gt;www.canusb.com&lt;/A&gt;) to test the canbus controller of MCF51AC256, but I supose that it can't be a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 23:03:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155426#M4442</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2009-02-24T23:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155427#M4443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;more news,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I configure the &lt;U&gt;Listen only mode in CANCRL1 register, I can receive a external CANbus&amp;nbsp;message,&lt;/U&gt;&amp;nbsp;&amp;nbsp;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; but, of course, I can't transmit nothing&amp;nbsp; &lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 23:23:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155427#M4443</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2009-02-24T23:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155428#M4444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and finally,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define PROP_SEG_CAN&amp;nbsp;&amp;nbsp; 11&lt;BR /&gt;#define PHASE_SEG1_CAN 2&lt;BR /&gt;#define PHASE_SEG2_CAN 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;It works &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;before I did this change I used:&lt;/P&gt;&lt;P&gt;#define PROP_SEG_CAN&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;#define PHASE_SEG1_CAN 4&lt;/P&gt;&lt;P&gt;#define PHASE_SEG2_CAN 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 23:46:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155428#M4444</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2009-02-24T23:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155429#M4445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you post a bit of code ?&lt;/P&gt;&lt;P&gt;i am working with that chips and i have a lot of issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 19:22:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155429#M4445</guid>
      <dc:creator>flameman</dc:creator>
      <dc:date>2011-06-29T19:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN driver problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155430#M4446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a long time (nearly 6 years) between your initial questions and these latest ones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Aceptance [sic] filters are setup to "FF".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you set up CANIDAC properly? I guess if you're receiving Loopback frames then you probably have the filters set up OK. The Reference Manual implies the filters have to be set up for loopback to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; but when I try to receive or transmit a external message to another can bus node, fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be getting received data or you should be getting errors. Put some code in there to indicate what errors you're getting and that may point to your problem. You should also check the other end (usb-canbus interface) to see if it is reporting errors on packets you're sending from MSCAN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I captured with a scope the TXcan and RXcan data frame's, and seems to be ok .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check them again. You've probably got a mismatch between the bit-rate on the MSCAN controller and what you've programmed the USB-CAN device to. Send some packets from the USB-CAN device and monitor them on the Oscilloscope - compare the bit period with the ones the MSCAN device is generating. That should show any problem with this part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 02:17:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-driver-problems/m-p/155430#M4446</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2015-01-06T02:17:00Z</dc:date>
    </item>
  </channel>
</rss>

