May 01, 2016
12:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 01, 2016
12:32 AM
Hi everybody! 🙂
I am playing with the XCM1300 series,
I am using the slices 0,1 and 2 of the CCU8 in order to generate three triangular signals.
I want the three of them to start/stop counting exactly at the same time, using a software variable.
So far I have been using the following code in order to start/stop the counting:
---------------------------------------START COUNTING------------------------------------------------------
XMC_CCU8_SLICE_StartTimer(CCU80_SLICE0_PTR);
XMC_CCU8_SLICE_StartTimer(CCU80_SLICE1_PTR);
XMC_CCU8_SLICE_StartTimer(CCU80_SLICE2_PTR);
---------------------------------------STOPCOUNTING--------------------------------------------------------
XMC_CCU8_SLICE_StopTimer(CCU80_SLICE0_PTR);
XMC_CCU8_SLICE_StopTimer(CCU80_SLICE1_PTR);
XMC_CCU8_SLICE_StopTimer(CCU80_SLICE2_PTR);
Does this ensure a synchronous start/stop of the counting? If not , could you please give me a hint about how to do it.
Thank you!
Regards!
Paul.
I am playing with the XCM1300 series,
I am using the slices 0,1 and 2 of the CCU8 in order to generate three triangular signals.
I want the three of them to start/stop counting exactly at the same time, using a software variable.
So far I have been using the following code in order to start/stop the counting:
---------------------------------------START COUNTING------------------------------------------------------
XMC_CCU8_SLICE_StartTimer(CCU80_SLICE0_PTR);
XMC_CCU8_SLICE_StartTimer(CCU80_SLICE1_PTR);
XMC_CCU8_SLICE_StartTimer(CCU80_SLICE2_PTR);
---------------------------------------STOPCOUNTING--------------------------------------------------------
XMC_CCU8_SLICE_StopTimer(CCU80_SLICE0_PTR);
XMC_CCU8_SLICE_StopTimer(CCU80_SLICE1_PTR);
XMC_CCU8_SLICE_StopTimer(CCU80_SLICE2_PTR);
Does this ensure a synchronous start/stop of the counting? If not , could you please give me a hint about how to do it.
Thank you!
Regards!
Paul.
- Tags:
- IFX
- xmc1300 ccu8
4 Replies
May 01, 2016
08:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 01, 2016
08:20 AM
Hello Paul,
No, that does not ensure the synchronous start/stop of the timers.
In order to do that, you have to associate an start/stop event to each timer slice, connect it to the input signal H and then call a specific SCU function.
So define an event like this:
Then configure the CCU80 start events like this:
At last, request the synchronous start of all the timer slices from CCU80:
No, that does not ensure the synchronous start/stop of the timers.
In order to do that, you have to associate an start/stop event to each timer slice, connect it to the input signal H and then call a specific SCU function.
So define an event like this:
XMC_CCU8_SLICE_EVENT_CONFIG_t CCU8_0_event0_config = {
.mapped_input = XMC_CCU8_SLICE_INPUT_H,
.edge = XMC_CCU8_SLICE_EVENT_EDGE_SENSITIVITY_RISING_EDGE,
.level = XMC_CCU8_SLICE_EVENT_LEVEL_SENSITIVITY_ACTIVE_LOW,
.duration = XMC_CCU8_SLICE_EVENT_FILTER_DISABLED
};
Then configure the CCU80 start events like this:
XMC_CCU8_SLICE_ConfigureEvent(CCU80_SLICE0_PTR, XMC_CCU8_SLICE_EVENT_0, &CCU8_0_event0_config);
XMC_CCU8_SLICE_StartConfig(CCU80_SLICE0_PTR, XMC_CCU8_SLICE_EVENT_0, XMC_CCU8_SLICE_START_MODE_TIMER_START);
At last, request the synchronous start of all the timer slices from CCU80:
XMC_SCU_SetCcuTriggerHigh(XMC_SCU_CCU_TRIGGER_CCU80);
May 02, 2016
06:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 02, 2016
06:05 AM
Thanks a lot!
I haven't got time to try it yet, but I will do it along this week! 😄
I haven't got time to try it yet, but I will do it along this week! 😄
May 03, 2016
03:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 03, 2016
03:40 AM
Hello!
I got to test the synchronization start of the counters and it works very nice.
The difference can clearly be seen below, where I have measured the PWM outputs generated by the three counters using the same Duty Cycle.
No synchronized start:
Synchronized start:
Thanks a lot! 🙂
I got to test the synchronization start of the counters and it works very nice.
The difference can clearly be seen below, where I have measured the PWM outputs generated by the three counters using the same Duty Cycle.
No synchronized start:
Synchronized start:
Thanks a lot! 🙂
May 03, 2016
04:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 03, 2016
04:01 AM
Hello Paul,
No problem, you are welcome. 🙂
No problem, you are welcome. 🙂