<?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: LPCopen sct_11u6x.h is wrong?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577293#M19579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using LPCopen 2.06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Rens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jul 2016 09:25:47 GMT</pubDate>
    <dc:creator>renskessener</dc:creator>
    <dc:date>2016-07-29T09:25:47Z</dc:date>
    <item>
      <title>LPCopen sct_11u6x.h is wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577291#M19577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it is the wrong place to start this discussion, but ......&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In lpc open, lpc_chip_11u6x project, there is an error in sct_11u6x.h, as far as I understand.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OUTPUTDIRCTRL register specifies (for each output) the impact of the counting direction on the meaning of set and clear operations on the output.&lt;/P&gt;&lt;P&gt;For each output there are 2 bits to set that behaviour.&lt;/P&gt;&lt;P&gt;However, the routine specified in sct_11u6x.h&amp;nbsp; to set that register is:&lt;/P&gt;&lt;P&gt;STATIC INLINE void Chip_SCT_SetoutputdirControl(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T value)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;OUTPUTDIRCTRL |= value;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;There is no reference to the output that is to be controlled, nor any&amp;nbsp; handling of the 2 bits per output.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the routine should look like:&lt;/P&gt;&lt;P&gt;STATIC INLINE void Chip_SCT_SetoutputdirControl(LPC_SCT_T *pSCT, CHIP_SCT_OUTPUT_REG_T n, uint8_t value)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;OUTPUTDIRCTRL |= uint32_t (value &amp;lt;&amp;lt; (n &amp;lt;&amp;lt; 1));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 10:59:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577291#M19577</guid>
      <dc:creator>renskessener</dc:creator>
      <dc:date>2016-07-15T10:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: LPCopen sct_11u6x.h is wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577292#M19578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you be so kind to tell me which LPCOpen version are you using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 16:29:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577292#M19578</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-07-28T16:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: LPCopen sct_11u6x.h is wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577293#M19579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using LPCopen 2.06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Rens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 09:25:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577293#M19579</guid>
      <dc:creator>renskessener</dc:creator>
      <dc:date>2016-07-29T09:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPCopen sct_11u6x.h is wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577294#M19580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I am not able to see any Chip_SCT_SetoutputdirControl function neither a CHIP_SCT_OUTPUT_REG_T enum in lpcopen_2_06_lpcxpresso_manley_11u68 or lpcopen_2_06_lpcxpresso_nxp_lpcxpresso_11u68 package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But supposing that CHIP_SCT_OUTPUT_REG_T is an enum from 0 to 3, your function seems correct, I would only suggest to add a MASK to ensure that value is not greater than 3 and clear corresponding field before updating the new data (in case you want to modify value from XX to 00):&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14702381225873524" data-hasrefreshed="true" data-renderedposition="189.64999389648438_8_1192_80" jivemacro_uid="_14702381225873524" modifiedtitle="true"&gt;&lt;P&gt;STATIC INLINE void Chip_SCT_SetoutputdirControl(LPC_SCT_T *pSCT, CHIP_SCT_OUTPUT_REG_T n, uint8_t value)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;OUTPUTDIRCTRL &amp;amp;= ~(0x3 &amp;lt;&amp;lt; (n &amp;lt;&amp;lt; 1));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;OUTPUTDIRCTRL |= uint32_t((value &amp;amp; 0x3) &amp;lt;&amp;lt; (n &amp;lt;&amp;lt; 1));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can help you!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 15:29:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCopen-sct-11u6x-h-is-wrong/m-p/577294#M19580</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-08-03T15:29:23Z</dc:date>
    </item>
  </channel>
</rss>

