Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Codevision or proteus problem

Status
Not open for further replies.

maniamoozadeh

Newbie level 3
Joined
Mar 24, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
proteus problem

hello.
I have a problem with counter/timer0 of the atmega16 AVR.
I wrote a simple code in codevisionAVR and then simulate it in proteus.
but the timer doesn't count up to 0xFF. I don't know why ?
my code seems to be right.
in proteus I put a atmega16 in designer windows. then set the CKSEL Fuses to
"internal RC 8 MHz" oscillator. then go into debug mode and open the watch
window and put TCNT0 register in it.
the TCNT0 counts up to a value (not 0xFF) and then goes to 0 !



Code:
#include <mega16.h>

void main()
{
  TCCR0 = 0x05;
  TCNT0 = 0x00;

  while(1)
  {

  }
}
 

problem with watch dog timer in proteus

i think your problem is at if......

i should use you this code if(TCNT0 >= 0xFF)

i sure this code will help u
 

watchdog codevisionavr mega16

no.
if you remove the whole "if block" nothing will change.
I think the AVR chip automatically resets. but I don't know why.
the watchdog is disabled.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top