Browse Source

changed set_imulse_duration parameters

Neluji 3 years ago
parent
commit
49f261078b
5 changed files with 27 additions and 13 deletions
  1. 13
    8
      MDK-ARM/Project.uvoptx
  2. 2
    2
      MDK-ARM/Project.uvprojx
  3. 1
    2
      MyDrivers/MyPWM.c
  4. 1
    1
      MyDrivers/MyPWM.h
  5. 10
    0
      Src/main.c

+ 13
- 8
MDK-ARM/Project.uvoptx View File

@@ -300,12 +300,12 @@
300 300
         <bEvRecOn>1</bEvRecOn>
301 301
         <bSchkAxf>0</bSchkAxf>
302 302
         <bTchkAxf>0</bTchkAxf>
303
-        <nTsel>5</nTsel>
303
+        <nTsel>6</nTsel>
304 304
         <sDll></sDll>
305 305
         <sDllPa></sDllPa>
306 306
         <sDlgDll></sDlgDll>
307 307
         <sDlgPa></sDlgPa>
308
-        <sIfile></sIfile>
308
+        <sIfile>..\..\inifiles\Simu_Pulse.ini</sIfile>
309 309
         <tDll></tDll>
310 310
         <tDllPa></tDllPa>
311 311
         <tDlgDll></tDlgDll>
@@ -317,7 +317,7 @@
317 317
         <SetRegEntry>
318 318
           <Number>0</Number>
319 319
           <Key>DLGDARM</Key>
320
-          <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=504,37,1150,710,0)(110=60,88,280,548,0)(111=752,104,972,564,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=273,112,694,539,0)(121=75,104,496,531,0)(122=674,103,1095,530,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=709,11,1303,762,0)(131=150,13,744,764,0)(132=599,52,1193,803,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
320
+          <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=504,37,1150,710,0)(110=60,88,280,548,0)(111=752,104,972,564,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=533,85,954,512,0)(121=892,96,1313,523,0)(122=674,103,1095,530,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=709,11,1303,762,0)(131=150,13,744,764,0)(132=599,17,1193,768,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
321 321
         </SetRegEntry>
322 322
         <SetRegEntry>
323 323
           <Number>0</Number>
@@ -362,7 +362,7 @@
362 362
         <Mm>
363 363
           <WinNumber>1</WinNumber>
364 364
           <SubType>0</SubType>
365
-          <ItemText>0x04010001</ItemText>
365
+          <ItemText>porta</ItemText>
366 366
           <AccSizeX>0</AccSizeX>
367 367
         </Mm>
368 368
       </MemoryWindow1>
@@ -412,12 +412,17 @@
412 412
         <Wi>
413 413
           <IntNumber>0</IntNumber>
414 414
           <FirstString>((porta &amp; 0x00000080) &gt;&gt; 7 &amp; 0x80) &gt;&gt; 7</FirstString>
415
-          <SecondString>00800000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274612026203078303030303030383029203E3E2037000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F1800000000000000000000000000000000000000540E0008</SecondString>
415
+          <SecondString>00800000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274612026203078303030303030383029203E3E2037000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000CDCCCCCCCCCCD43F1800000000000000000000000000000000000000540E0008</SecondString>
416 416
         </Wi>
417 417
         <Wi>
418 418
           <IntNumber>1</IntNumber>
419
-          <FirstString>((portb &amp; 0x00000200) &gt;&gt; 9 &amp; 0x200) &gt;&gt; 9</FirstString>
420
-          <SecondString>00000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303032303029203E3E2039000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F1800000000000000000000000000000000000000540E0008</SecondString>
419
+          <FirstString>(porta &amp; 0x00000001)</FirstString>
420
+          <SecondString>00000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F72746120262030783030303030303031290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000D43F1800000000000000000000000000000000000000E20E0008</SecondString>
421
+        </Wi>
422
+        <Wi>
423
+          <IntNumber>2</IntNumber>
424
+          <FirstString>((portb &amp; 0x00000040) &gt;&gt; 6 &amp; 0x40) &gt;&gt; 6</FirstString>
425
+          <SecondString>00008000000000000000000000000000E0FFEF400000000000000000000000000000000028706F7274622026203078303030303030343029203E3E2036000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003000000333333333333D73F1800000000000000000000000000000000000000440E0008</SecondString>
421 426
         </Wi>
422 427
       </LogicAnalyzers>
423 428
       <DebugDescription>
@@ -440,7 +445,7 @@
440 445
       <GroupNumber>1</GroupNumber>
441 446
       <FileNumber>1</FileNumber>
442 447
       <FileType>1</FileType>
443
-      <tvExp>1</tvExp>
448
+      <tvExp>0</tvExp>
444 449
       <tvExpOptDlg>0</tvExpOptDlg>
445 450
       <bDave2>0</bDave2>
446 451
       <PathWithFileName>../Src/main.c</PathWithFileName>

+ 2
- 2
MDK-ARM/Project.uvprojx View File

@@ -600,11 +600,11 @@
600 600
             <RunIndependent>0</RunIndependent>
601 601
             <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
602 602
             <Capability>1</Capability>
603
-            <DriverSelection>4107</DriverSelection>
603
+            <DriverSelection>4101</DriverSelection>
604 604
           </Flash1>
605 605
           <bUseTDR>1</bUseTDR>
606 606
           <Flash2>STLink\ST-LINKIII-KEIL_SWO.dll</Flash2>
607
-          <Flash3></Flash3>
607
+          <Flash3>"" ()</Flash3>
608 608
           <Flash4></Flash4>
609 609
           <pFcarmOut></pFcarmOut>
610 610
           <pFcarmGrp></pFcarmGrp>

+ 1
- 2
MyDrivers/MyPWM.c View File

@@ -47,9 +47,8 @@ void MyPWM_Conf_Input(TIM_TypeDef * Timer, int channel1, int channel2)
47 47
 }
