<?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: CRC_8 for Kinetis K60? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205431#M3166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also need the functionality of CRC 8 in K60, using MQX. I am not using Processor Expert, since I am Keil's uVision4 user.&lt;/P&gt;&lt;P&gt;Any suggestion for how to generate CRC_8 while using the advantages of the Kinetis CRC module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, I found the following command in MQX userguide: &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;_mem_sum_ip&lt;/STRONG&gt; - Gets the one’s complement checksum over the block of memory.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;However, it seems to be generating CRC16 only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lior.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 May 2013 14:48:22 GMT</pubDate>
    <dc:creator>panpwr</dc:creator>
    <dc:date>2013-05-26T14:48:22Z</dc:date>
    <item>
      <title>CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205427#M3162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to implement&amp;nbsp; SAE J1850 crc_8 using CRC Module in K60.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The CRC Module generates crc_16/32-bit codes but crc_8 is required.&lt;/P&gt;&lt;P&gt;I'm thinking this should not be a problem but am not having any success&lt;/P&gt;&lt;P&gt;getting expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input data:&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;&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; 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;Expected output (complemented):&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; 0x0074&lt;/P&gt;&lt;P&gt;Actual output (complemented):&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; 0x30FF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not have alot of experience with CRC and maybe am interpreting the&lt;/P&gt;&lt;P&gt;calculation incorrectly or need an extra logical to perform on the CRC output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the complete code; any of you guys with experience using CRC got any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void Main_task(uint_32 initial_data)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint_32 result=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Enable CRC module */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SIM_SCGC6 |= SIM_SCGC6_CRC_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Configure CRC_CTRL for 16-bit and complement read */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;CTRL&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp; CRC_CTRL_FXOR_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;CTRL&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;amp;=&amp;nbsp;&amp;nbsp; &amp;nbsp; ~CRC_CTRL_TCRC_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Write SAEJ1850 polynomial to CRC_GPOLY register - SAE J1850 CRC: X8 + X4 + X3 + X2 + 1 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;GPOLY_ACCESS16BIT.GPOLYL&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;0x11D;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Configure CRC_CTRL for seed */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;CTRL&amp;nbsp;&amp;nbsp; &amp;nbsp;|=&amp;nbsp;&amp;nbsp; &amp;nbsp; (CRC_CTRL_WAS_MASK);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Seed CRC with all ones */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//CRC_BASE_PTR-&amp;gt;ACCESS16BIT.CRCH&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;0x0000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;ACCESS16BIT.CRCL&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;0xFFFF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Clear seed bit to start writing data values */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;CTRL&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;amp;=&amp;nbsp;&amp;nbsp; &amp;nbsp; (~CRC_CTRL_WAS_MASK);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Write data to CRC data register */&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;CRC&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;0xFFFFFFFF;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Data */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;ACCESS8BIT.CRCLU &amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;0x00;;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Zeros padding */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Output complement of remainder */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("CRC byte:\t%X&amp;nbsp;&amp;nbsp; \n", (uint_16) CRC_BASE_PTR-&amp;gt;ACCESS16BIT.CRCL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Output remainder */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CRC_BASE_PTR-&amp;gt;CTRL&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;amp;=&amp;nbsp;&amp;nbsp; &amp;nbsp; (~CRC_CTRL_FXOR_MASK);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("CRC byte:\t%X&amp;nbsp;&amp;nbsp; \n", (uint_16) CRC_BASE_PTR-&amp;gt;ACCESS16BIT.CRCL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//_mqx_exit(0);&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Feb 2012 03:54:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205427#M3162</guid>
      <dc:creator>DangerMouse</dc:creator>
      <dc:date>2012-02-12T03:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205428#M3163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IDK if this will help you, but I hope it does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are trying to calculate CRC 8 here is a great website:&lt;/P&gt;&lt;P&gt;&lt;A href="http://smbus.org/faq/crc8Applet.htm" rel="nofollow" target="_blank"&gt;http://smbus.org/faq/crc8Applet.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is the CRC 8 you require, then here is code to make it happen...&amp;nbsp; Code should be easy to implement, but if you have any questions on how to use it no problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*************************************************************************&lt;/P&gt;&lt;P&gt;* Function Name: init_crc8&lt;/P&gt;&lt;P&gt;* Parameters: void&lt;/P&gt;&lt;P&gt;* Return: Loads a static array and sets a static variable flag&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;* Description: Loads a CRC8 polynomial checksum array (256 bytes). Sets the static&lt;/P&gt;&lt;P&gt;* value to indicate the array is loaded.&lt;/P&gt;&lt;P&gt;* STEP 1: Load the array x^8 + x^2 + x + 1&lt;/P&gt;&lt;P&gt;* STEP 2: Set the static varible that the array has been loaded&lt;/P&gt;&lt;P&gt;*************************************************************************/&lt;/P&gt;&lt;P&gt;void&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;init_crc8()&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;i,j;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;unsigned&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;char&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;crc;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;// STEP 1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(!MadeTable)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;for&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(i=0; i&amp;lt;256; i++)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;crc = i;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;for&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(j=0; j&amp;lt;8; j++)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;crc = (crc &amp;lt;&amp;lt; 1) ^ ((crc &amp;amp; 0x80) ? DI : 0);&lt;/P&gt;&lt;P&gt;crc8_table[i] = crc &amp;amp; 0xFF;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;// STEP 2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;MadeTable =&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;// END OF init_crc8&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;/*************************************************************************&lt;/P&gt;&lt;P&gt;* Function Name: crc8&lt;/P&gt;&lt;P&gt;* Parameters: unsigned char *, unsigned char&lt;/P&gt;&lt;P&gt;* Return: Loads a static array and sets a static variable flag&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;* Description: For a byte array whose accumulated crc value is stored in *crc, computes&lt;/P&gt;&lt;P&gt;* resultant crc obtained by appending m to the byte array. Note, befor calling the crc must&lt;/P&gt;&lt;P&gt;* be first set to 0.&lt;/P&gt;&lt;P&gt;* STEP 1: Check if table loaded - if not load&lt;/P&gt;&lt;P&gt;* STEP 2: Calculate the present checksum via use of crc table&lt;/P&gt;&lt;P&gt;*************************************************************************/&lt;/P&gt;&lt;P&gt;void&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;crc8(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;unsigned&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;char&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;*crc,&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;unsigned&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;char&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;m)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;// STEP 1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(!MadeTable)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;init_crc8();&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;// STEP 2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;*crc = crc8_table[(*crc) ^ m];&lt;/P&gt;&lt;P&gt;*crc &amp;amp;= 0xFF;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;// END OF crc8&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 06:33:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205428#M3163</guid>
      <dc:creator>Hab</dc:creator>
      <dc:date>2012-02-14T06:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205429#M3164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hab,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for that info.&amp;nbsp; I am looking at using a hardware solution however, by using the&lt;/P&gt;&lt;P&gt;Kinetis CRC Module. The Kinetis K60 CRC module generates 16/32-bit CRC's and that is fine&lt;/P&gt;&lt;P&gt;but i want to generate an 8-bit CRC. I think this should be possible although i'm not sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already have a working software solution but would like the use of the hardware module if i can&lt;/P&gt;&lt;P&gt;get it going.&amp;nbsp; The code i have posted is using the polynomial required and complementing the remainder output&lt;/P&gt;&lt;P&gt;after CRC checksumming.&amp;nbsp; The output generated however is not the value required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Possible reasons for problem:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;An 8-bit CRC cannot be generated by the Kinetis CRC module&lt;/LI&gt;&lt;LI&gt;An 8-bit CRC can be generated but requires addtional software logic&lt;/LI&gt;&lt;LI&gt;I am interpreting the CRC calculation incorrectly&lt;/LI&gt;&lt;LI&gt;?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has any ideas or is familiar with SAEJ1850 CRC please adivse&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 03:10:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205429#M3164</guid>
      <dc:creator>DangerMouse</dc:creator>
      <dc:date>2012-02-15T03:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205430#M3165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am ising the CRC module on Kinetis K60 and it works. I am not working with MQX but "only" with Processor Expert. After the initialization I only use this siple code to check all my flash program (form 0x00000000 to 0x0003F000):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CRC.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/118540iC1A1CDDC225EA3FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="CRC.jpg" alt="CRC.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that i am usign the CRC8 (CRC1_GetCRC8 function) only because we compare it with anoter CRC Generation code based on 8bit calculating. With Processor Expert is also available a CRC Block calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paolo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 12:00:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205430#M3165</guid>
      <dc:creator>p_vagnoni</dc:creator>
      <dc:date>2013-01-24T12:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205431#M3166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also need the functionality of CRC 8 in K60, using MQX. I am not using Processor Expert, since I am Keil's uVision4 user.&lt;/P&gt;&lt;P&gt;Any suggestion for how to generate CRC_8 while using the advantages of the Kinetis CRC module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, I found the following command in MQX userguide: &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;_mem_sum_ip&lt;/STRONG&gt; - Gets the one’s complement checksum over the block of memory.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;However, it seems to be generating CRC16 only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lior.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 May 2013 14:48:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205431#M3166</guid>
      <dc:creator>panpwr</dc:creator>
      <dc:date>2013-05-26T14:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205432#M3167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif'; color: black;"&gt;Yes, this module just supports CRC-16/32 . No support for 8 bit calculations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 01:57:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205432#M3167</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2014-06-17T01:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205433#M3168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CRC_8 is just a simple lookup in a 256-byte ROM array -- hard to be much simpler in execution speed than CRCresult=CRCtab[CRCold^new_data];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 00:08:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205433#M3168</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2014-06-26T00:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: CRC_8 for Kinetis K60?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205434#M3169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;8-bit CRC actually &lt;STRONG&gt;is possible&lt;/STRONG&gt; with a 16 or 32-bit CRC module.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can convert the 8-bit polynomial into 16-bit by shifting 8 bits to the left, and then to get a 8-bit result do the same to the resulting 16-bit CRC. Similarly, with 32-bit you would need to shift 24 bits to the left.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my more detailed answer to a similar question here: &lt;A href="https://community.nxp.com/thread/502067"&gt;https://community.nxp.com/thread/502067&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2020 21:27:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/CRC-8-for-Kinetis-K60/m-p/205434#M3169</guid>
      <dc:creator>tim_povall</dc:creator>
      <dc:date>2020-05-07T21:27:34Z</dc:date>
    </item>
  </channel>
</rss>

