Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to program AVR microcontroller as ADC?

Status
Not open for further replies.

sorry

Newbie level 4
Joined
Mar 3, 2005
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,351
Hi all
I want to use AVR Microcontroller (Mega8L) as ADC
how can I program this micro ,and what I have to do?

I use a basic compiler ,and i prefer to get some answers in basic.Please...

thanks for care
 

adc with avr

Hello 'SORRY';
I also have this problem.
Thus;
Have anyone to help US ?
 

adc and avr

Try BASCOM. Its a basic compiler. Available also as demo. Samples includes an ADC sample.
 

adc for avr

I am using CodeVisionAVR C compiler. I wrote a C code ( from CVAVR ex.)
such this for Mega64:

unsigned char read_adc(unsigned char adc_input)
{
ADMUX=adc_input|ADC_VREF_TYPE;
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCH;
}


Using 8bit ADC but it's output is wrong.
when input voltage is below 0.6 volt outputbyte=0x00 !!!
and when input voltage is above 0.6 volt outputbyte=0xFF !!!

could anybody help me.
best regards
amerion
...........................................................
...........................................................
I FOUND ANSWER: The IC WAS BURNED.
...........................................................
...........................................................
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top