48 48
 
49 49
 
50
-void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, int Percentage, int channel)
50
+void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, uint32_t CompareValue, int channel)
51 51
 {
52
-	uint32_t CompareValue = 0xFFFF * Percentage/100;
53 52
 	if (channel==LL_TIM_CHANNEL_CH1) LL_TIM_OC_SetCompareCH1(Timer, CompareValue);
54 53
 	else if (channel==LL_TIM_CHANNEL_CH2) LL_TIM_OC_SetCompareCH2(Timer, CompareValue);
55 54
 	else if (channel==LL_TIM_CHANNEL_CH3) LL_TIM_OC_SetCompareCH3(Timer, CompareValue);

+ 1
- 1
MyDrivers/MyPWM.h View File

@@ -6,4 +6,4 @@ void MyPWM_Conf_Output(TIM_TypeDef * Timer, int channel);
6 6
 
7 7
 void MyPWM_Conf_Input(TIM_TypeDef * Timer, int channel1, int channel2);
8 8
 
9
-void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, int Percentage, int channel);
9
+void MyPWM_Set_Impulse_Duration(TIM_TypeDef * Timer, uint32_t CompareValue, int channel);

+ 10
- 0
Src/main.c View File

@@ -72,6 +72,16 @@ int main(void)
72 72
 	My_GPIO_Init_Struct.Pull = LL_GPIO_PULL_DOWN;
73 73
 	LL_GPIO_Init(GPIOB, &My_GPIO_Init_Struct);
74 74
 	
75
+	My_GPIO_Init_Struct.Pin = LL_GPIO_PIN_0;
76
+	My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_FLOATING;
77
+	My_GPIO_Init_Struct.Pull = LL_GPIO_PULL_DOWN;
78
+	LL_GPIO_Init(GPIOA, &My_GPIO_Init_Struct);
79
+	
80
+	My_GPIO_Init_Struct.Pin = LL_GPIO_PIN_6;
81
+	My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_FLOATING;
82
+	My_GPIO_Init_Struct.Pull = LL_GPIO_PULL_DOWN;
83
+	LL_GPIO_Init(GPIOB, &My_GPIO_Init_Struct);
84
+	
75 85
 	MyTimer_Start(Timer1);
76 86
 	MyTimer_Start(Timer2);
77 87
 

Loading…
Cancel
Save