<?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>Kinetis Microcontrollers中的主题 Re: Help: Whole PORTC reading problems,PTC3 and PTC9 fail.</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850468#M51146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached&amp;nbsp; FRDM-K64F binary file that sets all port C pins to inputs with pull-ups, reads the level and prints the result to the UART (VCOM) at 115'200 Baud.&lt;/P&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hello, world... FRDM-K64F [External]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Static memory = 0x00000728&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;OS Heap use = 0x027d from 0xfc00&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Initial stack margin 0x0000fb7c&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Set PORT C to inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;0x000fffff&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also read the values in the I/O menu (command 3) with &lt;BR /&gt;"md 400ff090 l 1" [i.e. read one long work from address 0x400ff090 - PORTC_PDIR]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I used is (in uTasker Kinetis project)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CONFIG_PORT_INPUT(C, (0xffffffff), PORT_PS_UP_ENABLE); // configure all port C pins as inputs with pull-up&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;fnDebugMsg("Set PORT C to inputs\r\n");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;fnDebugHex(_READ_PORT(C), (sizeof(unsigned long) | WITH_LEADIN | WITH_CR_LF));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1, If you get different results with this binary you will need to check the signals on your board to see whether you have something different in the HW&lt;BR /&gt;2. If you get the same results it would point to a problem with the code that you are using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Nov 2018 15:40:48 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-11-20T15:40:48Z</dc:date>
    <item>
      <title>Help: Whole PORTC reading problems,PTC3 and PTC9 fail.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850467#M51145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having some problems when I try to read the whole PORTC. I find that PTC3 and PTC9 fail.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with a TWR-K64 board with KDS V3.2.0 and Processor Expert.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I configured the whole PORTC as input, with pull up resistor enabled in each of the pins. The TWR-K64 board is not connected to any other board, so ifI read the PORTC value, I should read '1' in each of the pins of PORTC. However, PTC3 and PTC9 are always '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following pictures shows how the PORTC_PCRn register is configured:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PORTC_PCRn.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76475i5740AA703A6E2B49/image-size/large?v=v2&amp;amp;px=999" role="button" title="PORTC_PCRn.png" alt="PORTC_PCRn.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Bit PE = 1, pull enabled.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Bit PS = 1, internal pull-up selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Bits MUX = 001, pin mux control at Alt1(GPIO).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following image shows GPIOC_PDDR register, and confirms that all of the pins are configured as inputs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the same image shows that when GPIOC_PDIR register is readed, PTC3 an PTC9 are '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="GPIOC_PDIR.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76512iA98DC9B1C06D1907/image-size/large?v=v2&amp;amp;px=999" role="button" title="GPIOC_PDIR.png" alt="GPIOC_PDIR.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking to the schematic of TWR-K64 I can not find any other connection of these two pins that would make to read them as '0', and neither in my code or Processor Expert configuration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing? Any help will be apreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2018 16:54:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850467#M51145</guid>
      <dc:creator>patricio</dc:creator>
      <dc:date>2018-11-19T16:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Whole PORTC reading problems,PTC3 and PTC9 fail.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850468#M51146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached&amp;nbsp; FRDM-K64F binary file that sets all port C pins to inputs with pull-ups, reads the level and prints the result to the UART (VCOM) at 115'200 Baud.&lt;/P&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hello, world... FRDM-K64F [External]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Static memory = 0x00000728&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;OS Heap use = 0x027d from 0xfc00&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Initial stack margin 0x0000fb7c&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Set PORT C to inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;0x000fffff&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also read the values in the I/O menu (command 3) with &lt;BR /&gt;"md 400ff090 l 1" [i.e. read one long work from address 0x400ff090 - PORTC_PDIR]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I used is (in uTasker Kinetis project)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CONFIG_PORT_INPUT(C, (0xffffffff), PORT_PS_UP_ENABLE); // configure all port C pins as inputs with pull-up&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;fnDebugMsg("Set PORT C to inputs\r\n");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;fnDebugHex(_READ_PORT(C), (sizeof(unsigned long) | WITH_LEADIN | WITH_CR_LF));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1, If you get different results with this binary you will need to check the signals on your board to see whether you have something different in the HW&lt;BR /&gt;2. If you get the same results it would point to a problem with the code that you are using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2018 15:40:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850468#M51146</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-11-20T15:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Whole PORTC reading problems,PTC3 and PTC9 fail.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850469#M51147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ooops... my mistake, now I see you are using a standalone TWR-K64F120M instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I just made a TWR-K64F120M version (running at 120MHz from IRC48). I also put the debug interface on USB-CDC due to the fact that the OpenSDA connection is otherwise on some PTC pins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the processor's USB interface is connected to a terminal emulator and ENTER is pressed it will print out the same info.&lt;/P&gt;&lt;P&gt;Now I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Serial number: 00&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Software version V1.4.012&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Device identification: KINETIS&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Set PORT C to inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;0x000ffdff&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I can confirm that at least one pin is at 0V (PTC9) - this was J26 (USB power switch).&lt;/P&gt;&lt;P&gt;After removing this I got&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Serial number: 00&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Software version V1.4.012&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Device identification: KINETIS&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Set PORT C to inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;0x000fffff&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For PTC3 you need to check J10. If it is set to 1-2 it will be '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Serial number: 00&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Software version V1.4.012&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Device identification: KINETIS&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Set PORT C to inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;0x000ffff7&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I expect that you have missed removing the jumpers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the binary again in case you don't manage to get the same results with your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2018 16:26:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850469#M51147</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-11-20T16:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Whole PORTC reading problems,PTC3 and PTC9 fail.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850470#M51148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You were right: once removed the jumpers J26 and J10 everything was right.&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2018 10:04:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Help-Whole-PORTC-reading-problems-PTC3-and-PTC9-fail/m-p/850470#M51148</guid>
      <dc:creator>patricio</dc:creator>
      <dc:date>2018-11-27T10:04:46Z</dc:date>
    </item>
  </channel>
</rss>

