Reading the battery voltage of the supply battery

Thanks MITEL and sslupsky, it works fine now.

I just wanted to clarifiy the reading. As the VBATT input is divided with a 680K/330K pair it is using the internal 1.1V reference value to measure against so i need to scale up the result. x 3.3 as per the code examples.

I read elsewhere the the 1.1 ref is not that accurate so in the end i measured VBATT with a multimeter and added a scale up factor to give me a genuine VBATT. In real terms this was about 2.93 to get a match rather than 3.3.

Is my thinking correct here?