USB disconnects in automotive environment....
eagletalontim
Posts: 1,399
in Propeller 1
So I have been testing a circuit that reads several sensors in a vehicle, but for some reason, the USB keeps disconnecting at high RPM. Everything else keeps working properly on the circuit board. I know that an automotive environment is quite electrically noisy, but even my 2 ADC circuits are reading smooth up to when the USB disconnects, then I can't see the data afterwards. The FTDI UART is connected exactly how the Parallax Prop Plug shows on the datasheet except for a removable jumper between the reset pin on the Prop and the UART. This is to prevent the circuit from restarting when plugging in the USB to the laptop while the circuit is running. The problem does not happen all the time, but happens quite often. The UART is powered from the Laptop and the negative (-) is bonded to the circuit board's low voltage ground plane. The shield of the USB cable is not bonded to anything on my current circuit board.
How can I fix this issue? Is it possible, my power supply is not filtering the 12V automotive power properly? Does anyone have a fail proof circuit to power the Prop and 5V ADC circuits in a very electrically noisy environment?
How can I fix this issue? Is it possible, my power supply is not filtering the 12V automotive power properly? Does anyone have a fail proof circuit to power the Prop and 5V ADC circuits in a very electrically noisy environment?
Comments
*** EDIT : The top ground plane is unfilled for easier viewing purposes.
Is your system in a well-shielded box ?
Depends on the type of interference so you could try it without grounding first and add it if that does not help.
I have tried no ground plane and single traces for the ground and a full ground plane for all 5V and 3.3V components. Neither worked. I am starting to wonder if I should connect the shield of the USB to the ground of the board. The device is plugged into a Laptop and hardly ever into a desktop so the shield is never contacting common ground of the vehicle. Should I try to connect the USB shield to the ground plane or straight to the negative input on the board? The ground plane is connected to the negative side via a 0.05 trace.
Your FTDI circuit for some reason is copied straight from the Parallax Prop plug schematic without reference to the FTDI datasheet itself. I say this because you have a 4.7uF across the VCC but that is relatively high-impedance at high frequencies so you should always put a ceramic decoupler across it close to the chip as well such as a 0.1uf. I've seen quite a few Parallax schematics that are can I say.. a bit "amateurish". So always do your homework and don't just copy a circuit, even the best circuit, without checking to see what's best for you.
The shield should normally be connected only from one end but I don't think it's going to affect anything in terms of ground loops if you do short it across to your board's ground, at least to see if this helps.
I've attached a section of the schematic of my "Prop Plug" which while pin compatible also has 4 extra pins in IDC fashion which include VCC and I2C.
I have attached the PCB in DipTrace format. Maybe that will help. Pretty much all components are filled out with their values.
And here is the 5V regulator I am using now. The original one got too hot for my comfort. : http://www.recom-power.com/pdf/Innoline/R-78Exx-0.5.pdf
EDIT *** I also have a strange thing that happens every time. If the circuit is turned on first, then the USB is plugged up, the Prop will reset which is highly undesirable. I ended up having to put a jumper on the Prop Reset pin so this would not happen. This makes it a pain to program the chip since I have to open the box, connect the jumper, then program it every time. Is there a different way to do this so I can leave the jumper always connected?
Some questions which maybe a schematic would help with too:
Why are you using a DIP EEPROM when everything else is SMD?
What is the supply voltage as I see you are driving the 3.3V regulator directly from it. Careful of 5V switchers feeding A/D chips directly as you will have switching noise, either use a filter or follow it with a linear regulator (at a lower voltage).
I try to avoid adding USB serial onto the board directly but if it's something you use all the time then that's fine although I prefer micro USB connectors (with through hold lugs).
If you use an smd crystal, even 6MHz (96Mhz) or 10MHz (80Mhz) you will find it a lot easier to route it cleanly around that area. Those crystals are cheap and those frequencies are plenty plenty fine, believe me. I will see if I find anything else but you are doing well.
The supply voltage is automotive "12V" and the regulator was a test to see if it would work. It can handle up to 40V input. I don't like the new chip, so I will revert back to regulating down to 5V, then use an LDO 3.3V regulator from there. I have had a bad problem with flyback spikes from relays or other coil type items on the same power input. I was thinking of putting a larger cap after the diode before the regulators and try an inductor again. My last power supply did not protect against flyback voltages either. Still battling with that one....
The USB is not only used for programming the chip as the circuit provides the end user a way to communicate directly with the board and see live data through my Windows program I have written. It also allows the user to adjust certain variables that are used for calculating different outputs based on their vehicle.
I did search for an SMD crystal that would fit, but was worried about using a different size than a 5Mhz crystal. Digikey is where I place my large stock orders and I was not able to match up a good fitting one
Now I hope you are not saying it can handle 40V because the component datasheets says 40V. A car can get really good economy but you won't be able to drive it with your foot flat to the pedal at the same time. So in similar manner you may operate the regulator at up to 40V input but don't expect to draw much current from it before you start to exceed the power rating of the package and how it has been mounted. 12V down to 5V at 100ma will dissipate the difference in voltage as heat, so you are dissipating 700mw in a tiny package and the regulator will not like that. Try running it at its rated 40V but at 100ma and it should give you a nice bit of magic smoke in return.
If you want a reliable design just use those switching regulators as you mentioned, the other thing is that because they use an inductor in series with the load it effectively becomes an extra filter. By the same token the output of a switching regulator has high frequency ripple, not a problem for digital circuits but don't try to run analog directly from it. The 3.3V regulator is really happy if you run it from the 5V switcher, it's a great partnership, use it.
If you are battling with big spikes coming through the power rail then consider using a common-mode choke but that means feeding both the power and the input ground through it.
As for crystals if you try to stick to 5Mhz you don't have much choice in SMD but use 10Mhz and change your clock parameters to x8 PLL mode so you still get 80MHz.
I've used many different types including small through-hole cylindrical cases but also a lot of 5x3mm 2-pad smd devices like this one. I will have to dig deeper to find some other part numbers.
https://www.digikey.com/product-search/en/filters/common-mode-chokes/3408553?FV=14340003,1434001f,1434002d,14340042,fff40034,fff802a9,3180002&mnonly=0&newproducts=0&ColumnSort=1000011&page=1&stock=1&pbfree=0&rohs=0&k=common+mode+choke&quantity=10&ptm=0&fid=0&pageSize=25&pkeyword=common+mode+choke
What is the maximum current drawn of your circuit, and what is the minimum voltage drop across the regulator.
The minimum voltage drop across the regulator is not on the data sheet, so I am not sure. The data sheet is listed above in a pdf link.
However I thought your main problem was that you had not connected pin 18 ground of the FT232R chip, surely that would be a very good reason for it to disconnect on a little bit of noise. I haven't heard you mention anything about this.
I have not been able to test the grounding of pin 18 yet. My day job takes 90% of my week days
Well you certainly are only adding to the 90% if you ain't doing the .01%. No need to check, I know it is not connected according to your artwork, you just need to bridge it.
One thing that comes to mind is the fact that the USB disconnects randomly at higher RPM which means that it probably has something to do with the RPM signal. Since the RPM signal on the vehicle I am testing this in is a 5V pulse each ignition pulse, I use a voltage divider setup with resistors which is R19 and R20 on the above attached Diptrace file.
The RPM signal can be either 5V or 12V to 15V so I need to be able to detect either voltage ranges without damaging the Prop. The values I have selected are 10K and 100K.
I hope the spacing works...
The one thing I see that could contribute to this issue is the ground plane on the top layer is not connected to the bottom ground plane anywhere close to the voltage divider for the RPM input signal. It is connected closer to the middle of the board so it is getting continuity though. Could that be an issue?
The next thing could be noise filtering. I probably need a BUNCH of help with this. On the car we are testing this on, it has a methanol spray that kicks in once the intake pressure rises high enough. When that solenoid is fired off, the USB seems to disconnect due to that. If the spray is turned off, the USB still disconnects, but randomly and usually high RPM.
Thoughts?
You're probably going to blow the prop pin if you connect the RPM signal like that. A 100K on the RPM signal and clamping diodes on the prop pin side would be safer. A 100K to a transistor & 10K pullup to 3.3V then on to the prop pin would be even better.
The 10K as you have it now is OK with 5V, it was the 12V & 15V signal you posted that I commented on. Pretty much any transistor would be fast enough. 9000RPM at 12 pulses per revolution is only 1800Hz. Any one of the transistors you listed is good for 100MHz or more. Probably wouldn't need a pulldown resistor for this application.
The RPM change did not work. I even disconnected the RPM signal and it still dropped the USB connection