瀏覽代碼

更改定时器配置

liuhao 3 年之前
父節點
當前提交
4194a71843

+ 14 - 3
ZStack-2.5.1a/Projects/zstack/Public/public.c

@@ -43,14 +43,16 @@ void InitTimer3(void)
     //T3CTL (0xCB)–定时器 3 控制  bit7:5 -->111: 标记频率/128
     T3CTL |= 0xE0;            //128分频,F=16M/128=125000HZ T=1/F=8us 计数一次8us 计满溢出
     T3CTL |= 0x08 ;          //开溢出中断 bit3 溢出中断屏蔽 0:中断禁止 1:中断使能  
-   // T3CTL &= ~0x03;          // 自动重装 00->0xff  bit1:0--->00: 自由运行,从0x00到0xFF反复计数
-    T3CTL |= 0x02;          //  //设置为 模模式 从0x00到T3CC0重复计数
+  //  T3CTL &= ~0x03;          // 自动重装 00->0xff  bit1:0--->00: 自由运行,从0x00到0xFF反复计数
+    T3CTL &= ~0x01;          //  //设置为 模模式 从0x00到T3CC0重复计数 bit1:0  -->10
     T3CC0 = 250;          //设置最大计数值  这里设置250 2ms触发一次中断 
     T3CCTL0 = 0x04;// bit2 选择定时器3通道0捕获或者比较模式   比较模式 
     T3CTL |= 0x10;           // bit4 启动定时器。正常运行时设置,暂停时清除
     //T3CTL bit2  清除计数器。写1到CLR复位计数器到0x00,并初始化相关通道所有的输出引脚。总是读作0。
     EA = 1;                  //开总中断
     //T3CNT (0xEA) – 定时器 3 计数器   定时器计数字节。包括8位计数器当前值。
+    P1DIR=0xff;
+    
 }
 
 
@@ -60,8 +62,10 @@ void InitTimer3(void)
 #pragma vector=T3_VECTOR
 __near_func __interrupt void t3_irq(void)
 {
+
    //T3STAT &= ~0x01; 
    IRCON &= ~0x04; //T3IF clear     //清除定时器3通道0中断标志
+   
 }
 
 /****************************************************************************
@@ -77,7 +81,7 @@ void InitTimer4(void)
     T4CTL |= 0xE0;            //128分频,F=16M/128=125000HZ T=1/F=8us 计数一次8us 计满溢出
     T4CTL |= 0x08 ;          //开溢出中断 bit3 溢出中断屏蔽 0:中断禁止 1:中断使能  
    // T3CTL &= ~0x03;          // 自动重装 00->0xff  bit1:0--->00: 自由运行,从0x00到0xFF反复计数
-    T4CTL |= 0x02;          //  //设置为 模模式 从0x00到T3CC0重复计数
+     T4CTL &= ~0x01;          //  //设置为 模模式 从0x00到T4CC0重复计数 bit1:0  -->10
     T4CC0 = 250;          //设置最大计数值  这里设置250 2ms触发一次中断 
     T4CCTL0 = 0x04;// bit2 选择定时器3通道0捕获或者比较模式   比较模式 
     T4CTL |= 0x10;           // bit4 启动定时器。正常运行时设置,暂停时清除
@@ -93,6 +97,13 @@ __near_func __interrupt void t4_irq(void)
 {
    //T3STAT &= ~0x01; 
    IRCON &= ~0x08; //T4IF clear     //清除定时器4通道0中断标志
+   
+   static int cnt=0;
+  if(++cnt>500)
+  {
+     cnt=0;
+     P1^=0xff;
+  }
 }
 
 

文件差異過大導致無法顯示
+ 995 - 1028
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/CC2530DB/SampleApp.dep


+ 2 - 2
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/CC2530DB/settings/SampleApp.EndDeviceEB.cspy.bat

@@ -25,7 +25,7 @@ if not "%~1" == "" goto debugFile
 
 @echo on 
 
-"D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" --backend -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
+"D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" --backend -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
 
 @echo off 
 goto end 
@@ -34,7 +34,7 @@ goto end
 
 @echo on 
 
-"D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" "--debug_file=%~1" --backend -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
+"D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" "--debug_file=%~1" --backend -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
 
 @echo off 
 :end

+ 3 - 3
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/CC2530DB/settings/SampleApp.EndDeviceEB.cspy.ps1

@@ -1,4 +1,4 @@
-param([String]$debugfile = "");
+param([String]$debugfile = "");
 
 # This powershell file has been generated by the IAR Embedded Workbench
 # C - SPY Debugger, as an aid to preparing a command line for running
@@ -23,9 +23,9 @@ param([String]$debugfile = "");
 
 if ($debugfile -eq "")
 {
-& "D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" --backend -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
+& "D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" --backend -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
 }
 else
 {
-& "D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" --debug_file=$debugfile --backend -f "E:\Git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
+& "D:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\cspybat" -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.general.xcl" --debug_file=$debugfile --backend -f "E:\git\TEST\ZStack-2.5.1a\Projects\zstack\Samples\EndDeviceEB\CC2530DB\settings\SampleApp.EndDeviceEB.driver.xcl" 
 }

文件差異過大導致無法顯示
+ 4 - 4
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/CC2530DB/settings/SampleApp.dbgdt


+ 5 - 5
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/CC2530DB/settings/SampleApp.dnx

@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <settings>
     <DebugChecksum>
-        <Checksum>1621451221</Checksum>
+        <Checksum>1301357367</Checksum>
     </DebugChecksum>
     <DisAssemblyWindow>
         <NumStates>_ 1</NumStates>
@@ -46,15 +46,15 @@
     <Disassembly>
         <MixedMode>1</MixedMode>
     </Disassembly>
-    <TermIOLog>
-        <LoggingEnabled>_ 0</LoggingEnabled>
-        <LogFile>_ ""</LogFile>
-    </TermIOLog>
     <LogFile>
         <LoggingEnabled>_ 0</LoggingEnabled>
         <LogFile>_ ""</LogFile>
         <Category>_ 0</Category>
     </LogFile>
+    <TermIOLog>
+        <LoggingEnabled>_ 0</LoggingEnabled>
+        <LogFile>_ ""</LogFile>
+    </TermIOLog>
     <Breakpoints>
         <Count>0</Count>
     </Breakpoints>

文件差異過大導致無法顯示
+ 4 - 4
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/CC2530DB/settings/SampleApp.wsdt


+ 5 - 0
ZStack-2.5.1a/Projects/zstack/Samples/EndDeviceEB/Source/SampleApp.c

@@ -18,6 +18,8 @@
 #include <stdio.h>
 #include "string.h"
 #include <stdlib.h> 
+#include "public.h"
+
 
 void App_GatherTask(void);
 // This list should be filled with Application specific Cluster IDs.
@@ -166,6 +168,9 @@ void SD_App_Init( uint8 task_id )
   P0DIR&=~0x20;//p05ÉèÖÃΪÊäÈë
   
    P0DIR&=~0x80;//p06ÉèÖÃΪÊäÈë
+   
+   InitTimer3();
+   InitTimer4();
  // P0DIR|=0x20;
 }
 

部分文件因文件數量過多而無法顯示