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

rs232 questions...

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



Joined: 16 Dec 2005
Posts: 22

View user's profile Send private message

rs232 questions...
PostPosted: Wed Jan 18, 2006 1:12 am     Reply with quote

Hi,

I just want to ask the following:

1.) Is it necessary to use RC7 (16F877A) as the RCV pin in RS232 in order to use #INT_RDA? Or it doesn't matter what pin I would use?

2.) If I�ll be using two #RS232 functions with different XMIT and RCV pins (2 pins for xmit and 2 pins for rcv), would that affect the #INT_RDA I set up for one of the RCV pins?

Thank you... Confused

-=alDin=-
Embarassed
ckielstra



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

View user's profile Send private message

PostPosted: Wed Jan 18, 2006 2:56 am     Reply with quote

Quote:
1.) Is it necessary to use RC7 (16F877A) as the RCV pin in RS232 in order to use #INT_RDA? Or it doesn't matter what pin I would use?
Only RC7 can be used for #int_RDA. No other options are available.

Quote:
2.) If I�ll be using two #RS232 functions with different XMIT and RCV pins (2 pins for xmit and 2 pins for rcv), would that affect the #INT_RDA I set up for one of the RCV pins?
The #INT_RDA will work for the rcv connected to pin RC7 but it might affect the data received on the other stream.

Try to understand the internal workings of the PIC processor. The CCS provided function #RS232 functionality is very nice but can not work miracles. When you specify the pins RC6 and RC7 to the #RS232 declaration then the compiler knows you want to use the internal hardware UART. By specifying other pins the compiler will generate a software UART for you. The CCS software UART has limited capabilities, for example:
- it can not generate interrupts
- it can not buffer data
- it can not send and receive data simultaneously
- interrupts occurring during data receive or transmit will affect the timing and cause communication errors (mangled characters).

There is only one hardware UART in the 16F877A which is connected to RC6 and RC7. Only the hardware UART can generate interrupts.

Trying to implement multiple serial streams, where one ore more software UARTs are involved, is a potential nightmare. Try to design your system so that only one serial stream will be active at any time, this will prevent problems from the streams interferring each other.

I can recommend to buy the book PIC Microcontroller Serial Communications by Roger L. Stevens. This book contains detailed info on serial communications including source code for improved software UARTs under interrupt control (he uses int_ext to create an alternative for the int_rda).
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