Reading analog channel MANUALLY

chriskner:
-snip-

-Chris

We have been sitting with it for AT LEAST 10 hours trying to solve it, we asked the mentor 3 times already and there is no one else to ask because we're basically ahead of everyone else. What we received as information to what we are supposed to do in order to read the value is to:

Select/Enable channel with the ADC_CHER registry
Set the ADC clock to 14 MHZ with the ADC_MR registry
Start a conversion with the ADC_CR registry
Wait until ADC_SR's DRDY bit is 1
Read the converted data with either the ADC_LCDR or the ADC_CDRx register

We've tried a lot of different ways to approach this. We have tried setting the values that the adc_init and adc_config functions sets above in the other post, reading the internal temp sensor, turning on freerun mode.... We have tried so many different variations that I can't even remember all of them.

I am not asking anyone to do our school work for us. I am searching for guidance about exactly which registers we need to change in order to make the ADC work. We are not two stupid guys and are capable enough to understand what the different registers do, once we know which ones we need to use.

You can imagine how frustrated we get when all we get from hours of googling is "use AnalogRead".
We only need a small sample of code that is a MUST for using ADC. We obviously need to understand it because we're going to use it for temperature sensors and what not.