Mar 21, 2018
10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 21, 2018
10:04 AM
Hello I use the following initialisation
GHPIO P0.6 as Input
ERU Unit Initialization
But the IRQ Routine is not fired
What is my mistake, thanks for your help
Best regards
EbbeSand
XMC_ERU_ETL_CONFIG_t wsync_event_gen_config =
{
.source = XMC_ERU_ETL_SOURCE_B,
.input = ERU0_ETL3_INPUTB_P0_6,
.edge_detection = XMC_ERU_ETL_EDGE_DETECTION_RISING,
.status_flag_mode = XMC_ERU_ETL_STATUS_FLAG_MODE_SWCTRL,
.enable_output_trigger = true,
.output_trigger_channel = XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL0
};
XMC_ERU_OGU_CONFIG_t wsync_event_det_config =
{
.enable_pattern_detection = false,
.service_request = XMC_ERU_OGU_SERVICE_REQUEST_ON_TRIGGER
};
GHPIO P0.6 as Input
XMC_GPIO_SetMode(XMC_GPIO_PORT0, 6, XMC_GPIO_MODE_INPUT_TRISTATE);
ERU Unit Initialization
XMC_SCU_INTERRUPT_ClearEventStatus(XMC_SCU_PERIPHERAL_RESET_ERU1);
XMC_ERU_ETL_Init(ERU0_ETL3, &wsync_event_gen_config);
XMC_ERU_OGU_Init(ERU0_OGU0, &wsync_event_det_config);
NVIC_SetPriority(ERU0_0_IRQn, 10);
// Interrupt for ERU0, OGU0
NVIC_EnableIRQ(ERU0_0_IRQn);
But the IRQ Routine is not fired
void ERU0_0_IRQHandler(void)
{
XMC_ERU_ETL_ClearStatusFlag(ERU0_ETL3);
XMC_GPIO_ToggleOutput(XMC_GPIO_PORT5, 8);
}
What is my mistake, thanks for your help
Best regards
EbbeSand
- Tags:
- IFX
2 Replies
Mar 22, 2018
04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 22, 2018
04:02 AM
Hi,
In the initialization of the ETL use .input_b instead of .input
If you want to use .input, you would need to shift by 2, i.e. .input = ERU0_ETL3_INPUTB_P0_6 << 2
Regards,
Jesus
In the initialization of the ETL use .input_b instead of .input
static const XMC_ERU_ETL_CONFIG_t wsync_event_gen_config =
{
.source = XMC_ERU_ETL_SOURCE_B,
.input_b = ERU0_ETL3_INPUTB_P0_6,
.edge_detection = XMC_ERU_ETL_EDGE_DETECTION_RISING,
.status_flag_mode = XMC_ERU_ETL_STATUS_FLAG_MODE_SWCTRL,
.enable_output_trigger = true,
.output_trigger_channel = XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL0
};
If you want to use .input, you would need to shift by 2, i.e. .input = ERU0_ETL3_INPUTB_P0_6 << 2
Regards,
Jesus
Mar 22, 2018
07:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 22, 2018
07:30 AM
Hello Jesus,
thanks for your help now the Interrupt is fired
Best regards
EbbeSand
thanks for your help now the Interrupt is fired
Best regards
EbbeSand