<?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 LPC1769 SPI with CMSIS RTOS V2 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-SPI-with-CMSIS-RTOS-V2/m-p/1085576#M41669</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm trying to get SPI&amp;nbsp;working on the LPC1769 using the CMSIS RTOS v2, and am having some issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to send a 16-bit address (0x7FFE) over the MOSI line to query a register in a peripheral (code is attached). I set up the SPI pins in the RTOS configuration wizard as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/115431i0A126F4AD0657706/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SSEL and SCK pins are outputting pulses correctly, but I'm getting nothing from the MOSI pin. And looking at the values set in the PINSEL0 register after&amp;nbsp;initializing, the pins appear to be set to the correct SPI functions. Is there something I'm forgetting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jul 2020 18:55:12 GMT</pubDate>
    <dc:creator>graham_thomas</dc:creator>
    <dc:date>2020-07-09T18:55:12Z</dc:date>
    <item>
      <title>LPC1769 SPI with CMSIS RTOS V2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-SPI-with-CMSIS-RTOS-V2/m-p/1085576#M41669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm trying to get SPI&amp;nbsp;working on the LPC1769 using the CMSIS RTOS v2, and am having some issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to send a 16-bit address (0x7FFE) over the MOSI line to query a register in a peripheral (code is attached). I set up the SPI pins in the RTOS configuration wizard as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/115431i0A126F4AD0657706/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SSEL and SCK pins are outputting pulses correctly, but I'm getting nothing from the MOSI pin. And looking at the values set in the PINSEL0 register after&amp;nbsp;initializing, the pins appear to be set to the correct SPI functions. Is there something I'm forgetting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2020 18:55:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-SPI-with-CMSIS-RTOS-V2/m-p/1085576#M41669</guid>
      <dc:creator>graham_thomas</dc:creator>
      <dc:date>2020-07-09T18:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769 SPI with CMSIS RTOS V2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-SPI-with-CMSIS-RTOS-V2/m-p/1085577#M41670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Graham,&lt;/P&gt;&lt;P&gt;I suppose that your code has issue:&lt;/P&gt;&lt;P&gt;while (1)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//main loop&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE); //SS active&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Send(&amp;amp;testdata_out, sizeof(testdata_out));&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Send data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;osThreadFlagsWait(0x01, NULL, osWaitForever);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE);&amp;nbsp;&amp;nbsp; &amp;nbsp;//SS inactive&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//SS active&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Receive(&amp;amp;testdata_in, 1);&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;//Receive data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;osThreadFlagsWait(0x01, NULL, osWaitForever);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE); //SS inactive&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;Because you do not post the low level driver of SPI, I suppose that you set up the /SS pin as GPIO mode, &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE) function clears the GPIO, &amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE) function set the GPIO.&lt;/P&gt;&lt;P&gt;I think setting/clearing the GPIO is okay.&lt;/P&gt;&lt;P&gt;But as you know that the SPI is a synchronous mode, in other words, when the transmitter has completed the transfer, the receiver has received the data at the same time.&lt;/P&gt;&lt;P&gt;so you code seems to be:&lt;/P&gt;&lt;P&gt;while (1)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//main loop&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE); //SS active&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Send(&amp;amp;testdata_out, sizeof(testdata_out));&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Send data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;osThreadFlagsWait(0x01, NULL, osWaitForever);&lt;/P&gt;&lt;P&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;SPIdrv-&amp;gt;Receive(&amp;amp;testdata_in, 1);&amp;nbsp; ////Rong modified&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE);&amp;nbsp;&amp;nbsp; &amp;nbsp;//SS inactive&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //deleting the following code&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_ACTIVE);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//SS active&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // SPIdrv-&amp;gt;Receive(&amp;amp;testdata_in, 1);&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;//Receive data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // osThreadFlagsWait(0x01, NULL, osWaitForever);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //SPIdrv-&amp;gt;Control(ARM_SPI_CONTROL_SS, ARM_SPI_SS_INACTIVE); //SS inactive&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;BTW, pls follow up the procedure to in initialize the SSP:&lt;/P&gt;&lt;P&gt;The two SSP interfaces, SSP0 and SSP1 are configured using the following registers:&lt;BR /&gt;1. Power: In the PCONP register (Table 46), set bit PCSSP0 to enable SSP0 and bit&lt;BR /&gt;PCSSP1 to enable SSP1.&lt;BR /&gt;Remark: On reset, both SSP interfaces are enabled (PCSSP0/1 = 1).&lt;BR /&gt;2. Clock: In PCLKSEL0 select PCLK_SSP1; in PCLKSEL1 select PCLK_SSP0 (see&lt;BR /&gt;Section 4.7.3. In master mode, the clock must be scaled down (see Section 18.6.5).&lt;BR /&gt;3. Pins: Select the SSP pins through the PINSEL registers (Section 8.5) and pin modes&lt;BR /&gt;through the PINMODE registers (Section 8.4).&lt;BR /&gt;4. Interrupts: Interrupts are enabled in the SSP0IMSC register for SSP0 and SSP1IMSC&lt;BR /&gt;register for SSP1 Table 376. Interrupts are enabled in the NVIC using the appropriate&lt;BR /&gt;Interrupt Set Enable register, see Table 50.&lt;BR /&gt;5. Initialization: There are two control registers for each of the SSP ports to be&lt;BR /&gt;configured: SSP0CR0 and SSP0CR1 for SSP0, SSP1CR0 and SSP1CR1 for SSP1.&lt;BR /&gt;See Section 18.6.1 and Section 18.6.2.&lt;BR /&gt;6. DMA: The Rx and Tx FIFOs of the SSP interfaces can be connected to the GPDMA&lt;BR /&gt;controller (see Section 18.6.10). For GPDMA system connections, see Table 544.&lt;BR /&gt;Remark: SSP0 is intended to be used as an alternative for the SPI interface, which is&lt;BR /&gt;included as a legacy peripheral. Only one of these peripherals can be used at the any one&lt;BR /&gt;time.&lt;BR /&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2020 04:10:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-SPI-with-CMSIS-RTOS-V2/m-p/1085577#M41670</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-07-10T04:10:39Z</dc:date>
    </item>
  </channel>
</rss>

