Running slow with MAX3232 serial — what have I done wrong?

385 views
Skip to first unread message

minc...@gmail.com

unread,
Oct 24, 2023, 7:35:52 PM10/24/23
to [PiDP-11]
Hi — I could do with some help adding serial ports to my PiDP-11.

I built my PiDP-11 and set it up and everything was running hunky dory — blinkenlights flashing, switches and knobs working, lamp test, everything.

I wanted to add some real serial ports, though, and bought a couple of CH340G USB-TTL adapters and added a couple of Maxim MAX3232CPE+ (note 3232 and not 232, if that makes any difference) RS-232 transceivers.  I used 50V 0.1µF capacitors for C1 and 0.47µF for C2-4: I picked these values from the datasheet at https://www.farnell.com/datasheets/1913103.pdf, given that Vcc is 5V.

The problem is the Pi is now running REALLY slowly — the PiDP-11 side looks fine in that all the switches seem to work and respond.  If I login via SSH (over wireless), however, the Pi really grinds: things like 'apt upgrade' take ages (much longer than normal), and it is generally very sluggish.

Also, I don't get any useful output from the RS-232 interfaces: connecting something gives me no input or output, my oscilloscope can decode RS-232, so I think something is subtly wrong, such as the voltage.

If I take the Pi off the PiDP-11 board, it runs quickly again.

I'm doing more fiddling about and trying to remove things from the board again to see when it speeds up (currently, it looks like removing C2-4 has made a difference) but I'm hoping someone can suggest something obvious I should be looking for.  For example, could using too large or small caps cause this?

The Pi is a 3B+ and I'm powering it from a 2.5A genuine Raspberry Pi micro USB PSU.

Any tips greatly received!  Thanks in advance,

  - Bob

minc...@gmail.com

unread,
Oct 24, 2023, 7:50:46 PM10/24/23
to [PiDP-11]
Oh, one last thing... when running something meaty, I get a message from the kernel saying that the voltage has dropped on input.  I think the PSU is OK but I'm not tried another.

Johnny Billquist

unread,
Oct 24, 2023, 7:54:19 PM10/24/23
to pid...@googlegroups.com
I have no real idea what you might be facing, but I hope you haven't
managed to get the serial ports in such a way that the system things
there is data coming in all the time on the ports...

Johnny
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/87f559dd-31fe-4284-aeac-54658c4f4f6fn%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/87f559dd-31fe-4284-aeac-54658c4f4f6fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol

minc...@gmail.com

unread,
Oct 25, 2023, 4:27:33 AM10/25/23
to [PiDP-11]
Thanks for the reply... I don't think so -- I've tried disconnecting the cables from the USB-TTL transceivers and get the same problem.

I've been asked what capacitors I'm using — they're just ceramic ones, so I think unpolarised — these: https://www.farnell.com/datasheets/2305633.pdf — the MAX3232 datasheet doesn't say any particular type is needed.

Gerry Duprey

unread,
Oct 25, 2023, 5:55:19 AM10/25/23
to minc...@gmail.com, [PiDP-11]
Howdy,

The fact that you can remove it to restore speed and that you received a low volt warning suggests
the RS232 adapter is overloading the power supply. Which could result in all sorts of bad behavior
(possibly slowing the CPU - not sure I heard of that, but). What is weird is that normally, that
sort of chip doesn't put much of a load at all on the power - few millis, but that is it.

What you might want to do to rule it out is try a larger power supply. So if you had, for example,
a 2A, 5V power supply, try a 2.5A or even 3A power supply. You may need to consider bypassing the
normal Micro USB connector too for power (although up to 2.5A should be fine).

That said, I'd review the schematic of the new RS232 driver closely - it really should only one a
few milliamps and the fact that its pushing the power supply over is a little suspicious. It is
possible you were right on the edge with the power supply before this, but that seems almost too
coincidental to me. You might have a bad chip drawing too much power or miswired adapter or bad caps.

