]> git.sur5r.net Git - freertos/commitdiff
Slow configured clock in the RM48 and TMS570 demos to 50MHz.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 31 Oct 2012 10:31:33 +0000 (10:31 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 31 Oct 2012 10:31:33 +0000 (10:31 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1807 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/.cproject
FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h
FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/serial.c
FreeRTOS/Demo/CORTEX_R4_RM48_TMS570_CCS5/startup/sys_system.c

index 4e6af39680fa217aceca1345e7f81a3701a7e3cf..cc190703c147f2343b175dc33ed445a3da6f0b0d 100644 (file)
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.181229071" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.VFPv3D16" valueType="enumerated"/>\r
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.972870798" name="Application binary interface (tiabi, ti_arm9_abi, eabi) (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.eabi" valueType="enumerated"/>\r
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.1607856814" name="Designate enum type (Default is packed for EABI) (--enum_type)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.packed" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.release.1826615201" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.release" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.3" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.release.1826615201" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.release" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.4" valueType="enumerated"/>\r
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_FOR_SPEED.1928323899" name="Optimize for speed (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/>\r
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL.43248373" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>\r
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH.403820922" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH" valueType="includePath">\r
index 808b6da34e2b95f3db25578540cae895478f18bf..1dae269d1381b807f25b7c31f52f28ba86ff9f4f 100644 (file)
@@ -95,7 +95,7 @@
 #define configUSE_TICK_HOOK                                            1\r
 #define configUSE_TRACE_FACILITY                               0\r
 #define configUSE_16_BIT_TICKS                                 0\r
-#define configCPU_CLOCK_HZ                                             ( ( unsigned portLONG ) 90000000 ) /* Timer clock. */\r
+#define configCPU_CLOCK_HZ                                             ( ( unsigned portLONG ) 50000000 ) /* Timer clock. */\r
 #define configTICK_RATE_HZ                                             ( ( portTickType ) 1000 )\r
 #define configMAX_PRIORITIES                                   ( 8 )\r
 #define configMINIMAL_STACK_SIZE                               ( ( unsigned portSHORT ) 128 )\r
index 46da7308c895cb21561d67b55883b26e6255acfc..2424421deedda9f7f74879dc5490e9df55d29b8a 100644 (file)
 #define serialVIM_REQMASKSET0_REG      ( * ( ( volatile unsigned long * ) 0xFFFFFE30 ) )\r
 #define serialVIM_SCIHINT_RAM       ( * ( ( void (**)(void) ) 0xFFF82038 ) )\r
 \r
+/* Baudrate */\r
+#define serialBAURATE          19200.0                 /* Baudrate in Hz */\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -174,7 +176,7 @@ xComPortHandle xReturn = ( xComPortHandle ) 0;
            /* Global control 1 */\r
                serialSCI_GCR1_REG = 0x03010032UL;\r
            /* Baudrate */\r
-               serialSCI_BAUD_REG = 292;\r
+               serialSCI_BAUD_REG = ((unsigned long)((configCPU_CLOCK_HZ / (16.0 * serialBAURATE) + 0.5)) - 1) & 0x00FFFFFF;\r
            /* Transmission length (8-bit) */\r
                serialSCI_LENGTH_REG = 8 - 1;\r
            /* Set SCI pins functional mode */\r
index 378210b7f0bb409c4ed356f03771253720f188d5..2988ed93d2a5143e66be8143f94a7c15d6c5624d 100644 (file)
 \r
 #include "sys_system.h"\r
 \r
-\r
-/** @fn void systemInit(void)\r
-*   @brief Initializes System Driver\r
-*\r
-*   This function initializes the System driver.\r
-*\r
-*/\r
-\r
+#define startupCPU_100MHZ 1\r
 \r
 void systemInit(void)\r
 {\r
     /** @b Initialize @b Flash @b Wrapper: */\r
 \r
     /** - Setup flash read mode, address wait states and data wait states */\r
+#if    startupCPU_100MHZ == 1\r
+       /* 100MHz */\r
+    flashWREG->FRDCNTL =  0x01000000U\r
+                       | (2U << 8U)\r
+                       | (0U << 4U)\r
+                       |  1U;\r
+#else\r
+    /* 180MHz */\r
     flashWREG->FRDCNTL =  0x01000000U \r
                        | (3U << 8U) \r
                        | (1U << 4U) \r
                        |  1U;\r
+#endif\r
 \r
 #if 0\r
     /** - Setup flash bank power modes */\r
@@ -77,6 +79,15 @@ void systemInit(void)
     *     - Setup Pll multiplier          \r
     */\r
 \r
+#if    startupCPU_100MHZ == 1\r
+       /* 100MHz */\r
+    systemREG1->PLLCTL1 =  0x00000000U\r
+                        |  0x20000000U\r
+                        | (0U << 24U)\r
+                        |  0x00000000U\r
+                        | (5U << 16U)\r
+                        | (74U << 8U);\r
+#else\r
     /* 180Mhz */\r
     systemREG1->PLLCTL1 =  0x00000000U \r
                         |  0x20000000U \r
@@ -84,6 +95,7 @@ void systemInit(void)
                         |  0x00000000U \r
                         | (5U << 16U) \r
                         | (134U << 8U);\r
+#endif\r
 \r
     /** - Setup pll control register 1 \r
     *     - Enable/Disable frequency modulation\r
@@ -131,8 +143,9 @@ void systemInit(void)
                           | 1U;\r
 \r
     /** - Setup RTICLK1 and RTICLK2 clocks */\r
+    /* 90MHz (180Mhz/2) */\r
     systemREG1->RCLKSRC = (1U << 24U)\r
-                        | (SYS_VCLK << 16U) \r
+                        | (SYS_VCLK << 16U)\r
                         | (1U << 8U)  \r
                         |  SYS_VCLK;\r
 \r