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 use multiple adc channel of atmega16 one at time

Status
Not open for further replies.

vishu489

Advanced Member level 4
Joined
Aug 28, 2011
Messages
116
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,120
hey friends i want to use three adc channel at one time.i don't required converted values.i just want to sense analog signal at input
 
atmega16 has a single A/D converter and 8 analog input that can be multiplexed and given to A/D.
so you can't do three A/D conversion simultaneously but you can do it sequentially
 

If you mean ADC measurement from different channels, then as hamidmoallemi suggested, you can do it sequentially. The code for reading values from all ADCs is exactly the same. The only difference would be the value of ADMUX register, which determines which analog channel is selected for reading (the three LSBs will have a value from 0 to 7 for a single ended input).
Now if you need three inputs on the same channel, you could use an analog multiplexer like HEF4051.

**broken link removed**
 

problem to sense analog input

i want to interface acclerometer to atmega 16 adc pins but problem is that atmega 16 can sense one analog signal at time.accelerometer has 3 output lines which gives acceleration in x,y,z direction.i just want to sense this signal. i doesn't required converted value.also i'm attaching datasheet of accelerometer. iwant to develop following logic

if analog signal is present at x then led will get on and there will be no further scanning of analog sigmnal.if not then it will check for y,if present then led will get on & no further scanning,and if not then it will go for z

and also tell me is it possible to use analog multiplexer in this situation which combine this three output signal and give them to single adc channel of atmegA16

Don't start new threads with the same content. Threads merged [alexan_e]
 

Attachments

  • Accelorometer.pdf
    353.2 KB · Views: 136

vishu489 said:
i want to interface acclerometer to atmega 16 adc pins but problem is that atmega 16 can sense one analog signal at time.accelerometer has 3 output lines which gives acceleration in x,y,z direction.i just want to sense this signal. i doesn't required converted value.also i'm attaching datasheet of accelerometer. iwant to develop following logic

if analog signal is present at x then led will get on and there will be no further scanning of analog sigmnal.if not then it will check for y,if present then led will get on & no further scanning,and if not then it will go for z

and also tell me is it possible to use analog multiplexer in this situation which combine this three output signal and give them to single adc channel of atmegA16

The fastest division factor of ADC is 2. ATmega16 can go up to 16MHz. This means 8MHz ADC speed. You say that this speed is not enough for you and you need to get three analog signals simultaneously? AVR will do one conversion at a time, I think we covered that. A multiplexer, as its name implies, can output one input at a time. From what you 're describing you check X value, then Y and then Z. This seems to be a sequential proccess. You need all the values to be already stored before applying this sequence?
 

Re: problem to sense analog input

The fastest division factor of ADC is 2. ATmega16 can go up to 16MHz. This means 8MHz ADC speed.

The mega16 ADC can work with up to 15K samples for 10bit resolution (50KHz-200KHz ADC clock) and higher than that (up to 1MHz) for lower resolutions.
With the max clock of 1MHz and 13 clocks for the conversion you can get up to 77K samples, you can't use use 8MHz ADC clock.
In addition there is a small delay that should be applied when you change channels before you start the conversion (a few us)

i just want to sense this signal. i doesn't required converted value
I don't get this, the outputs are analog so what is the point of sensing them if you are not going to measure the value they have?

Alex
 
  • Like
Reactions: alexxx

    alexxx

    Points: 2
    Helpful Answer Positive Rating
alexan_e said:
The mega16 ADC can work with up to 15K samples for 10bit resolution (50KHz-200KHz ADC clock) and higher than that (up to 1MHz) for lower resolutions. With the max clock of 1MHz and 13 clocks for the conversion you can get up to 77K samples, you can't use use 8MHz ADC clock. In addition there is a small delay that should be applied when you change channels before you start the conversion (a few us)

Just checked the datasheet. You are right Alex, thanks for sorting me out.
 

That is not the whole truth. ADC in ATMegas succesive approximation type, so you actually can clock them much faster than the datasheet says, but the resolution will significantly decrease. You alsi need to take samplin time into consideration. I would either use extetnal adc, external sample hold or an mcu which has multiple sample/hold units (for exampe some dsPIC33 from motor control family)
 

Atmel specifies up to 200KHz for 10bit or faster for less bits.
In the ADC characteristics it specifies a min clock of 50KHz and a max of 1MHz, If you want to discard what the manufacturer says then it is up to you but I prefer following the manufacturer suggestions instead of guessing.

Alex
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top