<?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: NON MQX SPI Driver in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154693#M357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone have a reference for the code to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_CONFIG_PERIPHERAL﻿&amp;nbsp; ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Sep 2011 07:18:23 GMT</pubDate>
    <dc:creator>aerodame</dc:creator>
    <dc:date>2011-09-27T07:18:23Z</dc:date>
    <item>
      <title>NON MQX SPI Driver</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154690#M354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone here please post a simple non MQX SPI driver for the K40.&lt;/P&gt;&lt;P&gt;I'm looking for a master mode (no ISR based) simple init and transmits&amp;nbsp;\&amp;nbsp;receive functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Eitan.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 23:08:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154690#M354</guid>
      <dc:creator>eitanm</dc:creator>
      <dc:date>2011-07-28T23:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: NON MQX SPI Driver</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154691#M355</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;Here are some snippets from an SPI Flash driver in the uTasker project:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Power up SPI2 and configure for master mode use (50MHz bus, 25MHz speed and 140ns min de-select time)//POWER_UP(3, SIM_SCGC3_SPI2);_CONFIG_PERIPHERAL(D, 11, (PD_11_SPI2_PCS0 | PORT_SRE_FAST | PORT_DSE_HIGH));_CONFIG_PERIPHERAL(D, 12, (PD_12_SPI2_SCK | PORT_SRE_FAST | PORT_DSE_HIGH));_CONFIG_PERIPHERAL(D, 13, (PD_13_SPI2_SOUT | PORT_SRE_FAST | PORT_DSE_HIGH));_CONFIG_PERIPHERAL(D, 14, PD_14_SPI2_SIN);SPI2_CTAR0 = (SPI_CTAR_DBR | SPI_CTAR_FMSZ_8 | SPI_CTAR_PDT_7 | SPI_CTAR_BR_2 | SPI_CTAR_CPHA | SPI_CTAR_CPOL);// Flush SPI FIFO and flags (required before starting transfers)//SPI2_MCR |= SPI_MCR_CLR_RXF;SPI2_SR = (SPI_SR_EOQF | SPI_SR_TFUF | SPI_SR_TFFF | SPI_SR_RFOF | SPI_SR_RFDF);// Write a single byte in a sequence (set byte with value and ulChipSelectLine with CS flag to be used)//SPI2_PUSHR = (byte | SPI_PUSHR_CONT | ulChipSelectLine | SPI_PUSHR_CTAS_CTAR0); // write a single byte to the output FIFO - assert CS line// Write the final byte in a sequence (set byte with value and ulChipSelectLine with CS flag to be used)//SPI2_PUSHR = (byte | SPI_PUSHR_EOQ  | ulChipSelectLine | SPI_PUSHR_CTAS_CTAR0); // write final byte to output FIFO - this will negate the CS line when complete// Wait for reception to complete//while (!(SPI2_SR &amp;amp; SPI_SR_RFDF)) {}&lt;/PRE&gt;&lt;PRE&gt;// Read single data byte from FIFO input//x = (unsigned char)SPI2_POPR;&lt;/PRE&gt;&lt;PRE&gt;// Clear flag - the flag is not self-clearing and needs to be reset by code//SPI2_SR |= SPI_SR_RFDF;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may or may not help (?). The project includes drivers for ATMEL, ST and SST SPI Flash devices - the SPI and the attached devices are simulated for simple verification and project developing/testing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The drivers use the FIFO queuing and the automatic Chip-Select control. The main thing to be aware of is that the reception flag is not self clearing and so one has to be a little careful that it is not left set from previous use, leading to reads that are made too early.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&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>Thu, 29 Oct 2020 08:58:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154691#M355</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T08:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: NON MQX SPI Driver</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154692#M356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Have a look at Processor Expert SSIMaster_LDD. It is very helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 13:04:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154692#M356</guid>
      <dc:creator>georgiad</dc:creator>
      <dc:date>2011-08-01T13:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: NON MQX SPI Driver</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154693#M357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone have a reference for the code to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_CONFIG_PERIPHERAL﻿&amp;nbsp; ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 07:18:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154693#M357</guid>
      <dc:creator>aerodame</dc:creator>
      <dc:date>2011-09-27T07:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: NON MQX SPI Driver</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154694#M358</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;PRE&gt;#define _CONFIG_PERIPHERAL(port, pin, function) SIM_SCGC5 |= SIM_SCGC5_PORT##port; PORT##port##_PCR##pin = function;#define POWER_UP(reg, module)            SIM_SCGC##reg |= (module);          // power up a module (apply clock to it)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These macros are from the uTasker project.&lt;/P&gt;&lt;P&gt;The project also simulates the Kinetis and displays the configured peripheral function for simplified testing / debugging as shown here: &lt;A __default_attr="77616" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/77616" jivemacro="thread" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank" title="https://community.freescale.com/thread/77616"&gt;https://community.freescale.com/thread/77616&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:58:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/NON-MQX-SPI-Driver/m-p/154694#M358</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T08:58:22Z</dc:date>
    </item>
  </channel>
</rss>

