Answer the question
In order to leave comments, you need to log in
Why are interrupt counts incorrect in atmega 2560?
Good day to all ! a. I connect the bill receiver to the atmega 2560. I took this article as a basis cxem.net/arduino/arduino136.php 1 impulse - 10 rubles. Why do glitches happen? for example put 100r - will count correctly. Then another 100r (with or without a delay, it doesn’t matter), it can count as 120r, or as 90 ((
Interrupt initialization:
void init_interrupt(){
EICRA &= ~(1<<ISC00);
EICRA |= (1<<ISC01);
/*EICRA &= ~(1<<ISC10);*/
/*EICRA |= (1<<ISC11);*/
EIMSK |= (1<<INT0);
/*EIMSK |= (1<<INT1);*/
}
ISR(INT0_vect){
EIMSK &= ~(1<<INT0);
//EIMSK &= ~(1<<INT1);
//_delay_ms(100);
bill_summ += 10;
printSumm(bill_summ);
//flag = 1;
//TCNT1 = 0;
//EIMSK |= (1<<INT1);
EIMSK |= (1<<INT0);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question