CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Serial getc() Problem in GSM

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lokeshbhatt



Joined: 16 Mar 2010
Posts: 11

View user's profile Send private message Send e-mail

Serial getc() Problem in GSM
PostPosted: Tue Mar 16, 2010 10:39 pm     Reply with quote

Hi,
Code:

puts("AT+COPS?\r");
   
do{
    printf("OM");
    var = getc();
    printf("%c" ,var);
    putc('X');
}while(var != '+' || var != 'E');

puts("hi");

Output = XOMOM
as I'm giving AT command some time it is showing quick response i.e. gsm is not even waiting for getc() function response.
Even though I'm trying to collect characters received from gsm it is not getting collected in var.

As you all are experienced, so I personally want to ask which compiler we should try, CCS or HITECH ?
Should we use builtin library or should we configure register like in Hitech?
As CCS uses library functions and Hitech needs configuration of registers, which compiler is best?
_________________
Thanks & Regards
Lokesh Bhatt
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Mar 16, 2010 11:18 pm     Reply with quote

This is an old problem that I think a little searching will find you many examples...

But the short of it is:

Always use kbhit() to check to see if there's a char in the UART RX register before trying to getc() something that may not exist yet.


-Ben

p.s. I haven't used Hi-Tech. Only C18 and C32.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
lokeshbhatt



Joined: 16 Mar 2010
Posts: 11

View user's profile Send private message Send e-mail

pic16f690 supporting compiler
PostPosted: Wed Mar 17, 2010 12:01 am     Reply with quote

Hi

Which are the compiler we can use for pic16f690 ?
Can we use C18 compiler ?
Is there any charge to use Hitech compiler
_________________
Thanks & Regards
Lokesh Bhatt
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

Re: pic16f690 supporting compiler
PostPosted: Wed Mar 17, 2010 8:00 am     Reply with quote

lokeshbhatt wrote:
Hi

Which are the compiler we can use for pic16f690 ?
Can we use C18 compiler ?
Is there any charge to use Hitech compiler


The C18 compiler is from Microchip and they charge for it (although there is an evaluation/student edition).

It will not work with the PIC16 series to my knowledge.

I'm sure there's a charge for the Hi-Tech C compiler, but I don't have it so I don't know what it is.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group