This confused me for a bit so if the following helps anyone then great.
Here is my circuit diagram..
The problem I was having was assuming that using a single ended ADC input at 12 bits was going to give me 0 for 0V and 4096 for 5V.
However the reality is different, if you look at the ADC data sheet on page 8 it says that the maximum value you can get from a single
ended input is 11 bits.
So the maximum you can get is 2047, the output is always signed.
Here is my ADC config
The other thing you need to watch out for is what voltage is the board powered by. You will need to change jumper J9 into 5V, it comes 3.3V as default.
Also you need to change the system tab in the .cydwr file to 5V VDDA or the calculations will come out wrong, this is set to 3.3V default too.
I am using a potentiometer on the input but if you want to quickly test if it is working you could just wire directly from the ADC pin to the 5V, 3.3V and 0V supplies
on the board like so..
Here is my source code.. (it is all included in the project below)
Incase it helps anyone this is the thread I opened on the Cypress forums asking for help, it explains all the problems I ran into there..
https://secure.cypress.com/?app=forum&id=4749&rID=88221
I have attached my project so you can use it too.