Input Capture & Analog Comparator

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I have tested my input capture on my ATMEGA32 and it went well as I used a square signal to ICP pin so that ATMEGA32 can count the number of positive (rising) pulse per second. This time, I want to use sine waveform, so I decided to use analog comparator with input capture. I use AN0 and ANI as input and 2.5V reference voltage respectively.

ACSR = 	(0 << ACD) |    // Enable ACD
        (0 << ACBG) |   // Disable
	(1 << ACIE) |   // Enable Interrupt 
        (1 << ACIC) |   // Enable AC with Input Capture
        (1 << ACIS1) | (1 << ACISO); // Rising Interrupt

I am about to include the above code in the my exisitng code. Is there anything I may miss out in term of analog comparator?

MM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since ACBG is cleared, you must use both analog comparator pins (AIN0-PB2 and AIN1-PB3). You misspelled ACIS0 as ACISO (using a capital letter O instead of the digit zero 0). The SFIOR register ACME bit should not be set, unless you intend to turn off the ADC and use an ADC input pin instead of the AIN1 input pin.

You still have the TCCR1B register ICES1 input capture edge select to configure. This edge select will determine how the actual timer1 input capture event is triggered. The input capture has its own interrupt. The ACSR register ACIS1 and ACIS0 bits only select the interrupt for the analog comparator interrupt trigger, not the timer1 input capture interrupt edge trigger. Do you want to use the analog comparator interrupt or the timer1 input capture interrupt (see the TIMSK register TICIE1 bit)?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

This time, I want to use sine waveform,

So what? As long as the sine wave goes to guaranteed logic 1, and below the level of guaranteed lo9gic 0, it will work just fine. No absolute need to use the analog comparator.

But of course you could use it, and it would be the "correct" way for a diminutive signal, especially with an offset.

I've used AC input to input campture on a real app, and it was quite different from your registers. (It was on a Mega88.)

// Analog Comparator initialization
// Analog Comparator: On
// Digital input buffers on AIN0: Off, AIN1: Off
DIDR1=0x03;
// Analog Comparator Input Capture by Timer/Counter 1: On
ACSR=0x04;
ADCSRB=0x00;
...

plus the stuff dealing with ACME and using the A/D and telling the timer... It has been a while so I'd need to study those parts of the datasheet, and let the CodeVision Wizard do a proctice setup for me.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike B wrote:
Since ACBG is cleared, you must use both analog comparator pins (AIN0-PB2 and AIN1-PB3). You misspelled ACIS0 as ACISO (using a capital letter O instead of the digit zero 0). The SFIOR register ACME bit should not be set, unless you intend to turn off the ADC and use an ADC input pin instead of the AIN1 input pin.

You still have the TCCR1B register ICES1 input capture edge select to configure. This edge select will determine how the actual timer1 input capture event is triggered. The input capture has its own interrupt. The ACSR register ACIS1 and ACIS0 bits only select the interrupt for the analog comparator interrupt trigger, not the timer1 input capture interrupt edge trigger. Do you want to use the analog comparator interrupt or the timer1 input capture interrupt (see the TIMSK register TICIE1 bit)?

Hi I am interested to use analog comparator with input capture within Timer 1 therefore I should disable ACIC?

MM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

First you need to understand how timer1 input capture using the ICP1 (PD6) pin works, without using the analog comparator. Once you understand how timer1 works including the timer1 input capture interrupt, then you will see the function of the ACIC bit is to change/replace the single input capture ICP1 pin with the analog comparator AIN1 (PB3) and AIN0 (PB2) pins. That is all the ACIC bit does, is decide which pins trigger the input capture. If you disable ACIC, then you must use the ICP1 (PD6) pin to trigger the timer1 input capture. If you enable ACIC, then you must use the AIN1 (PB3) and AIN0 (PB2) pins to trigger the timer1 input capture, except AIN1 (PB3) pin may be replaced with a single ADC input pin ADC0 (PA0) through ADC7 (PA7) if you want to.

