<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/41035/problem-in-gsm-modem-response-handling-using-interrupt-method-of-lpc2148-uart0</link><description> 
Actually i am getting problem while trying to receive the incoming
sms from gsm modem to micro controller 

 
controller-lpc2148 
Uart- UART0 //Cpu clock-60 Mhz (using PLL 12Mhz*5=60Mhz) 
VPB -15mhz //9600 baud rate ,8 bit data,1 stop bit,no parity</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/153120?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 08:10:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9f81dec2-f73a-4d23-900b-fc0ff2a5547f</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Most definitely - as clearly described in quite a number of
articles about the use of ring buffers. They are so popular just
because they work well with interrupts or with multiple threads. So
you haven&amp;#39;t located the Keil LPC2100 UART sample code yet?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/152402?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 07:41:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3f110e81-1e15-46e8-8aef-4a420081f1bd</guid><dc:creator>karthikeyan subramani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sorry for the mistakes in last post.I try to re write the code
using ring buffer sir.Could i able to use this ring buffer concept in
to ISR.?Is that possible&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/151588?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 06:51:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:21aa0414-5956-4a43-ac42-51e10d0a7247</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sorry, can&amp;#39;t afford the time to guide you. But Google is your
friend. There is more than enough information available. Just make
sure to read a bit more carefully than you read the posting
instructions for source code - details tends to be important.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/147105?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 05:44:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7f49382b-4964-4e53-b27c-563838cae244</guid><dc:creator>karthikeyan subramani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sir, ring buffer..? i have no prevoius experiance with ring
buffer.So i have to google about ring buffer and also why &amp;amp; where
do you refer me this ring buffer to implent?&lt;/p&gt;

&lt;p&gt;
To check buffer register,&lt;/p&gt;

&lt;p&gt;
&amp;quot;if(dataa!=0x0A)&amp;quot;&lt;/p&gt;

&lt;p&gt;
or&lt;/p&gt;

&lt;p&gt;
for(i=0; s1[i]!=&amp;#39;\0&amp;#39;;i++)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
s2[i]=s1[i];&lt;/p&gt;

&lt;p&gt;
}&lt;br /&gt;
Please clarify me also I am the new one to keil.So please guide me to
do the ring buffer implementation&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/145650?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 04:06:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:04ec3d42-3e2a-4a61-948d-ae860a9b4da3</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
By the way - I think you should consider looking at the ring
buffer implementation that Keil has available. It&amp;#39;s way better than
copying a full text line when you see a line break - you don&amp;#39;t want
big loops inside an ISR.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/143609?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 03:53:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b4b150c4-f6a9-412e-8aab-ccce23ab872b</guid><dc:creator>karthikeyan subramani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sir, I read the processor manual for UART0,I didn&amp;#39;t check the CTI
as well the 0&amp;#39;th bit of U0IIR. When Gsm getting incoming message
means with in that fraction it will send the full string in to Rx
buffer as well i don&amp;#39;t know where &amp;amp; how to check these things in
the isr function and one more thing is that if i connecting lke RFID
reader,gps modules means i can able to receive and read the full
string without any problem.Then how it could be possible sir?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/140867?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 03:22:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7ac99367-f0cd-4b51-964c-57b6e2fe5f0b</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Have you read the chapter about UART0 in the processor user
manual? You don&amp;#39;t seem to check if the least significant bit of U0IIR
is zero. And it&amp;#39;s good to care about both RDA and CTI since both are
enabled by the same bit in U0IER.&lt;/p&gt;

&lt;p&gt;
And you should read U0IIR at the end of your initialization
routine.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/131528?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 02:59:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4e3c34ce-7aad-4448-ac47-c06a3c6d2031</guid><dc:creator>karthikeyan subramani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for your reply sir,&lt;/p&gt;

