Kaynağa Gözat

1,删除DAC删除;
2,增加开机自转设置,通过宏定义设置;
3,改为使用外部晶振,用内部晶振时连接星恒电池会导致CAN进入发送错误。

dd 5 ay önce
ebeveyn
işleme
36157023d6
5 değiştirilmiş dosya ile 24 ekleme ve 19 silme
  1. 1 1
      .cproject
  2. 1 0
      .project
  3. 5 4
      1.FrameLayer/Source/main.c
  4. 1 1
      3.BasicFunction/Source/canAppl.c
  5. 16 13
      mspm0g3507.syscfg

+ 1 - 1
.cproject

@@ -30,7 +30,7 @@
 							</option>
 							<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.667530017" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="TICLANG_3.2.2.LTS" valueType="string"/>
 							<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.targetPlatformDebug.42360861" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.targetPlatformDebug"/>
-							<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.builderDebug.1137809730" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.builderDebug"/>
+							<builder buildPath="${BuildDirectory}" enableAutoBuild="false" id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.builderDebug.1137809730" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.builderDebug"/>
 							<tool id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.compilerDebug.1794514536" name="Arm Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.exe.compilerDebug">
 								<option id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.compilerID.GENERATE_DWARF_DEBUG.628486153" name="Generate DWARF debug" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.compilerID.GENERATE_DWARF_DEBUG" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.compilerID.GENERATE_DWARF_DEBUG.GDWARF_3" valueType="enumerated"/>
 								<option id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.compilerID.ENDIAN_NESS__BIG_LITTLE.1915348719" name="Endian-ness (big/little) [See 'General' page to edit]" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.compilerID.ENDIAN_NESS__BIG_LITTLE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.2.compilerID.ENDIAN_NESS__BIG_LITTLE.MLITTLE_ENDIAN" valueType="enumerated"/>

+ 1 - 0
.project

@@ -7,6 +7,7 @@
 	<buildSpec>
 		<buildCommand>
 			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
 			<arguments>
 			</arguments>
 		</buildCommand>

+ 5 - 4
1.FrameLayer/Source/main.c

@@ -207,10 +207,6 @@ int  main(void)
 //     *                          -----------------------
 //     *                              ReferenceVoltage
 
-
-     DL_DAC12_output12(DAC0, 2048);
-     DL_DAC12_enable(DAC0);
-
      //---over Cur of Valut
 #if((IPM_POWER_SEL == IPM_POWER_250W_6G) ||(IPM_POWER_SEL ==IPM_POWER_350W_6G))
      DL_COMP_setDACCode0(COMP_0_INST, 0xb5);//12G-100A-0x99-1.97V   6G-70A--0xb5-2.33V
@@ -272,6 +268,11 @@ int  main(void)
      uwFlash_IRQ_Enble=1;
     // hw_voPWMOn();
      // DL_TimerG_setCaptureCompareValue(PWM_B_INST, 1000, GPIO_PWM_B_C1_IDX);
+#if 0 //开机自转
+     MC_WorkMode = 1;
+     MC_ControlCode.GearSt = 2;
+     MC_ControlCode.LightSwitch = 0xF1;
+#endif
     while (1)
     {
 //        DL_GPIO_togglePins(LED_PORT, LED_LED1_PIN);

+ 1 - 1
3.BasicFunction/Source/canAppl.c

@@ -875,7 +875,7 @@ void Can_voMC_Run_200ms(void)
     MC_RunInfo.TorqueSensorData3=(UBYTE)(TorqueSensorRegFlt.SensorPer3 >> 4);
 
     static UBYTE test1 = 0;
-    if (MC_WorkMode == 1)
+    if(MC_WorkMode == 1)
     {
 #if(UART_ID==3)
         test1++;

+ 16 - 13
mspm0g3507.syscfg

@@ -48,9 +48,6 @@ divider5.divideValue = 4;
 const divider6       = system.clockTree["PLL_CLK2X_DIV"];
 divider6.divideValue = 4;
 
-const divider7       = system.clockTree["PLL_PDIV"];
-divider7.divideValue = 2;
-
 const divider9       = system.clockTree["UDIV"];
 divider9.divideValue = 2;
 
@@ -61,7 +58,7 @@ const gate8  = system.clockTree["MFPCLKGATE"];
 gate8.enable = true;
 
 const multiplier2         = system.clockTree["PLL_QDIV"];
-multiplier2.multiplyValue = 9;
+multiplier2.multiplyValue = 18;
 
 const mux2       = system.clockTree["CANCLKMUX"];
 mux2.inputSelect = "CANCLKMUX_PLLCLK1_OUT";
@@ -72,9 +69,13 @@ mux4.inputSelect = "EXHFMUX_XTAL";
 const mux8       = system.clockTree["HSCLKMUX"];
 mux8.inputSelect = "HSCLKMUX_SYSPLL2X";
 
+const mux12       = system.clockTree["SYSPLLMUX"];
+mux12.inputSelect = "zSYSPLLMUX_HFCLK";
+
 const pinFunction4       = system.clockTree["HFXT"];
 pinFunction4.inputFreq   = 8;
 pinFunction4.HFXTStartup = 40;
+pinFunction4.enable      = true;
 
 ADC121.$name                       = "ADC12_0";
 ADC121.trigSrc                     = "DL_ADC12_TRIG_SRC_EVENT";
@@ -264,7 +265,6 @@ MCAN1.peripheral.rxPin.$assign = "PA13";
 MCAN1.peripheral.txPin.$assign = "PA12";
 MCAN1.txPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric11";
 MCAN1.rxPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric12";
-scripting.suppress("MCAN is intended to work at the frequencies of 20, 40 or 80 Mhz\\.", MCAN1, "mcan_freq");
 
 OPA1.cfg0OutputPin                       = "ENABLED";
 OPA1.cfg0PSELChannel                     = "IN1_POS";
@@ -427,11 +427,14 @@ scripting.suppress("Migrating requires going through the Switch Board or Device
  * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
  * re-solve from scratch.
  */
-Board.peripheral.swclkPin.$suggestSolution   = "PA20";
-Board.peripheral.swdioPin.$suggestSolution   = "PA19";
-COMP1.peripheral.$suggestSolution            = "COMP1";
-GPIO1.associatedPins[1].pin.$suggestSolution = "PA9";
-GPIO1.associatedPins[2].pin.$suggestSolution = "PB7";
-GPIO1.associatedPins[4].pin.$suggestSolution = "PA31";
-GPIO4.associatedPins[0].pin.$suggestSolution = "PA23";
-GPIO5.associatedPins[1].pin.$suggestSolution = "PB6";
+pinFunction4.peripheral.$suggestSolution           = "SYSCTL";
+pinFunction4.peripheral.hfxInPin.$suggestSolution  = "PA5";
+pinFunction4.peripheral.hfxOutPin.$suggestSolution = "PA6";
+Board.peripheral.swclkPin.$suggestSolution         = "PA20";
+Board.peripheral.swdioPin.$suggestSolution         = "PA19";
+COMP1.peripheral.$suggestSolution                  = "COMP1";
+GPIO1.associatedPins[1].pin.$suggestSolution       = "PA9";
+GPIO1.associatedPins[2].pin.$suggestSolution       = "PB7";
+GPIO1.associatedPins[4].pin.$suggestSolution       = "PA31";
+GPIO4.associatedPins[0].pin.$suggestSolution       = "PA23";
+GPIO5.associatedPins[1].pin.$suggestSolution       = "PB6";