<?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 CodeWarrior 8- &amp; 16-bit tools: CAN Bean on HC08AZ60 in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-8-16-bit-tools-CAN-Bean-on-HC08AZ60/m-p/124798#M104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Posted: Sep 28, 2005 - 07:32 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;BR /&gt;I'm developing an application with CAN beam.&lt;BR /&gt;I set-up bit timing correctly bit-timing and I'm able to send messages with SendFrame but seems that OnFullRxBuffer event is never invoked, even OnReceiverErrorPassive/OnBusOff are invoked, instead OnFreeTxBuffer is called.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm sending two messages on bus with CANalyzer, this is CAN init :&lt;/P&gt;&lt;P&gt;void CAN1_Init(void)&lt;BR /&gt;{&lt;BR /&gt;/* CMCR0: ??=0,??=0,??=0,SYNCH=0,TLNKEN=0,SLPAK=0,SLPRQ=0,SFTRES=1 */&lt;BR /&gt;CMCR0 = 1; /* CAN reset */&lt;BR /&gt;/* CMCR1: ??=0,??=0,??=0,??=0,??=0,LOOPB=0,WUPM=0,CLKSRC=0 */&lt;BR /&gt;setReg8(CMCR1, 0);&lt;BR /&gt;/* CIDAC: IDAM1=0,IDAM0=0 */&lt;BR /&gt;clrReg8Bits(CIDAC, 4;&lt;BR /&gt;CIDAR0 = 0; /* Set the acceptance code, register CIDAR0 */&lt;BR /&gt;CIDAR1 = 0; /* Set the acceptance code, register CIDAR1 */&lt;BR /&gt;CIDAR2 = 0; /* Set the acceptance code, register CIDAR2 */&lt;BR /&gt;CIDAR3 = 0; /* Set the acceptance code, register CIDAR3 */&lt;BR /&gt;CIDMR0 = 0; /* Set the acceptance mask, register CIDMR0 */&lt;BR /&gt;CIDMR1 = 0; /* Set the acceptance mask, register CIDMR1 */&lt;BR /&gt;CIDMR2 = 0; /* Set the acceptance mask, register CIDMR2 */&lt;BR /&gt;CIDMR3 = 0; /* Set the acceptance mask, register CIDMR3 */&lt;BR /&gt;/* CBTR0: SJW1=1,SJW0=1,BRP5=0,BRP4=0,BRP3=0,BRP2=1,BRP1=0,BRP0=0 */&lt;BR /&gt;setReg8(CBTR0, 196);&lt;BR /&gt;/* CBTR1: SAMP=1,TSEG22=1,TSEG21=0,TSEG20=1,TSEG13=1,TSEG12=1,TSEG11=0,TSEG10=0 */&lt;BR /&gt;setReg8(CBTR1, 220);&lt;BR /&gt;CMCR1_CLKSRC=0; /* Select the clock source */&lt;BR /&gt;CMCR0 &amp;amp;= ~1; /* Start the device */&lt;BR /&gt;/* CRIER: WUPIE=0,RWRNIE=1,TWRNIE=1,RERRIE=1,TERRIE=1,BOFFIE=1,OVRIE=1,RXFIE=1 */&lt;BR /&gt;CRIER = 127; /* Enable interrupts */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;as you can see RXFIE = 1 so RX interrupt is enabled, acceptable mask is zero, why is OnFullRxBuffer never called ?&lt;/P&gt;&lt;P&gt;Thanks a lof for any help.&lt;/P&gt;&lt;P&gt;Luis.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Posted: Oct 04, 2005 - 09:04 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;According CAN bean initialization the Acceptance code property is set to 0 and Acceptance mask is set to 0 too. It means that messages are accepted only if acceptance code is 0.&lt;/P&gt;&lt;P&gt;Please try to set Acceptance Mask to 0xFFFF value and any message should be accepted.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Oct 04, 2005 - 11:45 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PEXPERT wrote:&lt;BR /&gt;According CAN bean initialization the Acceptance code property is set to 0 and Acceptance mask is set to 0 too. It means that messages are accepted only if acceptance code is 0.&lt;/P&gt;&lt;P&gt;Please try to set Acceptance Mask to 0xFFFF value and any message should be accepted.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Yes, you are right, but when I tried to set mask to 0xFFFF I put wrong parameters in ReadFrame function inside OnFullRxBuffer function. This caused CAN communication to *freeze* and CANalyzer showed ErrorFrame, so I thought there was error in mask ...&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Now it works correctly.&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;Luis.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jan 2006 01:35:56 GMT</pubDate>
    <dc:creator>marc_paquette</dc:creator>
    <dc:date>2006-01-28T01:35:56Z</dc:date>
    <item>
      <title>CodeWarrior 8- &amp; 16-bit tools: CAN Bean on HC08AZ60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-8-16-bit-tools-CAN-Bean-on-HC08AZ60/m-p/124798#M104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Posted: Sep 28, 2005 - 07:32 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;BR /&gt;I'm developing an application with CAN beam.&lt;BR /&gt;I set-up bit timing correctly bit-timing and I'm able to send messages with SendFrame but seems that OnFullRxBuffer event is never invoked, even OnReceiverErrorPassive/OnBusOff are invoked, instead OnFreeTxBuffer is called.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm sending two messages on bus with CANalyzer, this is CAN init :&lt;/P&gt;&lt;P&gt;void CAN1_Init(void)&lt;BR /&gt;{&lt;BR /&gt;/* CMCR0: ??=0,??=0,??=0,SYNCH=0,TLNKEN=0,SLPAK=0,SLPRQ=0,SFTRES=1 */&lt;BR /&gt;CMCR0 = 1; /* CAN reset */&lt;BR /&gt;/* CMCR1: ??=0,??=0,??=0,??=0,??=0,LOOPB=0,WUPM=0,CLKSRC=0 */&lt;BR /&gt;setReg8(CMCR1, 0);&lt;BR /&gt;/* CIDAC: IDAM1=0,IDAM0=0 */&lt;BR /&gt;clrReg8Bits(CIDAC, 4;&lt;BR /&gt;CIDAR0 = 0; /* Set the acceptance code, register CIDAR0 */&lt;BR /&gt;CIDAR1 = 0; /* Set the acceptance code, register CIDAR1 */&lt;BR /&gt;CIDAR2 = 0; /* Set the acceptance code, register CIDAR2 */&lt;BR /&gt;CIDAR3 = 0; /* Set the acceptance code, register CIDAR3 */&lt;BR /&gt;CIDMR0 = 0; /* Set the acceptance mask, register CIDMR0 */&lt;BR /&gt;CIDMR1 = 0; /* Set the acceptance mask, register CIDMR1 */&lt;BR /&gt;CIDMR2 = 0; /* Set the acceptance mask, register CIDMR2 */&lt;BR /&gt;CIDMR3 = 0; /* Set the acceptance mask, register CIDMR3 */&lt;BR /&gt;/* CBTR0: SJW1=1,SJW0=1,BRP5=0,BRP4=0,BRP3=0,BRP2=1,BRP1=0,BRP0=0 */&lt;BR /&gt;setReg8(CBTR0, 196);&lt;BR /&gt;/* CBTR1: SAMP=1,TSEG22=1,TSEG21=0,TSEG20=1,TSEG13=1,TSEG12=1,TSEG11=0,TSEG10=0 */&lt;BR /&gt;setReg8(CBTR1, 220);&lt;BR /&gt;CMCR1_CLKSRC=0; /* Select the clock source */&lt;BR /&gt;CMCR0 &amp;amp;= ~1; /* Start the device */&lt;BR /&gt;/* CRIER: WUPIE=0,RWRNIE=1,TWRNIE=1,RERRIE=1,TERRIE=1,BOFFIE=1,OVRIE=1,RXFIE=1 */&lt;BR /&gt;CRIER = 127; /* Enable interrupts */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;as you can see RXFIE = 1 so RX interrupt is enabled, acceptable mask is zero, why is OnFullRxBuffer never called ?&lt;/P&gt;&lt;P&gt;Thanks a lof for any help.&lt;/P&gt;&lt;P&gt;Luis.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Posted: Oct 04, 2005 - 09:04 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;According CAN bean initialization the Acceptance code property is set to 0 and Acceptance mask is set to 0 too. It means that messages are accepted only if acceptance code is 0.&lt;/P&gt;&lt;P&gt;Please try to set Acceptance Mask to 0xFFFF value and any message should be accepted.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Oct 04, 2005 - 11:45 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PEXPERT wrote:&lt;BR /&gt;According CAN bean initialization the Acceptance code property is set to 0 and Acceptance mask is set to 0 too. It means that messages are accepted only if acceptance code is 0.&lt;/P&gt;&lt;P&gt;Please try to set Acceptance Mask to 0xFFFF value and any message should be accepted.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Yes, you are right, but when I tried to set mask to 0xFFFF I put wrong parameters in ReadFrame function inside OnFullRxBuffer function. This caused CAN communication to *freeze* and CANalyzer showed ErrorFrame, so I thought there was error in mask ...&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Now it works correctly.&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;Luis.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2006 01:35:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-8-16-bit-tools-CAN-Bean-on-HC08AZ60/m-p/124798#M104</guid>
      <dc:creator>marc_paquette</dc:creator>
      <dc:date>2006-01-28T01:35:56Z</dc:date>
    </item>
  </channel>
</rss>

