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

gets help!!!

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



Joined: 06 Mar 2008
Posts: 35
Location: pakistan

View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger

gets help!!!
PostPosted: Thu Apr 03, 2008 1:33 am     Reply with quote

Code:
#include <18F452.h>
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=App,bits=8)   
#use rs232(baud=9600,parity=N,xmit=PIN_B1,stream=PC,bits=8)


i am using int_RDA for stream App but i am not successful to use it for stream PC.

if interrupt is only allowed for hardware UART. How can i get string from other stream....
Matro
Guest







PostPosted: Thu Apr 03, 2008 1:39 am     Reply with quote

#int_RDA is an interrupt trigerred when receiving a byte.
Your PC stream hasn't a receive PIN.

So I can't understand your question.
Matro.
Guest








PostPosted: Thu Apr 03, 2008 2:41 am     Reply with quote

i am sorry i forget to mention
Code:
#use rs232(baud=9600,parity=N,xmit=PIN_B1,rcv=PIN_B4,stream=PC,bits=8)
Matro
Guest







PostPosted: Thu Apr 03, 2008 3:05 am     Reply with quote

The fact is that an interrupt can't be generated if you use a "software" serial communication engine.
You have to poll it.
But personally I would have use the B4 pin for TX and B1 for RX. Because B1 is an external interrupt pin, you should have activated the corresponding interrupt and use it to detect the start condition of a new byte.

Matro.
Audi80



Joined: 07 Sep 2007
Posts: 41

View user's profile Send private message

PostPosted: Thu Apr 03, 2008 10:27 am     Reply with quote

Hi there i would suggest a usage of a pic with 2 uarts if that´s what you want do you want to interrupt is anything comes from the both serial ports?? if so you can use a 18f8723 that has 2 uarts, that´s what i use for most projects and the you could do something like this:
Code:


#include <18F8722.h>
#fuses INTRC,NOPROTECT,NOWDT
#DEVICE HIGH_INTS=TRUE
#use delay(clock=32000000)

#use rs232(baud=9600, xmit=PIN_G1,rcv=PIN_G2,ERRORS,UART2,STREAM=COM2,BRGH1OK)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7,ERRORS,UART1,STREAM=COM1,BRGH1OK)

/////////////////////////////////////////////////////////////
#INT_RDA2
   void something2(){
      fputc(fgetc(COM2),COM2);
   }
/////////////////////////////////////////////////////////////
#INT_RDA
   void something1(){
      fputc(fgetc(COM1),COM1);
   }
/////////////////////////////////////////////////////////////

void main() {
   setup_oscillator(OSC_32MHZ);
   enable_interrupts(GLOBAL);
   enable_interrupts(INT_RDA);
   enable_interrupts(INT_RDA2);

   for(;;){}
}


Hope it helps...
Guest








PostPosted: Thu Apr 03, 2008 10:39 pm     Reply with quote

thank you!!
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