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

Serial Rx Problem

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



Joined: 05 Dec 2009
Posts: 40

View user's profile Send private message

Serial Rx Problem
PostPosted: Sat Feb 05, 2011 8:10 am     Reply with quote

hey guys
i have a problem in receiving a string on MC Serial Port,
but my Tx controller is sending data properly i saw it on PC RS232 port,

for tx i'm using this & its work on PC RS232 but i'm not able to receive it on MC port

Code:

itoa(value,10, string);
puts(string);
putc(10);       
putc('\r');
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Feb 05, 2011 8:52 am     Reply with quote

You'll have to post a complete, compilable program for anyone to help you.
Will also need compiler version and PIC used.
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Sat Feb 05, 2011 11:02 am     Reply with quote

One possible guess.

If the serial receive, 'sees' data arriving, and your code does not handle it, the receive buffer (only a couple of characters - depends on the PIC), will overflow, and overflow error _will_ be flagged, and the UART _will_ stop receiving data.
Possibility is if you are sending stuff, and the unit at the other send is also sending things, but your code is not actually retrieving this. Hang.

Make sure you have 'ERRORS' in your #USR RS232 line, which will make the compiler add code to clear this error. Consider using a serial receive interrupt, and properly handling the data that is being sent.

Best Wishes
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