<?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のトピックRe: MSCAN double Rx interrupt</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218633#M11095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well Thanks Kef!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've got a doubt.... How can I do to send data via Tx ISR?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I do not understand you wrong, inside &lt;SPAN&gt;CAN_LoadBuffer_SID()&lt;/SPAN&gt; I'm transmitting data when I do the following:&lt;/P&gt;&lt;P&gt;CANTFLG = CANTBSEL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then inside &lt;SPAN&gt;CAN_Transmit_Buffer()&lt;/SPAN&gt; when I enable de Transmit Buffer Interrupt, it sends data again, because the flag in CANTFLG is set since that buffer is empt... is that right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess that in order to do what I want to do (transmit data in Tx ISR), I will have to put&amp;nbsp; &lt;SPAN&gt;CAN_LoadBuffer_SID()&lt;/SPAN&gt; inside Tx ISR...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2009 04:24:26 GMT</pubDate>
    <dc:creator>sebasira</dc:creator>
    <dc:date>2009-09-29T04:24:26Z</dc:date>
    <item>
      <title>MSCAN double Rx interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218631#M11093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get to know the MSCAN module, so I've done a simple test program. It's based on the MSCAN Driver and some Application Notes from Freescale (AN2283)... It's done for the DEMOJM board so if you have one, you can try it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I'm having is that the CAN Rx ISR is executed 2 times... in both it receives the same data... the question is... Am I transmitting 2 times or it just receiving 2 times?...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, I clear the CANRFLG twice.. Why? because if I put a break in the first clear instruction and step it, you could see that the falg remains set, but after the second clear it clears. But if I disable that breakpoint and just let it run, the ISR is executed twice... This makes me think that I transmitt twice...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a variable named "pepe" wich is initialized as 0, and then incremented in every CAN data read...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a quick start:&lt;/P&gt;&lt;P&gt;- Button PTG0 sends out data (3 bytes 0x17 0x05 0x85) and toggles PTE2 LED&lt;/P&gt;&lt;P&gt;- Button PTG1 sends out data (3 bytes 0x13 0x10 0x59) and toggles PTE3 LED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate if you could check the MSCAN routines, in MSCAN.c... I guess that's where the problem is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2FCFCOMM%2F7761_CAN_v1.zip" rel="nofollow" target="_blank"&gt;CAN_v1.zip&lt;/A&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-09-29&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:15 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 01:31:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218631#M11093</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2009-09-29T01:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN double Rx interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218632#M11094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In main() you have this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSCAN_buffer = CAN_LoadBuffer_SID(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Cargar el Elemento 0 de la Tabla de&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN_Transmit_Buffer(MSCAN_buffer);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Transmitir el Buffer de MSCAN que se cargo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CAN_LoadBuffer_SID() is sending clearing selected buffer CANFTLG flag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CANTFLG = CANTBSEL;&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;&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; // Buffer seleccionado no esta mas EMPTY, ahora&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CAN_Transmit_Buffer() enables TX interrupt.&amp;nbsp;When&amp;nbsp;CANTFLG flag becomes set, TX ISR gets called, which&amp;nbsp;clears&amp;nbsp;CANTFLG&amp;nbsp;flag and Tx buffer&amp;nbsp;is&amp;nbsp;resent.&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by kef on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-09-28&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:21 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 02:21:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218632#M11094</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-09-29T02:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN double Rx interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218633#M11095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well Thanks Kef!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've got a doubt.... How can I do to send data via Tx ISR?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I do not understand you wrong, inside &lt;SPAN&gt;CAN_LoadBuffer_SID()&lt;/SPAN&gt; I'm transmitting data when I do the following:&lt;/P&gt;&lt;P&gt;CANTFLG = CANTBSEL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then inside &lt;SPAN&gt;CAN_Transmit_Buffer()&lt;/SPAN&gt; when I enable de Transmit Buffer Interrupt, it sends data again, because the flag in CANTFLG is set since that buffer is empt... is that right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess that in order to do what I want to do (transmit data in Tx ISR), I will have to put&amp;nbsp; &lt;SPAN&gt;CAN_LoadBuffer_SID()&lt;/SPAN&gt; inside Tx ISR...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 04:24:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218633#M11095</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2009-09-29T04:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: MSCAN double Rx interrupt</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218634#M11096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want or have to use TX interrupts, then TX ISR should pull data from TX FIFO and send pulled data.&amp;nbsp;When your app is going to send message, some foreground task should push messages to FIFO and&amp;nbsp;enable one or more TX interrupts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:56:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MSCAN-double-Rx-interrupt/m-p/218634#M11096</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-09-29T13:56:30Z</dc:date>
    </item>
  </channel>
</rss>

