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

Is possible to have several #INT_RDA of different STREAM?

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



Joined: 30 Jan 2008
Posts: 197

View user's profile Send private message

Is possible to have several #INT_RDA of different STREAM?
PostPosted: Wed Sep 30, 2009 8:32 am     Reply with quote

Hi, I am using the PIC18F452 and I need to capture the strings of three peripherals, they have different speeds (KB) and number of characters, I am taking this example like reference, where is implemented 2 UARTS by software, I doubt it, I can get different interruption (#INT_RDA)?

Code:
#USE RS232(BAUD=9600, XMIT=PIN_B0, RCV=PIN_B1, STREAM=COM_A)
#USE RS232(BAUD=9600, XMIT=PIN_B2, RCV=PIN_B3, STREAM=COM_B)

#INT_RDA (COM_A)
.
.
.
#INT_RDA (COM_B)
.
.
.


main() {
    char c;
    fprintf(COM_A,"Online\n\r");
    fprintf(COM_B,"Online\n\r");
    while(TRUE) {
         c = fgetc(COM_A);
         fputc(c, COM_A); fputc(c, COM_B);
        }
 }
Ttelmah
Guest







PostPosted: Wed Sep 30, 2009 8:45 am     Reply with quote

INT_RDA, is a _hardware_ feature, for the hardware UART.
If you choose a chip that has multiple hardware UARTs, then you get INT_RDA, and INT_RDA2. On a chip like yours, with only one hardware UART, you can only have one INT_RDA.
For the software UART, you don't get an INT_RDA (INT_RDA, says there is a character waiting in the hardware buffer - software UART, no hardware buffer....).
You can use the interrupt input line(s), and program an interrupt on this/these falling, to say that the 'start' bit has arrived on a particular serial line, (search here many examples posted in the past) _but_ while receiving this, you _will_ miss anything happening on other lines.
The alternative is to use external hardware UARTs, with buffers, and use these to interrupt the main chip.

Best Wishes
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