Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Using ADC10 with external oscillator gives 0xFFFF as output

Using ADC10 with external oscillator gives 0xFFFF as output

Anonymous
Not applicable
Question: Why does ADC10 give 0xFFFF as output when used with external oscillator for any input?

 

Answer:

In ASE block the reference for current source is derived from the IMO. If external clock is selected then IMO is disabled. If the internal oscillator is turned OFF, the current source is disabled and the ramp voltage stays at ground. This causes the comparator to not trip and gives the 0xFFFF code. The internal oscillator must always be on when using the ADC.

The internal oscillator can be enabled by clearing bit 1 of register OSC_CR2 (bank1 address E2h). Use the following code snippet do the same in main.c:

OSC_CR2 &= ~0x02;

Having the IMO ON will not alter the system clock frequency when external clock is selected - that is determined only by the external clock. It will just result in a somewhat higher chip current compared to operating with the IMO disabled.

0 Likes
251 Views
Contributors