If you do try a larger PS, if you have the ability, using a multimeter to test the amperage draw of
your RS232 adapter might be really useful. Anything over about 20ma would be suspect to me.

But pretty strong indicators that this is a either weak power supply, bad/power-hungry adapter or both.

Gerry

On 10/25/23 04:27, minc...@gmail.com wrote:
> Thanks for the reply... I don't think so -- I've tried disconnecting the cables from the USB-TTL
> transceivers and get the same problem.
>
> I've been asked what capacitors I'm using — they're just ceramic ones, so I think unpolarised —
> these: https://www.farnell.com/datasheets/2305633.pdf — the MAX3232 datasheet doesn't say any
> particular type is needed.
>
> On Wednesday, 25 October 2023 at 00:54:19 UTC+1 [PiDP-11] wrote:
>
> I have no real idea what you might be facing, but I hope you haven't
> managed to get the serial ports in such a way that the system things
> there is data coming in all the time on the ports...
>
> Johnny
>
> On 2023-10-25 01:35, minc...@gmail.com wrote:
> > Hi — I could do with some help adding serial ports to my PiDP-11.
> >
> > I built my PiDP-11 and set it up and everything was running hunky dory —
> > blinkenlights flashing, switches and knobs working, lamp test, everything.
> >
> > I wanted to add some real serial ports, though, and bought a couple of
> > CH340G USB-TTL adapters and added a couple of Maxim MAX3232CPE+ (note
> > 3232 and not 232, if that makes any difference) RS-232 transceivers.  I
> > used 50V 0.1µF capacitors for C1 and 0.47µF for C2-4: I picked these
> > values from the datasheet
> > at https://www.farnell.com/datasheets/1913103.pdf
> <https://www.farnell.com/datasheets/1913103.pdf>, given that Vcc is 5V.
> https://groups.google.com/d/msgid/pidp-11/87f559dd-31fe-4284-aeac-54658c4f4f6fn%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/87f559dd-31fe-4284-aeac-54658c4f4f6fn%40googlegroups.com> <https://groups.google.com/d/msgid/pidp-11/87f559dd-31fe-4284-aeac-54658c4f4f6fn%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pidp-11/87f559dd-31fe-4284-aeac-54658c4f4f6fn%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> Johnny Billquist || "I'm on a bus
> || on a psychedelic trip
> email: b...@softjar.se || Reading murder books
> pdp is alive! || tryin' to stay hip" - B. Idol
>
> --
> You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> pidp-11+u...@googlegroups.com <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/5d7d21a5-28d1-4c73-9927-8227ba558546n%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/5d7d21a5-28d1-4c73-9927-8227ba558546n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Erik Hanson

unread,
Oct 25, 2023, 10:18:40 AM10/25/23
to [PiDP-11]
This sounds familiar, do they get hot? I had a similar problem with some MAX3232C that turned out to be fake. They got very hot and didn't work at all. I replaced them with some real MAX232ECN from Digi-Key which solved the issue.

While I swapped out 3232 for 232, I don't think that's the issue. It was not my issue, mine were definitely fake and not from a reputable distributor. Real 3232 should drop-in for the 232.

If the ICs you have are known-good I'd try removing them from the board to see if the problem goes away.

minc...@gmail.com

unread,
Oct 25, 2023, 8:08:29 PM10/25/23
to [PiDP-11]
Thanks for the replies.  I'm considering sourcing some alternative MAX232 chips just to try something different, although this looks like I'd need different capacitors.  All the comments on this forum say you need 0.1µF but surely this depends on the exact version of the MAX232 chip and Vcc (although Vcc here will always be 5V, I assume), so although they're functionally the same and I can put in a 232 instead of a 3232, but I'd probably need to change the capacitors?

The MAX3232s I have may be dodgy but I'd be surprised, since I bought them from a reputable UK retailer (Farnell), unless anyone has experience of them sending anything dodgy.  I've got an order going in for some stuff from RS, so I could try them.  The 232 looks like it consumes more power than the 3232, although neither are major users.

