主题中讨论的其他器件:Energia、 CC3200
您好!
在 Energia 中使用 cc3200的计时器时、我面临很多问题。
我没有在串行监视器上获得任何计时器电流值的输出。
我正在共享我的代码。
有人能告诉我犯了什么错误。
实际上、我想计算不同代码中的一个函数所花费的时间。
但我无法在 Energia 上运行计时器。
是否有人可以共享有关如何配置和启用计时器的基本代码。
工作代码可能会对我有所帮助。
#include
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_timer.h"
#include "inc/hw_types.h"
#include "debug.h"
#include "interrupt.h"
#include "timer.h"
#include "driverlib/prcm.h"
#include "inc/hw_gprcm.h"
#include "wiring_prive.h"
#include "driverlib/rom_map.h"
#include "driverlib/pin.h"
unsigned long count=0;
void setup()
{
引脚模式(RED_LED、输出);
PRCMPeripheralClkEnable (PRCM_TIMERA0、PRCM_RUN_MODE_CLK);
PRCMPeripheralReset (PRCM_TIMERA0);
TimerDisable (TIMERERA0_BASE、TIMER_Both);
TimerConfigure (TIMERERA0_BASE、TIMER_CFG_PERIODIC_UP);
HWREG (TIMERERA0_BASE + TIMER_O_TAV)=0;
TimerEnable (TIMERERA0_BASE、TIMER_Both);
Serial.begin(115200);
}
void loop()
{
TimerEnable (TIMERERA0_BASE、TIMER_Both);
计数= TimerValueGet (TIMERERA0_BASE、TIMER_A);
serial.println (count);
}