Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using ADC & Timer For Measuring Time A Varying Voltage Takes To Reach A Certain Level

Status
Not open for further replies.

muashr

Member
I want to measure the time a varying voltage takes to reach a particular level. This idea can be the basis for measuring time constant. However, the timer doesnot give the correct value. The device being used is ATmega8. Basic settings for Timer and ADC being used are:

TCNT1 = 0;

TCCR1B |= (1 << CS11) | (1 << CS10);


ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);


ADMUX |= (1 << ADLAR);


ADMUX |= (1 << REFS0);


ADCSRA |= (1 << ADIE);


ADCSRA |= (1 << ADEN);

Any ideas or suggestions are welcomed.
 
I suggest you show what you get and what expected for every input and output.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top