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

Mutiple RS232 Port problem !!! Help!!

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



Joined: 15 Jul 2005
Posts: 0

View user's profile Send private message

Mutiple RS232 Port problem !!! Help!!
PostPosted: Sat Jul 16, 2005 5:54 am     Reply with quote

Hello.

It is not skillful not to be it is sorry in English.
There is not it will not be able to use distant Multiple RS232 Port well.
I want the program which with lower part am same.


---- I want program of the method which -----
RDdata,WRdata : #User RS232 STREAM Name

A : The data which it sends (MAX232 IC 1)
Computer(RS232) -> Board (RDdata) -> Board(WRdata) -> Controller(RS232)
(value : A) (Value : A ) (value : A) (value : A)

B : The result data price against the A (MAX232 IC 2)
Controller(RS232) -> Board(WRdata) ---> Board(RDdata) ->Computer(RS232)
(value : B) (value : B) (value : B) (value : B)

-----------------------------------------------------


--------------------------------------------------------------------------------
--- Source Code ------

#include <16F877A.h>

#device *=16

#use delay(clock=4000000)

#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,STREAM=RDdata)
#use rs232(baud=9600,parity=N,xmit=PIN_B1,rcv=PIN_B0,bits=8,STREAM=WRdata)

char RDdata_char[81];
char WRdata_char[81];

#int_rda
rda_isr()
{
fgets(RDdata_char,RDdata);

fprintf(WRdata,"%s",RDdata_char);
}

#int_EXT
EXT_isr()
{

fgets(WRdata_char,WRdata);

fprintf(RDdata,"%s",WRdata_char);

}

void init()
{
enable_interrupts(int_rda);
ext_int_edge(H_to_L);
enable_interrupts(int_ext);
enable_interrupts(global);
}

void main()
{
init();

while(1)
{
}
}

------------------------------------------------------------------------------

"A" it sends the data which is from the computer and the RDdata (MAX232_1_IC) it passes by and the WRdata (MAX232_2_IC) it passes by and and control le with it is delivered,, the data which is and control le from "A" a data again it analyzes the WRdata (MAX232_2_IC) with it sends and the altruism the RDdata (MAX232_1_IC) with in the sound last which is delivered is transmitted with the computer.

I want the program which the place must become the operation in the dignity explanation arctic regions. The data which is transmitted with the RDdata does not become transmission with the WRdata. With above together the place program percentage lye, well it does not become. The explanation which is simple or annual festival entrusting it gives.
bill147



Joined: 26 Oct 2004
Posts: 13

View user's profile Send private message

PostPosted: Sat Jul 16, 2005 11:56 am     Reply with quote

I am not able to understand what your problem is.

I would offer comments as to your code.

I have tried to use external interrupt with a software serial port and could not get it to work for me.

I would suggest to not use #int_EXT.
But to use the following in the main() function:

Code:

while(1)
{
 if(kbhit(WRdata))
 {
  fgets(WRdata_char,WRdata);

  fprintf(RDdata,"%s",WRdata_char);
 }
}



Bill
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