<?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: MQX4.2 MCF52259 Hardwareflow, RTS not working in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537338#M16440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made the following changes to my example based on your example&lt;/P&gt;&lt;P&gt;1. fopen pass NULL&lt;/P&gt;&lt;P&gt;2. Separate call to IO_SERIAL_HW_FLOW_CONTROL using IO_IOCTL_SERIAL_SET_FLAGS&lt;/P&gt;&lt;P&gt;3. changed your &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;printf("\n Hello World \n"); to fprintf(Comm3_IO, "%s", &amp;amp;SDI_TX_BUFF[0]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately no luck. RTS always high. If I call fflush(Comm3_IO); it never returns...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;From what you have posted, really you have just pointed out not to pass flags in the fopen call which i thought was ok? I get the same result if I pass flags with fopen or set it after... I did this because MQX example pass flags with fopen. MQX's on examples do this, this is copy and pasted from the example supplied by MQX&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;rs485_dev = fopen( RS485_CHANNEL, (char const *)IO_SERIAL_HW_485_FLOW_CONTROL );&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2016 23:43:59 GMT</pubDate>
    <dc:creator>carlnormansuret</dc:creator>
    <dc:date>2016-07-27T23:43:59Z</dc:date>
    <item>
      <title>MQX4.2 MCF52259 Hardwareflow, RTS not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537335#M16437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to configure my UART(2) to use RTS flow control on the MCF52259. I can use the UART normally with IO_SERIAL_RAW_IO no problem, but cant get RTS working. I checked PUCPAR and it is set to one indicating primary function of RTS on pin 82 (PUC3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried many experiments, settings, configurations yesterday and this morning. I have posted some simple test code below that hopefully someone can look at and quickly tell me what I have done wrong, or why its not working. I have no experience with hardware flow control really, Ive used it on other projects and it "just worked" so I didnt have to look into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Auto start task&lt;/P&gt;&lt;P&gt;void SDI_Task(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 temp = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pointer Comm3_IO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_8 SDI_TX_BUFF[512] = {0};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Needs to have 9 bit data, always set low, so I tried this &amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Comm3_IO = (pointer)fopen("ittyc:", (pointer)(IO_SERIAL_RAW_IO));&lt;/P&gt;&lt;P&gt;//PUCPAR bit 3 becomes set ifi printf PUCPAR or stop debugger and check it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//9 bit data always low for this application&lt;/P&gt;&lt;P&gt;temp = IO_SERIAL_PARITY_SPACE;&lt;/P&gt;&lt;P&gt;ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_PARITY, &amp;amp;temp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //For a simple test to see if I could just get RTS to change state I tried this &amp;gt;&amp;gt; (this does nothing)&lt;/P&gt;&lt;P&gt;&amp;nbsp; temp = IO_SERIAL_RTS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_HW_SIGNAL, &amp;amp;temp);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_CLEAR_HW_SIGNAL, &amp;amp;temp);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_HW_SIGNAL, &amp;amp;temp);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_CLEAR_HW_SIGNAL, &amp;amp;temp);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _time_delay(100);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_HW_SIGNAL, &amp;amp;temp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sprintf(SDI_TX_BUFF, "123456789");&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(1000);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //CTS is manually tied high with a 10K resistor, tried high and low with no change&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //I tried first setting and/or clearing the RTS as above, but still nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fprintf(Comm3_IO, "%s", SDI_TX_BUFF);&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>Tue, 26 Jul 2016 01:52:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537335#M16437</guid>
      <dc:creator>carlnormansuret</dc:creator>
      <dc:date>2016-07-26T01:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: MQX4.2 MCF52259 Hardwareflow, RTS not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537336#M16438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To start testing i quickly wrote some code which works for a simple test to emulate what I need from RTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If MQX's RTS control on ittyc / ttyc is an issue, maybe someone could indicate where in the MQX source I can add two lines marked "//RTS high" and "//RTS low" as this would be fine for my application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code works fine for testing, but, I must meet a protocol specification that requires RTS low to happen within 25uS of the final stop bit, and I simply cannot stop my processor like I am below in a loop waiting for the TEMP flag in USR to clear, it would have to be interrupt driven in some way, or, maybe someone has some other ideas? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comm3_IO = (pointer)fopen("ittyc:", (pointer)(IO_SERIAL_RAW_IO | IO_SERIAL_PARITY_SPACE | IO_SERIAL_STOP_BITS_1)); &lt;/P&gt;&lt;P&gt;reg_ptr-&amp;gt;GPIO.PUCPAR &amp;amp;= (~0b00000100); //Force to GPIO&lt;/P&gt;&lt;P&gt;reg_ptr-&amp;gt;GPIO.DDRUC |= 0b00000100; //Force to output state&lt;/P&gt;&lt;P&gt;reg_ptr-&amp;gt;GPIO.PORTUC &amp;amp;= (~0b00000100); //Force to output to low&lt;/P&gt;&lt;P&gt;sprintf(SDI_TX_BUFF, "123456789");&lt;/P&gt;&lt;P&gt;for(;;){&lt;/P&gt;&lt;P&gt;_time_delay(1000);&lt;/P&gt;&lt;P&gt;reg_ptr-&amp;gt;GPIO.PORTUC |= 0b00000100; //RTS high &lt;/P&gt;&lt;P&gt;fprintf(Comm3_IO, "%s", SDI_TX_BUFF);&lt;/P&gt;&lt;P&gt;fflush(Comm3_IO);&lt;/P&gt;&lt;P&gt;while((reg_ptr-&amp;gt;UART[2].READ.USR &amp;amp; 0x08) == 0);&lt;/P&gt;&lt;P&gt;reg_ptr-&amp;gt;GPIO.PORTUC &amp;amp;= (~0b00000100); //RTS low&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 01:52:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537336#M16438</guid>
      <dc:creator>carlnormansuret</dc:creator>
      <dc:date>2016-07-27T01:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: MQX4.2 MCF52259 Hardwareflow, RTS not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537337#M16439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can try the io open flag&amp;nbsp; "IO_SERIAL_HW_FLOW_CONTROL"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37681i8C71EB05DF8D6AE0/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For see the MQX_IO_User_Guide.pdf for more details&lt;/P&gt;&lt;P&gt;it is located on your installation folder&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_2\doc\mqx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void Main_task(uint_32 initial_data)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;uint_32 flags=IO_SERIAL_HW_FLOW_CONTROL; &lt;/P&gt;&lt;P&gt;MQX_FILE_PTR pfile1;&lt;/P&gt;&lt;P&gt;MQX_FILE_PTR pfile2;&lt;/P&gt;&lt;P&gt;pfile1 = fopen("ittyc:", NULL);&lt;/P&gt;&lt;P&gt;pfile2 = fopen("ittya:", NULL);&lt;/P&gt;&lt;P&gt;ioctl(pfile1,IO_IOCTL_SERIAL_SET_FLAGS, &amp;amp;flags);&lt;/P&gt;&lt;P&gt;ioctl(pfile2,IO_IOCTL_SERIAL_SET_FLAGS, &amp;amp;flags);&lt;/P&gt;&lt;P&gt;printf("\n Hello World \n");&lt;/P&gt;&lt;P&gt;_time_delay(240000);&lt;/P&gt;&lt;P&gt;fclose(pfile1);&lt;/P&gt;&lt;P&gt;fclose(pfile2);&lt;/P&gt;&lt;P&gt;_mqx_exit(0);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 06:44:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537337#M16439</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2016-07-27T06:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: MQX4.2 MCF52259 Hardwareflow, RTS not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537338#M16440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made the following changes to my example based on your example&lt;/P&gt;&lt;P&gt;1. fopen pass NULL&lt;/P&gt;&lt;P&gt;2. Separate call to IO_SERIAL_HW_FLOW_CONTROL using IO_IOCTL_SERIAL_SET_FLAGS&lt;/P&gt;&lt;P&gt;3. changed your &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;printf("\n Hello World \n"); to fprintf(Comm3_IO, "%s", &amp;amp;SDI_TX_BUFF[0]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately no luck. RTS always high. If I call fflush(Comm3_IO); it never returns...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;From what you have posted, really you have just pointed out not to pass flags in the fopen call which i thought was ok? I get the same result if I pass flags with fopen or set it after... I did this because MQX example pass flags with fopen. MQX's on examples do this, this is copy and pasted from the example supplied by MQX&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;rs485_dev = fopen( RS485_CHANNEL, (char const *)IO_SERIAL_HW_485_FLOW_CONTROL );&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 23:43:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537338#M16440</guid>
      <dc:creator>carlnormansuret</dc:creator>
      <dc:date>2016-07-27T23:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: MQX4.2 MCF52259 Hardwareflow, RTS not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537339#M16441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you enabled the macro "BSPCFG_ENABLE_TTYC_HW_SIGNALS" in user_config.h (config/twrmcf52259)?&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYC_HW_SIGNALS 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 06:51:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-2-MCF52259-Hardwareflow-RTS-not-working/m-p/537339#M16441</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2016-08-01T06:51:13Z</dc:date>
    </item>
  </channel>
</rss>

