Exact match. Not showing close matches.
'[PIC] - Transistor Not Gate (Inverter) for UART Rx'
I have a 18F1320 where the UART works goes to TTL fiber optic
transmitter (Optek OPF1412T) and Receiver (Optek OPF 2412). Using a
74LS00 Nand gate on the receiver with a 560 ohm pullup on the one NAND
input and other tied to 5 volt, everything works fine at 9600 baud.
Prefer using transistor inverter. First tried (NPN) 2N2222A with :5 volt
> 1K ohm > collector, Emitter > ground, and signal (from OPF 2412) >
4.7k ohm > Base. With Pic online, no joy, but remove the PIC and jumper
TX > RX, OK. As I understand the 1320 (with schmidt) low level needs to
be 0.2 volt or less, and I was getting 0.3 volt. Then tried (PNP) 2N3906
with : 5 volt > Emitter, Ground > 1K ohm to collector, and signal > 4.7K
> base. Now the low is getting to 0.00 volts. Tried a 0.1 mfd capacitor
between 5 volt and ground. The Tx > Rx jumper thing still works, but the
1320 should receive one of several characters and respond with a string
or a character, which isn't happening.
I also have a MAX232 on the circuit, the transmitter (from the 1320)
always active, but a jumper to select either the RS-232 or fiber
receiver so as not to drive the RX pin from 2 sources.
The board is a PICPROTO18, the fiber optic goes to a 6' Tyco jumper
cable (with loopback works fine) to a B&B FOSTC serial (either RS-232,
Rs-485, but now RS-232) to fiber optic converter to a PC.
Assuming I have some sort of timing issue with rise fall times, but I
don't have a O-scope to troubleshoot. :)
My guess would be the 1k between the collector and the +5V line is too
high to pull the line up fast enough - how long is the line or is
there addtonal capacitance on it? 1k @ 5V is "only" 5mA . at 9600
bits/sec the risetime required is goiig to be better than 26uS (1/4
bit?) If the schmitt input threashold is 0.2V then
Try dropping the 1k to 330 ohms or so. Or you could use a PNP/NPN
pair to actively pull the line high.
On 01/11/06, Carl Denk <alltel.net> wrote: cdenk
Now the line between the pic and the breadboard that the transistor and
resistors are on is roughly a foot apart. If I can get this working a
little, I'll move the stuff to the PIC's board. I'll try dropping the
resistor, someone else suggested 470 ohms, but at the moment the MAX232
quit working, that's my fall back, get that working, then move the DB-25
and connect to the fiber transceiver. Thanks. :)
Richard Prosser wrote:
San Mateo, 31 oktober 2006.
I'm not sure if this helps, but in my Drake 2 I used an RTL inverter to
handle my RS-232 input. It should be somewhere in the schematic:
R7 is 27 kOhm, R8 is 1 kOhm, the transistor is a 2N4124. I've had successes
with it up to 100kbps, although I generally use it at 2.4Kbps, so I'm not
sure if those 100kbps speeds are reproducable.
And yes, the circuit relies on the diodes inside the PICmicro to handle
excesses. In a real circuit you might want to have additional diodes
external of the PICmicro.
Thanks for the comments. I had 2 other replies that suggested R7 be 330
or 470 ohm. One's comment was to make sure the transistor was saturated,
and current not that much. Since this runs off 120 volt and not battery,
a little extra power not a problem. The Pic quit even on the RS-232,
have had problems with that before, don't know why, but in the morning
I'll take a good look at things. :)
Maarten Hofman wrote:
More... (looser matching)
- Last day of these posts
- In 2006
, 2007 only
- New search...