<?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: K64 UART Receiver Active Flag &amp;quot;RAF&amp;quot; in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618331#M36902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. I don't think i want &amp;nbsp;interrupt for the moment. All i want is something like the below pseudo code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (UART0 RAF Flag ==&amp;nbsp;&amp;nbsp;IDLE) { &amp;nbsp; &amp;nbsp;//check the RAF flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Do something&lt;/P&gt;&lt;P&gt;}else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Do another task&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2016 19:24:35 GMT</pubDate>
    <dc:creator>Designer11</dc:creator>
    <dc:date>2016-10-18T19:24:35Z</dc:date>
    <item>
      <title>K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618325#M36896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm new to the Kinetis K64 series of microcontrollers. I would like to detect whether the UART receiver line is idle or active. I'm currently using Processor Expert &amp;nbsp;AS1_ReceiveBlock(), UART1 to receive incoming serial data and it works great. I know that UART1_S2 is the status register i need to work with. &amp;nbsp;But how do i access the RAF field ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2016 19:25:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618325#M36896</guid>
      <dc:creator>Designer11</dc:creator>
      <dc:date>2016-10-07T19:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618326#M36897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Designer11,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; From the register description:&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/3286i3E8622D45E13D338/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;You can get that the RAF bit is read only.&lt;/P&gt;&lt;P&gt;If you want to access this bit, just read UART1_S2[RAF] bit in the code is OK.&lt;/P&gt;&lt;P&gt;You can use code:&lt;/P&gt;&lt;P&gt;UART1_S2 &amp;amp; UART_S2_RAF_MASK&lt;/P&gt;&lt;P&gt;&amp;nbsp;If this result is 0x0, it means the RAF bit is 0:UART receiver idle/inactive waiting for a start bit..&lt;/P&gt;&lt;P&gt;&amp;nbsp;If the result is 0x01, it means the RAF bit is 1:UART receiver active, RxD input not idle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Oct 2016 05:54:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618326#M36897</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-10-09T05:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618327#M36898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. However, whenever the interrupt happened it called&amp;nbsp;PE_DEBUGHALT(); function&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the example code. What is going on ?&lt;/P&gt;&lt;P&gt;if (UART1_S2 &amp;amp; UART_S2_RAF_MASK){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;i = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 17:11:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618327#M36898</guid>
      <dc:creator>Designer11</dc:creator>
      <dc:date>2016-10-10T17:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618328#M36899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Degisner11,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When the interrupt happened, it called PE_DEBUGHALT().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Did you add the interrupt ISR function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If you didn't add the interrupt service function, when the interrupt happens, the mcu can't find the according function, it will cause the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp; I don't know how you configure it.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you are convenient, could you give me your test project, then I can help you to check it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Kerry&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2016 03:14:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618328#M36899</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-10-11T03:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618329#M36900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;Since I don't have much experience with the Kinetis 32 bit. Could you give me an example on how to configure the interrupt ISR function for the RAF? I have dealt with the RAF flag in the 8bit HCS08 family of microcontrollers in the past.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2016 05:15:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618329#M36900</guid>
      <dc:creator>Designer11</dc:creator>
      <dc:date>2016-10-11T05:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618330#M36901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Designer11,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do you just want to get the receive idle interrupt?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If yes, you don't need to use RAF to get the interrupt, because RAF is just the state flag, it doesn't have the interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You should enable the idle line request in UARTx_C2[ILIE].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; About the example, I help you use the KDS PE generate a K64 project, and test it on my side, it works ok on my FRDM-K64 board, you can refer to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The code function is, when the receive idle interrupt happens, it will clear the idle flag, and receive the UART data, then send the received data back.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The configuration is like this:&lt;/P&gt;&lt;P&gt;&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/3977i23373FFB212AC739/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;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/4026i72236A3330D1C43B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsigned char data, flag=0;&lt;BR /&gt;PE_ISR(UART_ISR)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; if(UART0_S1 &amp;amp; UART_S1_IDLE_MASK)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; data= UART0_D;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag=1;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void send_data(char ch)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while(!(UART0_S1 &amp;amp; UART_S1_TDRE_MASK));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;UART0_D= ch;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; /* Write your local variable definition here */&lt;BR /&gt;&amp;nbsp; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;BR /&gt;&amp;nbsp; PE_low_level_init();&lt;BR /&gt;&amp;nbsp; /*** End of Processor Expert internal initialization.&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; ***/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here */&lt;BR /&gt;&amp;nbsp; /* For example: for(;;) { } */&lt;BR /&gt;&amp;nbsp; send_data(0x55);&lt;BR /&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; if(flag==1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; flag=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; send_data(data);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More details, please check my attached project.&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you still have question, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2016 06:58:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618330#M36901</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-10-11T06:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618331#M36902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. I don't think i want &amp;nbsp;interrupt for the moment. All i want is something like the below pseudo code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (UART0 RAF Flag ==&amp;nbsp;&amp;nbsp;IDLE) { &amp;nbsp; &amp;nbsp;//check the RAF flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Do something&lt;/P&gt;&lt;P&gt;}else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Do another task&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 19:24:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618331#M36902</guid>
      <dc:creator>Designer11</dc:creator>
      <dc:date>2016-10-18T19:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: K64 UART Receiver Active Flag "RAF"</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618332#M36903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Designer 11,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you don't want to use the interrupt, it is very simple, you just can use the code which you are mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; if(UART0_S1 &amp;amp; UART_S1_IDLE_MASK)&lt;BR /&gt;&amp;nbsp; But go to your initial question:I would like to detect whether the UART receiver line is idle or active.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If you just want to detect the receiver line, you can use UARTx_S1[IDLE], then when you want to send one byte, the code write like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; while(!(UART0_S1 &amp;amp; UART_S1_IDLE_MASK));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; data= UART0_D;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can refer to my attached code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 03:09:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-UART-Receiver-Active-Flag-quot-RAF-quot/m-p/618332#M36903</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-10-19T03:09:30Z</dc:date>
    </item>
  </channel>
</rss>

