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

How do putc() work?

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



Joined: 08 Oct 2010
Posts: 10

View user's profile Send private message

How do putc() work?
PostPosted: Wed Mar 02, 2011 9:29 pm     Reply with quote

Hi everyone! Although I have look for this function in PICC folder but I can't find this function. Can you tell me how to see inside this function? Thanks!
bkamen



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

View user's profile Send private message

Re: How do putc() work?
PostPosted: Wed Mar 02, 2011 10:55 pm     Reply with quote

agreement wrote:
Hi everyone! Although I have look for this function in PICC folder but I can't find this function. Can you tell me how to see inside this function? Thanks!


Look in the help file Ccsc.chm in your installation folder.

(mine is the default: C:\Program Files\PICC)

putc is easily searched in said file.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 02, 2011 11:04 pm     Reply with quote

Quote:
Can you tell me how to see inside this function?

To learn how to see the ASM code for putc(), read these threads:
http://www.ccsinfo.com/forum/viewtopic.php?t=22649
http://www.ccsinfo.com/forum/viewtopic.php?t=22149
agreement



Joined: 08 Oct 2010
Posts: 10

View user's profile Send private message

PostPosted: Thu Mar 03, 2011 7:35 am     Reply with quote

i see. thanks so much!
tim_sid



Joined: 11 Apr 2014
Posts: 16

View user's profile Send private message

PostPosted: Mon Jun 30, 2014 6:11 am     Reply with quote

Hello all,
I used this blocking technique in my code and I want to create blocking putc().
using byte and bit defined for TXIF i added this in my code.
Code:
while(TXIF==0);
     putc(packet[k]);

when i disconnect Rx Tx lines, shouldn't it stuck at this? my program goes on running and doesnt block at this point. Please suggest how can I create blocking transmit function.
Ttelmah



Joined: 11 Mar 2010
Posts: 19482

View user's profile Send private message

PostPosted: Mon Jun 30, 2014 7:44 am     Reply with quote

putc, already blocks. It waits if the character can't be accepted by the UART. However the UART will merrily transmit into an open line, so disconnecting the lines won't stop it.

You could make it check for 'line break', by verifying that the RX line is high before sending. This can simply be read as an input.
tim_sid



Joined: 11 Apr 2014
Posts: 16

View user's profile Send private message

PostPosted: Tue Jul 01, 2014 12:46 am     Reply with quote

Thanks Ttelmah,
This made some points clear about transmission. I will try it. Thanks.
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