New AVR board, runs immediately without halting at main :(

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

Any ideas anyone.
I've a MEGA32A project running under JTAG emulation - one circuit board works fine.. but my new pcb ( variation ) simply loads code then runs without even halting at main. I can't work out what's different between them.. fuses look ok.. nothing special. The code appears to have been loaded ok, but its not running properly.

I'm loading the same project into two different PCBS.
In one it works - the other it doesn't.

I'm seeing JTAGICE mkII: IDR event 0x00 - what's this mean?

Has anyone else seen this and has the answer, or clues where to look?

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

Stab in the dark, check you power pins for proper solder joints.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Nope.. it's all solid .. I have TWO new boards failing in the same way .. 4 other MEGA32A projects work fine so it's not the JTAG ICE .. and there's only power , reset and JTAG connected!

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

ok - here's the answer.
The CPU was programmed to 1MHz internal RC.
Set to 8Mhz and it works...
I guess there's an option in Studio to cope with that somewhere!

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

What is your JTAG speed set at?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I had these symptoms some time ago. Took a long time to work it out. But in my case:
The board that ran on reset had previously had a bootloader installed. Consequently I had used the alternative location for the Vector Table. For some reason this caused the problem. Changed BOOTRST fuse back to application reset. Problem solved.

Still not sure of the mechanism. But on entering Debug not only is the application area erased before programming but so is the boot area. Consequently the boot reset vector is empty!