petit jc wrote: > > I would like to connect a pic (13c84) to the serial port. > The problem is that I don't want to use any battery and no converter > 0/5v +12v/-12v. > I would like to use the line TX at the level (-12 v) and so I need to > put a regulator between TX and GND. But what about the other lines? How > can I obtain the correct protocol? It seems that a mouse works like that > (TX/GND -12v) but I can't find any schematic of a mouse... > Thanks for response. > petitj@esiee-amiens.fr Hi Jc, I don't know why you want to use the TX insted of RTS. well, this is a circuit that connect to PC via serial port, use no other power supply than the RS-232 and works up to 19200bps. The PIC can receive and transmit data. If you need code, I can send to you, just ask me. Octavio nogueira@mandic.com.br list n=78, p=PIC16C84, r=HEX ;*************************************************************************** TITLE "RS232C Interface" ; ; Comments: PIC-16C84/PC RS232 Interface ; By: Terry Rudersdorfer, AScT ; Date: Aug/94 ; Revised: Sep/94 eliminate transistor, diode and resistor on RX ; Revised: Oct/94 added test led for do something test ; ; Fuses: XT or HS and PWRTE enabled ; ; This design provides; ; - full duplex 2400 Baud with 8 bits no parity 1 stop using ; a standard 5.066 MHz communication xtal. ; - only 3 resistors to provide an RS232 Tx/Rx electrical interface ; - power is obtained from the standard RS232 control leads. ; (RS232 O/P's can sink/source 10mA; this circuit uses < 5mA.) ; ; Simple RS232C - PC to PIC Interface Aug/94 T. Rudersdorfer, AScT ; revised Sep/94 ; ; 1 - 470 ohm short circuit current limit ; 1 - 10k open collecter pull down ; 1 - 47k power up pull up ; 1 - 470k injection current limit ; 2 - 15pf oscillator stabilization ; 1 - .1uf decouple PIC and regulator ; 1 - 10uf voltage stabilization ; 1 - 5.0688MHz standard communication xtal ; 1 - 1N4150 reverse voltage blocking diode ; 1 - 78L05 5V low power regulator (100mA Max) ; 1 - 16C84 PIC ; 1 - LED do something test led ; 1 - 2k7 do something current limit for test led ; ; PC DTE DCE ; ; RX<(3)--(3)-/\/\/\/-----------------------------+--/\/\/\/----+ ; 470 | 10k | ; |\ | | /// ; +-----/\/\/\/--| >|---------------------+ | ; | 2k7 |/ | --------------- | | ; | LED | 1 U RA1 |--+ | ; | ^ +5V | RA0 |----+ ; | | | ____ 1 Osc1 |------------------+ ; +---+-/\/\/\/--------| MCLR 6 Osc2 |------+ | ; 47k +-----| Vss C Vdd |--+ | _ | ; | +--| RB0 8 | | +---||_||---+ ; /// | | 4 | | | 5.0688MHz | ; TX>(2)--(2)-/\/\/\/-----+ | | | _|_ _|_ ; 470k |_______________| | ___15pf ___15pf ; | | | ; 1N4150 _____ ^ +5V | /// /// ; |\ | | | | | ; RTS>(4)--(4)-+----| >|----+---|78L05|---+------+ ; | |/ | | 1|_____|3 | ; CTS<(5)--(5)-+ _|_ |2 _|_ ; | ___10uf | ___.1uf ; DSR<(6)--(6)-+ | | | ; /// /// /// ; GND (7)--(7)-+ ; | ; /// ; ; RS232 RX circuit background: ; Based on AN521 in the 1993 Embedded Handbook; PIC I/O pins can handle ; +/- 500uA of continuous injected current. This means voltages greater ; than VDD and VSS CAN BE used as long as adequate current limiting is ; provided. My original RX input design isolated the PIC by using an ; extra transistor, diode and resistor. This can be eliminated by using ; a large enough resistor value in series to the PIC I/O Pin. RS232 ; voltage levels can be up to +/- 15V, therefore, a 470k resistor provides ; an adequate current limit of 32uA (the same current used in AN521). ; ; RS232 TX circuit background: ; Researching specification sheets for RS232 receivers like the 1489, ; reveals that they do not require bipolar voltages to operate. The ; 1489 in fact clips all -ve signals to ground, therefore only requiring ; +ve and ground input levels. ; ;