Jun 11, 2013
04:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2013
04:00 AM
Hi all,
my problem:
I have PWM with period 1s and duty 50%.
and I need neverending loop where in each compare match (0,5s; 1,5s; 2,5s; ...) will be set some value (0x0000 - 0xFFFF) to 16bit variable.
and in each period match (1s; 2s; 3s; ...) will automaticaly starts DMA (no by SW in interrupt .... interupt have to be called directly by HW - period match - without CPU) which only transfer this 16bit value to port P1 (ie address 0x0x48028100)
Is it possible with app DMA002 or DMA003 or DMA004 or with else?
How can I do it?
Regards
Koumak
my problem:
I have PWM with period 1s and duty 50%.
and I need neverending loop where in each compare match (0,5s; 1,5s; 2,5s; ...) will be set some value (0x0000 - 0xFFFF) to 16bit variable.
and in each period match (1s; 2s; 3s; ...) will automaticaly starts DMA (no by SW in interrupt .... interupt have to be called directly by HW - period match - without CPU) which only transfer this 16bit value to port P1 (ie address 0x0x48028100)
Is it possible with app DMA002 or DMA003 or DMA004 or with else?
How can I do it?
Regards
Koumak
- Tags:
- IFX
3 Replies
Not applicable
Jun 14, 2013
02:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 14, 2013
02:10 AM
Hi Koumak,
My question is why you don't directly write to port P1 in compare match ISR?
If you really want to use DMA, you need to use software trigger since this is memory-to-memory transfer (refer to Pg231 of xmc4500_rm_v1+2_2012_12_). You can use either DMA002 (using linked list to create an infinite loop) or DMA003 (need to reenable the DMA channel in CCU ISR).
Best regards,
Sophia
My question is why you don't directly write to port P1 in compare match ISR?
If you really want to use DMA, you need to use software trigger since this is memory-to-memory transfer (refer to Pg231 of xmc4500_rm_v1+2_2012_12_). You can use either DMA002 (using linked list to create an infinite loop) or DMA003 (need to reenable the DMA channel in CCU ISR).
Best regards,
Sophia
Jun 18, 2013
12:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 18, 2013
12:31 AM
Hi sophia,
Thanks for advices.
My reason is, that I need to control another device at precise time intervals - and this is not possible with sw interrupt (in sw interrupt is not possible to guarantee precise time when it will be done).
Now I tried to use DMA003 which I set following:
But in this way I can update P1 4000 times and then I must reload config.
And interesting is that I must set transfer as "Periphera-Memory" - only in this case it functions correct (as I want).
(and in addition - this solve maybe is not quite good)
Sophia I am not sure, that I understand your advice well - I think some example would be more helpful.
Or can you little more describe how to set apps for case as you say...
Or someone have better idea, how to solve this problem?
Thanks.
Best regards
Koumak
Thanks for advices.
My reason is, that I need to control another device at precise time intervals - and this is not possible with sw interrupt (in sw interrupt is not possible to guarantee precise time when it will be done).
Now I tried to use DMA003 which I set following:
But in this way I can update P1 4000 times and then I must reload config.
And interesting is that I must set transfer as "Periphera-Memory" - only in this case it functions correct (as I want).
(and in addition - this solve maybe is not quite good)
Sophia I am not sure, that I understand your advice well - I think some example would be more helpful.
Or can you little more describe how to set apps for case as you say...
Or someone have better idea, how to solve this problem?
Thanks.
Best regards
Koumak
Not applicable
Jun 19, 2013
02:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 19, 2013
02:55 AM
Hi Koumak,
Glad to know that you got the function you wanted. To avoid reloading, you can use DMA002 for multi-block transfers, select "Auto-reload multi-block transfer" for "Transfer Type".
At the same time, thank you very much your feedback. We will try to provide more examples in future.
Best regards,
Sophia
Glad to know that you got the function you wanted. To avoid reloading, you can use DMA002 for multi-block transfers, select "Auto-reload multi-block transfer" for "Transfer Type".
At the same time, thank you very much your feedback. We will try to provide more examples in future.
Best regards,
Sophia