<?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>MQX Software SolutionsのトピックSPI PCS0 not functional on MK20DN512VLK10</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272003#M8366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="MsoNormal"&gt;I am using SPI0 on a MK20DN512VLK10 with MQX 4.0 and having trouble getting anything out of PC0. &lt;/P&gt;&lt;P class="MsoNormal"&gt;_bsp_dspi_io_init has been modified for the pins on PORTA…&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;0&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* Configure GPIOD for SPI0 peripheral function */&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (PORT_MemMapPtr)PORTA_BASE_PTR;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;14&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.PCS0&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;15&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.SCK&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;16&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.SOUT&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;17&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.SIN&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* Enable clock gate to SPI0 module */&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sim&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;SCGC6 &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;|=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SIM_SCGC6_SPI0_MASK;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;The io channel is initialized and accessed with…&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;adc_spi &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;fopen &lt;/STRONG&gt;(ADC_CHANNEL, NULL);&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (NULL &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;==&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; adc_spi)&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;500000&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;SPAN style="mso-tab-count: 4;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set baud rate&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_BAUD, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SPI_CLK_POL_PHA_MODE0;&lt;SPAN style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set clock mode&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_MODE, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SPI_DEVICE_BIG_ENDIAN;&lt;SPAN style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set endianess&lt;SPAN style="mso-tab-count: 1;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_ENDIAN, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SPI_DEVICE_MASTER_MODE;&lt;SPAN style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set transfer mode&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_TRANSFER_MODE, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;SPAN style="mso-tab-count: 5;"&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;&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; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set CS0&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl&lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_CS, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (SPI_OK != ioctl (adc_spi, IO_IOCTL_SPI_READ_WRITE, &amp;amp;adc_rw))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;error = TRUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;I used the IAR debugger to examine the registers and verified that the PortA PCR[14] through PCR[17] are set correctly with avalue of 0x200.&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;I also verified that the SPI0 PUSHR has both CONT=1 and PCS=0x01.&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; The SPI data lines and clock are all working but &lt;/SPAN&gt;PORTA[14] just sits there in a high impedance state.&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;Am I missing a step to enable PCS0 as an output?&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Oct 2013 02:06:44 GMT</pubDate>
    <dc:creator>daviduhen</dc:creator>
    <dc:date>2013-10-10T02:06:44Z</dc:date>
    <item>
      <title>SPI PCS0 not functional on MK20DN512VLK10</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272003#M8366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="MsoNormal"&gt;I am using SPI0 on a MK20DN512VLK10 with MQX 4.0 and having trouble getting anything out of PC0. &lt;/P&gt;&lt;P class="MsoNormal"&gt;_bsp_dspi_io_init has been modified for the pins on PORTA…&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;0&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* Configure GPIOD for SPI0 peripheral function */&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (PORT_MemMapPtr)PORTA_BASE_PTR;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;14&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.PCS0&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;15&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.SCK&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;16&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.SOUT&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;pctl&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;PCR[&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;17&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;] &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;PORT_PCR_MUX&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;);&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* DSPI0.SIN&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*/&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;/* Enable clock gate to SPI0 module */&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sim&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;SCGC6 &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;|=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SIM_SCGC6_SPI0_MASK;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;The io channel is initialized and accessed with…&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;adc_spi &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;fopen &lt;/STRONG&gt;(ADC_CHANNEL, NULL);&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (NULL &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;==&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; adc_spi)&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;500000&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;SPAN style="mso-tab-count: 4;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set baud rate&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_BAUD, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SPI_CLK_POL_PHA_MODE0;&lt;SPAN style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set clock mode&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_MODE, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SPI_DEVICE_BIG_ENDIAN;&lt;SPAN style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set endianess&lt;SPAN style="mso-tab-count: 1;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_ENDIAN, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; SPI_DEVICE_MASTER_MODE;&lt;SPAN style="mso-tab-count: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set transfer mode&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl &lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_TRANSFER_MODE, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: olive;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;SPAN style="mso-tab-count: 5;"&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;&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; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; font-family: 'Courier New';"&gt;// set CS0&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="color: black; font-size: 10.0pt; mso-spacerun: yes; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; (SPI_OK &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;!=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;ioctl&lt;/STRONG&gt;(adc_spi, IO_IOCTL_SPI_SET_CS, &amp;amp;param))&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;error &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; font-family: 'Courier New';"&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; TRUE;&lt;BR /&gt; &lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (SPI_OK != ioctl (adc_spi, IO_IOCTL_SPI_READ_WRITE, &amp;amp;adc_rw))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;error = TRUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;I used the IAR debugger to examine the registers and verified that the PortA PCR[14] through PCR[17] are set correctly with avalue of 0x200.&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;I also verified that the SPI0 PUSHR has both CONT=1 and PCS=0x01.&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; The SPI data lines and clock are all working but &lt;/SPAN&gt;PORTA[14] just sits there in a high impedance state.&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;Am I missing a step to enable PCS0 as an output?&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 02:06:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272003#M8366</guid>
      <dc:creator>daviduhen</dc:creator>
      <dc:date>2013-10-10T02:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: SPI PCS0 not functional on MK20DN512VLK10</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272004#M8367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By adding...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fflush (adc_spi);&lt;/P&gt;&lt;P&gt;before and after the IO_IOCTL_SPI_READ_WRITE call I was able to get the PCS0 line active.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function fflush() ends up calling _dspi_cs_deassert().&amp;nbsp; This toggles the MSTR and HALT bits in the SPI_MCR register.&lt;/P&gt;&lt;P&gt;The reference manual describes HALT with "Starts and stops the module transmissions".&amp;nbsp;&amp;nbsp; It makes sense that this bit has to&lt;/P&gt;&lt;P&gt;be toggled after each transmission.&amp;nbsp; I'm not sure why MSTR is being toggled or why HALT has to be toggled before PCS0 will&lt;/P&gt;&lt;P&gt;become active for the first time.&amp;nbsp; Until you call this function the PCS0 line is tri-stated.&amp;nbsp; That might cause problems for the first&lt;/P&gt;&lt;P&gt;transmission from the SPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the moral to the story is like my mom used to say "Always remember to fflush".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 03:25:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272004#M8367</guid>
      <dc:creator>daviduhen</dc:creator>
      <dc:date>2013-10-11T03:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: SPI PCS0 not functional on MK20DN512VLK10</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272005#M8368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try looking at the SPIx_MCR register - specifically SPI_MCR_PCSIS to enable the specific CS you desire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 14:00:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SPI-PCS0-not-functional-on-MK20DN512VLK10/m-p/272005#M8368</guid>
      <dc:creator>Hab</dc:creator>
      <dc:date>2013-10-14T14:00:33Z</dc:date>
    </item>
  </channel>
</rss>