Next you need to understand how the analog comparator works. Since the input capture has its own interrupt, you probably do not want to enable the analog comparator interrupt when using it to trigger the timer1 input capture (which already has its own interrupt). The added optional complexity of using an ADC input pin is strictly part of how the analog comparator works. As far as the timer1 input capture goes, the analog comparator output (ACO) may be used instead of the regular ICP1 input pin. This optional ACO connection is the only thing the analog comparator and timer1 have in common.

So understanding timer1 input capture operation is one step. Then understanding the analog comparator operation is the next step. If you enable ACIC, all the timer1 input capture cares about is the state of the analog comparator output (ACO) and its up to you to configure what changes ACO within the limits of the analog comparator configuration possibilities.

One thing Lee was questioning if you really needed to use the analog comparator or if you could do your input capture with the digital ICP1 pin. There is also a slight power saving reason to use the analog comparator with analog input signals in newer AVRs with analog comparator pin digital input disable registers, but this doesn't apply to your ATmega32.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

this is an old thread I know; but a related question to this very device. I also am using the AVR atmega324p analog comparator to interface the input capture unit. I've configured ACSR's ACIC and the TCCR1B to ICES1 for rising edge....

 

this is my issue: with the negative input as my reference (DC value) and input signal as my positive input THE INPUT CAPTURE UNIT triggers on BOTH EDGES......of a sine wave crossing the the reference. Example I set negative input @ 3.3V DC and run a sine wave that swings above 3.3V slightly in the positive trajectory. the GPIO I set to trigger each time the input capture interrupt fires toggles on the upward 3.3V cross and AGAIN on the downward 3.3V crossing.....................which doesn't make much sense except to think

 

EITHER:

due to the noise on the REF 3.3V it maybe fluttering between 3.289-3.399 (or something) and each time the input signal on the comparator approaches that range a situation occurs where a RISING EDGE outputs thru the ACO triggering the edge detector (both on the upward swing and the downward swing).

 

OR:

secretly, THOUGH CLEARLY NOT INDICATED IN THE DATASHEET, the analog comparator outputs RANGES  of voltages so each of those (rising) transition attributes to a triggering effect on the edge detector.  that seems to  wonky??

 

ELSE OR:

secretly still while using the comparator as the input to the input capture unit edge detector setting are overridden to capture signals on both positive and negative edges.

 

finally pulses work extremely well as inputs to the comparator (which it should b/c in that case its like just using the input capture pin directly except getting to adjust what the threshold (REF) of a digital 1 is and is not).

 

 

Yet still another issue..........had the analog comparator using the input capture unit been CONSISTENTLY CAPTURING both RISING and FALLING edges EACH time and NOT skip edges randomly...I could thru code isolate, for example, RISING EDGE 1 and RISING EDGE 2 out of the 4 captured edges.

 

 

help me please!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suspect it is noise.  Try enabling the input capture noise canceller by setting ICNC1 in TCCR1B.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While there is a lot of information in the OP, I'm confused.  What is the actual problem here?  Is it because of triggerring on both edges?  And only upward edge is desired?  How can we address that without seeing some code?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My bad! I'll add code later. But two things. I want to trigger a single edge not both edges. Also I have activated the noise canceler in the input capure unit.

But the code is simple: set acsr to output to the imput capture unit, enable the input capture interrupt, set the noise canceler , set the edge detector up (or leave down), set the 16bit counter in normal mode, and.....start the free running counter.

