-Jonathan Kirwan wrote:
->
->
->>What's the best way to compensate for RS232 levels that are out of spec?
->> The absolute levels I'm getting are around 9.1V, and I'd like to
->>raise them to the 12-13V level.
As pointed out these voltages are not in fact out of spec.
->>I've deduced (from my very limited electronics - learning all the time!)
->>that I could either build a transistor amplifier (given that I have
->>access to a 12V power source), or feed the signal through a MAX232/233 -
->> what would be simplest?
The simplest would be a transistor switch (not an amplifier per se) that
switches 13V.
->>If it matters - the problem is that my serial-port PIC ICSP cannot read
->>back (or verify) what's been programmed, although the programming is
->>definitely working correctly. Doing a Read-All (using IC-Prog software)
->>it gets the first word back correctly, the second wrong, and the rest
->>are 0x3FFF. I'm hoping it's not the timings - I don't have a clue how
->>to fix them (and have no Oscilloscope anyway...)
What PIC chip are you testing with?
-> The RS-232 specification allows for 9V signaling, I believe. Just a
-> moment..., looking in both 2nd and 3rd ed McNamara..., yes, the
-> requirement is that the loaded voltage should be between +5 to +15 or
-> else -5 to -15. The receiver is supposed to consider anything over +3
-> or below -3 as valid. And the open circuit driver voltage should not
-> exceed 25V.
Bingo. So many RS-232 ports that are PC based fall out of spec that one
should not even bother to try to extract a paricular voltage level from it.
I always treat RS-232 as if it were going to be a 0-3.3V out of spec signal.
Many serial ports for laptops will produce exactly that.
-> So this is probably not your problem. The 9.1V (assuming we are
-> talking about +9V for a SPACE and -9V for a MARK) you mentioned is
-> within the specification and should work just fine.
But the PIC programmer presumes that +-12V are going to be available. A
mistake BTW.
-> It very well may be your timing that is causing later words to be read
-> incorrectly.
Depending on the chip, it may be the voltage.
THe OP's best bet is to use an external power supply to generate the Vpp
voltage and then use the RS-232 modem line to switch it.
-Thanks Jon - unfortunately I seem to have misled you somewhat - the
-problem is that the PIC (16F876A) that I am dealing with expects
-13+/-0.5V on its Vpp - the 9.1V it's getting is obviously way off that.
However the 16F876A in particular will accept a Vpp that is only 3.5V above
Vdd. So in fact it should work with a 9.1V Vpp.
So it's possible that some other issue is causing the problem.
- The programmer is a version of the Ludipipo programmer (also
-equivalent to JDM) and uses direct manipulation of the serial port
-signals to control the programming of the chip. It's not actually doing
-RS232 comms - just using the wires...
I know it well. This is one reason that I prefer, design, and maintain
parallel port programmers as parallel ports are always within TTL spec.
Let me suggest that if you have a parallel port that you may wish to
consider throwing together one of my Trivial Programmers. You can find
them here:
http://www.finitesite.com/d3jsys
They are quite reliable when attached to short cables. Also one of my
users has experimented with grounding the cable shield via a small valued
cap (0.1 uF IIRC) and has had success with even 10ft cables.
One of my students recently threw a low voltage one together. Once the
cable was debugged it worked like a champ.
Just some ideas.
BAJ