Other Parts Discussed in Thread: CC2642R, SIMPLELINK-CC13XX-CC26XX-SDK, SYSCONFIG, SIMPLELINK-CC2640R2-SDK
在2640r2f使用定时器设置100us,在回调函数中进行电平翻转。测得时间不是100us。cc2642r测试准确。(黄色为2642r,蓝色2640)
相同的翻转函数。黄色ch1 主机,蓝色ch2从机,主机100us
1ms也不是很准
1)2640r2f定时器最小能精确产生多少?还是我的代码有问题。
2)在那可以找到2640r2f 使用的是24M倍频的48M?
void timerCallback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) { // syn_t_count++; // GPIO_toggle(IOID_0); GPIO_toggleDio(EEG_BOARD_UART_TX); // interrupt callback code goes here. Minimize processing in interrupt. } void Timer_Init(void) { GPTimerCC26XX_Params params; GPTimerCC26XX_Params_init(¶ms); params.width = GPT_CONFIG_16BIT; params.mode = GPT_MODE_PERIODIC; params.direction = GPTimerCC26XX_DIRECTION_UP; params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF; hTimer = GPTimerCC26XX_open(EEG_BOARD_GPTIMER1B, ¶ms); if(hTimer == NULL) { // Task_exit(); } Types_FreqHz freq; BIOS_getCpuFreq(&freq);//48000 000 GPTimerCC26XX_Value loadVal = freq.lo / 10000 - 1; //100us GPTimerCC26XX_setLoadValue(hTimer, loadVal); GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_TIMEOUT); GPTimerCC26XX_start(hTimer); }