Embedded Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsComputer HardwareEmbedded Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 12th, 2011, 07:33 AM
d.mancic d.mancic is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 2 d.mancic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m
Reputation Power: 0
Microcontroller Texas Instruments MSP430F449 to Telit GPRS GM862 connection problems

Hi everybody,


I connected my MSP430F449 controller to GPRS GM862 over the RS232 serial port. I want to send AT<cr> command, and to read response OK (in fact, it responses <cr><lf>OK<cr><lf>). However, I receive only one character, the one I sent the last (and that is <cr>).

Here is the code. Where did I wrong?

It enters the interrupt routine only once... Please, help! Thanks!


------------------------------------------------------------

#include "io430.h"
#include "in430.h"

#include<string.h>
#include<stdio.h>

unsigned char d;
int b;

int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;

P2SEL |= 0x30;
ME1 |= URXE0+UTXE0;
U0CTL = 0x10;
U0TCTL = 0x30;
U0BR0 = 0x6D;
U0BR1 = 0x00;
U0MCTL = 0x0040;
IE1 = 0x40;
_EINT();

b = 0;

while(!IFG1&UTXIFG0);
U0TXBUF = 'A';
while(!IFG1&UTXIFG0);
U0TXBUF = 'T';
while(!IFG1&UTXIFG0);
U0TXBUF = 0x0D;
while(!IFG1&UTXIFG0);

while(1)
{ }

}

#pragma vector = UART0RX_VECTOR
__interrupt void uart0RxHandler (void)
{
d = U0RXBUF;
b++;
}
------------------------------------------------------------

Reply With Quote
  #2  
Old August 13th, 2011, 04:36 AM
salem's Avatar
salem salem is offline
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,840 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 19 h 38 m 49 sec
Reputation Power: 1774
> It enters the interrupt routine only once... Please, help! Thanks!
Well you probably need to do more in your ISR than just read the data.

It seems to me that you also need to figure out what "IRQ-ACK" (Interrupt Acknowledge) is also required for that particular device. Until you do this, it won't inform you of any more characters.

Also, modern UART's come with buffers, so you might need to check whether there is more data in the buffer.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper

Reply With Quote
  #3  
Old September 6th, 2011, 05:33 AM
d.mancic d.mancic is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 2 d.mancic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m
Reputation Power: 0
Hi, thanks for answering!

The problem was ECHO. GPRS immediately returned back every char I sent him. When I turned ECHO off, he started to accept all my commands.

Thank you again!

Reply With Quote
Reply

Viewing: Dev Shed ForumsComputer HardwareEmbedded Programming > Microcontroller Texas Instruments MSP430F449 to Telit GPRS GM862 connection problems

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap