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.

timer isr for 1 sec tick.

Status
Not open for further replies.

vikrant

Junior Member level 2
Joined
Jun 30, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,425
hi all,
I am using ATmega1280 microcontroller with a external crystal of 7.3728 Mhz . IDE which I am using is AVR and WinAVR compiler.
I have written a timer ISR for timer1(16-bit), this timer I am using in CTC mode (Clear Timer on Compare Mode).

Initial settings are:
TCCR1A = 0x02; // for CTCmode;
TCCR1B = 0x04; // for Prescale 256;
TCNT1 = 0x00;
OCR1A = (7372800/256); // for One Second tick
TIMSK1 = 0x02; //for Interrupt On CompareA

Timer ISR:

SIGNAL(TIMER1_COMPA_vect){
//some code, say LED blink

}

but i am not getting 1 sec tick . Instead of that ISR is occuring very fast ,i guess it is in milli sec.

so any body tell me where is the problem.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top