I built a circuit that uses a level converter max232 and now i need to cancel it due to make pcb smaller and reduce cost.I saw many circuits can work without this ic.They use classical resistors.So how should i connect rs232 pins to my pic 16f628 and how should i modify my ccs c code? Thanks.
Analyzer
If your only goal is to save PCB space, did you consider using another level converter? For example the dallas DS275 has only 8 pins and requires no external components. Other semiconductor vendors offer such parts, too.
You can use the following but in software you have to invert the data.
Output is easy with only a resistor in series(1K) just for protection.
Again you have to invert data.
This way you may have shorter line length.
Yes, the simple resistor will work with the
PIC/RS-232 connection - most of the time.
However, if this is for a product that others
will be using, it is proper engineering practice
to adhere to the specifications. Just because
it might work with your PC doesn't mean it
will work with all others. Been there, done that.
OK
1)We have input from RS-232C
2)place a divider 47K(series) with 22K(to GND)
3)At the output of the divider (midpoint of 47K and 22K) connect
the cathode of a 1N4148 and its anode to GND.
4) Take signal from 1N4148 cathode.
If you need to drive a long length of cable, use level converters. The RS232 level must be greater than +/- 3V at the receiving end to operate properly. If you drive less than 5V, make sure that the receiver at the other end will see enough voltage.