View previous topic :: View next topic |
Author |
Message |
lokeshbhatt
Joined: 16 Mar 2010 Posts: 11
|
Serial getc() Problem in GSM |
Posted: Tue Mar 16, 2010 10:39 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
bkamen
Joined: 07 Jan 2004 Posts: 1611 Location: Central Illinois, USA
|
|
Posted: Tue Mar 16, 2010 11:18 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
lokeshbhatt
Joined: 16 Mar 2010 Posts: 11
|
pic16f690 supporting compiler |
Posted: Wed Mar 17, 2010 12:01 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
bkamen
Joined: 07 Jan 2004 Posts: 1611 Location: Central Illinois, USA
|
Re: pic16f690 supporting compiler |
Posted: Wed Mar 17, 2010 8:00 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|