atmega8 watchdog and timers problem

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

Hi all ,
I've got some problems dealing with ATMEGA8
I haven't had this kind of problems with ATMEGA16,32,64,128 and 1280
Watcdog timer & TIM0_Delay(100) & TIM1_Delay(100) don't work

IDE : Codevision 2.04 , Crystal 16M , fUSEbITS on External Crystal

What's the problem ?

Thanks

Attachment(s): 

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

Why post in the OffTopic ?
Moved to general AVR forum.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Include .prj file so I can look at project settings and compiler configurations.

It all starts with a mental vision.

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

KitCarlson wrote:
Include .prj file so I can look at project settings and compiler configurations.
Here is the project :

Attachment(s): 

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

When I compile the project, warnings suggest TIMO_Delay and TIM1_Delay are not linked. The way you have written these functions, they block other foreground activity. It is best to check for the correct time count, if not continue processing main events. I suggest you rethink the means of generating the delays.

I often like using the OCRx not overflow, since the next time can be += to the OCRx and does not result in cumulative error.

It all starts with a mental vision.

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

KitCarlson wrote:
When I compile the project, warnings suggest TIMO_Delay and TIM1_Delay are not linked.

I commneted both of them cause non of them works .
But as I said I haven't had this problem with other micros . Don't you know what's the problem ?
And what about watchdog timer ?

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

You need to feed the watchdog periodically . How do you do that with code that blocks main activity while waiting in endless loop for ISR to count? I have used Mega8 in the distant past, in a few products without problems. Not related to that. Might be how you handle shared variables, and or handling of 16 bit control registers.

Start small. Verify your work, then add and verify again. You will learn how things work together, and develop a strategy for real-time programming. Simple is elegance, strive for that.

Don't give up. Just take a few steps back, and try again.

It all starts with a mental vision.

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

Thanks KitCarlson