Hi,
I have written the code for led blinking, using timer0 of ATmega2560 on AtmelStudio7. When I run it on simulator, the status of led(s) changes without timer reaching the set value. Can someone assist me with this..? Thanks in advance..
Here is the code:
Need assistaance with TIMER
I have written the code for led blinking, using timer0 of ATmega2560 on AtmelStudio7. When I run it on simulator, the status of led(s) changes without timer reaching the set value. Can someone assist me with this..? Thanks in advance..
Here is the code:
Code (Text):
- #include <avr/io.h>
- void delaynew ();
- int main(void)
- {
- DDRB = 0xFF; //PortB is set as o/p
- while (1)
- {
- PORTB = 0xAA;
- delaynew();
- PORTB = 0x55;
- delaynew();
- }
- }
- void delaynew (void)
- {
- TCCR0A =0xC2;...