View previous topic :: View next topic |
Author |
Message |
helmi03
Joined: 12 Apr 2011 Posts: 7
|
Is some wrong with my schematic ? |
Posted: Sat Apr 16, 2011 11:26 am |
|
|
Hi, I just want to do a simple connection between pc and rs232.
I'm using 2 virtual port RS232 and a terminal.
When I send data to the pic, the pic answer with no data .
http://img821.imageshack.us/i/shema.png/
My code is :
Code: |
#include <16F877.h>
#device *=16
#fuses HS, NOWDT, NOLVP, NOBROWNOUT, NOPROTECT, PUT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,errors, stream=PC)
//int i=2;
int8 msg[40];
//int8 next_in=0;
void main() {
//set_tris_a(0x00);
while(1) {
msg[0]=fgetc();
fputc(msg[0]);
}
} |
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Sat Apr 16, 2011 5:01 pm |
|
|
Why not use the examples that CCS supplies in the examples folder ? |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sat Apr 16, 2011 8:07 pm |
|
|
I don't think the MAX232 pin #2 should be grounded. That is the voltage doubled +V and grounding it will kill the + and - charge pumps. It should have a cap to ground. See the MAX232 datasheet. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
surfer0815
Joined: 10 Sep 2010 Posts: 7 Location: Germany
|
|
Posted: Sun Apr 17, 2011 3:16 am |
|
|
HI! Ground pin 5 on your com Connector, and change Pin 2 and 3 of Com connector, It looks like your schema is wrong. |
|
|
|