<?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>8-bit Microcontrollers中的主题 read input level on PA32 FTM2 input capture channel?</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/read-input-level-on-PA32-FTM2-input-capture-channel/m-p/435905#M21538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FTM2 channel on 9S08PA32VLH is configured for rising edge input capture. No issues with interrupts or related routines. Same port pins have inputs enabled (in PORT_PTCIE).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I disable input capture (by writing 0 to FTM2CxSC), I can connect the input to Vcc or Ground and read the input levels just fine. But, as soon as I enable input capture (by writing 0x44 to FTM2CxSC), the Port input level gets "stuck". In other words, I can change the level at the input, but the result from reading PORT C never changes.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried disabling all interrupts as well as clearing the interrupt flag before reading. I have looked at the port contents and related registers (PORT_PTCD, PORT_PTCIE, and FTM2 registers) directly using debug in Code Warrior as well as with an LED when hardware is not attached via BDM. No difference.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried deleting all FTM2 init code and just using the Processor Expert capture component with Enable, Disable, and GetPinValue methods. Still no difference.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My memory could be faulty, but I do not recall this being an issue with TPM on other S08 processors. The reference manual for this device is somewhat ambiguous on whether GPIO will work with a FTM channel.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this just the way it is supposed to work? Or is there something else in configuration I could be missing? Currently, clock&amp;nbsp; gating is already enabled for all. Or is this a bug in the chip?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can always change my interrupt routine to handle this (for example by using both edges and temporarily disabling capture to read the level), but I would really like to know how this is supposed to work.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any and all input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2015 14:03:39 GMT</pubDate>
    <dc:creator>anno</dc:creator>
    <dc:date>2015-08-12T14:03:39Z</dc:date>
    <item>
      <title>read input level on PA32 FTM2 input capture channel?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/read-input-level-on-PA32-FTM2-input-capture-channel/m-p/435905#M21538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FTM2 channel on 9S08PA32VLH is configured for rising edge input capture. No issues with interrupts or related routines. Same port pins have inputs enabled (in PORT_PTCIE).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I disable input capture (by writing 0 to FTM2CxSC), I can connect the input to Vcc or Ground and read the input levels just fine. But, as soon as I enable input capture (by writing 0x44 to FTM2CxSC), the Port input level gets "stuck". In other words, I can change the level at the input, but the result from reading PORT C never changes.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried disabling all interrupts as well as clearing the interrupt flag before reading. I have looked at the port contents and related registers (PORT_PTCD, PORT_PTCIE, and FTM2 registers) directly using debug in Code Warrior as well as with an LED when hardware is not attached via BDM. No difference.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried deleting all FTM2 init code and just using the Processor Expert capture component with Enable, Disable, and GetPinValue methods. Still no difference.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My memory could be faulty, but I do not recall this being an issue with TPM on other S08 processors. The reference manual for this device is somewhat ambiguous on whether GPIO will work with a FTM channel.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this just the way it is supposed to work? Or is there something else in configuration I could be missing? Currently, clock&amp;nbsp; gating is already enabled for all. Or is this a bug in the chip?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can always change my interrupt routine to handle this (for example by using both edges and temporarily disabling capture to read the level), but I would really like to know how this is supposed to work.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any and all input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 14:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/read-input-level-on-PA32-FTM2-input-capture-channel/m-p/435905#M21538</guid>
      <dc:creator>anno</dc:creator>
      <dc:date>2015-08-12T14:03:39Z</dc:date>
    </item>
  </channel>
</rss>

