Vous êtes sur la page 1sur 2

www.avrprojects.

net
projects for AVR 8 bits microcontrollers
H ome AV R Links

cheap AVR boards Click here

search...
AV R Downloa d s Conta ct

AV R G ue stb ook

Main Menu
AV R Le a rning AVR Programming Hardware AVR Programming Software AVR Projects AVR LED Projects AVR C-Programming Projects AVR Tools AVR Books You are here: Home AVR Learning AD Convertor

AD Convertor
User Rating: Poor /2 Best

Rate

Description
An analog to digital converter converts a analog input voltage into a digital value. The resolution of the converter indicates the number of discrete values it can produce. It is usually expressed in bits. For example, an ADC that encodes an analog input to one of 256 discrete values has a resolution of eight bits, 28 = 256. Most ADCs are linear, which means that they are designed to produce an output value that is a linear function of, i.e. proportional to, the input. In this example the AT Mega8 is used, it has 6 AD-converters which have a resolution of 10 bits so it has 210 = 1024

Who Is online
We have 15 guests online

discrete values. In his example a potmeter is connected to the portC.0 of the Mega8 and a LCD module of 20x4 characters is connected to portD. The LCD module displays the values that are measured on the ADC port. The values are presented on the display as discrete values (0 to 1023), the percentage (0 to 100%) of the values and in a bargraph display.

Login Form

Username

Password

Remember Me

Login
Forgot your password? Forgot your username? Create an account

Software
The software of this example is written in the BASCOM AVR program language. BASCOM has build in commands for reading from an ADC port, the A/D convertor of the Mega8 has to be configured first before it can read:

Statistics
Members : 8230 Content : 48 Web Links : 18 Content View Hits : 664813

Configuration ADC = single / ADC = free PRESCALER - a numeric constant for the clock divider. AUTO lets the compiler generate the best value for the used crystal. START ADC - puts the port in the ADC mode. V = GETADC(channel) - reads the A/D value from the selected channel.

Downloads
File Description File size Last Modified

AD Convert~.bas AD Convert~.HEX

AVR BASCOM source file hex file

2 Kb 25/05/2009 18:36 3 Kb 25/05/2009 18:37

Last Updated on Monday, 25 May 2009 22:23

Powered by WebRing.

Advertisement

Joomla

Vous aimerez peut-être aussi