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

interesting rs 232 problem!!! F1 please :)

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



Joined: 21 Apr 2008
Posts: 3

View user's profile Send private message

interesting rs 232 problem!!! F1 please :)
PostPosted: Sun Apr 27, 2008 5:35 am     Reply with quote

Hi to everybody..

I have a project about rf communication. (Rf integrates are UDEA atx-34 UDEA arx-34) I should communicate 2 pic 16f628 with each other. The communication will be full dublex. But i wanted to try it step by step. So first i communicated them half duplex. First circuit has transmitter and the second circuit has receiver, and the rf integrates communicates with PIC by the UART module. As you know i used for receiver for half dublex.

Code:
#use rs232(BAUD=600, RCV=PIN_B1 )


and for transmitter
Code:
#use rs232(BAUD=600,XMIT=PIN_B2)


the system works with these parameters perfect.


But when i try to communicate them full dublex with the code ;


Code:
#use rs232(BAUD=600,XMIT=PIN_B2, RCV=PIN_B1, BRGH1OK, PARITY=N, BITS=8,ERRORS)


it doesn't work !!!

i couldn't understand? what can be problem??
this is my final project and i have only a mount to achieve it...thanks
Izzy



Joined: 27 May 2007
Posts: 106

View user's profile Send private message

PostPosted: Sun Apr 27, 2008 7:17 am     Reply with quote

Try using hardware UART. Pin C6 and C7.

#use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

and make sure you have C6 of one PIC connected to C7 of another PIC and vice versa.
volki_56



Joined: 21 Apr 2008
Posts: 3

View user's profile Send private message

PostPosted: Sun Apr 27, 2008 2:24 pm     Reply with quote

Sorry but i wrote PIC 16f628...it has no c port..Maybe you confused with 16f877...i used the uart module of 16f628..

It is very interesting and nonsense...

Has anybody ever experienced this problem???
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sun Apr 27, 2008 3:10 pm     Reply with quote

Are you using interrupts for the communication?
Half duplex is easy without the use of interrupts but for full-duplex you need interrupts or you are running a high risk of loosing data.

You will have to show more of your program for us to tell what is wrong.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sun Apr 27, 2008 4:44 pm     Reply with quote

Quote:

But when i try to communicate them full dublex with the code ;

Code:
#use rs232(BAUD=600,XMIT=PIN_B2, RCV=PIN_B1, BRGH1OK, PARITY=N, BITS=8,ERRORS)

it doesn't work !!!
i couldn't understand? what can be problem??


Well, to communicate both devices in full duplex mode, the above modifications are not
the only things that you need to do. You need to establish a way to handle or arbitrate the
data flow between devices, normally it is done either using Hardware Control (RTS/CTS) or
Software Control (Xon/Xoff). The only chance that you have in an RF link, is to use Xon/Xoff.

Software Control Xon/Xoff
When the buffer within the receiving end is nearly full, Xoff is sent to the transmitting end
to ask it to stop when data have been processed by the receiving end and the buffer has
space again, Xon is sent to the transmitting end to notify it to resume.

Hardware Control (RTS/CTS)
The transmitting end activates RTS to inform the receiving end that it has data to
send if the receiving end is ready to receive, it activates CTS.


Humberto
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