<?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: UART1 LPC2148 stop sending data after amount of data transmited in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART1-LPC2148-stop-sending-data-after-amount-of-data-transmited/m-p/1037076#M40371</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Raul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the code, I see that the api function void SendCharUART1 (char str) is used to transmit data, but I do not see where you call the function.&lt;/P&gt;&lt;P&gt;Anyway, because you use interrupt mode, I suppose that you can transmit the char in the ISR.&lt;/P&gt;&lt;P&gt;Pls have a try.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XianJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//------------------------------------------Interrupt IRQ--------------------------------------------&lt;/P&gt;&lt;P&gt;void UART1Handler (void)&amp;nbsp; __irq&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;//&amp;nbsp; &amp;nbsp; /* Serial Receive Interrupt. */&lt;/P&gt;&lt;P&gt;char recieved;&lt;/P&gt;&lt;P&gt;if ((U1IIR &amp;amp; 0x0E) == 0x04) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;recieved=U1RBR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ptr2 = &amp;amp;datos_serial2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(ptr2-&amp;gt;in&amp;gt;=399)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ptr2-&amp;gt;in=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ptr2-&amp;gt;buffer[ptr2-&amp;gt;in++]=recieved;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;if(U1LSR &amp;amp; 0x40) U1THR = str; //Rong wrote&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;VICVectAddr = 0x00;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jan 2020 06:11:18 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2020-01-07T06:11:18Z</dc:date>
    <item>
      <title>UART1 LPC2148 stop sending data after amount of data transmited</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART1-LPC2148-stop-sending-data-after-amount-of-data-transmited/m-p/1037075#M40370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have configured the UART1 of my LPC2148 with speed: (9600 / 8bits / N /1bit Stop) with interruption. The UART1 connects to an ESP-01 I can send and receive information perfectly. The problem I present is when receiving a certain amount of data from the ESP-01, the microcontroller for some reason stops transmitting information and I do not understand what the reason is. below I leave the configuration and the information that I am receiving from the ESP, when receiving 6 times this frame the microcontroller stops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;Data frame:&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;//----------------------------------------Data frame received---------------------&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;+IPD,4,346:HTTP/1.1 200 OK&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;Server: xxxxx/x.x.xx&amp;nbsp;(xxxxxx)&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;Vary: Accept-Encoding&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;Content-Length: 155&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;Connection: close&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;Content-Type: text/html; charset=UTF-8&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;[{"count":"6","image":"0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;&amp;nbsp;0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,"}]&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;OK&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;//------------------------------------------------------------------------------&lt;/P&gt;&lt;P style="font-size: 14.4px; margin-top: 4px;"&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;//----------------------------Structure for Data recieved------------------------------------------&lt;/P&gt;&lt;P&gt;typedef struct {&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;int in;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;int out;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;char buffer[400];&lt;/P&gt;&lt;P&gt;}p;&lt;/P&gt;&lt;P&gt;p *ptr2,datos_serial2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//---------------------------Init UART1---------------------------------------------&lt;/P&gt;&lt;P&gt;void uart1_init(void)//9600 BAUD pclock 48MHZ&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PCONP |= 0x00000010;/* PCRTC = 1 */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PINSEL0 |= 0x00050000; /* Enable RxD1 and TxD1*/&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;U1LCR=0X83;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //8-data bits, 1 Stop bit, Disable Parity and Enable DLAB&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;U1DLL=0x38;// MULVAL = 0x5 and DIVADDVAL = 14&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;U1DLM=1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;U1LCR=0X03;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //cleared DLAB&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;U1IER= 0x00000001;//Enable Interrupt&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//---------------------------------Send Char----------------&lt;/P&gt;&lt;P&gt;void SendCharUART1 (char str){&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;U1THR = str;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; while( (U1LSR &amp;amp; 0x40) == 0 ); /* Wait till THRE bit becomes 1 which tells that transmission is completed */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;//--------------------------------Interrupt enable------------------------------------------------------&lt;/P&gt;&lt;P&gt;void UART1_Interrupt_EN(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; // VICIntSelect = 0x00000000;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;VICVectAddr7 = (unsigned) UART1Handler;//Vector 7&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;VICVectCntl7 = 0x00000020 | 7; //select UART1 interrupt as IRQ i.e vector 7&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; VICIntEnable |=(1UL&amp;lt;&amp;lt;7);//interrupt ena.&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//------------------------------------------Interrupt IRQ--------------------------------------------&lt;/P&gt;&lt;P&gt;void UART1Handler (void)&amp;nbsp; __irq&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;//&amp;nbsp; &amp;nbsp; /* Serial Receive Interrupt. */&lt;/P&gt;&lt;P&gt;char recieved;&lt;/P&gt;&lt;P&gt;if ((U1IIR &amp;amp; 0x0E) == 0x04) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;recieved=U1RBR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ptr2 = &amp;amp;datos_serial2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(ptr2-&amp;gt;in&amp;gt;=399)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ptr2-&amp;gt;in=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ptr2-&amp;gt;buffer[ptr2-&amp;gt;in++]=recieved;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;VICVectAddr = 0x00;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;//-----------------------------------------Main-------------------&lt;/P&gt;&lt;P&gt;int main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;uart1_init();&lt;/P&gt;&lt;P&gt;UART1_Interrupt_EN();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while(1){&lt;/P&gt;&lt;P&gt;&amp;nbsp; sendata_esp01&lt;SPAN class=""&gt;();&amp;nbsp; &amp;nbsp; &amp;nbsp; //Process to send data to ESP01&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; delay()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp;//-----------------&amp;nbsp;Algorithm to process the received data&lt;SPAN class=""&gt;------------------//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp;Process_Datareceived();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; //--------------------------------------------------------------------------------------//&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jan 2020 18:02:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART1-LPC2148-stop-sending-data-after-amount-of-data-transmited/m-p/1037075#M40370</guid>
      <dc:creator>rtoribio</dc:creator>
      <dc:date>2020-01-04T18:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: UART1 LPC2148 stop sending data after amount of data transmited</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART1-LPC2148-stop-sending-data-after-amount-of-data-transmited/m-p/1037076#M40371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Raul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the code, I see that the api function void SendCharUART1 (char str) is used to transmit data, but I do not see where you call the function.&lt;/P&gt;&lt;P&gt;Anyway, because you use interrupt mode, I suppose that you can transmit the char in the ISR.&lt;/P&gt;&lt;P&gt;Pls have a try.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XianJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//------------------------------------------Interrupt IRQ--------------------------------------------&lt;/P&gt;&lt;P&gt;void UART1Handler (void)&amp;nbsp; __irq&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;//&amp;nbsp; &amp;nbsp; /* Serial Receive Interrupt. */&lt;/P&gt;&lt;P&gt;char recieved;&lt;/P&gt;&lt;P&gt;if ((U1IIR &amp;amp; 0x0E) == 0x04) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;recieved=U1RBR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ptr2 = &amp;amp;datos_serial2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(ptr2-&amp;gt;in&amp;gt;=399)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ptr2-&amp;gt;in=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ptr2-&amp;gt;buffer[ptr2-&amp;gt;in++]=recieved;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;if(U1LSR &amp;amp; 0x40) U1THR = str; //Rong wrote&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;VICVectAddr = 0x00;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2020 06:11:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART1-LPC2148-stop-sending-data-after-amount-of-data-transmited/m-p/1037076#M40371</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-01-07T06:11:18Z</dc:date>
    </item>
  </channel>
</rss>

