NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Help with ADC
March 22, 2011 by jkoppp |
Can someone explain what setting ADPS2, ADPS1, and ADPS0 to one does? This is mentioned in the temperature sensor project but i still don't really get what it does. |
---|---|
March 23, 2011 by Rick_S |
Those registers are for setting the rate at which the ADC takes samples in relationship to the micro's clock speed. You can have anywhere from a 1/2 to 1/128th ADC clock in relationship to the system clock. In the tempsensor project, these are each set to 1 which gives the ACD a sample frequency of 1/128th that of the clock. These values can be changed based on what you are trying to achieve. The number of ADC cycles required to perform a conversion is detailed in the datasheet. Rick |
March 23, 2011 by bretm |
And the reason you would want to choose different speeds is that the microcontroller can run at a wide range of speeds but the ADC is most accurate in a specific speed range. This lets you choose trade-offs between speed, accuracy, and power consumption. |
Please log in to post a reply.
Did you know that NerdKits believes in the importance of a mixture of meaningful topics, clear instruction, and engaging projects? Learn more...
|