<?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: Acceptance filter mask in S9S12GA240 microcontroller in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918517#M15114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;My problem is the system there are a lot of other messages and almost all messages are captured by the CANBUS RX interrupt, because the acceptance filter mask is the OR of all standard IDs.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could you explain your understanding with this OR? '1' in filter mask is 'don't care' for corresponding filter bit. So I'm lost understanding what and why do you mean&amp;nbsp;above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not trivial to calculate best filter setup. You should take into account not only ID, but RTR bit as well. There was AN2010 and AN2010SW for this. Don't know though, was this AN only for standard ID's or did it support&amp;nbsp;extended and/or mix of std/ext. If&amp;nbsp;the most of messages has extended ID, 2x32bit filters could be the best, but&amp;nbsp;if not, then 4x16 or even 8x8bit could filter more, it depends&amp;nbsp;on ID's nomenclature. Here's a bit about problem:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www-users.cs.york.ac.uk/~robdavis/papers/RTNS2017CANFilter.pdf"&gt;https://www-users.cs.york.ac.uk/~robdavis/papers/RTNS2017CANFilter.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jul 2019 20:19:30 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2019-07-29T20:19:30Z</dc:date>
    <item>
      <title>Acceptance filter mask in S9S12GA240 microcontroller</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918516#M15113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need a question regarding the acceptance mask of the microcontroller MC9S12GA240. I need to accept both standard and extended ID. In particular the list of the messages is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;- STANDARD: 274h, 518h, 570h, 567h, 565h, 500h, 777h.&lt;/P&gt;&lt;P&gt;&amp;nbsp;- EXTENDED:&amp;nbsp;18DAC3F1h.&lt;/P&gt;&lt;P&gt;Following other topics and documentation present in this community, I created 2 boxes of 32bit, one for extended ID and the other for standard ID.&lt;/P&gt;&lt;P&gt;My problem is the system there are a lot of other messages and almost all messages are captured by the CANBUS RX interrupt, because the acceptance filter mask is the OR of all standard IDs. Then I filter the messages by software, but from my side it is better to filter them before interrupt comes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any suggestion to create a better filter mask? Is it possible to create one mask for 32bit and 2 mask for 16bit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Andrea Cavazzoni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2019 08:01:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918516#M15113</guid>
      <dc:creator>andreacavazzoni</dc:creator>
      <dc:date>2019-07-29T08:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Acceptance filter mask in S9S12GA240 microcontroller</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918517#M15114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;My problem is the system there are a lot of other messages and almost all messages are captured by the CANBUS RX interrupt, because the acceptance filter mask is the OR of all standard IDs.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could you explain your understanding with this OR? '1' in filter mask is 'don't care' for corresponding filter bit. So I'm lost understanding what and why do you mean&amp;nbsp;above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not trivial to calculate best filter setup. You should take into account not only ID, but RTR bit as well. There was AN2010 and AN2010SW for this. Don't know though, was this AN only for standard ID's or did it support&amp;nbsp;extended and/or mix of std/ext. If&amp;nbsp;the most of messages has extended ID, 2x32bit filters could be the best, but&amp;nbsp;if not, then 4x16 or even 8x8bit could filter more, it depends&amp;nbsp;on ID's nomenclature. Here's a bit about problem:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www-users.cs.york.ac.uk/~robdavis/papers/RTNS2017CANFilter.pdf"&gt;https://www-users.cs.york.ac.uk/~robdavis/papers/RTNS2017CANFilter.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2019 20:19:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918517#M15114</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2019-07-29T20:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Acceptance filter mask in S9S12GA240 microcontroller</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918518#M15115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward,&lt;/P&gt;&lt;P&gt;thank you for your reply.&lt;/P&gt;&lt;P&gt;'OR' simply means that the filter mask for BOX1 (the one I want to use for STANDARD IDs) is 7FEh. With this mask almost every message with standard ID is capture by the interrupt.&lt;/P&gt;&lt;P&gt;Since the extended messages have the same initial structure (all messages starts with&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;STRONG&gt;18DA&lt;/STRONG&gt;nnnnh) I could use 4 16bit boxes and use one of these boxes for extended message, by checking the IDE bit. Is it a possible solution?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Andrea Cavazzoni&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 15:45:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918518#M15115</guid>
      <dc:creator>andreacavazzoni</dc:creator>
      <dc:date>2019-07-30T15:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Acceptance filter mask in S9S12GA240 microcontroller</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918519#M15116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrea,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK, understood regarding OR. This is not the right way. I repeat, one in the mask means don't care. You should don't care only bits which you can't make filter for. Lets simplify, say you have just one filter. You need to compare all ID's bit by bit and set mask bit only if bits differ:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1010&lt;/P&gt;&lt;P&gt;1100&lt;/P&gt;&lt;P&gt;1110&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mask:&lt;/P&gt;&lt;P&gt;0110 - first and last bit are the same in all your IDs, 0 in the mask,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inner bits differ from bit to bit&lt;/P&gt;&lt;P&gt;filter:&lt;/P&gt;&lt;P&gt;1000 - first and last bit, which you 'do care'&amp;nbsp;you need to set to match&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all your id's. Bits which you 'don't care' can be&amp;nbsp;any&amp;nbsp;in the filter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's one point. Another point you should keep in mind that filters operate not on identifiers, like your 18DAC3F1h or 274h, but on the ID mapping. See Figures 18-24 "Receive/Transmit Message Buffer — Extended Identifier Mapping" and 18-25 "Receive/Transmit Message Buffer — Standard Identifier Mapping" from MC9S12G RM. Filter compare not ID's but first bytes starting from IDR0. 32bit filter compares IDR0 to IDR3, 16bit filter IDR0 to IDR1, 8 bit filter only IDR0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Since the extended messages have the same initial structure (all messages starts with&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;STRONG&gt;18DA&lt;/STRONG&gt;nnnnh) I could use 4 16bit boxes and use one of these boxes for extended message, by checking the IDE bit. Is it a possible solution?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Yes. But you compare not 18DAnnnn, but &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;((0x18DAC3F1ul &amp;amp; 0x1FFC0000ul) &amp;lt;&amp;lt; 3) |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;0x00180000ul |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;((0x18DAC3F1ul &amp;amp; 0x0003FFFFul) &amp;lt;&amp;lt; 1)&amp;nbsp; = (18D80000h &amp;lt;&amp;lt;3)&amp;nbsp;| 180000h | (2C3F1h &amp;lt;&amp;lt; 1) = C6C00000h | 180000h | 587E2h = C6DD87E2h. So,&amp;nbsp; C6DDnnnn, not 18DAnnnn.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The same with standard ID's, not 274h, but &lt;SPAN style="color: #51626f;"&gt;274h &amp;lt;&amp;lt; 5 = 4E80h. See ID mapping. So you have&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;C6DD, one filter could have 0 mask and C6DD filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;274h, 518h, 570h, 567h, 565h, 500h, 777h shifted left &amp;lt;&amp;lt;5 are :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0100111010000000&lt;/P&gt;&lt;P&gt;1010001100000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1010000000000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1010111000000000&lt;/P&gt;&lt;P&gt;1010110011100000&lt;/P&gt;&lt;P&gt;1010110010100000&lt;/P&gt;&lt;P&gt;1110111011100000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I moved them around to group in to 3 the most visually looking to have similar bits set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3 least significant bits are don't care for standard IDs. Bit3, IDE=0 is do care and should be compared to 0. Now lets calculate filters for those 3 groups&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;0100111010000000&lt;/P&gt;&lt;P&gt;1010001100000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0100111010000000 - for filter setting just chose any one ID from the group&lt;/P&gt;&lt;P&gt;1110110110000111 - mask is&amp;nbsp;0 for equal bits, 1 - for don't care bits, least 3 are don't care since not used in Std.ID compare&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;1010000000000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1010000000000000 - filter&lt;/P&gt;&lt;P&gt;0000000000000111 - mask&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)&lt;/P&gt;&lt;P&gt;1010111000000000&lt;/P&gt;&lt;P&gt;1010110011100000&lt;/P&gt;&lt;P&gt;1010110010100000&lt;/P&gt;&lt;P&gt;1110111011100000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1010111000000000 - filter&lt;/P&gt;&lt;P&gt;0100001011100111 - mask&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) 4th filter, assuming "initial structure" is not &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;STRONG&gt;18DA&lt;/STRONG&gt;nnnnh but 18DA + one more bit.&amp;nbsp;If you look at Extended Identifier Mapping , first two ID registers contain ID28 to ID15 (not ID16):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;So, C6DDxxxx:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;1100011011011101&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;SPAN style="color: #51626f;"&gt;1100011011011101&lt;/SPAN&gt; filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;0000000000000000 mask&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;If initial structure is indeed 18DAnnnn, then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;1100011011011101 filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;0000000000000001 mask&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Please keep in mind that I could make mistake somewhere above. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Edward&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2019 08:59:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918519#M15116</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2019-07-31T08:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Acceptance filter mask in S9S12GA240 microcontroller</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918520#M15117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I forgot one important thing. RTR bit. To receive it both set or cleared, you need to make it don't care in filters for std. identifiers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0100111010000000 - for filter setting just chose any one ID from the group&lt;/P&gt;&lt;P&gt;11101101100&lt;STRONG&gt;1&lt;/STRONG&gt;0111 - mask is&amp;nbsp;0 for equal bits, 1 - for don't care bits, least 3 are don't care since not used in Std.ID compare&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1010000000000000 - filter&lt;/P&gt;&lt;P&gt;00000000000&lt;STRONG&gt;1&lt;/STRONG&gt;0111 - mask&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1010111000000000 - filter&lt;/P&gt;&lt;P&gt;01000010111&lt;STRONG&gt;1&lt;/STRONG&gt;0111 - mask&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2019 09:04:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Acceptance-filter-mask-in-S9S12GA240-microcontroller/m-p/918520#M15117</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2019-07-31T09:04:30Z</dc:date>
    </item>
  </channel>
</rss>

