Mega640 runs slowly when not using JTAG ICE

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

I have a really weird problem with a Mega640. It only runs properly when the JTAG ICE is plugged in.

I have put a GPIO toggle in the main loop which goes at 307kHz. The main loop is incredibly simply. All it does is wait for serial comms which is interrupt driven.

If I boot without the JTAG plugged in it [the GPIO] toggles at about 10kHz. I can get it going at the right speed by simply plugging and unplugging the JTAG header of the ICE - you can see the GPIO suddenly toggling at the right speed.

The crystal seems to be oscillating at the correct frequency from the word go, brown out is disabled.

This is not a new design, it's a very low volume production board and I don't have any more boards.

Anyone got any suggestions please?

Many thanks.

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

Looks like it was nothing to do with clocking. I think what was happening was that the new wireless module was giving a framing error which I wasn't recovering from. I've changed the code to clear the error flag (duh).

Sorry for bothering!

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

Quote:
JTAG ICE
Which type so that we can get a clearer picture?

And I would NOT recommend plugging and unplugging stuff on live boards or they may get upset. :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly