Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 Serial pc(USBTX, USBRX); // tx, rx 00004 00005 int main() { 00006 int Fin = 12000000; // 12MHz XTAL 00007 00008 pc.baud(921600); 00009 00010 pc.printf("PLL Registers:\n"); 00011 pc.printf(" - PLL0CFG = 0x%08X\n", LPC_SC->PLL0CFG); 00012 pc.printf(" - CLKCFG = 0x%08X\n", LPC_SC->CCLKCFG); 00013 00014 int M = (LPC_SC->PLL0CFG & 0xFFFF) + 1; 00015 int N = (LPC_SC->PLL0CFG >> 16) + 1; 00016 int CCLKDIV = LPC_SC->CCLKCFG + 1; 00017 00018 pc.printf("Clock Variables:\n"); 00019 pc.printf(" - Fin = %d\n", Fin); 00020 pc.printf(" - M = %d\n", M); 00021 pc.printf(" - N = %d\n", N); 00022 pc.printf(" - CCLKDIV = %d\n", CCLKDIV); 00023 00024 int Fcco = (2 * M * 12000000) / N; 00025 int CCLK = Fcco / CCLKDIV; 00026 00027 pc.printf("Clock Results:\n"); 00028 pc.printf(" - Fcco = %d\n", Fcco); 00029 pc.printf(" - CCLK = %d\n", CCLK); 00030 00031 while(1); 00032 }
Generated on Thu Aug 4 2022 20:23:51 by
1.7.2