As an aside, how much power does the PiDP-11 bit consume on top of the normal Pi power, for all the LEDs and other stuff?

I've tried unsoldering the 470nF capacitors and removing one of the MAX3232s and things seem fine with a single serial port: no slowdowns and the serial port works.  So I'll probably try inserting the other MAX3232 and resoldering the capacitors to see what it does.

The suggestion about the power supply sounds sensible — I do have a bench power supply, so I'm thinking of connecting them up to the PiDP-11 board power input and running things that way.  That will let me monitor the current, too.

Bill Backstrom

unread,
Oct 25, 2023, 8:28:38 PM10/25/23
to [PiDP-11]
I once measured the PiDP-11 draw at 7 mA idling and 19 mA with all the LEDs on in test mode.

Erik Hanson

unread,
Oct 25, 2023, 8:42:02 PM10/25/23
to [PiDP-11]
Ah, you're right, I didn't take the cap values into consideration. I don't think it matters though if you're using the recommended value.

The datasheet Farnell has for the 3232CPE+ has a table of minimum values to use on page 9, in a section with "Using Four 0.1µF External Capacitors" in the title. There's no maximum value so it's reasonable to think 1uF (which the 232 datasheet recommends) would also be fine for the 3232. 


Re Farnell, I'm not in the UK but I understand they're reputable, I think some trustworthy YouTubers like GadgetUK164 and BigClive have spoken highly of them. I doubt you got fakes.

With one working, I would swap it for the other one and see if possibly it went bad. Could have also been a solder bridge that's gone now.

Glad to see you're getting somewhere with it.

On Wednesday, October 25, 2023 at 7:08:29 PM UTC-5 minc...@gmail.com wrote:

minc...@gmail.com

unread,
Oct 26, 2023, 6:20:32 PM10/26/23
to [PiDP-11]
I've not tried resoldering the capacitors and reinserting the second MAX3232 but I've tried powering things through the PiDP-11's power connector (the pins on the TTL-level Pi serial connector) and shorting the keyswitch terminals (since I don't have the keyswitch connected).  On my bench power supply, I've set 5.35V and 2.5A maximum current — the Pi boots but I get a lot of undervoltage warnings and the Pi behaves slowly, even though the bench PSU is reporting 5.35V but only about 500mA being drawn.

That seems odd to me (I was expecting it to show a much higher current and possibly the voltage dropping, once it hit 2.5A) — perhaps there is a problem elsewhere.

If I power things the other way — via the Pi and the 2.5A micro USB PSU — I measure 5.1V on the power connector pins (and 5V at the MAX3232 between pins 15 and 16).

I think the next thing is to try resoldering the capacitors and replace the second MAX3232.

Henk Gooijen

unread,
Oct 27, 2023, 2:35:57 AM10/27/23
to [PiDP-11]
If you replace the MAX3232, do it as follows.
Cut the pins as close to the body of the IC, and try to avoid force on the pin / solder joint on the PCB. The IC is way cheaper to replace than the PCB!
Now that the IC body is removed, you can desolder each pin one by one. Use a solder sucker to clean the pin holes in the PCB. Then insert an IC *socket*, preferably one with "machined pins". Those are the best quality. Avoid single-spring contacts, double-spring contacts are OK.
Remove the capacitors, do not overheat the PCB. If you want to be careful, cut one lead of the capacitor as close to the capacitor. Now you only have to heat one pad to remove the capacitor / lead.
If you use MAX232 use 1 microFarad polarized capacitor. Check the datasheet for correct polarity! If you use the MAX232A (notice the "A" suffix), you can use 0.1 microFarad capacitors (there is no polarity).
BTW, repeat your tests after you removed the MAX2323, that might give some insight.

minc...@gmail.com

