<?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 How to enable SCLK in SSP1 in SPI mode in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599000#M23200</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using gcc to develop firmware for a LPC43xx chip.&amp;nbsp;I need to use the SSP1 peripheral to read a temperature from a MAX31855 thermocouple converter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I need to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Pull the CS line down&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;Wait and read the output from the MAX31855&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have successfully programmed the chip to use the SSP0 channel, however when I try to use the SSP1 channel no clock is generated in the pin PF_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I write any value to the DR register from the SSP1 it is written to the MOSI pin&amp;nbsp;(P1_4), however no clock is generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my configuration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_CGU-&amp;gt;BASE_CLK[CLK_BASE_SSP1] = (1 &amp;lt;&amp;lt; 11) | (CLKIN_MAINPLL &amp;lt;&amp;lt; 24); //enable SSP1 clock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SCU-&amp;gt;SPFP1_4 = 0xF5; //set P1_4 as function 5&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(SSP1_MOSI), EPD=0, EPUN=1,EZI=1,ZIF=1, EHS = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SCU-&amp;gt;SPFP1_3 = 0xF5; //set P1_3 as function 5&lt;SPAN&gt;&amp;nbsp;(SSP1_MISO), EPD=0, EPUN=1,EZI=1,ZIF=1, EHS = 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LPC_SCU-&amp;gt;SPFPF_4 = 0xF0; //set PF_4 as function 0 (SSP1_CLK), EPD=0, EPUN=1,EZI=1,ZIF=1, EHS = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_SSP1&amp;gt;CR0 = 0x650F;&amp;nbsp;&amp;nbsp;&amp;nbsp;//SPI Mode, 16bit, SPOL=0, CPHA=0, SCR = 0x65&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP1&lt;/SPAN&gt;&amp;gt;CR1 = 0; //Master Mode&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SSP1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;CPSR = 2; // prescaler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SSP1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;CR1 |= (1&amp;lt;&amp;lt;1)&lt;/SPAN&gt;&lt;SPAN&gt;; //Enable SSP1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After running this code, if I write a value to the LPC_SSP1-&amp;gt;DR register I can see the output in MOSI pin, however no clock is generated. Similar config in the SSP0 works. Any help?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2016 17:35:09 GMT</pubDate>
    <dc:creator>marcosfg</dc:creator>
    <dc:date>2016-09-30T17:35:09Z</dc:date>
    <item>
      <title>How to enable SCLK in SSP1 in SPI mode</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599000#M23200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using gcc to develop firmware for a LPC43xx chip.&amp;nbsp;I need to use the SSP1 peripheral to read a temperature from a MAX31855 thermocouple converter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I need to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Pull the CS line down&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;Wait and read the output from the MAX31855&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have successfully programmed the chip to use the SSP0 channel, however when I try to use the SSP1 channel no clock is generated in the pin PF_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I write any value to the DR register from the SSP1 it is written to the MOSI pin&amp;nbsp;(P1_4), however no clock is generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my configuration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_CGU-&amp;gt;BASE_CLK[CLK_BASE_SSP1] = (1 &amp;lt;&amp;lt; 11) | (CLKIN_MAINPLL &amp;lt;&amp;lt; 24); //enable SSP1 clock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SCU-&amp;gt;SPFP1_4 = 0xF5; //set P1_4 as function 5&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(SSP1_MOSI), EPD=0, EPUN=1,EZI=1,ZIF=1, EHS = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SCU-&amp;gt;SPFP1_3 = 0xF5; //set P1_3 as function 5&lt;SPAN&gt;&amp;nbsp;(SSP1_MISO), EPD=0, EPUN=1,EZI=1,ZIF=1, EHS = 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LPC_SCU-&amp;gt;SPFPF_4 = 0xF0; //set PF_4 as function 0 (SSP1_CLK), EPD=0, EPUN=1,EZI=1,ZIF=1, EHS = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_SSP1&amp;gt;CR0 = 0x650F;&amp;nbsp;&amp;nbsp;&amp;nbsp;//SPI Mode, 16bit, SPOL=0, CPHA=0, SCR = 0x65&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP1&lt;/SPAN&gt;&amp;gt;CR1 = 0; //Master Mode&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SSP1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;CPSR = 2; // prescaler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SSP1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;CR1 |= (1&amp;lt;&amp;lt;1)&lt;/SPAN&gt;&lt;SPAN&gt;; //Enable SSP1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After running this code, if I write a value to the LPC_SSP1-&amp;gt;DR register I can see the output in MOSI pin, however no clock is generated. Similar config in the SSP0 works. Any help?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 17:35:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599000#M23200</guid>
      <dc:creator>marcosfg</dc:creator>
      <dc:date>2016-09-30T17:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable SCLK in SSP1 in SPI mode</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599001#M23201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I ve been struggling with spi myself so i have a basic understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not quit sure what are you asking. If I am getting it wrong please reply and be more specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all i2c is more straight forward and "suitable" for sensor reading. I think its the best practice, but let's focus on spi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use LPCOpen examples for ssp (Are you using them?)&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc-cortex-m4/lpc4300-cortex-m4-m0/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX" title="http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc-cortex-m4/lpc4300-cortex-m4-m0/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX"&gt;LPCOpen Software for LPC43XX|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Inside main function there is a Board_SSP_Init funtion.&lt;/P&gt;&lt;P&gt;This function uses the Chip_SCU_PinMuxSet function to set spi pins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. According to datasheet (what model of dev board do u have?) you can do sth like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below code is from lpcopen ssp example for 4367 dev board.&lt;/P&gt;&lt;P&gt;if (pSSP == LPC_SSP1) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x1, 5, (SCU_PINIO_FAST | SCU_MODE_FUNC5));&amp;nbsp; /* P1.5 =&amp;gt; SSEL1 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0xF, 4, (SCU_PINIO_FAST | SCU_MODE_FUNC0));&amp;nbsp; /* PF.4 =&amp;gt; SCK1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x1, 4, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5)); /* P1.4 =&amp;gt; MOSI1 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x1, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5)); /* P1.3 =&amp;gt; MISO1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when i wanted to initialize and set SSP0 i added&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else if (pSSP == LPC_SSP0) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x1, 0, (SCU_PINIO_FAST | SCU_MODE_FUNC5));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x3, 0, (SCU_PINIO_FAST | SCU_MODE_FUNC4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x1, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SCU_PinMuxSet(0x1, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC5));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code and the lpcopen example is configured to auto toggle the cs line every sent frame. If you want a different functionality of chip select you should assign chip select to gpio pins so that you can manually manipulate them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ive tried both and worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are welcome for any further details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below link is my feedback on how manual gpio chip select works&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/433611"&gt;SSEL as Gpio for SSP/SPI&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 15:23:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599001#M23201</guid>
      <dc:creator>dimitrissideris</dc:creator>
      <dc:date>2016-10-03T15:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable SCLK in SSP1 in SPI mode</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599002#M23202</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 think I have the same problem with the SSP1 clock. I'm using the LPC4357 OEM Board with the dev kit from embedded artists and work with the lpcOpen_2.09.&lt;BR /&gt;I can also measure the MOSI signals but have problems with the SCK signal. After some measurements I found the SCK signal with a very low amplitude of ~60mV. So I think there are no problems within the code. After that I isolated the SCK signal from the dev kit and measured the signal direkt at the LPC4357 the signal was then ~0,5V thats mor but definitely not enought to drive the bus.&lt;/P&gt;&lt;P&gt;@marco gomes: Could you solve your problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any ideas what could be the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2017 10:54:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-enable-SCLK-in-SSP1-in-SPI-mode/m-p/599002#M23202</guid>
      <dc:creator>michaelschuehle</dc:creator>
      <dc:date>2017-04-12T10:54:03Z</dc:date>
    </item>
  </channel>
</rss>

