![]() Then we produce a sound on the speaker and pause for a length of time Then poll a flag that tells us when the conversion is complete. Our strategy is to start an Analog-to-Digital Conversion on ADC3, The two resistors form a voltage divider and the voltage at the input pin will be dependent If we connect a resistor between an ADC input pin to ground and if the internal resistor We will be using ADC3/PortB3 (Pin 2) for our input and Port B0 (Pin 5) for output.ĬHAPTER 1: MEASURING RESISTANCE WITH ADC: The circuits & code should be easy to adapt to most any AVR Core chips.įrom the diagram we can see that the ADC inputs are on pins 1, 7, 2 & 3 or The example programs should run on the ATtiny 13, ATtiny25, ATtiny45 or ATtiny85. The ATtiny13 runs at 1.2MHz ( 9.6MHz Oscillator divided by 8 ) with 1K of RAM. This chip has one ADC which can be used to read up to four inputs. The result is a digital number that correlates to the applied voltage at the input.įor this primer we use the AVR ATtiny13 for its simplicity & small number of pins. Not only can they convert an analog signal like music into a digital format,īut they can also be used to measure resistance.ĪDCs are not mysterious, they often work by measuring how long it takes to charge a capacitor, It does this by measuring voltage on its input pin. An Analog to Digital Converter (ADC) is used to turn an analog signal into a digital one.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |