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

Multiple RS232 Port (16F877A)

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







Multiple RS232 Port (16F877A)
PostPosted: Fri Jul 15, 2005 3:16 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)

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)

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


--------------------------------------------------------------------------------
--- 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,errors)
#use rs232(baud=9600,parity=N,xmit=PIN_B1,rcv=PIN_B0,bits=8,STREAM=WRdata,errors)

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)
{
}
}

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

The explanation reads me in small quantity and it is strenuous. English to be insufficient, the bedspread. Reply entrusting it gives in the annual festival center.
Guest








Re: Multiple RS232 Port (16F877A)
PostPosted: Fri Jul 15, 2005 3:20 am     Reply with quote

---- 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 : MAX232 IC 1) -> Board(WRdata : MAX232 IC 2) -> Controller(RS232)
(value : A) (Value : A ) (value : A)

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

-----------------------------------------------------
bill147



Joined: 26 Oct 2004
Posts: 13

View user's profile Send private message

PostPosted: Fri Jul 15, 2005 8:11 am     Reply with quote

One thing the errors keyword should only be used with Rdata stream since it is using the hardware port. The software port would not use errors.

I would reccomend using a timer function instead of the external interupt for the software port. You could keep calling kbhit(stream) or just monitor the input pin for a low to know when data is coming in. This has worked for me.

Bill
Guest








PostPosted: Fri Jul 15, 2005 9:49 am     Reply with quote

It is input in the RDdata the "A" price does not become transmission with the WRdata.

If there to be a COM1, COM2 to the board which I produce, is received with the COM1 the data which with the COM2 to transmit, ten sup ni all. But the data of the COM1 is not transmitted with the COM2. And again to transmit the DATA which is received from the COM2 with the COM1, ten sup ni all.

I do well! from will give a bay help initially and in small quantity. The suffering cold region the 7th day passed already because of this portion.
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