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

ATI Commands & Rs232 - PIC 18F8722

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



Joined: 04 Jul 2007
Posts: 4

View user's profile Send private message

ATI Commands & Rs232 - PIC 18F8722
PostPosted: Wed Jul 04, 2007 4:57 pm     Reply with quote

Hi,

PLEASE HELP!

I'm trying to implement a timeout on serial port if I don't get a character after say 30 seconds. I've looked at the timed_getc() example, this is fine upto 1/2 second but if I increase this it never returns.

I'm using the following to read the ATI response from a modem.

fprintf (rs232stream,"ATI4\n\r");

while (1)
{
c = fgetc (rs232stream);
fprintf (hyperterm, "%c", c);
}

I would love it if I could replace the above with a timeout version which works - many thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 04, 2007 11:12 pm     Reply with quote

What about this thread that you started two weeks ago ?
At the end of the thread you said everything is working fine.
http://www.ccsinfo.com/forum/viewtopic.php?t=31209
newbie_1974



Joined: 04 Jul 2007
Posts: 4

View user's profile Send private message

PostPosted: Thu Jul 05, 2007 12:11 am     Reply with quote

Hi PCM Programmer,
That wasn't me, but thanks for posting the link. I'm new to PIC programming, I was thinking on the same lines of the example but don't know how to do it.

My question is on the RTCC timer, can you let me have an example of a variable time out function such as:


Code:
void timeout ( int16 num_secs)
{
   // this will wait num_secs before timing out

   ...
      code
   ...
}


I'm not completely sure of the best way to do this - thanks

help!
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