<?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中的主题 LPC824 Glitch Filter Clock Divide Register Issue</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-Glitch-Filter-Clock-Divide-Register-Issue/m-p/569611#M17971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Sat Nov 15 18:37:29 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;there is already a slightly similar post on the 812, but i want to elaborate on the 824&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to set a glitch filter a few things need to happen&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) in order to write to the iocon regs the peripheral clock to the iocon block needs to be enabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Enable the clock to the IOCon Block */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_Clock_EnablePeriphClock (SYSCTL_CLOCK_IOCON) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) set the S_MODE (sample mode) bits to the desired IOCONFILTR_PCLK) count&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_IOCON_PinSetSampleMode (LPC_IOCON, IOCON_PIO15, PIN_SMODE_CYC3) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) set the desired IOCON glitch filter clock divider registers 6 to 0 (IOCONFILTCLKDIVx) to the desired IOCONFILTR_PCLK ... please observe the numbering of 6 to 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_IOCON_PinSetClockDivisor (LPC_IOCON, IOCON_PIO15, IOCONCLKDIV0) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4) now that the iocon regs are set the peripheral clock can be turned off again&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Disable the clock to the IOCon Block */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_Clock_DisablePeriphClock (SYSCTL_CLOCK_IOCON) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;5) and this is the tricky part now ... remember that the IOCONFILTCLKDIVx regs are in descending order of 6 to 0 (outlined in item 3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_SYSCTL-&amp;gt;IOCONCLKDIV[6] = 0x00ff ;/* IoConClkDiv - 0 = div 255*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IOCONCLKDIV[6] is IOCON glitch filter clock divider register 0 and NOT 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;6) note that "typedef enum CHIP_PIN_CLKDIV { ..." can only be used for setting the IOCON clock divisor field bits 15 - 13 in the PIO0_xx regs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and can NOT be used as index into the 7 IOCONCLKDIV[index] regs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i wish there would be an enum for the indexing in the 7 IOCONCLKDIV[x] regs to really show this reverse order of reg index vs reg number&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;7) on top of it if you try to look at the IOCONCLKDIV[x] regs in xpresso, all you see is IOCONCLKDIV6 and no 5 - 0 ... maybe the xpresso guys will read this and try to fix it in the next revision&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers efiLabs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:09:26 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:09:26Z</dc:date>
    <item>
      <title>LPC824 Glitch Filter Clock Divide Register Issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-Glitch-Filter-Clock-Divide-Register-Issue/m-p/569611#M17971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Sat Nov 15 18:37:29 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;there is already a slightly similar post on the 812, but i want to elaborate on the 824&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to set a glitch filter a few things need to happen&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) in order to write to the iocon regs the peripheral clock to the iocon block needs to be enabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Enable the clock to the IOCon Block */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_Clock_EnablePeriphClock (SYSCTL_CLOCK_IOCON) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) set the S_MODE (sample mode) bits to the desired IOCONFILTR_PCLK) count&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_IOCON_PinSetSampleMode (LPC_IOCON, IOCON_PIO15, PIN_SMODE_CYC3) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) set the desired IOCON glitch filter clock divider registers 6 to 0 (IOCONFILTCLKDIVx) to the desired IOCONFILTR_PCLK ... please observe the numbering of 6 to 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_IOCON_PinSetClockDivisor (LPC_IOCON, IOCON_PIO15, IOCONCLKDIV0) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4) now that the iocon regs are set the peripheral clock can be turned off again&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Disable the clock to the IOCon Block */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Chip_Clock_DisablePeriphClock (SYSCTL_CLOCK_IOCON) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;5) and this is the tricky part now ... remember that the IOCONFILTCLKDIVx regs are in descending order of 6 to 0 (outlined in item 3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; LPC_SYSCTL-&amp;gt;IOCONCLKDIV[6] = 0x00ff ;/* IoConClkDiv - 0 = div 255*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IOCONCLKDIV[6] is IOCON glitch filter clock divider register 0 and NOT 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;6) note that "typedef enum CHIP_PIN_CLKDIV { ..." can only be used for setting the IOCON clock divisor field bits 15 - 13 in the PIO0_xx regs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and can NOT be used as index into the 7 IOCONCLKDIV[index] regs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i wish there would be an enum for the indexing in the 7 IOCONCLKDIV[x] regs to really show this reverse order of reg index vs reg number&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;7) on top of it if you try to look at the IOCONCLKDIV[x] regs in xpresso, all you see is IOCONCLKDIV6 and no 5 - 0 ... maybe the xpresso guys will read this and try to fix it in the next revision&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers efiLabs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:09:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-Glitch-Filter-Clock-Divide-Register-Issue/m-p/569611#M17971</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 Glitch Filter Clock Divide Register Issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-Glitch-Filter-Clock-Divide-Register-Issue/m-p/569612#M17972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jgoulder on Wed Jan 21 07:34:18 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been diving into LPC8xx.h and noticed this as well.&amp;nbsp; It seems very confusing when you set IOCONCLKDIV[0] and it is really setting the IOCONCLKDIV6 register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it should be defined in the header file individually as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV6;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV5;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV4;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV3;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; __IO uint32_t IOCONCLKDIV0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of using an array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:09:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-Glitch-Filter-Clock-Divide-Register-Issue/m-p/569612#M17972</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:09:27Z</dc:date>
    </item>
  </channel>
</rss>

