This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2538: CC2538

Part Number: CC2538

Hello,

I'd like feedback configuring timer GPT2 as a 32-bit timer A on the CC2538 for edge time mode in an input edge application.  My result is that if I don't use periodic mode, but rather use "capture mode" I seem to no longer get timeout interrupts.  I have configured an input edge from GPIO which I know works properly in another timer when it is set up in 16-bit mode.  I don' want a 16 bit capture, I want 32.  Is this available?

IOCPinConfigPeriphInput(GPIO_B_BASE, GPIO_PIN_3, IOC_GPT2OCP1);  <<  Input pin configuration
GPIOPinTypeTimer(GPIO_B_BASE, GPIO_PIN_3); <<  PIn to monitor for negative edge.
GPTIMER2_CFG = 0;  <<  32 bit operation.
GPTIMER2_TAMR |= (0
| GPTIMER_TAMR_TAMR(TnMR_CAPTURE)  <<  Capture rather than periodic???
| GPTIMER_TAMR_TACMR_MASK //Timer A Edge-time mode
| GPTIMER_TAMR_TACDIR_MASK //Timer A The timer counts up
);
GPTIMER2_CTL |= (0
| GPTIMER_CTL_TAEVENT(NEGATIVE_EDGE)
);
TimerCountSet(GPTIMER2_BASE, GPTIMER_A, 0);
tmp = GPT2_FROM_USEC(pll_mod_usec);
TimerLoadSet(GPTIMER2_BASE, GPTIMER_A, tmp);
TimerIntEnable(GPTIMER2_BASE, GPTIMER_TIMA_TIMEOUT);
TimerIntEnable(GPTIMER2_BASE, GPTIMER_CAPA_EVENT);
TimerIntRegister(GPTIMER2_BASE, GPTIMER_A, gpt2_interrupt_vector);
TimerIntClear(GPTIMER2_BASE,GPTIMER_TIMA_TIMEOUT|GPTIMER_CAPA_MATCH|GPTIMER_CAPA_MATCH);
TimerEnable(GPTIMER2_BASE, GPTIMER_A);

From the user's guide....what's with step 2?  Configure mode 4??  I want a 32 bit edge time not 16.

Input Edge-Timing Mode
A timer is configured to Input Edge-Timing mode by the following sequence:
1. Ensure the timer is disabled (the TAEN bit is cleared) before making any changes.
2. Write the GPTM Configuration (GPTIMER_CFG) register with a value of 0x0000.0004.  <<<<<<<<<<<<<<<<<<Why do I  need split the timer??  I want a 32 bit edge time.
3. In the GPTM Timer Mode (GPTIMER_TnMR) register, write the TnCMR field to 0x1 and the TnMR
field to 0x3.
4. Configure the type of event(s) that the timer captures by writing the TnEVENT field of the GPTM
Control (GPTIMER_CTL) register.
5. If a prescaler is to be used, write the prescale value to the GPTM Timer n Prescale Register
(GPTIMER_TnPR).
6. Load the timer start value into the GPTM Timer n Interval Load (GPTIMER_TnILR) register.
7. If interrupts are required, set the CnMIM bit in the GPTM Interrupt Mask (GPTIMER_IMR) register.
8. Set the TnEN bit in the GPTIMER_CTL register to enable the timer and start counting.
9. Poll the CnMRIS bit in the GPTMRIS register or wait for the interrupt to be generated (if enabled). In
both cases, the status flags are cleared by writing a 1 to the CnMCINT bit of the GPTM Interrupt
Clear (GPTIMER_ICR) register.
In Input Edge Timing mode, the timer continues running after an edge event has been detected, but the
timer interval can be changed at any time by writing the GPTMTnILR register. The change takes effect at
the next cycle after the write.

Thanks very much