SRAM corruption Due to EMI , Weird Crystal behavior

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi All,

I have noticed some strange behavior with my code and I had couple of questions:

My board is a DC brushed motor(perm magnet.) control board. The DC brushed motor is within 10 inches of this board.

my questions/situations are:

1. Question- Can EMI noise corrupt SRAM or PC counter? i am seeing some weird behavior if I turn on PWM and start turning the motor. Weird Behaviors are: Watchdog reset, Software reset. A reset without any Reset flag status, my Variable corruption, Also it seems like my PC jumps into some unknown code locations..

2. Question- If I use my external crystal as my system clock source, my system resets either by (software or watchdog or sometimes gets stuck in an unknown state...). But if I use PLL as System clock source and use External Crystal as PLL source, I see less of this behavior. Is there a filter on PLL?

3. Info- If I use internal RC 2MHZ as source to PLL i haven't been able to recreate this problem.

4. Info- I have brown out detection enabled and also OSC failure monitor is also enabled.I don't see any of them getting triggered.

5. Info-If I have my System clock source set for External OSC (16MHZ), and i run the DC motor, If i move my hand close to the Crystal proximity, or close to where the micro resides, i notice motor speed change and sometimes an earlier reset. If i touch my Crystal package/case, i see a definite reset /miss behavior.

5. Question-Can my program counter get corrupted due to noise? what about SRAM variables? Is the noise getting through my XSOC inputs?

Thanks for your thought/help.

Last Edited: Sat. Apr 30, 2011 - 04:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EMI can affect things, but it would have to be huge. As a first pass, I'd guess it's not your problem. Or, not your first problem.

Your point 5, about moving your dog (hound) close to the xtal, is interesting. Although I personally keep my dog well away from my boards, to each their own. :) Check your xtal capacitor values. It sounds like your xtal caps may be the wrong value - if I had to guess I'd suggest the caps may be too large? Check the manufacturer's datasheet for the exact xtal you're using - the datasheet should tell you the caps to use.

I assume the xtal and caps are right up close to the CPU - no long wires or traces of any description?

I'd certainly be worried about noise on the supply lines. Motors are noisy as heck. I don't suppose you have a 'scope so you can look at things?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi frankvh,

haha, my dog is my "hand" misspelled ...

anyways, i do have a scope, the problem is the scope it self pickups lots of noise as well... and also whenever I use the scope, the problem becomes less (I think i might have bad ground also, because when i connect the ground lead of the probe, issue becomes less but still happens. Same is true when I connect the debugger as well(it also connect my board to earth ground). I tried increasing my capacitor but it made it worse so I think you are right. I'll decrease it.

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Actually as far as the crystal issue goes, I don't understand how it could relate to:

1. why I don't see a XOSC failure interrupt if my capacitor values are wrong.

2. Why would I see SRAM corruption?

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Noise can do some very unpredictable things, even sometimes appearing to cause things that it does not.

How you have the current paths on your board will make a huge difference. Here are some critical questions:

1) What provides power to the motor and what provides power to the electronics?

2) How do you control the motor? An H-bridge or something else?

3) How are the ground or common points for the electronics and the motor power circuit connected?

4) How do you run the motor circuits from the control device to the motor?

Can you provide a schematic and board layout (image)?

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim,

Unfortunately I cannot provide a schematic at this point but here are some info:

1. Drive a DC motor using High side IGBT FET.
2. AC in gets rectified to 170 VDC
3. DC motor supply is running off of 170 VDC
5. Motor current path goes through a .1 ohm resistor to Hot ground when FET is ON.
4. Micro-controller ground reference is also at hot ground.

When i used my scope, i had isolated the micro controller using isolation transformer.

So what I'm hearing is that all the things I have mentioned is possible in a noisy environment?

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, what you see is clearly possible. I simply might not draw the same conclusions that you have about what is going on inside the chip.

Is motor current actually flowing ON your board or is the current sense resistor located off-board?

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The current is flowing ON my board.

can you explain a bit more on what you mean by this:
"I simply might not draw the same conclusions that you have about what is going on inside the chip. "?

are you saying it might not be noise that's causing what i'm seeing? firmware?

Thanks.