&lt;p&gt;
Actually i seen in a tutorial in that code for timer0 before to
check overflow in isr,they read the register by a variable.That&amp;#39;s why
i used that variable(regval).But sir,i removed that variable and
checked ,i am getting the same problem.If you allow me i will update
here my main() code.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/128971?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 02:33:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ab4c8fab-c9f5-4fcc-8e48-d195de850cfa</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
You really do not like to use the proper tags for source
code...&lt;/p&gt;

&lt;p&gt;
Notice the difference with source code posted using the intended
tags?&lt;/p&gt;

&lt;pre&gt;
#include &amp;lt;stdio&amp;gt;

int main(void) {
    printf(&amp;quot;Hello World!\n&amp;quot;);
    return 0;
}
&lt;/pre&gt;

&lt;p&gt;
By the way - you shouldn&amp;#39;t read twice from U0IIR since reading
from registers isn&amp;#39;t identical to reading from normal RAM - that&amp;#39;s
why you have the &amp;quot;regVal&amp;quot; variable.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/117813?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 00:42:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:becd6735-3efb-4518-9902-27d49059a7af</guid><dc:creator>karthikeyan subramani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sorry for the last post sir,&lt;/p&gt;

&lt;p&gt;
//Once gsm got any sms it will sent to the uC,have to receive that
and show it in the 16x2 LCD&lt;/p&gt;

&lt;p&gt;
char s1[28], s2[28],DATA0_RECEIVED;//DATA0_RECEIved is flag&lt;/p&gt;

&lt;p&gt;
void myUart0_ISR(void)__irq&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
long int regVal;&lt;/p&gt;

&lt;p&gt;
regVal = U0IIR; // read the current value in U0&amp;#39;s Interrupt
Register&lt;/p&gt;

&lt;p&gt;
if((U0IIR&amp;amp;RDA))&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
unsigned char dataa;&lt;/p&gt;

&lt;p&gt;
dataa=U0RBR;&lt;/p&gt;

&lt;p&gt;
if(dataa!=0x0A)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
s1[count++]=dataa; }&lt;/p&gt;

&lt;p&gt;
else&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
s1[count++]=&amp;#39;\0&amp;#39;;&lt;/p&gt;

&lt;p&gt;
count=0;&lt;/p&gt;

&lt;p&gt;
for(i=0; s1[i]!=&amp;#39;\0&amp;#39;;i++)&lt;/p&gt;

&lt;p&gt;
{&lt;/p&gt;

&lt;p&gt;
s2[i]=s1[i];&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
s2[i]=&amp;#39;\0&amp;#39;;&lt;/p&gt;

&lt;p&gt;
DATA0_RECEIVED=1;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
VICVectAddr = 0x00; // The ISR has finished!&lt;/p&gt;

&lt;p&gt;
} }&lt;/p&gt;

&lt;p&gt;
void UART0_INIT() {&lt;/p&gt;

&lt;p&gt;
PINSEL0 |= 0x00000005; //p0.15 and p0.7 as GPIO P0.1=RXD
P0.0=TXD&lt;/p&gt;

&lt;p&gt;
U0LCR=0x83;//data,stop,parity bit as well DLAB=1 befor do calc
Bdrte&lt;/p&gt;

&lt;p&gt;
U0DLL=97;//15mhz -BDrte&lt;/p&gt;

&lt;p&gt;
U0DLM=0;&lt;/p&gt;

&lt;p&gt;
//U0FDR=(MULVAL&amp;lt;&amp;lt;4)|DIVADDVAL;//Fraction for Prescale her it
is no need&lt;/p&gt;

&lt;p&gt;
U0LCR&amp;amp;=~(1&amp;lt;&amp;lt;7);//DLAB=0 before enable uart interrupt as
well for U0RBR,U0THR buffers&lt;/p&gt;

&lt;p&gt;
U0FCR = 0x01; //clear the buffer&lt;/p&gt;

&lt;p&gt;
U0IER=0x1; //Uart Rx itrpt Enable&lt;/p&gt;

&lt;p&gt;
VICIntSelect=0x00;//selct as IRQ&lt;/p&gt;

&lt;p&gt;
VICVectCntl0=6|(1&amp;lt;&amp;lt;5);//IRqslot enable(5,)interrupt no
4,//slot0 has high and slot 15 has low priority&lt;/p&gt;

&lt;p&gt;
VICVectAddr0=(unsigned)myUart0_ISR;&lt;/p&gt;

&lt;p&gt;
VICIntEnable=(1&amp;lt;&amp;lt;6);&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/108319?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 00:20:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:29b18ed8-4e99-4612-b40d-3acab8c4a565</guid><dc:creator>edPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
How about reposting the code but &lt;b&gt;with&lt;/b&gt; the proper tags as
displayed directly above the message input box. Right now, it&amp;#39;s very
hard to read with no line breaks or indentation...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/82690?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2015 00:00:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:827b727b-64e4-47d8-965b-3cd00770f1d8</guid><dc:creator>karthikeyan subramani</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks and sorry for your reply and my late reply sir.Actually i
am getting problem in code side not in hardware side .But the same
code working perfectly in Pic micro controller.I can&amp;#39;t receive the
data from receiver buffer properly.I don&amp;#39;t think so whether I am ok
or not ok with this following Interrupt isr..Iam the new one to keil
ARM .Please give me the direction.&lt;/p&gt;

&lt;p&gt;
This is code is, char s1[28], s2[28],DATA0_RECEIVED;//global
declaration&lt;/p&gt;

&lt;p&gt;
void myUart0_ISR(void)__irq { long int regVal; regVal = U0IIR; //
read the current value in U0&amp;#39;s Interrupt Register if((U0IIR&amp;amp;RDA))
{ unsigned char dataa; dataa=U0RBR; if(dataa!=0x0A) {
s1[count++]=dataa; } else { s1[count++]=&amp;#39;\0&amp;#39;; count=0; for(i=0;
s1[i]!=&amp;#39;\0&amp;#39;;i++) { s2[i]=s1[i]; } s2[i]=&amp;#39;\0&amp;#39;; DATA0_RECEIVED=1; }
VICVectAddr = 0x00; // The ISR has finished! } } /** Baud calc
DLL=(pclk/(16*9600)) pclk derived from Cclk by using VPBDIV (in
datasheet APBDIV) **/&lt;/p&gt;

&lt;p&gt;
void UART0_INIT() { PINSEL0 |= 0x00000005; //p0.15 and p0.7 as
GPIO P0.1=RXD P0.0=TXD
U0LCR=0x83;//(1&amp;lt;&amp;lt;0)|(1&amp;lt;&amp;lt;1)|(0&amp;lt;&amp;lt;2)|(1&amp;lt;&amp;lt;7);//data,stop,parity
bit as well DLAB=1 befor do calc Bdrte U0DLL=97;//15mhz//for 30
mhz0xC3;//110;//BDrte U0DLM=0; U0LCR&amp;amp;=~(1&amp;lt;&amp;lt;7);//DLAB=0
before enable uart interrupt as well for U0RBR,U0THR buffers U0FCR =
0x01; //clear the buffer U0IER=0x1; //Uart Rx itrpt Enable
VICIntSelect=0x00;//selct as IRQ
VICVectCntl0=6|(1&amp;lt;&amp;lt;5);//IRqslot enable(5,)interrupt no
4,//slot0 has high and slot 15 has low priority
VICVectAddr0=(unsigned)myUart0_ISR; VICIntEnable=(1&amp;lt;&amp;lt;6); }&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in GSM modem response handling using interrupt method of LPC2148 UART0</title><link>https://community.arm.com/thread/63914?ContentTypeID=1</link><pubDate>Sat, 11 Jul 2015 04:16:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2642abc3-dff6-49d0-8f16-3ddadcc667d4</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
What seems to be the issue? Is there are problem with the code you
wrote? A problem debugging the code and/or hardware? Or that you
expect someone to perform the coding task for you?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>