Hello,
Reading the CPU reference document and the kinetis.h and pins_teensy.c files, I am trying to understand where the 31.25 kHz clock source that the analogWriteFrequency uses for low frequencies comes from.
Is it :
- the external 16mHz crystal source divided by 512 (page 490 : MCG_C1 CLKS = 2, FRDIV = 0x100 : divide factor = 16 or 512) ?
or
- the internal 4mHz source divided by 128 (page 499 : MCG_SC ATMS = 1, MCG_SC FCRDIV = 7) ?
I can see that the analogWriteFrequency function uses ftmClockSource = 2 and ftmClock = 31250, but I cannot find where this 31.25 kHz hardware source is setup in the library files.
Thank you in advance for your enlightenment !
Reading the CPU reference document and the kinetis.h and pins_teensy.c files, I am trying to understand where the 31.25 kHz clock source that the analogWriteFrequency uses for low frequencies comes from.
Is it :
- the external 16mHz crystal source divided by 512 (page 490 : MCG_C1 CLKS = 2, FRDIV = 0x100 : divide factor = 16 or 512) ?
or
- the internal 4mHz source divided by 128 (page 499 : MCG_SC ATMS = 1, MCG_SC FCRDIV = 7) ?
I can see that the analogWriteFrequency function uses ftmClockSource = 2 and ftmClock = 31250, but I cannot find where this 31.25 kHz hardware source is setup in the library files.
Thank you in advance for your enlightenment !