Different/strange behaviour with or w/o ATMEL-ICE attached

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

Hi,

 

I've a strange behaviour with an ATMEGA328P, ATMEL-ICE and my program, which I cannot resolve.

 

1) When building the solution (ATEMLSTUDIO7 on Win10), and programming the device using ATMEL-ICE, and then run the program, everything is fine. Even after toggling power on the device, everything is ok. (ATMELICE still attached)

2) When removing ATMEL-ICE (during operation and without toggling power on the device) -> everything is ok.

3) After removing ATMEL-ICE and toggling power, the program's not working as expected anymore.

 

In 3) there is the strange behaviour, that:

- timer are much faster (~factor 10 or so)

- some led's are in an undefined state (an are ON, but should not.)

 

I'm going to get another MCU short term to retest and see whether I "burned" the current MCU.

 

Any support to find out more about the reason would be great.

 

Regards

Andreas

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

Welcome to AVRFreaks.

 

A difference in expected times and or speed suggests a change in the clock speed by a factor of 8. Have you examined your fuse settings? One of them controls the divide by 8 parameter.

 

Cheers,

 

Ross

 

Ross McKenzie ValuSoft Melbourne Australia

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

I checked the fuse settings, they're ok. Different parts of the program are ok, too (I've a "pause" mode that toggles an LED every 1s.)

 

What would be the difference with the ATMEL-ICE powered and plugged in to ISP (no dW)?

 

In my former tests I had the cable still attached, and was pretty surprised when running w/o ICE today.

 

Regards, Andreas

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

I checked the fuse settings, they're ok.

Are you sure?  Post a screenshot of your fuse settings.

 

What is the clock speed of your AVR?

 

Do you have a 10k resistor on the RESET line of the AVR tied to VCC?

 

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Fuse settings are:

In my current development branch, I've an 8 MHz quartz and capacitors attached, deselected CKDIV8 is ok, too, and all timer are calculated using these values. (In the next version I'll go to 2 MHz, ext. resonator and set CKDIV8, too.)

Yes, a 10k resistor is tied, too.

 

In deed, I'd an issue in my code, which executed some single steps in the appropriate ISR every 1ms gone, but was expected to do only every 1s. Anyway, the code executed took only 15-20 steps, and thus should not be too long. The results are the same w/ and w/o ICE attached.

 

For me it's something like a lesson learnt to do early tests with the standalone device.

 

 

Although my issue is resolved now, I still don't have a clue why an attached ATMEL-ICE using ISP gives a different result than without the ISP attached. Any hint is very welcome.

 

Regards, Andreas