<?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: interrupt or not interrupt uart in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159017#M1047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure, but I think MQX is designed for that purpose by not defining IO_SERIAL_NON_BLOCKING﻿.&lt;/P&gt;&lt;P&gt;But what happens if the baudrate is e.g. 115200, the waiting task is wakened up quite often when receiving data.&lt;/P&gt;&lt;P&gt;I've made in my earlier (non MQX) projects that receive buffer is polled in 10 or 20 ms period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've made the polling in MQX in this way:&lt;/P&gt;&lt;P&gt;readCount = _io_read (uart_device, dataBuffer, bufSize);﻿&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Aug 2011 18:52:53 GMT</pubDate>
    <dc:creator>MarkP_</dc:creator>
    <dc:date>2011-08-25T18:52:53Z</dc:date>
    <item>
      <title>interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159005#M1035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 16px; background-color: #f5f5f5;"&gt;&lt;SPAN style="line-height: normal;"&gt;hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: normal;"&gt;I was studying&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;the possibility of receiving&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;data from the&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;UART port&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: normal;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;I was&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;asking a question&lt;/SPAN&gt;&lt;SPAN style="line-height: normal;"&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 16px; background-color: #f5f5f5;"&gt;&lt;SPAN style="line-height: normal;"&gt;&lt;SPAN&gt;MQX&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;seen&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;that&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;there are&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;tasks&lt;/SPAN&gt;&lt;SPAN&gt;, so&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;you can run&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;a loop&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;in each task&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;to wait for&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;receiving&lt;/SPAN&gt;&lt;SPAN&gt;data, you&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;must use&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;an interrupt for&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;the UART&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;﻿&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 16px; background-color: #f5f5f5;"&gt;&lt;SPAN style="line-height: normal;"&gt;Maurizio Felicioni&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Aug 2011 17:30:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159005#M1035</guid>
      <dc:creator>Microfelix</dc:creator>
      <dc:date>2011-08-13T17:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159006#M1036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ﻿﻿Maurizio,&lt;/P&gt;&lt;P&gt;I don't think the issue is to have the UART in POLLED or INTERRUPT mode but more of a system architecture conversation of how you want the two task to access the recieved data.&lt;/P&gt;&lt;P&gt;In general only on task will be able to receive the UART data.&amp;nbsp; Your code needs to either use a synchronization method (semaphore or&amp;nbsp;mutex or glabal variable) or possible one task that will recieve the UART data and then determine who it is for and send that data to a task using message or global variable.&lt;/P&gt;&lt;P&gt;To see how a semaphore can be used for synchronization look at the mqx/examples/hello2 project.&amp;nbsp; It is outputing data to UART and not receiving but the concept is what I want you to see.&lt;/P&gt;&lt;P&gt;There is a lightweight message queue example that might be helpful too in mqx/examples/lwmsgq .&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 22:39:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159006#M1036</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-08-16T22:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159007#M1037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maurizio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 14:52:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159007#M1037</guid>
      <dc:creator>Microfelix</dc:creator>
      <dc:date>2011-08-18T14:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159008#M1038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a bare-metal system I would have an interrupt handler for the UART, which stores the incoming chars in a buffer, and sets one or more flags.&lt;/P&gt;&lt;P&gt;The flag can be polled whenever the application is ready to cope with the incoming data.&lt;/P&gt;&lt;P&gt;What nice bit of example code shows me how a task can wait for incoming data on the UART?&amp;nbsp; I have looked for this in the MQX examples but haven''t found it yet.&lt;/P&gt;&lt;P&gt;﻿﻿Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 18:16:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159008#M1038</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-22T18:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159009#M1039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to define ITTYx (means interrupt):&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;#define BSPCFG_ENABLE_ITTYD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change default IO-channel in twrk60n512.h to ittyd:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#if BSPCFG_ENABLE_ITTYD&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //#define BSP_DEFAULT_IO_CHANNEL&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; "ttyf:"&amp;nbsp;&amp;nbsp;&amp;nbsp; /* OSJTAG-COM&amp;nbsp;&amp;nbsp; polled mode&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #define BSP_DEFAULT_IO_CHANNEL&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; "ittyd:"&amp;nbsp;&amp;nbsp;&amp;nbsp; /* RS 232 port */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define BSP_DEFAULT_IO_CHANNEL_DEFINED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define BSP_DEFAULT_IO_CHANNEL&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; NULL&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open uart:&lt;/P&gt;&lt;P&gt;&amp;nbsp; MQX_FILE_PTR uart_device;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uart_device = _io_fopen("ittyd:"﻿,&amp;nbsp; (char _PTR_)(IO_SERIAL_RAW_IO|IO_SERIAL_NON_BLOCKING));&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;Write&amp;amp;read data:&lt;/P&gt;&lt;P&gt;count = _io_write( uart_device, data, len );﻿&lt;/P&gt;&lt;P&gt;readCount = _io_read ( uart_device, data, bufSize);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change queue-size if larger than 64 needed in user_config.h:&lt;/P&gt;&lt;P&gt;#define BSPCFG_SCI3_QUEUE_SIZE 256 /* sci3=ittyd */﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 19:31:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159009#M1039</guid>
      <dc:creator>MarkP_</dc:creator>
      <dc:date>2011-08-22T19:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159010#M1040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which bit of that is sitting waiting for incoming characters? (I suspect fread...﻿), and what is the task doing in the meantime?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, does the device need a mutex for TX use, or is that built into the fwrite?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 20:22:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159010#M1040</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-22T20:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159011#M1041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi OldNick,&lt;/P&gt;&lt;P&gt;Here is one way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; pointer fh_ptr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint_32 result;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; fh_ptr = (pointer)fopen("ittyc:", BSP_DEFAULT_IO_OPEN_MODE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (fh_ptr == NULL) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("cannot open file: ittyc\n");&amp;nbsp;&amp;nbsp;//print to uart0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("\nittyc: Device Handler opened successfully\n");&amp;nbsp;&amp;nbsp;//print to uart0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; fflush(stdout);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if(result = fstatus(fh_ptr))&amp;nbsp;&amp;nbsp;// check uart &amp;nbsp;to see if char is pending&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;printf("Character waiting in UART1\n");&amp;nbsp;&amp;nbsp;&amp;nbsp;//print to uart0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;read(fh_ptr,(pointer)&amp;amp;Z,1);&amp;nbsp;// read 1 char to uart1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;printf("Your character in UART1 was %c\n", Z);&amp;nbsp;//print to uart0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;printf("No character waiting in UART1\n");&amp;nbsp;&amp;nbsp;//print to uart0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 21:49:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159011#M1041</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-08-22T21:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159012#M1042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DavidS&lt;/P&gt;&lt;P&gt;Sorry to be a bit slow on the uptake here.&amp;nbsp; Your example code looks like "check once then exit".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think&amp;nbsp;&lt;/P&gt;&lt;P&gt;while(1){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if(result = fstatus(fh_ptr)) ﻿{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; handlecharacter();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is very elegant.&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;Anyway, I am reading chapter 5 of MQXIOUG, and not seeing anything that enables a task to "wait on RX"&lt;/P&gt;&lt;P&gt;Nor is fstatus documented in that manual, or anywhere else that I can find in the docs directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;﻿I reckon there must be something simple in there somewhere?&amp;nbsp; A simple UART example that waits on incoming chars and echoes them back to the terminal would be a great help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 23:02:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159012#M1042</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-22T23:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159013#M1043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi OldNick,&lt;/P&gt;&lt;P&gt;Yes my example checked once (i.e. it is a non-blocking method).&amp;nbsp; It could easily be implemented in a loop as well.&lt;/P&gt;&lt;P&gt;When you do a read with a polling driver, then it will wait for a charater to be entered.&lt;/P&gt;&lt;P&gt;ex: read(fh_ptr,(&lt;FONT color="#005032" size="2"&gt;&lt;FONT color="#005032" size="2"&gt;pointer&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;)bptr++,1);&lt;/FONT&gt; &lt;FONT color="#3F7F5F" size="2"&gt;&lt;FONT color="#3F7F5F" size="2"&gt;// read 1 char where fh_ptr is returned from fopen(), bptr is pointer to a character buffer, and 1 indicates you are waiting for one charater only.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3F7F5F" size="2"&gt;&lt;FONT color="#3F7F5F" size="2"&gt;The fstatus() gets mapped to io_fstatus() from fio.h and is in io_fstatus.c.&amp;nbsp; Sorry that it isn't in UG or RM.&amp;nbsp; We are trying to document everything but not quite there yet.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3F7F5F" size="2"&gt;&lt;FONT color="#3F7F5F" size="2"&gt;Interrupt drivers will read the input data as it arrives, place it in a buffer, set a flag so if a task was blocked waiting for data it will awaken.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3F7F5F" size="2"&gt;&lt;FONT color="#3F7F5F" size="2"&gt;Hope this helps.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3F7F5F" size="2"&gt;&lt;FONT color="#3F7F5F" size="2"&gt;Regards,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3F7F5F" size="2"&gt;&lt;FONT color="#3F7F5F" size="2"&gt;David&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2011 22:43:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159013#M1043</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-08-23T22:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159014#M1044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Ok guys.&amp;nbsp; this is how I have set it up.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in userconfig.h&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1//use interrupt version...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in MyBoardk40x256.h&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#if BSPCFG_ENABLE_ITTYA&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define BSP_DEFAULT_IO_CHANNEL&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; "ittya:"&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define BSP_DEFAULT_IO_CHANNEL_DEFINED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;﻿...&lt;/P&gt;&lt;P&gt;&amp;nbsp;#define BSP_DEFAULT_IO_OPEN_MODE&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; (pointer) ( IO_SERIAL_RAW_IO |IO_SERIAL_NON_BLOCKING)﻿﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;the tasklist is&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;const TASK_TEMPLATE_STRUCT&amp;nbsp; MQX_template_list[] =&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; /* Task Index,&amp;nbsp;&amp;nbsp; Function,&amp;nbsp;&amp;nbsp; Stack,&amp;nbsp; Priority, Name,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attributes,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param, Time Slice */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { HELLO_TASK,&amp;nbsp;&amp;nbsp; hello_task, 1500,&amp;nbsp;&amp;nbsp; 8,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "hello",&amp;nbsp; MQX_AUTO_START_TASK, 0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { COMMS_TASK,&amp;nbsp;&amp;nbsp; rs232_task, 1000,&amp;nbsp;&amp;nbsp; 8,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "rs232",&amp;nbsp; MQX_AUTO_START_TASK, 0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 0 }&lt;BR /&gt;};&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And the rs232-stask is&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/* --------------------------------------------------------------------------&lt;BR /&gt;MQX task.&amp;nbsp; Very simple&lt;BR /&gt;--- */&lt;BR /&gt;void rs232_task&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32 dummy&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;{&lt;BR /&gt;static int rxcount = 0;&lt;BR /&gt;uint_32 st;&lt;BR /&gt;char in;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; while(1){//sit here forever&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; st = status();&amp;nbsp; //waiting for chars&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (st){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in = getchar();//add char to rxbuff&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tx_byte(in);// echo debug&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (CR==in){//if CR&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rxbuff[rxcount]=0; //replace CR with 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comm_handler();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //parse command&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rxcount=0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //reset rxcount&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rxbuff[rxcount]=in;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (++rxcount&amp;gt;BUFFSIZ) rxcount = BUFFSIZ;//stop overrun.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;﻿&lt;STRONG&gt;This works quite nicely...except that the hello_task never runs.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt=":robotsad:" class="emoticon emoticon-robotsad" id="robotsad" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-sad.gif" title="Robot Sad" /&gt;&lt;/P&gt;&lt;P&gt;Like I said, I need this task to sleep pending an incoming character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2011 15:13:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159014#M1044</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-24T15:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159015#M1045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;when using nonblocking interrupt method the getchar doesn't block, instead it returns IO_EOF.&lt;/P&gt;&lt;P&gt;_mqx_int _io_fgetc﻿:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if ((*dev_ptr-&amp;gt;IO_READ)(file_ptr, &amp;amp;tmp, 1) == 1) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return((_mqx_int)((uchar)tmp));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;STRONG&gt;(IO_EOF&lt;/STRONG&gt;);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;﻿You need to add task suspend/wait when this IO_EOF is received.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Serial read function:&lt;/P&gt;&lt;P&gt;_mqx_int _io_serial_int_read﻿:&lt;/P&gt;&lt;P&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; while ( i ) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_queue = int_io_dev_ptr-&amp;gt;IN_QUEUE;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _int_disable();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(flags &amp;amp; &lt;STRONG&gt;IO_SERIAL_NON_BLOCKING&lt;/STRONG&gt;) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_CHARQ_SIZE(in_queue) == 0) {&lt;BR /&gt;&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; num -= i;&lt;BR /&gt;&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; _int_enable();&lt;BR /&gt;&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; break;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (_CHARQ_SIZE(in_queue) == 0) {&lt;BR /&gt;&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;STRONG&gt;_taskq_suspend&lt;/STRONG&gt;(int_io_dev_ptr-&amp;gt;IN_WAITING_TASKS);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* Endwhile */&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _CHARQ_DEQUEUE(in_queue,c);&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 12:31:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159015#M1045</guid>
      <dc:creator>MarkP_</dc:creator>
      <dc:date>2011-08-25T12:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159016#M1046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm.&amp;nbsp; Take a while to get my head around that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would rather take a step backward and re-frame the original question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the simplest way to get a task to wake up when a character is received on the RS232-port?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. for a task to go to sleep for a while, I call "time_delay()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to make a task wait for RX-chars, I call ???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Polling the UART takes processor time.&amp;nbsp; But the interrupt driver surely ought to be capable of waking a task?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for all the advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 16:19:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159016#M1046</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-25T16:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159017#M1047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure, but I think MQX is designed for that purpose by not defining IO_SERIAL_NON_BLOCKING﻿.&lt;/P&gt;&lt;P&gt;But what happens if the baudrate is e.g. 115200, the waiting task is wakened up quite often when receiving data.&lt;/P&gt;&lt;P&gt;I've made in my earlier (non MQX) projects that receive buffer is polled in 10 or 20 ms period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've made the polling in MQX in this way:&lt;/P&gt;&lt;P&gt;readCount = _io_read (uart_device, dataBuffer, bufSize);﻿&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 18:52:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159017#M1047</guid>
      <dc:creator>MarkP_</dc:creator>
      <dc:date>2011-08-25T18:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159018#M1048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep...interrupts about every 90us.&lt;/P&gt;&lt;P&gt;that was going to be my next question...how to move the task-wake from a per-character basis.&amp;nbsp; (Since the driver has a buffer anyway.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like I am going to be doing the good old 10mS &lt;EM&gt;poll-&amp;gt;double-buffer-&amp;gt;process&lt;/EM&gt; shuffle (Always assuming I don't get buffer overruns because some other task is munching away and won't give me the processor back.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems crazy that all this stuff gets done for USB and Ethernet stacks, but there is nothing for the ubiquitous UART.&amp;nbsp; (115,200 bits per second is too fast for them, I suppose.&lt;IMG alt=":robotwink:" class="emoticon emoticon-robotwink" id="robotwink" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-wink.gif" title="Robot wink" /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you happen to know what the context-switching time for MQX is, on (say) a Kinetis at 100MHz?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 20:39:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159018#M1048</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-25T20:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159019#M1049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi OldNick,&lt;/P&gt;&lt;P&gt;With the UART/SCI in interrupt mode, there is a 64byte buffer defined in the twrk60n512.h in the BSP.&lt;/P&gt;&lt;P&gt;/* TTYA and ITTYA buffer size */&lt;BR /&gt;#ifndef BSPCFG_SCI0_QUEUE_SIZE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define BSPCFG_SCI0_QUEUE_SIZE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 64&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;It really is only used with the interrupt mode.&amp;nbsp; As a character is received, the interrupt handler will add it to the buffer.&amp;nbsp; If there is a task blocked and waiting for a character, the RTOS will place it in the ready queue and when it is the highest priority task ready to run it will run.&amp;nbsp; Should the task have to wait for awhile as other higher priority tasks are running, the UART/SCI interrupt keeps adding to the buffer.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 21:59:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159019#M1049</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-08-25T21:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159020#M1050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DavidS,&lt;/P&gt;&lt;P&gt;You wrote&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If there is a task blocked and waiting for a character&lt;/STRONG&gt;,﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this sounds silly, but that is the one thing I cannot see how to set up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please explain, if I am using the non-blocking interrupt driver,which API layer function call will block the task until one or more characters are available in the ring buffer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you saw, I tried status() and getchar() and that was not succesful.&lt;/P&gt;&lt;P&gt;=================&lt;/P&gt;&lt;P&gt;MarkP&lt;/P&gt;&lt;P&gt;I assume that _io_read is non-blocking, and returns 0 if there is nothing in the buffer?&amp;nbsp; Should I have been able to find that out by myself?&amp;nbsp; (Sorry)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 22:43:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159020#M1050</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-08-25T22:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159021#M1051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi TIm,&lt;/P&gt;&lt;P&gt;The MQX IO-Drivers User's Guide describes the _io_read operation. If no characters received, it returns 0.&lt;/P&gt;&lt;P&gt;My first trial with interrupt-mode halted the task, then debugging the code I found the parameter IO_SERIAL_NON_BLOCKING﻿.&lt;/P&gt;&lt;P&gt;In MQX BSP-project there are peripheral drivers source folder (don't remember the exact name because sitting now at my home PC). Studying those polled mode and interrupt mode source files helps to understand the functionality.&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 23:12:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159021#M1051</guid>
      <dc:creator>MarkP_</dc:creator>
      <dc:date>2011-08-25T23:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159022#M1052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I ment OldNick.&lt;/P&gt;&lt;P&gt;Mixed up two discussion topics.&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 01:22:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159022#M1052</guid>
      <dc:creator>MarkP_</dc:creator>
      <dc:date>2011-08-26T01:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159023#M1053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi OldNick,&lt;/P&gt;&lt;P&gt;Mark answered perfectly...ect for the Tim reference :smileywink:.&amp;nbsp; Thanks Mark!&lt;/P&gt;&lt;P&gt;My previous comment was for a blocking&amp;nbsp;mode...sorry.&amp;nbsp; Mark is right that with non-blocking if no data is present, a zero is returned.....an non-zero is how many bytes were read.&lt;/P&gt;&lt;P&gt;Good conversation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 05:17:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159023#M1053</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-08-26T05:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: interrupt or not interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159024#M1054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK,&lt;/P&gt;&lt;P&gt;after dealing with a load of other stuff, I have returned to ask one last question on this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no API to peek at teh size of the CharQ.&amp;nbsp; Only one to say if there is a non-zero number of bytes (IO_IOCTL_CHAR_AVAIL﻿ returns "true or false") &lt;IMG alt=":robotsad:" class="emoticon emoticon-robotsad" id="robotsad" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-sad.gif" title="Robot Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I am going to use _io_read (uart_device, dataBuffer, &lt;STRONG&gt;bufSize&lt;/STRONG&gt;);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read the driver source code, and as far as I can tell, if I ask for 64 bytes, and there is only one byte in the queue, the driver returns 64, not one. So I have no idea how many bytes I have actually got to process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I ask for 1 but ehere were 64 in the queue, I only get one, leaving the rest in the queue.&amp;nbsp; So I have to poll more often.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple modification to the driver would be&lt;/P&gt;&lt;P&gt;//&amp;nbsp; _mqx_int&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; i = num;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _mqx_int&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; i = 0;&lt;BR /&gt;﻿...&lt;/P&gt;&lt;P&gt;// while ( i ) {&lt;BR /&gt;﻿&amp;nbsp;while (num ) {&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; num -= i;&lt;BR /&gt;﻿...&lt;/P&gt;&lt;P&gt;// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --num;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; } /* Endwhile */&lt;BR /&gt;&lt;BR /&gt;// &amp;nbsp; return num;&lt;BR /&gt;﻿return i;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Any objections?&lt;/P&gt;&lt;P&gt;I could just do it anyway, but hate to patch a library that will one day get updated/overwritten.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 19:27:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/interrupt-or-not-interrupt-uart/m-p/159024#M1054</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2011-09-07T19:27:24Z</dc:date>
    </item>
  </channel>
</rss>

