NerdKits - electronics education for a digital generation

You are not logged in. [log in]

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
jkoppp's Avatar

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
Rick_S's Avatar

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
bretm's Avatar

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.

Post a Reply

Please log in to post a reply.

Did you know that you can connect a pushbutton to a microcontroller with only one wire? Learn more...