AD Convertor |
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 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.
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:
|
No comments:
Post a Comment
Confused? Feel free to ask
Your feedback is always appreciated. I will try to reply to your queries as soon as time allows.
Note:
Please do not spam Spam comments will be deleted immediately upon my review.