Test program to show cpu running at 84MHz

Dependencies:   ST_401_84MHZ mbed

Speed up the CPU to 84MHz to get a SPI clock of 20MHz.

Files at this revision

API Documentation at this revision

Comitter:
dreschpe
Date:
Wed Mar 05 21:41:36 2014 +0000
Parent:
0:21b36798fd00
Child:
2:d53a7002da28
Commit message:
Test for 84MHz cpu speed

Changed in this revision

ST_401_84MHZ.lib Show annotated file Show diff for this revision Revisions of this file
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/ST_401_84MHZ.lib	Wed Mar 05 21:41:36 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/ST_401_84MHZ/#d19543ab3afa
--- a/main.cpp	Fri Feb 21 12:38:59 2014 +0000
+++ b/main.cpp	Wed Mar 05 21:41:36 2014 +0000
@@ -1,9 +1,16 @@
 #include "mbed.h"
+#include "stm32f4xx_hal.h" 
+#include "ST_F401_84MHZ.h"
  
 SPI device(SPI_MOSI, SPI_MISO, SPI_SCK);
  
 int main() {
     int i = 0;
+    SystemClock_Config_84MHz_internal();                                     // speed up to 84 MHz
+    HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_1);        // output SYSCLOCK to pin PC9 to monitor frequency
+    device.format(8,0); 
+    device.frequency(20000000);     // 20 MHz SPI Clock to test the clock setting
+
     while(1) {
         device.write(0x55);
         device.write(i++);
--- a/mbed.bld	Fri Feb 21 12:38:59 2014 +0000
+++ b/mbed.bld	Wed Mar 05 21:41:36 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file