Strange start problem

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

Hi guys,

I have the weirdest problem... I'm trying to make a sinusoidal brushless controller based on the AVR447 app. note. Everything is ok, i mean the motor works but the MCU doesn't always start ok. Sometimes it starts sometime it doesn't. I have to remove and reapply power a couple of times until it starts. When it starts, everything works just fine. I've tried everything, i've even changed the MCU and i've built another circuit with new components. Every time it has the same behaviour.

Any help is appreciated...

Thanks,
Jarod

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

Include LEDS turned on in different parts of your code to find out if MCU is running but have a bug.
Look at your clock (if not internal) with a scope to see if you have a ticking clock.
Does your RESET pin have a pull-up resistor (10k is a normal value)?
Maybe include some delay at beginning of your code?

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

Hello again... Another strange thing... Application built with ICC AVR works fine every time. Application built with IAR AVR doesn't work and hangs at startup almost everytime... I'm evaluating both IDEs but i think i'll purchase the ICC as it seems simpler and it doesn't fail like the IAR.

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

In the end, I don't think it's a fault the compiler. Maybe your code just does something funny?

Have you tried GCC compiler?

- Jani

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

jarod31 wrote:
Everything is ok, i mean the motor works

1) I've tested it w/o motor yet and notice that in hall's combinations (PC0 PC1 PC2) 110 and 011 there are no PWM on any PWM outs.

In another combinations 101, 011, 101, 110, there are 2 PWM presence that varyed by "SPEED" pot.

How can motor starts from 110 and 011 rotor positions ?

2) PD4 has strange behavier not that one is in AVR447.pdf

Last Edited: Sun. Feb 1, 2009 - 01:24 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jarod31 wrote:
MCU doesn't always start ok. Sometimes it starts sometime it doesn't.

Try my FUSE combination

jarod31 wrote:
Application built with ICC AVR works fine every time.

Can you shared to me ICC project or only .hex

Thanks ![/img]