EMI hanging serial port. Any ideas?

donperryjm

Well-known member
Hello guys,

Teensy 4.1 with sound/serial.
I have this client with one of my devices in an automotive (car) environment.
There is a harness from the device that goes in engine bay.
Device works well, sound works and serial works. As soon as the car is started about 10 seconds give or take it hangs the serial port.
The device no longer responds to serial BUT the audio is still coming over into windows.

if the harness is disconnected there is no issue. IF the harness is present and not connected to the car, the issue is there! So the harness is like an antenna I suppose. I know it's EMI related as the sound has some huge spikes coming in now and then, too.

But as for the serial hanging, do you think there is anything I can do about that? Make it recover after a hang?



So far I told him to get Ferrite bead on the USB, not sure how much that would help but eliminating that would help I guess.


P.S, I have hundreds of customers using it but only this guy has this issue now, and I've seen it only once before now.
 
When you say "serial", are you talking about regular serial communication which involves connection to RX1 and TX1 (pins 0 and 1)?

Or are you talking about USB Serial? The only mention of USB in your message is about a ferrite bead... so it kinda sounds like regular hardware serial. But you also talked about connection to Windows, and today most PCs no longer have serial ports. But many motherboards still do have a header for COM1 serial.

If you're using USB Serial, which version of Windows could matter. All pre-10 versions had serious bugs in USBSER.SYS.
 
First thing to check is if the Windows computer is Windows 10 or later. The bugs in earlier versions of windows manifest as a hung serial port. It's very confusing, because it the port ever disconnects while any program has the COM port open, the next time (even days or months later) Teensy connects, Windows detects it and creates a COM port which doesn't work and is for all practical purposes completely hung. Fortunately Microsoft finally fixed this and other nasty USB Serial bugs in Windows 10, but they never published a fix for Windows 7, 8 or any other earlier versions.
 
The other thing you can try is forcing Teensy to use only 12 Mbit/sec speed, even when 480 Mbit/sec would have been possible. You'll need to edit usb.c in the core library. Look for this line.

Code:
        //USB1_PORTSC1 |= USB_PORTSC1_PFSC; // force 12 Mbit/sec
 
Is this in a classic car or something a little older than normal? From experience older cars, especially those pre-computer controlled engines, can create an absolute nightmare environment for modern electronics.
None of this is teensy specific but there is only so much you can handle in firmware. If that fails take a look at shielding, use big ferrites with a the cable doing a couple of turns through them, and physically move things as far away as you can from the ignition system, the distributor and spark plugs are the biggest noise sources.
 
Close to a classic car because it's using spark plug lead wires and a distributor. So not a points ignition but not much better either.
 
Back
Top