Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CC2538: gptimer in pwm mode

$
0
0

Part Number:CC2538

Hi.
Is it possible to configure GPTimer in PWM mode without interrupts?
From datashet it seem's possible, but does not work in my case.
I am trying to setup one of the pin to generate sample rate clock for external ADC.
Usually with another mcu it is possible.

The code is here:

SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_GPT0); 
*(unsigned long*)IOC_PA3_SEL = IOC_MUX_OUT_SEL_GPT0_ICP1;
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_CTL) = 0x00000000;
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_CFG) = 0x00000004; 
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_TAMR) = (1UL<<10)|(1UL<<11)|(1UL<<3)|(0UL<<2)|2UL; 
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_CTL) |= (1UL<<6); 
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_TAILR) = 5000; //osc clock 16MHz, so the period is 3200 Hz
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_TAMATCHR) = 1000; 
*(unsigned long*)(GPTIMER0_BASE + GPTIMER_CTL) |= 1UL;

I use IAR IDE.


Viewing all articles
Browse latest Browse all 262198

Trending Articles