News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

18F25K22 ICSP problem

Started by Peter Truman, Nov 17, 2023, 12:55 AM

Previous topic - Next topic

tumbleweed

I don't understand what you're suggesting. With nothing connected to the RS232, the MAX232 will be driving it's RX output high (which is connect to the pic's PGD).

With nothing to isolate the signal what are you going to "current boost"? Surely you're not suggesting to add something to sink (short) the output of the MAX232 low.

John Lawton

I assume as has been said that the U2 programmer is trying to pull this line low, and is sometimes being unsuccessful, so yes I was suggesting that the U2 output is current boosted. Messy but there you are.

John

tumbleweed

In my book that falls under the "very bad idea" category. There's no max current limit on the output, so you'll have to try and sink who knows how much current.

Add the resistor. You only really need one... the PGC shouldn't be a problem since it's a MAX232 input.

John Lawton

I agree it's nasty, but if it gets the OP out of a hole with his present (expensive) boards that is a pragmatic fix.

Of course he needs to add a resistor or a link on the RS232 line so he can program the PIC normally on a revision of the board, we can all agree on that.

Peter Truman

Quote from: John Lawton on Nov 18, 2023, 01:36 PMThe OP said "These particular boards cost me about Aus$2k to have made (inc assembly) for 3 boards - and all 3 exhibit this same problem - so I don't want to have any more made until I understand what is going on."

So he probably isn't able to modify these boards, adding resistors, he needs a fix which is what I suggested.
It is indeed tricky. These boards are all surface mount, with 0603 size resistors and capacitors. It's also 4 layer so a lot of the signal tracks are buried on layer 2. Having said that, these are prototypes so no hardship including series resistors on the data lines for the next version.

I did think I might add a couple of jumper shunts to the data lines - that way I could remove them for programming - but that is a recipe for disaster in the field. Just a question then of exactly what size R to add that won't cause a problem with the MAX232 and yet are big enough to solve the problem. Surely Microchip must have thought this through? (I emailed ME Labs to see what they may suggest - no answer!)


John Lawton

You only need one resistor, on the RXout pin of the RS232 adaptor, and as Les said 470R to 2k2, it is not critical.

John

tumbleweed

The value of the resistor is going to depend on what the output stage of the U2 programmer looks like, and I've never seen a schematic. Just from looking at pictures of the board it would appear that PGC/PGD are driven from  PIC IO pins with a series resistor of ~220 ohms(?), but that's just a guess.

For comparison, here's a pic of the output stage of a PICkit2 programmer.

Whatever series resistor you add is going to create a voltage divider with either of these output stages.

tumbleweed

#27
Look at it this way - adding a series resistor is effectively adding a pullup to 5V onto the PGD line.

If the U2 has an output R of 220 and you add a 470 R pullup then the output low voltage on the PGD line is going to be 220/(470+220) * 5V = 1.6V.

If you add a 2200 R pullup it's 220/(2200+220) * 5V = 0.5V, which is better.

Since that doesn't account for any Vol of the output driver itself, I'd be inclined to go even higher, perhaps as high as 10K.