<?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: I am using MKL17z microcontroller and trying to implement Data transmission uing UART  (RS485),but the data register UART2_D is empty in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640735#M38799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi xiangjun.rong&lt;SPAN style="color: #5e89c1; background-color: #ffffff; font-weight: 500;"&gt;&amp;nbsp;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After posting the issue i noticed that it should be ALT4 and not ALT3.So i changed that configurations and my UART is working properly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Sep 2016 03:58:47 GMT</pubDate>
    <dc:creator>priyankavorugan</dc:creator>
    <dc:date>2016-09-26T03:58:47Z</dc:date>
    <item>
      <title>I am using MKL17z microcontroller and trying to implement Data transmission uing UART  (RS485),but the data register UART2_D is empty</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640733#M38797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have implemented the code as mentioned below.Please let me if i missed any initializations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the following code.&lt;BR /&gt;PTE22 is TX&lt;BR /&gt;PTE23 is RX&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void uart2_init(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;SIM_SCGC4 |= SIM_SCGC4_UART2_MASK;&lt;BR /&gt;&amp;nbsp; GPIOE_PDDR |= 0x00400000; //Tx as output and x as input.&lt;BR /&gt;&amp;nbsp; PORTD_PCR22 = PORT_PCR_MUX(0x3u); //chip specific&lt;BR /&gt;&amp;nbsp; PORTD_PCR23 = PORT_PCR_MUX(0x3u);&lt;/P&gt;&lt;P&gt;&amp;nbsp; UART2_C1 = 0x00; //8bit data,start bit and stop bit ,no parity&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; UART2_C2 &amp;nbsp;= 0x00; &amp;nbsp;&amp;nbsp;Tx off&amp;nbsp;&amp;nbsp;Rx off&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; sbr = ((24*1000000) /(16 * 9600)); BUS clock is 24Mhz ,and baud rate is 9600&lt;BR /&gt;&amp;nbsp; brfa = (((24*1000000*32)/(9600*16)) - ((sbr) * 32));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; UART2_BDH |= 0x00;&lt;BR /&gt;&amp;nbsp; UART2_BDL = ((U8)(sbr));&lt;BR /&gt;&amp;nbsp; UART2_C4 |= ((U8)(brfa));&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)UART2_S1; // to clear TX_DATA_REG_EMPTY_FLAG ,TRANSMIT_COMPLETE_FLAG &lt;BR /&gt;&amp;nbsp; (void)UART2_D;&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; UART2_C2 = 0x0C; // TX RX On&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void transmit_data(U8 Buffer_data) &lt;BR /&gt;{&lt;BR /&gt; while((UART2_S1 &amp;amp; UART_S1_TDRE_MASK)==0); &amp;nbsp; &amp;nbsp; // Wait for transmit buffer to be empty&amp;nbsp;&lt;BR /&gt; (void)UART2_S1; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Read UART2_S1 register to clear TDRE&amp;nbsp;&lt;BR /&gt; UART2_D=Buffer_data; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Send data&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while(TRUE)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;transmit_data(0x01); &lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 06:03:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640733#M38797</guid>
      <dc:creator>priyankavorugan</dc:creator>
      <dc:date>2016-09-22T06:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: I am using MKL17z microcontroller and trying to implement Data transmission uing UART  (RS485),but the data register UART2_D is empty</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640734#M38798</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;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/5722i6085501D5FF54265/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I suppose you should use the foolwoing code:&lt;/P&gt;&lt;P&gt;SIM_SCGC5|=0x2000; //set PORTE clock&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTE_PCR22 = PORT_PCR_MUX(0x4u); //It is PORTE instead of PORTD and ALT4 instead of ALT3&lt;BR /&gt;&amp;nbsp; PORTE_PCR23 = PORT_PCR_MUX(0x4u);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;SIM_SCGC4 |= SIM_SCGC4_UART2_MASK;&lt;/P&gt;&lt;P&gt;Pls use the above setting and have a try.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 03:09:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640734#M38798</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-09-26T03:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: I am using MKL17z microcontroller and trying to implement Data transmission uing UART  (RS485),but the data register UART2_D is empty</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640735#M38799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi xiangjun.rong&lt;SPAN style="color: #5e89c1; background-color: #ffffff; font-weight: 500;"&gt;&amp;nbsp;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After posting the issue i noticed that it should be ALT4 and not ALT3.So i changed that configurations and my UART is working properly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 03:58:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-using-MKL17z-microcontroller-and-trying-to-implement-Data/m-p/640735#M38799</guid>
      <dc:creator>priyankavorugan</dc:creator>
      <dc:date>2016-09-26T03:58:47Z</dc:date>
    </item>
  </channel>
</rss>

