Sep 14, 2016
01:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 14, 2016
01:50 AM
Dear all,
At the moment I am playing with the XMC4400 and I have the timer slices 0, 1 and 3 of Timer Module 0 running
according to example 3 of AP32288: CU8 initialization for 3 phase motor drive.
Everying is working as expected.
What I want to do now, is to introduce a phase shift between the carriers by changing the initial value of the Timer as following at the beguining of the main:
XMC_CCU8_SLICE_SetTimerValue(SLICE00_PTR, 200U);
XMC_CCU8_SLICE_SetTimerValue(SLICE01_PTR, 500U);
XMC_CCU8_SLICE_SetTimerValue(SLICE03_PTR, 1000U);
/* Set period match value of the timer module1 */
XMC_CCU8_SLICE_SetTimerPeriodMatch(SLICE00_PTR, 1499U);
XMC_CCU8_SLICE_SetTimerPeriodMatch(SLICE01_PTR, 1499U);
XMC_CCU8_SLICE_SetTimerPeriodMatch(SLICE03_PTR, 1499U);
for some reason the Period is set correctly but not the Timer value, and when I read it, after having set the value, I get the value 0:
A = XMC_CCU8_SLICE_GetTimerValue(SLICE00_PTR);
Can anyone help me with this ? How do I set the initial Timer value that I want correnctly in order to optain the desired phase-shift?
Thank you very much! 🙂
At the moment I am playing with the XMC4400 and I have the timer slices 0, 1 and 3 of Timer Module 0 running
according to example 3 of AP32288: CU8 initialization for 3 phase motor drive.
Everying is working as expected.
What I want to do now, is to introduce a phase shift between the carriers by changing the initial value of the Timer as following at the beguining of the main:
XMC_CCU8_SLICE_SetTimerValue(SLICE00_PTR, 200U);
XMC_CCU8_SLICE_SetTimerValue(SLICE01_PTR, 500U);
XMC_CCU8_SLICE_SetTimerValue(SLICE03_PTR, 1000U);
/* Set period match value of the timer module1 */
XMC_CCU8_SLICE_SetTimerPeriodMatch(SLICE00_PTR, 1499U);
XMC_CCU8_SLICE_SetTimerPeriodMatch(SLICE01_PTR, 1499U);
XMC_CCU8_SLICE_SetTimerPeriodMatch(SLICE03_PTR, 1499U);
for some reason the Period is set correctly but not the Timer value, and when I read it, after having set the value, I get the value 0:
A = XMC_CCU8_SLICE_GetTimerValue(SLICE00_PTR);
Can anyone help me with this ? How do I set the initial Timer value that I want correnctly in order to optain the desired phase-shift?
Thank you very much! 🙂
6 Replies
Sep 16, 2016
07:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 16, 2016
07:21 AM
Hi paulDBone,
Have you tried to do a shadow transfer?
XMC_CCU8_EnableShadowTransfer(CCU8_MODULE, ((uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_0 |
(uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_1 |
(uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_2 |
(uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_3));
Regards
Eric
Have you tried to do a shadow transfer?
XMC_CCU8_EnableShadowTransfer(CCU8_MODULE, ((uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_0 |
(uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_1 |
(uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_2 |
(uint32_t)XMC_CCU8_SHADOW_TRANSFER_SLICE_3));
Regards
Eric
Sep 20, 2016
03:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 20, 2016
03:06 AM
Hi Erik!!
Thank you very much for your interest!
YES! I tried that as well, but it didn't work.
Eventually I used an External Load to set the initial value of the times right at the start up.
This method is described into the manual, section 21.2.8.5.
What I still don´t understand though, is why functions don´t work!!!
🙂
Thank you very much for your interest!
YES! I tried that as well, but it didn't work.
Eventually I used an External Load to set the initial value of the times right at the start up.
This method is described into the manual, section 21.2.8.5.
What I still don´t understand though, is why functions don´t work!!!
🙂
Sep 20, 2016
03:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 20, 2016
03:13 AM
Maybe what you can do is use the Compare Match 2 of the slice 0 to the external start of the timer slice 1, and do the same with the slice 1 and 3.
In this way I think that you can achieve the phase shift that you want.
In this way I think that you can achieve the phase shift that you want.
Sep 20, 2016
03:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 20, 2016
03:22 AM
Hi apereira,
Yes, thanks , that would also be a posibility.
It is just that , all the other possible solutions complicate things and it would be so easy with the funcion.
Select the timer and the value that you want, and just change it. Nice and easy 🙂
Yes, thanks , that would also be a posibility.
It is just that , all the other possible solutions complicate things and it would be so easy with the funcion.
Select the timer and the value that you want, and just change it. Nice and easy 🙂
Oct 14, 2016
02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 14, 2016
02:51 AM
Hi paulDBone,
are you sure that the timer is stopped before you write to the TIMER register?
Reference Manual:
Timer Value
This field contains the actual value of the timer. A write access is only possible when the timer is stopped.
You can also check the Slice status run bit: TRB (CC8yTCST)
Regards
Eric
are you sure that the timer is stopped before you write to the TIMER register?
Reference Manual:
Timer Value
This field contains the actual value of the timer. A write access is only possible when the timer is stopped.
You can also check the Slice status run bit: TRB (CC8yTCST)
Regards
Eric
Nov 14, 2016
04:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 14, 2016
04:12 AM
Hi Eric,
Yes, I am completely sure.
The Timers are initialized by the following instruction at the end of the initialization.
XMC_SCU_SetCcuTriggerHigh(XMC_SCU_CCU_TRIGGER_CCU80);
Thank you for your answer.
Yes, I am completely sure.
The Timers are initialized by the following instruction at the end of the initialization.
XMC_SCU_SetCcuTriggerHigh(XMC_SCU_CCU_TRIGGER_CCU80);
Thank you for your answer.