Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

DAVE™ Forum Discussions

Not applicable
hello,
I just bought an xmc1300 and run few examples, and trying to modify them I'm getting the first problems... 😉
I'd like to make a led blink by pressing an external switch. The XMC1300_ERU example can make the internal P0_0 led blink through the potentiometer or the P2.5 pin that are connected to the same internal pin.

I'm trying to change that P2.5 pin at first and then to add a second pin with the same ability to another led.
Looking at the ERU0_EXISEL register I modified

WR_REG(ERU0->EXISEL, ERU_EXISEL_EXS1A_Msk, ERU_EXISEL_EXS1A_Pos, 1);
into
WR_REG(ERU0->EXISEL, ERU_EXISEL_EXS1B_Msk, ERU_EXISEL_EXS1B_Pos, 1);

and
P2_5_enable_digital(); // ERU0_1A1
P2_5_set_mode(INPUT);
into
P2_3_enable_digital();
P2_3_set_mode(INPUT);

since P2.3 should correspond to ERU0_1B1

but the led doesn't blink as I press the external switch.
I tryed also to assign directly

ERU0->EXISEL = 0x40010610UL; //0x40010600 base EXISEL address + 0x00000010 ERU_1B1 address
but this is also uncorrect.
Why??
Sorry for these very basic questions, thanks
0 Likes
3 Replies
Not applicable
Hi pitupitu,

Did you change "Event Request Select Configuration" from "A" to "B" in ERU001 configuration tab?

Best regards,
Zain
0 Likes
Not applicable
Hi Zain,
thank you at first; I had some time to work on it:
- I wasn't neither able to find the "configuration tab" you mentioned, could you be more precise where is it?

- A mistake was ERU0->EXISEL = 0x10UL; as ERU0->EXISEL already specifies the address ;

- I succeded by substituting WR_REG(ERU0->EXISEL, ERU_EXISEL_EXS1A_Msk, ERU_EXISEL_EXS1A_Pos, 1); with ERU0->EXISEL = 0x00001000UL; and activating the P2_7 switch


Now I returned to the original configuration (the ERU example one) with a single switch to the P2_5 pin (using the potentiometer) and it works...but when I try to override the potentiometer with a switch on P2_5 action, to whole board seems to disconnect as it was detatched from the USB port...any idea on this?

thanks
pt
0 Likes
Not applicable
Hi pt,

Configure "Event Request Select" to "B" in ERU001 configuration tab is equivalent to "ERU0_EXICONx.SS=1". Do remember to click "Generate Code" button after changing the UI setting.

367.attach

Another option is to put all the changes in MULTIPLEXER.c
368.attach

Best regards,
Zain
0 Likes