Question

In: Computer Science

Write an ALP to get the data rom channel 0 of the ADC of Atmega 32...

Write an ALP to get the data rom channel 0 of the ADC of Atmega 32 and display the result on port A and port B . This should continue for ever.

Solutions

Expert Solution

ADC (Analog to Digital converter) is the most widely used device in embedded systems which is designed especially for data acquisition. In AVR ATmega series normally 10-bit ADC is inbuilt in the controller.

Let us see how to use the ADC of AVR ATmega16 / ATmega32.

ATmega16/32 supports eight ADC channels, means we can connect eight analogue inputs at a time. ADC channel 0 to channel 7 are present on PORTA. i.e. Pin no.33 to 40.

The controller has 10 bit ADC, means we will get digital output 0 to 1023.

i.e. When the input is 0V, the digital output will be 0V & when input is 5V (and Vref=5V), we will get the highest digital output corresponding to 1023 steps, which is 5V.

So controller ADC has 1023 steps and

  • Step size with Vref=5V : 5/1023 = 4.88 mV.
  • Step size with Vref=2.56 : 2.56/1023 = 2.5 mV.

So Digital data output will be Dout = Vin / step size.

  • It is 10-bit ADC
  • Converted output binary data is held in two special function 8-bit register ADCL (result Low) and ADCH (result High).
  • ADC gives 10-bit output, so (ADCH : ADCL) only 10-bits are useful out of 16-bits.
  • We have options to use this 10-bits as upper bits or lower bits.
  • We also have three options for Vref. 1. AVcc (analog Vcc), 2. Internal 2.56 v3. External Aref. Pin.
  • Total conversion time depends on crystal frequency and ADPS0 : 2 (frequency devisor)
  • If you decided to use AVcc or Vref pin as ADC voltage reference, you can make it more stable and increase the precision of ADC by connecting a capacitor between that pin and GND.

Related Solutions

question: Bits 0 and 1 are transmitted in the data transmission channel,  due to a noise, a...
question: Bits 0 and 1 are transmitted in the data transmission channel,  due to a noise, a single bit is incorrectly received by a probability of 0.3 , Playback For encoding instead of bit 0, the code word 00000 and bit 1 are transmitted as code word 11111,The receiver decodes the codeword received by selecting the most frequently occurring bit ,  for example 00000 → 0, 01010 → (a) What is the probability that the received code word is correctly decoded? (b)...
Write code in C language in the Arduino IDE ADC data using Serial plotter Serial plot...
Write code in C language in the Arduino IDE ADC data using Serial plotter Serial plot : raw data, delay data (int) Purpose: Delay Block (**Using Class**) Input : u(t) Output : o(t)=u(t-h) sample time=0.02 Delay (h) = 0.4
1. Calculate the step values for the following ADC bit sizes over a range of 0...
1. Calculate the step values for the following ADC bit sizes over a range of 0 to 3.3v. a.4 Bit b.8 Bit c.10 Bit d.12 Bit 2.Calculate the step size for 4, 8, 10, and 12 Bit analog to digital conversation of the temperature sensor with a range of 90 to 100 degrees fahrenheit. 3.Identify the minimum ADC bit size that is needed to convert the temperature with one tenth of a degree accuracy.
Consider a 12-bit ADC with an analog input voltage range of 0 to 3 volts. a)...
Consider a 12-bit ADC with an analog input voltage range of 0 to 3 volts. a) Compute the ADC precision, ADC ranges for input and output, and ADC resolution. b) What is the binary value computed by the ADC for an analog input voltage of 1.0 volt? c) Write an ADC0_In function in C that uses busy-wait synchronization to sample the ADC. The function reads the ADC output, and returns the 12-bit binary number. Assume the ADC has already been...
Consider the "Successive Approximation" based ADC with a 5-bit converter and a voltage range of 0...
Consider the "Successive Approximation" based ADC with a 5-bit converter and a voltage range of 0 to 5.0 volts. Show how it would approximate an incoming analog voltage value of 1.723 volts using a drawing of volts vs. discrete time steps associated with sampling. Show each approximation step (upper and lower bound voltage limits), show final A/D Output in Hex and show Vmin-max and the actual error in this approximation as a voltage and as a percentage of the actual...
A computer is reading data from a rotating CD-ROM. At a point that is 0.0206 m...
A computer is reading data from a rotating CD-ROM. At a point that is 0.0206 m from the center of the disk, the centripetal acceleration is 174 m/s2. What is the centripetal acceleration at a point that is 0.0841 m from the center of the disc?
: For the given data 38, 11, 40, 0, 26, 15, 5, 45, 7, 32, 2,...
: For the given data 38, 11, 40, 0, 26, 15, 5, 45, 7, 32, 2, 18, 42, 8, 31, 27, 4, 12, 35, 15, 0, 7, 28, 46, 9, 16, 29, 34, 10, 7, 5, 1, 17, 22, 35, 8, 36, 47, 11, 30, 19, 0, 16, 14, 16, 18, 41, 38, 2, 17, 42, 45, 48, 28, 7, 21, 8, 28, 5, 20. Find the following (without using SPSS- Show all the steps -if necessary use spss to...
For the problems 1 -6 Consider the data set    16, 26, 31, 32, 32, 32,...
For the problems 1 -6 Consider the data set    16, 26, 31, 32, 32, 32, 42, 47, 47, 47, 50, 50 (already put in increasing order) Compute the following: 1/   The mode: A/ 47       B/ 32           C/ Bimodal       D/ 42   2/   The median: A/ 42       B/ 37           C/ 32           D/ 47   3/   The mean:        A/ 37.7       B/ 37           C/ 36           D/ 36.2 4/  ...
For each problem write as many of the following types of data you would get if...
For each problem write as many of the following types of data you would get if you... { discrete, continuous, ordinal, qualitative, quantitative } a) asked people if they like spaghetti. b) asked people how many people live in their house. c) asked people to get on a scale and weighed them. d) asked people to guess the percentage of the population with the coronavirus.
Write a program using interrupts to get data serially and send it to P2 while at...
Write a program using interrupts to get data serially and send it to P2 while at the same time Timer 0 is generating a square wave of 5 kHz. We've been basing our code on the Intel 8051 microntroller and assembly language.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT