PLL Check with changed USB-Serial baudrate to 921600

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
cedes
Date:
Wed Jun 09 12:40:20 2010 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r cd464ee509f7 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jun 09 12:40:20 2010 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX); // tx, rx
+
+int main() {
+    int Fin = 12000000; // 12MHz XTAL
+    
+    pc.baud(921600);
+
+    pc.printf("PLL Registers:\n");
+    pc.printf(" - PLL0CFG = 0x%08X\n", LPC_SC->PLL0CFG);
+    pc.printf(" - CLKCFG  = 0x%08X\n", LPC_SC->CCLKCFG);
+    
+    int M = (LPC_SC->PLL0CFG & 0xFFFF) + 1;
+    int N = (LPC_SC->PLL0CFG >> 16) + 1;
+    int CCLKDIV = LPC_SC->CCLKCFG + 1;
+
+    pc.printf("Clock Variables:\n");
+    pc.printf(" - Fin = %d\n", Fin);
+    pc.printf(" - M   = %d\n", M);
+    pc.printf(" - N   = %d\n", N);
+    pc.printf(" - CCLKDIV = %d\n", CCLKDIV);
+
+    int Fcco = (2 * M * 12000000) / N;
+    int CCLK = Fcco / CCLKDIV;
+
+    pc.printf("Clock Results:\n");
+    pc.printf(" - Fcco = %d\n", Fcco);
+    pc.printf(" - CCLK = %d\n", CCLK);
+    
+    while(1);
+}
diff -r 000000000000 -r cd464ee509f7 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jun 09 12:40:20 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/029aa53d7323