AnsweredAssumed Answered

[solved] eTimer input capture mode SPC56EL

Question asked by Patrik Schantl on May 7, 2015
Latest reply on Jun 8, 2015 by Patrik Schantl
Hello,

I would like to use the input capture functionality of eTimer on SPC56EL. This is my eTimer configuration:

01.ETIMER_0.CHANNEL[0].CTRL1.B.PRISRC = 0b11000;
02.ETIMER_0.CHANNEL[0].CTRL1.B.SECSRC = 0b00010;
03.ETIMER_0.CHANNEL[0].CTRL1.B.CNTMODE = 0x3;
04.ETIMER_0.CHANNEL[0].CTRL1.B.LENGTH = 0x0;
05.ETIMER_0.CHANNEL[0].CTRL1.B.DIR = 0x0;
06.  
07.ETIMER_0.CHANNEL[0].CTRL2.B.OUTMODE = 0x3;
08.ETIMER_0.CHANNEL[0].CTRL2.B.OEN = 0x1;  
09.  
10.ETIMER_0.CHANNEL[0].CCCTRL.B.CLC2 = 0x5;    
11.ETIMER_0.CHANNEL[0].CCCTRL.B.CLC1 = 0x2;    
12.ETIMER_0.CHANNEL[0].CCCTRL.B.CMPMODE = 0x0; 
13.ETIMER_0.CHANNEL[0].CCCTRL.B.CPT2MODE = 0x1;    
14.  
15.ETIMER_0.CHANNEL[0].INTDMA.B.ICF2IE = 0x1;      
16.ETIMER_0.CHANNEL[0].INTDMA.B.CMPLD1DE = 0x1;    
17.ETIMER_0.CHANNEL[0].INTDMA.B.CMPLD2DE = 0x1;
18.      
19.ETIMER_0.DREQ[0].R = DREQ_ENABLED | DREQ_CMPLD1_CH0;
20.ETIMER_0.DREQ[1].R = DREQ_ENABLED | DREQ_CMPLD2_CH0;

The primary input source is the bus clock, the secondary input source is an external signal. The counter counts up with every rising edge of primary source when the secondary input is high. Additionally, I am using the compare load function to reload the compare values with DMA. Anyway, doesn´t matter because this part works fine. The counter runs up when secondary input is high and reloads the compare values.

According to my configuration I expected that the eTimer captures falling edges of the secondary input source (my external signal) and stores the corresponding counter values to the CAPT_2 register. But the capture of falling edge isn´t working. Can anyone tell me if something is missing in my configuration or what I have to do to use the capture functionality?

Best regards,
Patrik




Outcomes