<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: MCF52235 UART interrupt help for a NOOB</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-UART-interrupt-help-for-a-NOOB/m-p/208282#M10040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi cmag&lt;BR /&gt;&lt;BR /&gt;Here is basic code for configuration and reception by interrupt. I have left out the actual UART configuration for speed, parity etc. but the rest shows the most important steps (UART0 only):&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;// Configure the pins for UART usePUAPAR |= ((PRIMARY_FUNCTION_Q &amp;lt;&amp;lt; BIT_0_Q_SHIFT) | (PRIMARY_FUNCTION_Q &amp;lt;&amp;lt; BIT_1_Q_SHIFT)); // Set TX/RX on UA// Enter interrupt handlerIC_ICR_0_13 = UART0_INTERRUPT_PRIORITY;                          // define interrupt level and priorityfnSetIntHandler(UART0_VECTOR, (unsigned char *)_SCI0_Interrupt); // enter the handler routineIC_IMRL_0 &amp;amp;= ~(UART0_PIF_INT_L | MASK_ALL_INT);                  // unmask interrupt source//configure speed and mode...// enable rx (tx is enabled only during transmission)UCR_0 = UART_RX_ENABLE;UIMR_UISR_0 = (ucEnabledState[Channel] |= (UART_RXRDY_MASK)); // this register can not be read so we keep a backup of its content!!// interrupt on character receptionstatic __interrupt__ void _SCI0_Interrupt(void){    unsigned char ucState;    while ((ucState = (UIMR_UISR_0 &amp;amp; UART_INTERRUPTS)) != 0) {           // while interrupts present        if (ucState &amp;amp; UART_RXRDY_MASK) {            fnSciRxByte(UTB_RB_0, 0);                                    // receive data interrupt - read the byte        }        if (ucState &amp;amp; UART_TXRDY_MASK) {            fnSciTxByte(0);                                              // transmit data empty interrupt - write next byte        }    }}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;This is a small extract from the uTasker project. The UART interface supports interrupt or DMA operation and optional HW and SW flow control. You may like to look at the project (link below) because the code if free for non-commercial work and fully supported (&lt;A href="http://www.uTasker.com/forum/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.uTasker.com/forum/&lt;/A&gt;). It also works in the uTasker simulator which allows the analysis of UART code, including interrupt operation on a virtual M5223X without needing to work on the hardware.&lt;BR /&gt;The uTasker project comes with complete TCP/IP stack, OS and device drivers for the M5223X chips - it allows firmware updates via Ethernet (web browser) so can save lots of time as well as aiding simple learning.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Apr 2008 02:54:42 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2008-04-01T02:54:42Z</dc:date>
    <item>
      <title>MCF52235 UART interrupt help for a NOOB</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-UART-interrupt-help-for-a-NOOB/m-p/208281#M10039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Technically I guess I'm not a noob, but it's been a very long time since I had to do this, so all real knowledge is gone.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can someone point me to a resource that would have a good step by step example on how to enable and utilize an interrupt for when the UART receives a byte.&amp;nbsp; I did this about&amp;nbsp;two years ago and haven't touched a microcontroller since so I&amp;nbsp;don't for the life of&amp;nbsp;me remember how to do this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I've looked around and havent found anything very simple to understand, and thus far you guys&amp;nbsp;have been tremendously helpful.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;cmag&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 02:11:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-UART-interrupt-help-for-a-NOOB/m-p/208281#M10039</guid>
      <dc:creator>cmag</dc:creator>
      <dc:date>2008-04-01T02:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52235 UART interrupt help for a NOOB</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-UART-interrupt-help-for-a-NOOB/m-p/208282#M10040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi cmag&lt;BR /&gt;&lt;BR /&gt;Here is basic code for configuration and reception by interrupt. I have left out the actual UART configuration for speed, parity etc. but the rest shows the most important steps (UART0 only):&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;// Configure the pins for UART usePUAPAR |= ((PRIMARY_FUNCTION_Q &amp;lt;&amp;lt; BIT_0_Q_SHIFT) | (PRIMARY_FUNCTION_Q &amp;lt;&amp;lt; BIT_1_Q_SHIFT)); // Set TX/RX on UA// Enter interrupt handlerIC_ICR_0_13 = UART0_INTERRUPT_PRIORITY;                          // define interrupt level and priorityfnSetIntHandler(UART0_VECTOR, (unsigned char *)_SCI0_Interrupt); // enter the handler routineIC_IMRL_0 &amp;amp;= ~(UART0_PIF_INT_L | MASK_ALL_INT);                  // unmask interrupt source//configure speed and mode...// enable rx (tx is enabled only during transmission)UCR_0 = UART_RX_ENABLE;UIMR_UISR_0 = (ucEnabledState[Channel] |= (UART_RXRDY_MASK)); // this register can not be read so we keep a backup of its content!!// interrupt on character receptionstatic __interrupt__ void _SCI0_Interrupt(void){    unsigned char ucState;    while ((ucState = (UIMR_UISR_0 &amp;amp; UART_INTERRUPTS)) != 0) {           // while interrupts present        if (ucState &amp;amp; UART_RXRDY_MASK) {            fnSciRxByte(UTB_RB_0, 0);                                    // receive data interrupt - read the byte        }        if (ucState &amp;amp; UART_TXRDY_MASK) {            fnSciTxByte(0);                                              // transmit data empty interrupt - write next byte        }    }}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;This is a small extract from the uTasker project. The UART interface supports interrupt or DMA operation and optional HW and SW flow control. You may like to look at the project (link below) because the code if free for non-commercial work and fully supported (&lt;A href="http://www.uTasker.com/forum/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.uTasker.com/forum/&lt;/A&gt;). It also works in the uTasker simulator which allows the analysis of UART code, including interrupt operation on a virtual M5223X without needing to work on the hardware.&lt;BR /&gt;The uTasker project comes with complete TCP/IP stack, OS and device drivers for the M5223X chips - it allows firmware updates via Ethernet (web browser) so can save lots of time as well as aiding simple learning.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 02:54:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52235-UART-interrupt-help-for-a-NOOB/m-p/208282#M10040</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2008-04-01T02:54:42Z</dc:date>
    </item>
  </channel>
</rss>

