Quantcast
Viewing all articles
Browse latest Browse all 5415

General • Re: External clocks

I am still puzzled how it can be that I solder an external oscillator module with a frequency of 14 MHz (or 14.31 MHz in my second try), and without any code changes at all I get a ROSC frequency that is actually lower than with the 12 MHz crystal.

ROSC with 14.31 MHz oscillator module: 3050 kHz
ROSC with 12 MHz crystal oscillator: 2550 kHz

Okay I see that

(3050/14.31)*12 = 2558

but what conclusion ensues from that?

My first thought was that the frequency counter function doesn't work as intended any more.

Data sheet: "The frequency counter measures the frequency of internal and external clocks by counting the clock edges seen over a test interval. The interval is defined by counting cycles of clk_ref which must be driven either from XOSC or from a stable external source of known frequency."

When I take a look at the respective code (I am not a programmer by the way and English is not my native language, so I am probably missing something) I am not able to find the 12 MHz hard coded anywhere.

Right now, however, I am tending to doubt that the frequency counter function is extremely far off with the external oscillator, for it measures the USB clock exactly with 48 000 kHz (CLOCKS_FC0_SRC_VALUE_PLL_USB_CLKSRC_PRIMARY). What in turn leads me to the question how can it then be that the USB bootloader doesn't work any more when we have exactly 48 MHz.

I think I have to delve very deeply into the code to make sense of that.

Statistics: Posted by FlorianJW — Mon Dec 18, 2023 5:47 am



Viewing all articles
Browse latest Browse all 5415

Trending Articles