|
From: | Parthasaradhi Nayani |
Subject: | Re: [avr-gcc-list] ICP on ATmega8 helpme please |
Date: | Sat, 24 Feb 2007 10:23:30 -0800 (PST) |
Hi:
I'have problem with the code: using the AVR-GCC 4.1.1 this code not
work.
Initialization:
void icp_init( void ) {
TCCR1B = (1<<
TIFR = (1<
TIMSK =(1<
TIMSK = (1<
DDRB &=~(1<
TCCR1B &=~(1<
ov_counter1 = 0;
sei();
}
SIGNAL( SIG_INPUT_CAPTURE1 ) {
if( !ICES1 ){
//Read ICR1 first
value_init = ICR1;
TCCR1B |=(1<
}
if( ICES1 ){
//Read ICR1 High byte
value_end = ICR1;
TCCR1B &=~(1<
}
icp_value = value_end - value_init;
}
void main (void) {
icp_init();
while(1){
/* send icp_value to serial port */
}
}
Regard in advance
--
Atentamente. Electronica y Unix
+------------------------+------------------------+
| Ricardo Albarracin B. | address@hidden |
+------------------------+------------------------+
|counter.li.org:#238.105 | Fono:(56-2) 3905536 |
+------------------------+ Fax: (56-2) 6882641 |
|emails:address@hidden | Agustinas 1022 Of.510 |
|MSN: address@hidden | Santiago - CHILE |
+------------------------+------------------------+
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[Prev in Thread] | Current Thread | [Next in Thread] |