irfan ahmad
Full Member level 3
- Joined
- Feb 17, 2012
- Messages
- 181
- Helped
- 54
- Reputation
- 108
- Reaction score
- 54
- Trophy points
- 1,318
- Location
- LAHORE PAKISTAN
- Activity points
- 2,212
I am trying to toggle PORTC of atmega16 at rate of
100ms.
this is my code .
these are simulation results on proteus.
it toggles after32ms.
what is problem.
100ms.
this is my code .
Code:
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
//////////////////////////////
int main(void)
{
DDRC=0XFF;
PORTC=0XFF;
while(1)
{
_delay_ms(100);
PORTC=~PORTC;
}
return 0;
}
////////////////////////
it toggles after32ms.
what is problem.