Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How does RS232 work ?

Status
Not open for further replies.

ZS1BFE

Member level 1
Member level 1
Joined
Nov 17, 2007
Messages
40
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Cape Town South Africa
Activity points
1,612
I am using 2 x16f877 and transfer data via rs232.
If use a simple counter code, I can get the data from one PIC to the other, BUT as soon as I use other cade like i/p's and delay's to do more functions , then the rs232 does not work anymore.Sometimes the complete code does not work.
Can any one help me to explain how to do rs232 , or is there timing involved on when to rx/tx data via rs232???

I have looked at examples , but as I am fairly new to PIC , I do not understand all the examples. I use CCS C.

Thx
ZS1BFE
 

Re: RS232 not working

I have used PICBASIC by microEngineering Labs (https://www.melabs.com/) for an RS232 circuit without any problem. Give it a try.
 

Re: RS232 not working

Most probably the problem is timing.
check out for timing issues

Regards
Nandhu
 

Re: RS232 not working

Simple communication of RS232 does not invlove timing issue, as they are dependent on the the internal interrupt flag called TI and RI. So they will take care of timing. If you can post your code it might be useful to give suggestions.

Added after 30 minutes:

Simple communication of RS232 does not invlove timing issue, as they are dependent on the the internal interrupt flag called TI and RI. So they will take care of timing. If you can post your code it might be useful to give suggestions.

Added after 2 minutes:

Simple communication of RS232 does not invlove timing issue, as they are dependent on the the internal interrupt flag called TI and RI. So they will take care of timing. If you can post your code it might be useful to give suggestions.
 

Re: RS232 not working

ckshivaram said:
Simple communication of RS232 does not invlove timing issue, as they are dependent on the the internal interrupt flag called TI and RI. So they will take care of timing. If you can post your code it might be useful to give suggestions.

Added after 30 minutes:

Simple communication of RS232 does not invlove timing issue, as they are dependent on the the internal interrupt flag called TI and RI. So they will take care of timing. If you can post your code it might be useful to give suggestions.

Added after 2 minutes:

Simple communication of RS232 does not invlove timing issue, as they are dependent on the the internal interrupt flag called TI and RI. So they will take care of timing. If you can post your code it might be useful to give suggestions.

You're repeating yourself
 

RS232 not working

sorry there was problem with my browser. it used to logout whenever i submit the answer or was not responding. Sorry for repeating the same answer.
 

Re: RS232 not working

Hi,
I have written this code and found that it works when I change the Delay to 100ms,but as it is here, the data received only runs for about 3 or 4 cycles and then no data is received from rs232.
The output on portB also does not count anymore when rs232 stops.????

while(1)
{
a = getc();
output_d(a);
delay_ms(100); // If this delay = 500ms >>> problem

delay_ms(500);
value ++;

if (value>=200)
value = 7;
output_b(value);
}

If the problem can be solved by using interrupts, please advise how this is done.I have not tried interrupt before.
THX
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top