a few questions

8 views
Skip to first unread message

Philippe

unread,
Feb 19, 2010, 4:49:10 AM2/19/10
to RuggedCircuits
Hi,

2 simple questions..

Which Microcontroller is used on the Gator, ATmega324PA or
ATmega324P ?

Is the ICP1 usable ? (ICP1 (Timer/Counter1 Input Capture Trigger))


On Duemilanove, I can use it like that. I would like to do the same
with the Gator:

void setup_timer1(){
//disable all interupts
TIMSK1 &= ~( _BV(TOIE1) | _BV(ICIE1) | _BV(OCIE1A) | _BV(OCIE1B));

//set timer mode
TCCR1A &= ~( _BV(WGM11) | _BV(WGM10) );
TCCR1B &= ~( _BV(WGM12) | _BV(WGM13) | _BV(ICNC1));

//capture raising edge
TCCR1B |= _BV(ICES1);

//prescaler 1/8
TCCR1B |= _BV(CS11);
TCCR1B &= ~( _BV(CS12) | _BV(CS10) );

//disable outputs
TCCR1A &= ~( _BV(COM1A0) | _BV(COM1A1) | _BV(COM1B0) | _BV(COM1B1));

//enable capture interupt
TIMSK1 |= (1<<ICIE1) + 1;
}

ISR(TIMER1_CAPT_vect){
unsigned char sreg;
/* Save global interrupt flag */
sreg = SREG;
mesureTemps.courant.a=ICR1;
SREG = sreg;
}

ISR(TIMER1_OVF_vect ){
noInterrupts();
mesureTemps.courant.b+=1;
interrupts();
}

thank you !

Philippe

Rugged Circuits

unread,
Feb 20, 2010, 9:14:24 AM2/20/10
to RuggedCircuits
On Feb 19, 4:49 am, Philippe <philippe.cr...@gmail.com> wrote:
> Hi,
>
> 2 simple questions..
>
> Which Microcontroller is used on the Gator, ATmega324PA or
> ATmega324P ?

It is the ATmega324P.

> Is the ICP1 usable ? (ICP1 (Timer/Counter1 Input Capture Trigger))

Yes it is.

Philippe

unread,
Feb 22, 2010, 3:28:33 AM2/22/10
to RuggedCircuits
thank you
Reply all
Reply to author
Forward
0 new messages