unread,
Oct 30, 2023, 5:09:02 AM10/30/23
to [PiDP-11]
Thanks... I put in dual-wipe sockets for the MAX3232 and put the chips into those so swapping those should be easy.  The capacitors I will have to desolder but I do have a desolder station.  I ordered a MAX232A (well, actually a MAX232ACPE+ as that's all I could find) and 10x 0.1µF capacitors to replace everything, which should arrive in the next day or so.

All that said, I've done more testing over the weekend and I've had some confusing behaviour: after removing the Pi 3B+ from the PiDP-11 board and disabling the pidp11 service from starting on boot, I get normal performance.  My test is to install and remove git using apt (as this exercising things a fair bit): if I 'time' the sequence 'apt install git -y; apt remove git -y; apt autoremove -y', this takes 27.7s real and 19.08s user on the first run, immediately after boot.  Running it second time, however, it now takes a massive 3m52.7s real but 19.632s user.  The load average is up at 3-4 but there isn't anything apparently busy in 'top' (the highest program is 'top' itself at about 1-2%, occasionally showing 'dpkg' popping up for a second or two at 30% or so).  Every subsequent run takes 4-5 minutes but the same user time.

I moved the SD card to a spare Pi 2B and I get the same behaviour (although it takes around 32s user as it's slower, but real time is still 4-5 minutes).

I then took another SD card which hadn't had the PiDP-11 software installed and that doesn't seem to have the same issues: it always takes the same (sub-minute) real time to run.  I've now moved that SD card to the Pi 3B+ and it is consistently running the above command in around 30s of real time and 16.358s of user time.  So I'm now thinking it's a software problem.

I'll take a fresh card and install Raspberry Pi OS on it, test it as above, whilst connected to the PiDP-11 board.  If all is good, I'll gradually reinstall things and see where and if it goes wrong, but this is looking more like a software problem (or a problem with the SD card) now.

Clem Cole

unread,
Oct 30, 2023, 10:37:50 AM10/30/23
to minc...@gmail.com, [PiDP-11]
One small suggestion  - test your chips before you try it.
If you have a protoboard, take your MAX chips and place them on it.   Power it will 5 volts on pin 16 and GND on 16

Pins 1-2-3 make up a voltage doubler.  Assuming in you using 232A's and have .1 uF caps, you should see +10 volts on pin 2 
Pins 4-5-6 make up a voltage inverter.  again Assuming in you using 232A's and have .1 uF caps, you should see -10 volts on pin 6 

Assuming this works apply +5v to pin 10 and 11 and you should see -3 to -9 volts [traditional RS-232 level low - it's an inverter] on 14 and 7
Then looping 14 to 13 and 7 to 8, you should see a CMOS/TTL 'high'  on 12 an 9.

Repeat with GND on pin 10 & 11 which should produce +3 to +9 volts [RS-232 level high] on 14 and 7 a CMOS/TTL 'low'  on 12 an 9.

Change the cap's appropriately for the chips you use.

Note for the newer MAX32XX family - life is a little different - besides being different pin out [18 pin vs 16], 2  - 3 - 4 make of the positive pump and its only +5.5v volts on pin 3 and 5 - 6 - 7 with -5.5v on pin 7.    The output swings are more modest [the original chip could hand +30v/-30v swings of the original RS-232 B&C standards although IIRC the 220/232/232A only drives to about 5-6 volts +/- on the output.] 


--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/1d7875d1-e34a-4042-8056-05be796fe217n%40googlegroups.com.

minc...@gmail.com

unread,
Oct 31, 2023, 7:12:57 PM10/31/23
to [PiDP-11]
Thanks for all this — I'm going to do that with the MAX232A that arrived today, along with the new caps, but as more of an electronics project.

The good news is that I've fixed things, and the cause was... the SD card!  Or perhaps the type of SD card!

I was using a SanDisk Ultra 16GB, SDHC C10 (one of the red and grey ones) and I've switched to a SanDisk Edge 16GB, SDHC A1 U1 C10 (a black one) and everything is now working.  I tried a different SanDisk Ultra red/grey one and had the same problem (with a fresh image written to the card).  The first alternative card I tried was another black SanDisk 16GB U1 C10 card, not branded Edge, and that didn't have any problems.

This is all very weird — maybe the two SanDisk Ultra cards are broken in some way, but I get no errors, just sluggish performance once it gets busy: I've used those in some other Pis and not had any issues, though.  I'm going to stick with the Edge though.

This is all without changing the MAX3232s out, plus using the 0.1µF and 0.47µF capacitors; all the serial ports are working, too (although I haven't got them working under BSD2.11 yet, but that's for later)!  So I think everything is OK.

The 'undervoltage' errors I haven't had since I've had the PiDP-11 in pieces and I've traced that to the short extension between the Micro USB power input on the Pi and the panel mount connector: if I put that back inline, I get the warnings; that it out and they go.  I've ordered a new one of these that is supposedly compatible with the Pi3B (I'm getting it from ThePiHut in the UK, so I assume it's going to cope with the higher current).

So, it turned out to have nothing to do with my soldering or electronics and was something different.  Sorry for leading you all on a wild goose chase and thanks for all your help.

Steve Haflich

unread,
Nov 1, 2023, 11:11:32 AM11/1/23
to [PiDP-11]
Although Sandisk is generally considered a reliable brand, a significant business exists inserting misbranded lesser/slower misbranded counterfeits into the retail supply chain.  Googlr `counterfeit sdhc' to find lots of info about identifying fakes and avoiding them in future purchases.

Jonathan Morton

unread,
Nov 1, 2023, 5:42:39 PM11/1/23
to Steve Haflich, [PiDP-11]
> On 1 Nov, 2023, at 5:11 pm, Steve Haflich <shaf...@gmail.com> wrote:
>
> Although Sandisk is generally considered a reliable brand, a significant business exists inserting misbranded lesser/slower misbranded counterfeits into the retail supply chain. Googlr `counterfeit sdhc' to find lots of info about identifying fakes and avoiding them in future purchases.

While this is true, there's also a lot of expected performance difference between genuine SanDisk card models, and this is not signalled very well by the marketing materials. You will want to distinguish between them very carefully when buying, and refer to guides as to which cards have been tested to perform well when used in a Pi. The access patterns - particularly the write patterns - from a Pi a very different to those from a camera or even a phone.

- Jonathan Morton

minc...@gmail.com

unread,
Nov 2, 2023, 2:40:39 PM11/2/23
to [PiDP-11]
The SD cards I have I think should be genuine as I tend to buy them from "reputable" locations, typically Amazon (and Amazon as the seller, not just the marketplace).  It's possibly they're fakes but they don't look it and I would be surprised if Amazon themselves were sourcing counterfeits.

Any, as you've said, there is a difference between models and, looking at the SanDisk / Western Digital website, there is no information about why to choose one over the other.  Clearly there are things like different classes and the U-number, A-number etc. but it's all vague.  The text describing why you'd choose a particular model has clearly been through the marketing nonsense department.  I think some are geared up for streaming large files (like video recording) whereas some for making lots of small accesses (which I think would be more your Pi territory), but I can't find anything that explains this.

The PiHut in the UK sells only SanDisk Edge (which are black) but I'm not clear how they've arrived at that.

In other news, the panel mount USB extender arrived yesterday and works fine — my undervoltage warnings are now all gone, so we're all good (aside from the BSD 2.11 thing, but I'll work some more on that!).  Thanks all for your help!

John Kline

unread,
Nov 2, 2023, 2:52:22 PM11/2/23
to minc...@gmail.com, [PiDP-11]
I tend to buy them from "reputable" locations, typically Amazon (and Amazon as the seller, not just the marketplace)

Do a search on: amazon commingled inventory

Unless something has changed, I think you will find that Amazon commingles inventory for a single product from multiple resellers, including “sold by amazon” inventory.

On Nov 2, 2023, at 11:40 AM, minc...@gmail.com <minc...@gmail.com> wrote:

The SD cards I have I think should be genuine as I tend to buy them from "reputable" locations, typically Amazon (and Amazon as the seller, not just the marketplace).  It's possibly they're fakes but they don't look it and I would be surprised if Amazon themselves were sourcing counterfeits.
--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages