<?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>LPC MicrocontrollersのトピックRe: LPC SSP port modes not set correct</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-SSP-port-modes-not-set-correct/m-p/779259#M31338</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;Götz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reporting this bug!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned each time you call the function&amp;nbsp;Chip_IOCON_PinMux is necessary to make a downshifted ( &amp;gt;&amp;gt; 2 ) as you did for the SSP initialization in the line 193.&amp;nbsp;&amp;nbsp;Chip_IOCON_PinMux(LPC_IOCON, 0, 7, IOCON_MODE_INACT&amp;gt;&amp;gt;2, IOCON_FUNC2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure the correct functionality of the drivers&amp;nbsp; the downshifted is necessary every time you call the function&amp;nbsp;Chip_IOCON_PinMux, not only in the SSP initialization.&amp;nbsp;If you don't make this the demo may work, but the values in the register PINMODE will be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A different solution is to declare new macros for the values of&amp;nbsp; MODE&amp;nbsp; without the shift. The IOCON_MODE_INACT macro expansion is the next:&lt;/P&gt;&lt;P&gt;#define IOCON_MODE_INACT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (0x2 &amp;lt;&amp;lt; 2)&lt;/P&gt;&lt;P&gt;Once you make the downshifted (&amp;gt;&amp;gt; 2) in the&amp;nbsp;&lt;SPAN&gt;Chip_IOCON_PinMux function call you are leaving the 0x2 only. So you can declare new macros in board.h instead, like the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#define PIN_MODE_INACT 0x02&amp;nbsp;&lt;BR /&gt;#define PIN_MODE_PULLDOWN 0x03&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And replace for the new macros in all the calls to function&amp;nbsp;&lt;SPAN&gt;Chip_IOCON_PinMux.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMux(LPC_IOCON, 0, 7, PIN_MODE_INACT, IOCON_FUNC2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It's important to mention that if you decided to declare new macros, you can't delete the old ones since other configuration requires that macros.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Have a great day,&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Victor.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&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;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Feb 2018 18:13:29 GMT</pubDate>
    <dc:creator>victorjimenez</dc:creator>
    <dc:date>2018-02-08T18:13:29Z</dc:date>
    <item>
      <title>LPC SSP port modes not set correct</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-SSP-port-modes-not-set-correct/m-p/779258#M31337</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;we found a bug in: "lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769.zip\lpcopen\software\lpc_core\lpc_board\boards_17xx\nxp_lpcxpresso_1769\board.c" where the pin mode is not set correct for the SPI pins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. line 193:&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMux(LPC_IOCON, 0, 7, IOCON_MODE_INACT&amp;gt;&amp;gt;2, IOCON_FUNC2);&lt;/P&gt;&lt;P&gt;has to be used. In the original call the&amp;nbsp;mode is not is downshifted but required for&amp;nbsp;&lt;SPAN&gt;Chip_IOCON_PinMux() API call.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached corrected board.c file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Best regards, Götz-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 15:08:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-SSP-port-modes-not-set-correct/m-p/779258#M31337</guid>
      <dc:creator>götzfriedrich</dc:creator>
      <dc:date>2018-02-01T15:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPC SSP port modes not set correct</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-SSP-port-modes-not-set-correct/m-p/779259#M31338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;Götz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reporting this bug!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned each time you call the function&amp;nbsp;Chip_IOCON_PinMux is necessary to make a downshifted ( &amp;gt;&amp;gt; 2 ) as you did for the SSP initialization in the line 193.&amp;nbsp;&amp;nbsp;Chip_IOCON_PinMux(LPC_IOCON, 0, 7, IOCON_MODE_INACT&amp;gt;&amp;gt;2, IOCON_FUNC2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure the correct functionality of the drivers&amp;nbsp; the downshifted is necessary every time you call the function&amp;nbsp;Chip_IOCON_PinMux, not only in the SSP initialization.&amp;nbsp;If you don't make this the demo may work, but the values in the register PINMODE will be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A different solution is to declare new macros for the values of&amp;nbsp; MODE&amp;nbsp; without the shift. The IOCON_MODE_INACT macro expansion is the next:&lt;/P&gt;&lt;P&gt;#define IOCON_MODE_INACT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (0x2 &amp;lt;&amp;lt; 2)&lt;/P&gt;&lt;P&gt;Once you make the downshifted (&amp;gt;&amp;gt; 2) in the&amp;nbsp;&lt;SPAN&gt;Chip_IOCON_PinMux function call you are leaving the 0x2 only. So you can declare new macros in board.h instead, like the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#define PIN_MODE_INACT 0x02&amp;nbsp;&lt;BR /&gt;#define PIN_MODE_PULLDOWN 0x03&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And replace for the new macros in all the calls to function&amp;nbsp;&lt;SPAN&gt;Chip_IOCON_PinMux.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Chip_IOCON_PinMux(LPC_IOCON, 0, 7, PIN_MODE_INACT, IOCON_FUNC2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It's important to mention that if you decided to declare new macros, you can't delete the old ones since other configuration requires that macros.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Have a great day,&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Victor.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&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;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2018 18:13:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-SSP-port-modes-not-set-correct/m-p/779259#M31338</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-02-08T18:13:29Z</dc:date>
    </item>
  </channel>
</rss>

