View previous topic :: View next topic |
Author |
Message |
agreement
Joined: 08 Oct 2010 Posts: 10
|
How do putc() work? |
Posted: Wed Mar 02, 2011 9:29 pm |
|
|
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: 1615 Location: Central Illinois, USA
|
Re: How do putc() work? |
Posted: Wed Mar 02, 2011 10:55 pm |
|
|
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
|
|
|
agreement
Joined: 08 Oct 2010 Posts: 10
|
|
Posted: Thu Mar 03, 2011 7:35 am |
|
|
i see. thanks so much! |
|
|
tim_sid
Joined: 11 Apr 2014 Posts: 16
|
|
Posted: Mon Jun 30, 2014 6:11 am |
|
|
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: 19540
|
|
Posted: Mon Jun 30, 2014 7:44 am |
|
|
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
|
|
Posted: Tue Jul 01, 2014 12:46 am |
|
|
Thanks Ttelmah,
This made some points clear about transmission. I will try it. Thanks. |
|
|
|