[solved] eTimer input capture mode SPC56EL
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-07 1:57 AM
Posted on May 07, 2015 at 10:57
Hello,
I would like to use the input capture functionality of eTimer on SPC56EL. This is my eTimer configuration:
ETIMER_0.CHANNEL[0].CTRL1.B.PRISRC = 0b11000;
ETIMER_0.CHANNEL[0].CTRL1.B.SECSRC = 0b00010;
ETIMER_0.CHANNEL[0].CTRL1.B.CNTMODE = 0x3;
ETIMER_0.CHANNEL[0].CTRL1.B.LENGTH = 0x0;
ETIMER_0.CHANNEL[0].CTRL1.B.DIR = 0x0;
ETIMER_0.CHANNEL[0].CTRL2.B.OUTMODE = 0x3;
ETIMER_0.CHANNEL[0].CTRL2.B.OEN = 0x1;
ETIMER_0.CHANNEL[0].CCCTRL.B.CLC2 = 0x5;
ETIMER_0.CHANNEL[0].CCCTRL.B.CLC1 = 0x2;
ETIMER_0.CHANNEL[0].CCCTRL.B.CMPMODE = 0x0;
ETIMER_0.CHANNEL[0].CCCTRL.B.CPT2MODE = 0x1;
ETIMER_0.CHANNEL[0].INTDMA.B.ICF2IE = 0x1;
ETIMER_0.CHANNEL[0].INTDMA.B.CMPLD1DE = 0x1;
ETIMER_0.CHANNEL[0].INTDMA.B.CMPLD2DE = 0x1;
ETIMER_0.DREQ[0].R = DREQ_ENABLED | DREQ_CMPLD1_CH0;
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
Solved! Go to Solution.
This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-29 5:44 AM
Posted on May 29, 2015 at 14:44Hello Patrik ,Your configuration seems to be ok.Did you arm the capture ?ARM - Arm CaptureSetting this bit high starts the input capture process. This bit can be cleared at anytime to disable input capture operation. This bit is self cleared when in one shot modeand the enabled capture circuit(s) has had a capture event(s).1 = Input capture operation as specified by the CPT1MODE and CPT2MODE bits isenabled.0 = Input capture operation is disabled. Best Regards Erwan
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-29 5:44 AM
Posted on May 29, 2015 at 14:44Hello Patrik ,Your configuration seems to be ok.Did you arm the capture ?ARM - Arm CaptureSetting this bit high starts the input capture process. This bit can be cleared at anytime to disable input capture operation. This bit is self cleared when in one shot modeand the enabled capture circuit(s) has had a capture event(s).1 = Input capture operation as specified by the CPT1MODE and CPT2MODE bits isenabled.0 = Input capture operation is disabled. Best Regards Erwan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-06-08 6:06 AM
Posted on June 08, 2015 at 15:06
Hello Erwan,
That's it, now it works! Thanks for your help! Best regards, Patrik