My experience with two atmegas is a clear double triggering.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
    TCCR1A =  0; //16 bit counter normal mode
	TCCR1B = ((1<<ICNC1) | (1<<CS12) | (1<<CS10)); // INPUT CAPTURE EDGE DETECTOR SELECT TO RISING EDGE & and counter prescaler
	TIMSK1 = ((1<<ICIE1);// enable input capture interrupt
	
	ISR (TIMER1_CAPT_vect)
{

	
	 PORTD = 0xFF;
	
		
		BPM[1] = BPM[0];
		BPM[0]= ICR1;
	
	 
		if (BPM[0]> BPM[1]) bpm=(BPM[0] - BPM[1]);
		else bpm = (65535 - BPM[1]) + BPM[0];
		if(BPM[1] !=0)
		{
			setX(8);
			setY(8);
			putHex((bpm)>>8);
			putHex((bpm));
		}
		
	  PORTD = 0x0;
	  PORTD = 0x0;
	
}

ignore the info inside the routine that's particular to my objective. The main issue is i want SINGLE TRIGGERING (just up or just down) and not on BOTH  edges.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This:

TIMSK1 = ((1<<ICIE1);

... will not compile.

 

Please don't type fragments of your code into the forum software's code editor.  Rather, copy/paste the code exactly.

 

You have not shown the code which configures ACSR.

 

Show a >>complete<< but short test program which demonstrates your observed behaviour, and nothing else.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include <lcd.h>
#include <serial.h>
#include <stddef.h>
#include <math.h>


volatile uint8_t Xpos = 1;
volatile uint8_t temp_ADC= 0;
volatile uint8_t XBUFF = 0;
volatile uint8_t YBUFF = 0;
volatile uint8_t temp_ADC1= 0;
volatile uint8_t XBUFF1 = 0;
volatile uint8_t YBUFF1 = 0;
volatile uint8_t count= 0;
volatile uint16_t DisplayBPM = 0;
volatile int N = 0;
volatile uint8_t Xpos2 = 1;
volatile uint8_t ADC_array[160] = {0};
volatile uint8_t ADC_array1[160] = {0};
volatile float b_high[21] = {
	-0.0024,   -0.0036  , -0.0067  , -0.0119,   -0.0191,   -0.0279 ,  -0.0372 ,  -0.0462,   -0.0536   ,-0.0584,    0.9421 ,  -0.0584,



	-0.0536,   -0.0462,   -0.0372 ,  -0.0279,   -0.0191  , -0.0119 ,  -0.0067 ,  -0.0036 ,  -0.0024
};
volatile float coming[3] = {0};
volatile float y[3] = {0};
volatile float c[5] = {  0.0041 ,  -0.0040   , 0.0041

	,   -1.9071   , 0.9112



};
volatile float coming1[4] = {0};
volatile float y1[4] = {0};
volatile float c1[7] = {      0.0040 ,  -0.0010 ,  -0.0010,    0.0040

	,  -2.6182  ,  2.3060 ,  -0.6818
};
volatile float input[21] = {0};	
volatile uint8_t filtered = 0;
volatile uint16_t BPM[2] ={0}; 
volatile uint16_t bpm = 0;
volatile uint8_t START = 0;


float IIR2(uint8_t samples) //IIR FILTER WORK IN PROGRESS.
{
	coming[0]= (float) samples;
	y[0]=c[0]*coming[0]+c[1]*coming[1]+c[2]*coming[2]-(c[3]*y[1]+c[4]*y[2]); //convolution
	
	for (int i= 2; i > 0; i--)
	{
		coming[i] = coming[i-1]; // FIFO buffer
	}
	for (int i= 2; i > 0; i--)
	{
		y[i] = y[i-1]; // FIFO buffer
	}
	return (y[0]);
} 
float IIR3(uint8_t samples) //IIR FILTER WORK IN PROGRESS.
{
	coming1[0]= (float) samples;
	y1[0]=c[0]*coming1[0]+c1[1]*coming1[1]+c1[2]*coming1[2] +c1[3]*coming1[3]-(c1[4]*y1[1]+c1[5]*y1[2] +c1[6]*y1[3]); //convolution
	
	for (int i= 3; i > 0; i--)
	{
		coming1[i] = coming1[i-1]; // FIFO buffer
	}
	for (int i= 3; i > 0; i--)
	{
		y1[i] = y1[i-1]; // FIFO buffer
	}
	return (y1[0]);
}
float Fir_filter_high(uint8_t samples) //FIR FILTER 
{
	input[0] = (float) samples;
	float y_output = 0;
	for(int i=0; i < 21; i++)
	{
		 y_output += b_high[i]*input[i];   // y[n] = summation(k=0 to 16, bk*x[n]) convolution .
	}
	for (int i= 20; i > 0; i--)
	{
		input[i] = input[i-1]; // FIFO buffer
	}
	return (y_output);
}
uint16_t TIM16_ReadTCNT1( void ) //READ THE 16 BIT COUNTER REGISTER
{
	unsigned char sreg;
	uint16_t i;
	/* Save global interrupt flag */
	sreg = SREG;
	/* Disable interrupts */
	cli();
	/* Read TCNTn into i */
	i = TCNT1;
	/* Restore global interrupt flag */
	SREG = sreg;
	return i;
} 
 void TIM16_WriteTCNT1( unsigned int i ) //  WRITE TO THE 16 BIT COUNTER REGISTER
 {
	 unsigned char sreg;
	 
	 /* Save global interrupt flag */
	 sreg = SREG;
	 /* Disable interrupts */
	 cli();
	 /* Set TCNTn to i */
	 TCNT1 = i;
	 /* Restore global interrupt flag */
	 SREG = sreg;
 }
void ADC_config(void) //config ADC
{
	
	ADCSRA = ((1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0)); //ADC clock PRESCALER division by a factor of 128
	ADMUX = 1<<MUX0; //ADC 1 IS selected
	ADMUX |= 1<<ADLAR;  //LEFT shift 10 bit
	ADMUX |=  (1<<REFS0);  // SETS AREF to AVCC
	ADCSRA |= 1<<ADEN;  //enable ADC
	ADCSRA |= 1<<ADIE;  //enable ADC interrupts
	_delay_ms(200);
	ADCSRA |= 1<<ADSC;  // ADc Start Conversion	
}
void AC_conf(void)
{
	ACSR = ((1<<ACIC)); //analog comparator uses input capture & AC interrupt rising edge.
}
void TCNT_8BIT0(void) // 8 BIT COUNTER 2
{
	TCCR0A = 0x02; //fast PWM MODE
	TIMSK0 = ((1<<TOIE0) | (1<<OCIE0A)); // ENABLE OVERFLOW TIMER2 INTERRUPT & OUTPUT COMPARE A
	OCR0A = 39; // INTERRUPT ON 39 count. (400 hz refresh rate).
	OCR0B = 39;
	TCCR0B= (1<<WGM02); // FAST PWM MODE compare to OCRA
	_delay_ms(200);
	TCCR2B |= 0x05; // PRESCALER 1024
	
}
void TCNT_8BIT2(void) // 8 BIT COUNTER 2
{
	TCCR2A = 0x02; //CTC MODE
	TIMSK2 = ((1<<TOIE2) | (1<<OCIE2A)); // ENABLE OVERFLOW TIMER2 INTERRUPT & OUTPUT COMPARE A
	OCR2A = 240; // INTERRUPT ON 255 count. (30 hz refresh rate).
	_delay_ms(200);
	TCCR2B = 0x07; // PRESCALER 1024
	
}
void TCNT_16BIT(void) // 16 BIT COUNTER 1
{
	DDRD = (1<<PORTD5);
	//PORTD = 0xFF;
	TCCR1A =  0; //( (0<<COM1A0) | (1<<WGM11) | (1<<WGM10) ); //fast PWM (toggle mode) OC1A
	TCCR1B = ((1<<ICNC1) | (0<<ICES1)| (1<<CS12) | (1<<CS10) | (0<<WGM13) | (0<<WGM12)); //  INPUT CAPTURE EDGE DETECTOR SELECT TO RISING EDGE (); //FAST PWM  with OCR1A as compare register (1<<WGM13) | (1<<WGM12) |
	TIMSK1 = ((1<<ICIE1) | (0<<TOIE1) | (0<<OCIE1A));// enable input capture & overflow flag // ENABLE Output COMPARE INTERRUPT 1 A
	OCR1A = 0xFFFE; // TOP OF COUNTER (10)
	
	
}
ISR (TIMER1_CAPT_vect)
{

	
	 PORTD = 0xFF;
	
		
		BPM[1] = BPM[0];
		BPM[0]= ICR1;
	
	 
		if (BPM[0]> BPM[1]) bpm=(BPM[0] - BPM[1]);
		else bpm = (65535 - BPM[1]) + BPM[0];
		if(BPM[1] !=0)
		{
			setX(8);
			setY(8);
			putHex((bpm)>>8);
			putHex((bpm));
		}
		
	  PORTD = 0x0;
	  PORTD = 0x0;
	
}
ISR (TIMER0_OVF_vect)
{
	
	putLine("hello this works.");
	
;}
ISR (TIMER1_OVF_vect)
{
	 PORTD = 0xFF;
	//putLine("this works!");
	//TIM16_WriteTCNT1(0xFFFD);
	//N++; // used to determine BPM
	//if ((ADCH >= 115))
	{
		
	//	DDRD = (1<<PORTD5); //set port as output pin OC1A
	}
	//else
	{
		//DDRD = 0; //disable port as output pin OC1A
		
	}
	
	//if( (N >= 1800) & (ADCH ==115) )
	{
		//bpm = (float)2172.37/(float)N * (float)60; //BPM
		//N = 0;
		
	}
;}
ISR (TIMER2_COMPA_vect) //8 BIT COUNTER 2 INTERRUPT ROUTINE
{
	
	
	if (Xpos == 1) // this is so I dont have a line from 0,0 to Xpos, temp_ADC (i.e. 0,0 to 1,20) instead getting (1,20 to 1,20)
	{
		XBUFF = Xpos;
		YBUFF = temp_ADC;
		XBUFF1 = Xpos;
		YBUFF1= temp_ADC;
	}
	lcdDrawLine(XBUFF, YBUFF, Xpos, temp_ADC, ON); //draws a line from OLD X,Y to current X,Y
	//lcdDrawLine(XBUFF1, YBUFF1, Xpos, temp_ADC1, ON); //draws a line from OLD X,Y to current X,Y
	XBUFF = Xpos;  //setting OLD values to Current
	YBUFF = temp_ADC;
	XBUFF1 = Xpos;  //setting OLD values to Current
	YBUFF1 = temp_ADC1;
	ADC_array[Xpos] = temp_ADC; //saving Current values into array
	ADC_array1[Xpos] = temp_ADC1; //saving Current values into array
	Xpos++; //increment X for next iteration

	if ((Xpos >=120) | (Xpos2 >= 40)) // starts the erase process once Xpos reaches 120 and continues the erase until Xpos2 < 40
	{
		lcdEraseLine(Xpos2, ADC_array[Xpos2], (Xpos2+1), ADC_array[Xpos2+1], ON); //undraw the previous points starting at 0
	//	lcdEraseLine(Xpos2, ADC_array1[Xpos2], (Xpos2+1), ADC_array1[Xpos2+1], ON); //undraw the previous points starting at 0
		Xpos2++; //increment X2 for next iteration
		if (Xpos2 >= 159) Xpos2 = 1; // start over
	}
	if (Xpos >= 159) // start over
	{
		Xpos=1;
		XBUFF = 0;
		YBUFF = 0;
		XBUFF1 = 0;
		YBUFF1 = 0;
	}
	
	//DisplayBPM++;  //THIS IS TO UPDATE THE BPM ONCE EVERY 150 counts at 60hz to prevent lcd screen flickering (0.4hz refresh)
	if((DisplayBPM==450) )
	{
		setX(23);
		setY(8);
		putLine("HEART RATE:");
		putDec(bpm);
		
	}
	if(DisplayBPM >= 900) DisplayBPM=0;
	
	
}
ISR (ADC_vect)
{
	//if(N%2==0) PORTD = 0xFF;
	//else PORTD = 0;
	//N++;
	
	//filtered = (IIR2(ADCH));
	temp_ADC= (ADCH>>2) +70 ; // (filtered>>1)+ 10; //scaling ADC down to fit in my 160x128 screen; y goes from 0-127
	temp_ADC1= ((uint8_t)(IIR2(ADCH))>>2)+30; // (filtered>>1)+ 10; //scaling ADC down to fit in my 160x128 screen; y goes from 0-127
	
	_delay_us(2322); //slower ADC conversion rate closer to 400hz
	
	ADCSRA |= 1<<ADSC;  // ADc Start Conversion AGAIN
	
} 


int main (void)
{
	_delay_ms(3000); //give the lcd time to power up
	
	
	
	sei(); //global interrupts
	
	TCNT_16BIT(); // config 16 bit counter.
	serialInit(16); // set baud rate to LCD
	

	
	lcdClearScreen();
	putLine("Kon'nichiwa!");
	_delay_ms(2000);
	lcdClearScreen();

	//ADC_config();
	
	
	//TCNT_8BIT0();
	//TCNT_8BIT2(); // config 8 bit counter for displaying to the LCD at a slower rate than ADC sampling rate
	//_delay_ms(1000);
	AC_conf();
	
	
	while(1)
	{
		;
	}
	
	
	
    return 0;
}

copy paste. lol....(I hope I'm wrong and it is code related!! or that whatever it is we could figure out together!) thank for your assistance

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
Show a >>complete<< but short test program which demonstrates your observed behaviour, and nothing else.
Not many around here will fix your code for you.  They >>will<< help to explain what's going on when you have some questions.  Like:

 

I've noticed strange AC capture behaviour.  Here's the shortest program I could come up with that shows this behaviour.  As far as I know, it should only trigger on rising edges, but it seems to trigger on falling edges too.  Here also are some o'scope traces of the input signal along with a GPIO pin toggled by the ISR, showing that in fact the ISR seems to be running whenever the input signal crosses (whether rising or falling) the AC's other input.

That is something we can work with.

 

I've whittled down your code based on what you commented out in main().  I also removed all of the LCD and serial stuff, since you're not using it at all.  What's left is 'the smallest possible program which should demonstrate your problem'.  Please do this yourself in the future.

 

#include <avr/io.h>
#include <avr/interrupt.h>

ISR (TIMER1_CAPT_vect) {
  PORTD |= (1<<PD5);
  PORTD &= ~(1<<PD5);
}

int main (void) {

  DDRD   = (1<<PD5);
  TCCR1B = (1<<ICNC1) | (1<<CS12) | (1<<CS10);
  TIMSK1 = (1<<ICIE1);
  ACSR   = (1<<ACIC);
  sei();

  while (1);

  return 0;

}

So, apply your reference to AIN1, and your signal to AIN0.  Also supply your signal to an oscilloscope on one channel.  Attach PD5 to another channel.  Show us a capture.  PD5 will pulse high for 2 cycles every time the interrupt fires.  If you're right, that will happen at the same time that your signal rises above your reference, and every time it falls below your reference.

 

Note that, with your choice of the /1024 prescaler for TIMER1, the interrupt won't be able to trigger any faster than 1024 CPU cycles.  How fast is your AVR running?  What frequency is your input signal?

 

If you don't have an o'scope, there are other ways of capturing and reporting ISR activity.

 

Let us know how you make out.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Direct to Mr joey. Thank you for your assistant and suggestions but in the future if you wish to respond like you did the past two times just skip my call for help.

I've already done your last suggestions. I was asking if anyone else familiar with using the analog comparator output as the input to the input capture unit have double triggering issues.

All that extra shit and remarks save it. If you don't want to help bc I didn't phrase it right or format "correctly " I understand if you just skip the post.

Anyone else with amicable remarks that feel compelled to answer this mystery I welcome.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think something got lost in the translation! I see Joey as being wonderfully helpful here.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
All that extra shit and remarks save it. If you don't want to help bc I didn't phrase it right or format "correctly " I understand if you just skip the post.
Well, no good deed goes unpunnished, I suppose.

 

If you feel you are being challenged in some way, that's not the case.

 

You seem rather defensive.  Suit yourself.  However, you came here with a problem, asking for help.  Many will be happy to help you.  Including me.  Even now.  You will, however, be asked some pertinent questions.   Answering them isn't too much to expect in return for help.  Not many here enjoy chasing wild geese.

 

You've been a member since 2010, but your posts here in this thread suggest you may not have read this:

https://www.avrfreaks.net/forum/newbie-start-here

Which links to:

http://www.catb.org/~esr/faqs/smart-questions.html#before

 

The suggestion that you read these isn't an attack on you.  It is the shortest path to a solution.

 

As I have suggested, the issue is likely noise.  You yourself proposed this in your first post.  We have no access to nor can we reproduce your input signal, so only you can do the work to prove or disprove this theory.  However, apart from noise on one or both of the AC inputs, there is no peculiarity of the hardware which would lead 'double triggering' of input capture in conjunction with the AC.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]