Nov 03, 2015
02:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 03, 2015
02:43 PM
Hi,
here I have an 16bit Timer.
Now to my question, is it possible to make a software interrupt in the function "CCU40_0_IRQHandler"? And have you an idea or have you an example without Apps (e.g. CMSIS) ?
The idea is an second timer wich is synchron to the CCU40_0_IRQHandler...
Thanks...
here I have an 16bit Timer.
Now to my question, is it possible to make a software interrupt in the function "CCU40_0_IRQHandler"? And have you an idea or have you an example without Apps (e.g. CMSIS) ?
The idea is an second timer wich is synchron to the CCU40_0_IRQHandler...
XMC_CCU4_SLICE_COMPARE_CONFIG_t timer_config_ccu40 = {
.timer_mode = XMC_CCU4_SLICE_TIMER_COUNT_MODE_EA,
.monoshot = XMC_CCU4_SLICE_TIMER_REPEAT_MODE_REPEAT,
.prescaler_initval = 0, };
/** 16 Bit Timer **/
XMC_CCU4_Init(CCU40, XMC_CCU4_SLICE_MCMS_ACTION_TRANSFER_PR_CR);
XMC_CCU4_SLICE_CompareInit(CCU40_CC40, &timer_config_ccu40);
XMC_CCU4_SLICE_SetTimerPeriodMatch(CCU40_CC40, 0x2328);
XMC_CCU4_SLICE_EnableEvent(CCU40_CC40, XMC_CCU4_SLICE_IRQ_ID_PERIOD_MATCH);
XMC_CCU4_SLICE_SetInterruptNode(CCU40_CC40, XMC_CCU4_SLICE_IRQ_ID_PERIOD_MATCH, 0);
NVIC_SetPriority(CCU40_0_IRQn, 2);
NVIC_EnableIRQ(CCU40_0_IRQn);
XMC_CCU4_StartPrescaler(CCU40);
XMC_CCU4_EnableShadowTransfer(CCU40, XMC_CCU4_SHADOW_TRANSFER_SLICE_0);
XMC_CCU4_EnableClock(CCU40, 0);
XMC_CCU4_SLICE_StartTimer(CCU40_CC40);
void CCU40_0_IRQHandler(void)
{
#if 0
if((CCU40_CC40->INTS)&0x00000001)
{
}
#endif
-->>>> (Software) Interrupt ??? <<<<<--
CCU40_CC40->SWR |= 0x00000001;
}
Thanks...
8 Replies
Nov 03, 2015
06:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 03, 2015
06:18 PM
Hi,
So sorry I really do not understand your intention. Can you please be a bit more specific? Do you mean that you want to re trigger the CCU again with this existing interrupt handler or you want to do a nested interrupt?
So sorry I really do not understand your intention. Can you please be a bit more specific? Do you mean that you want to re trigger the CCU again with this existing interrupt handler or you want to do a nested interrupt?
Nov 04, 2015
12:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 04, 2015
12:37 AM
Hi,
First I´m sorry.
I would like to have a nested interrupt wich is triggert after 10 invocations from the existing interrupt handler.
Maybe I need the NVIC but I don´t have any experiance with it and how I triggert die NVIC by software command.
Thanks.
First I´m sorry.
I would like to have a nested interrupt wich is triggert after 10 invocations from the existing interrupt handler.
Maybe I need the NVIC but I don´t have any experiance with it and how I triggert die NVIC by software command.
Thanks.
Not applicable
Nov 04, 2015
09:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 04, 2015
09:52 PM
It would be better if you can explain your application so that we can sort it out for you.
Nov 04, 2015
11:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 04, 2015
11:59 PM
MaJa wrote:
Hi,
First I´m sorry.
I would like to have a nested interrupt wich is triggert after 10 invocations from the existing interrupt handler.
Maybe I need the NVIC but I don´t have any experiance with it and how I triggert die NVIC by software command.
Thanks.
Totally do not understand your needs.
Nov 05, 2015
01:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 05, 2015
01:33 PM
like this..
but I don´t know, is it correct ?
and in the ire_handler
but I don´t know, is it correct ?
SCB->CCR |= 0x00000002; // Enable Software Interrupt
NVIC_SetPriority(ERU0_0_IRQn, 3);
NVIC_EnableIRQ(ERU0_0_IRQn);
and in the ire_handler
void CCU40_0_IRQHandler(void)
{
#if 0
some code
#endif
cnt125us++;
if(cnt125us >= 10){
NVIC->STIR |= 0x01; // now ERU0_0_IRQHandler Software Interrupt
cnt125us = 0;
}
}
Not applicable
Nov 05, 2015
11:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 05, 2015
11:05 PM
So in simple words you meant to call a user handler inside CCU40_0_IRQHandler ?? BTW you are just enabling ERU interrupt as per your code. ERU0_0_IRQHandler will be fired only when any event is detected on that particular pin. Again i would say if you can tell your application, we can help you.
Nov 16, 2015
02:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 16, 2015
02:12 PM
yes thats right. Inside the CCU40_0_IRGHandler, I would like to call a user handler (software interrupt)
Not applicable
Nov 22, 2015
09:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 22, 2015
09:56 PM
so you can do a simple function call in the CCU4 system handler..