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 CCS Technical Support

RS 232 connection with PIC18F8722 and CCS C

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



Joined: 01 Mar 2008
Posts: 3

View user's profile Send private message

RS 232 connection with PIC18F8722 and CCS C
PostPosted: Sat Mar 01, 2008 4:28 pm     Reply with quote

Hi

Can anyone help me or suggest me how i could read a VARIABLE STRING RESPONSE from a device connected via a RS232 to my PIC. I want to then be able to check each of the character of that read string and then loop into my code.

I tried with putc and getc but cant make it generic when the length of the response changes.

The code need to get whatever length string the response is given by the device at the RS232 PIN and store it in say response[x].

thanks
ujjwal
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Mar 01, 2008 4:38 pm     Reply with quote

What is the string terminator? Whatever that is, you have to look for that to know the current string is completed.

if there is no terminator you start a timer on the receipt of each character then wait several character times to know when the string is complete.

If the characters in each string don't always come in together and there is no terminator I offhand don't know of any solution to your problem...
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