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

Software Serial

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



Joined: 26 Jan 2011
Posts: 31

View user's profile Send private message

Software Serial
PostPosted: Wed Mar 30, 2011 7:21 pm     Reply with quote

Hi
I am trying to use two serial communication in PIC16f877a -Software as well as hardware serial. Unfortunately, if I use fprintf( stream,"CCS"), then the hardware serial also wont work!
What may be the problem?
Here is my code

Code:


#include<16f877a.h>
#use delay(clock=20000000)
#USE RS232(BAUD=4800,errors,PARITY=N,XMIT=PIN_D1,RCV=PIN_D0,BITS=8,stream = CH1)
#USE RS232(BAUD=9600,errors,PARITY=N,XMIT=PIN_C6,RCV=PIN_C7,BITS=8)

void main()
{
   char ch;
   
   fprintf(ch1,"CCS");
   while(1)
   {
      delay_ms(1000);
      printf("hai");
      }
      }
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 30, 2011 8:02 pm     Reply with quote

Make all #use rs232() statements into streams. Use fprintf with stream
ID's for everything. Then it should work.
ratheeshbr



Joined: 26 Jan 2011
Posts: 31

View user's profile Send private message

Software Serial
PostPosted: Wed Mar 30, 2011 10:27 pm     Reply with quote

Thanks for the immediate reply
So , I have to use stream for Hardware usart too!
thanks
will reply
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