<?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>topic Re: Use EXTAL0 and XTAL0 pins in UART mode in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442271#M25963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out what the problem was:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mbed's PinMap module did not include the PTA18 and PTA19 pins as part of the UART Peripheral. The fix was just to add both pins and the alt mode to the PinMap_UART_TX structure in the PeripheralPins.c file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone else.&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;Alex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Nov 2015 01:20:48 GMT</pubDate>
    <dc:creator>alex323qp</dc:creator>
    <dc:date>2015-11-01T01:20:48Z</dc:date>
    <item>
      <title>Use EXTAL0 and XTAL0 pins in UART mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442267#M25959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;Hi, I have a custom board with a MKL25Z128 MCU. The MCG is configured in FEI mode (internal clock source) and I'm trying to repurpose the EXTAL0 and XTAL0 pins for serial communication (UART1). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;(My project uses mbed libraries, but I'm comfortable manipulating the registers directly if required)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;mbed has a &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;DigitalOut library for generic I/O purposes that works fine over the PTA19 pin. &lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;The problem is that if I replace it with the serial instance (using the Serial library), the program stops working. My guess is that there is something in that library that conflicts with my configurations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;I tried to set the ALT mode 3 directly thinking that was the problem but no luck whatsoever:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;PORTA-&amp;gt;PCR[19] = PORT_PCR_MUX(3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;PORTA-&amp;gt;PCR[18] = PORT_PCR_MUX(3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fdfdfd;"&gt;I wonder if there is something else I'm supposed to do in order to free these pins and use the UART module available to them?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 1.7rem; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #222222; background-color: #fdfdfd;"&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P style="margin-bottom: 1.7rem; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #222222; background-color: #fdfdfd;"&gt;Regards,&lt;/P&gt;&lt;P style="margin-bottom: 1.7rem; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #222222; background-color: #fdfdfd;"&gt;Alex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 20:06:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442267#M25959</guid>
      <dc:creator>alex323qp</dc:creator>
      <dc:date>2015-10-29T20:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Use EXTAL0 and XTAL0 pins in UART mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442268#M25960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you show your code about how to configure the UART1 ?&lt;/P&gt;&lt;P&gt;And have you enable the UART1 clock ?&lt;/P&gt;&lt;P&gt;Have you IDE can debug your project , if have , i recommend you first debug it to be sure the code can work well ,&lt;/P&gt;&lt;P&gt;and the project only with UART1 , thus we can locate the problem quickly .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 03:41:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442268#M25960</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-10-30T03:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Use EXTAL0 and XTAL0 pins in UART mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442269#M25961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the UART setup is done by the mbed libraries, so I'll have to check the source code to see what configurations are being used. Since this is a custom board, I don't yet have debugging capabilities; that is in fact the purpose of getting the UART working to use it as an improvised way of getting debugging statements out of the chip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you point me out to the chapter in the datasheet regarding the UART clock configuration? That would really help me find my way through the mbed libraries and figure out whether it is active or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Oct 2015 22:55:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442269#M25961</guid>
      <dc:creator>alex323qp</dc:creator>
      <dc:date>2015-10-31T22:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use EXTAL0 and XTAL0 pins in UART mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442270#M25962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After having a quick look to the mbed's serial_api.c library, it seems that the UART1 clock is being enabled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;SIM-&amp;gt;SCGC4 |= SIM_SCGC4_UART1_MASK;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tested adding the line to my main() method (just in case), but the problem persists. Any other idea? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Oct 2015 23:37:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442270#M25962</guid>
      <dc:creator>alex323qp</dc:creator>
      <dc:date>2015-10-31T23:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Use EXTAL0 and XTAL0 pins in UART mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442271#M25963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out what the problem was:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mbed's PinMap module did not include the PTA18 and PTA19 pins as part of the UART Peripheral. The fix was just to add both pins and the alt mode to the PinMap_UART_TX structure in the PeripheralPins.c file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone else.&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;Alex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Nov 2015 01:20:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-EXTAL0-and-XTAL0-pins-in-UART-mode/m-p/442271#M25963</guid>
      <dc:creator>alex323qp</dc:creator>
      <dc:date>2015-11-01T01:20:48Z</dc:date>
    </item>
  </channel>
</rss>

