Gast
#76757
hallo leute
wäre nett wenn jemand rat weiss. nun zum problem:
//Globals
static volatile uint16_t Sec;
.
.
.
SIGNAL(SIG_OVERFLOW1) // handler for tcnt1 overflow
interrupt
{
PORTB ^= (_BV(PINB0) | _BV(PINB1) ); //toggle bits
Sec++;
if(Sec == 60)
{
Sec = 0;
Min++;
}
if(Cls == 1)
Dauer++;
if(Sec == 5)
PORTD|= _BV(PIND6);
if(Sec == 10)
PORTD&= _BV(PIND6); //clear bit PIND6
TCNT1 = TIMER_1_CNT; // reset counter to get this interrupt
again
}
folgendes phaenomen ereignet sich. wenn 5 sec vorbei sind schaltet er
brav die led an, wenn 10 sec vorbei sind gehen auf einmal von PORTB
zwei leds an die auf PINB2 +3 liegen. das ganze läuft auf einem atmel
AT90S2313
hier noch die timer init:
TCCR1A = 0x00; // disable PWM and Compare Output
Mode
TCCR1B = TMC16_CK1024; // use CLK/1024 prescale value
TCNT1 = TIMER_1_CNT // reset TCNT1 high/low byte
TIMSK = _BV(TOIE1); // enable TCNT1 overflow,bit 8 set on
1
und dann natürlich sei().
wäre nett wenn jemand rat wüsste
thx
kirby