[En-Nut-Discussion] Timer1, AT90CAN128 & NutOS
jaripetteri
jaripetteri at gmail.com
Tue Jan 20 10:46:40 CET 2009
Can anyone check/comment is this totally wrong approach for native interrupt
on CAN128 NutOS combination?
Isn't that overflow interrupt routine?
>
> I have on main:
>
> //enable interrupt
> TCCR1A= 0x00; // Timer1 normal mode
> TIMSK |= (1 << TOIE1); // Enable overflow interrupt
> sei(); // Enable global interrupts
> TCCR1B |= (1 << CS10); // Start timer at Fcpu/1
> counter_500ms = 61;
> pass_500ms = 0;
>
> ISR Timer1 Overflow routine:
>
> ISR(TIMER1_OVF_vect)
> {
> if(counter_500ms == 0)
> {
> pass_500ms = 1;
> counter_500ms = 61;
> }
> counter_500ms--;
> }
>
> And I'll check 500ms pass flag on main loop with :
>
> if(pass_500ms == 1)
>
>
>
I also find another code sample which I also didn't manage to get running,
is there something I should activate on nutos config to get interrupts to
the source? This on is from BTNut but should be compatible, right?
http://www.vs.inf.ethz.ch/edu/WSN/tut/ch11.pdf
Any help to get there interrupts to run are most welcome, I'm getting really
desperate here.
> >> So is there sample anywhere how to use native Timer1 on NutOS? Or can
> anyone
> >> give me some info how to go forward with this?
> >>
> >
> > Yes, inside the OS: arch/avr/dev/ostimer.c.
> > Because of the different options supported, it might be a bit difficult
> > to read, though.
> >
> Thanks, I'll try to find the idea there.
>
I couldn't find any help there either. =(
BR,
Jari
--
Electricity is blue and it hurts...
More information about the En-Nut-Discussion
mailing list