PLL Check with changed USB-Serial baudrate to 921600
Revision 0:cd464ee509f7, committed 2010-06-09
- 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 |
--- /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);
+}
--- /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
Marco Graf