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.

[AVR] Atmega16a ADC c code

Status
Not open for further replies.

decapitary

Banned
Joined
Jul 16, 2014
Messages
62
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
0
i have a analog signal i want to process the signal but i cant program my micro to do it...
any1 can help me with code? analog input USART output. plz note which pin is in and which is out!

ty
 

You can try with two things basically as you have written Atmega16 So I am telling w.r.t that,

First Initialize ADC,
This Involves the bit setting responsible to start ADC and set Prescaler(Optional),

Then secondly make a Function to read ADC this happens
over a certain condition like (Wait for the Conversion mechanism to be completed), then read the value in the respective register,

then assign a Variable which receives the ADC converted data,
and finally Transmit that data via UART

So process is finally
HTML:
main() {
// Initialize UART
// Initialize ADC

while(1)
{ 
// get data to a variable via Reading ADC
delay(); 
//Transmit the variable through Tx of UART
}
}
 
Post the circuit. We need to know what micro you are using and which adc channel.
 
It is using one ADC channel and one digital output connected to an isolation circuit. What should the circuit (micro) do ? Read ADC value and do what ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top