Author Topic: Help with AVR's USB in automotive environment  (Read 1741 times)

0 Members and 1 Guest are viewing this topic.

Offline cmcraesloTopic starter

  • Regular Contributor
  • *
  • Posts: 60
  • Country: 00
Help with AVR's USB in automotive environment
« on: December 20, 2016, 07:55:19 am »
Hey Guys.

I'm having problems with my USB device in automotive environment. I've been struggling around this for a very long time and haven't found any solution yet. My device, when connected to my laptop (everytime I crank the car or push the throttle hard or just randomly), just looses USB connection to my laptop (windows). I need to unplug and plug the USB connector back in and everything works again. The device itself is not powered off and it works without any problem. I'm using the XMEGA192C3 usb driver from ASF and windows drivers that come with the ASF example.

I've attached a schematics of my USB connection. Please note that the capacitors C45, C46, C47 and C48 and resistors R45 and R46 are 1mm away from the AVR.

Any help and advice would be really appreciated. I'd even pay for a working USB design in this application..
« Last Edit: December 20, 2016, 07:57:52 am by cmcraeslo »
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Help with AVR's USB in automotive environment
« Reply #1 on: December 22, 2016, 03:59:49 pm »
What exactly is your set up?  And what does automotive have to do with it?  You mention it disconnects from your laptop... is this inside your car? whilst looking at your car? or whilst being 'powered' by the vehicle ?

I'm assuming - from the fact things 'reset' whenever you 'crank' - that you have something powered from the cars electrical system, in which case you will have to deal with large transients, sudden dips well below 12V, and general hellishness.  Its a less-than-ideal power supply, so would require heavy filtering, protection, and decent capacitance after a diode to take up the slack.

I could be wrong, but your post just reads like you have an issue with USB... that is somehow linked to your car...
 

Offline cmcraesloTopic starter

  • Regular Contributor
  • *
  • Posts: 60
  • Country: 00
Re: Help with AVR's USB in automotive environment
« Reply #2 on: December 22, 2016, 06:30:50 pm »
Hey. This is actually a shifting control unit that runs in the car and controls the gearbox. Being connected by laptop is for the setup and diagnostics only. There are no other noticable problems (a/d works normally, other functions aswell..), so i am assuming usb itself is a problem.
 

Offline elecman14

  • Supporter
  • ****
  • Posts: 169
  • Country: us
Re: Help with AVR's USB in automotive environment
« Reply #3 on: December 22, 2016, 09:43:33 pm »
Sounds to me like you may be having a power supply issue. Without a full schematic of your power supply, it would be probably hard to troubleshoot. Probably not practical but a passenger with a high end scope is always helpful to troubleshoot something like this.

Some random thoughts:
  • Try a new usb cable. They do go bad over time. Especially the cheap ones.
  • If you have access to a DMM with a min/max function (like a fluke 87) hook it up across device power and go for a drive. Check out what min is when it crashes. Your hard acceleration may be causing the system voltage to sag.
  • If you are powering this with your car try putting a large value cap >= 1000 uF across device power.
  • If you think it is working and you have a brown out register set. Try disabling it and see if the device is just resetting often. If you have spare gpio you could hook up an LED to show when reset occurs.
 

Offline cmcraesloTopic starter

  • Regular Contributor
  • *
  • Posts: 60
  • Country: 00
Re: Help with AVR's USB in automotive environment
« Reply #4 on: December 23, 2016, 07:34:52 am »
Hey.

Device works normally and was tested running more than 24 hours without a glitch (like reseting). I did find some problem with the supply and will try to fix it first and then report (see attachment)

Blue is the 3.3V line, yellow is 12V.


Thanks
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Help with AVR's USB in automotive environment
« Reply #5 on: December 23, 2016, 08:17:13 am »
Looks fairly typical for a car. The environment is not nice. There is a reason they use the robust CAN bus for diagnostics!

Those common mode spikes on the 3v3 are not normal. But you probably are using the scope with the ground aligator clip?
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Help with AVR's USB in automotive environment
« Reply #6 on: December 23, 2016, 06:39:44 pm »
So its a circuit using the XMEGA with USB, that's powered form the car.  Do you have a schematic of the power supply for this?  As noted the drops in the 3v3 line are easily enough to reset things, especially a microcontroller (which will no doubt have brown-out as well).

As you say it 'generally works well', then it should just be a case of redesigning/modifying the power supply for this.
 

Offline TheDane

  • Regular Contributor
  • *
  • Posts: 209
  • Country: dk
Re: Help with AVR's USB in automotive environment
« Reply #7 on: December 24, 2016, 07:52:25 am »
What I/O's do you have 'out' in the car?
- it sounds like a ground current/EMC issue to me. (Fast changes on the alternator/starter generates high currents who needs a place to go (like your I/O's who is clamped to Vcc and Gnd) - the battery has an internal resistance that is much higher when charged, than discharged)

A galvanic isolated USB connection might be the best solution - try look into http://www.analog.com/en/products/interface-isolation/isolation/standard-digital-isolators/adum4160.html#product-overview or http://www.linear.com/product/LTM2884
It's not free, but not all cars are equal - and it might save you a lot in the future, not least your time  :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf