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

XMC™ Forum Discussions

Travis
Employee
Employee
First like received
Do you know that, the Button 2 (P1.15) on the XMC4500 Relax kit is link to the ERU (Event Request Unit) input source selection "ERU1.1A0"?

Which means we can configure this button to generate an interrupt or triggering signal to other hardware peripheral (eg. CCU).

(See attached example)

Example Overview:
This simple ERU example is for XMC4500 relax kit. It demo a selected input A of ERU (ERU1.1A0) from Button 2 (P1.15) and generate an ERU interrupt to toggle LED2.

Test:
Press Button 2 repeatedly on Relax kit which will create pulses to the ERU input A. Next you shall see the LED2 toggle.


G@@d Luck..
0 Likes
12 Replies
User5327
Level 4
Level 4
Thanks 🙂
0 Likes
Not applicable
Hello there!

I wasn't sure If I should create a new thread for this question, but I wanted ask if It is possible to use ERU on pins which are not connected to any input source selection (like the one mentioned in this example: "ERU1.1A0"). I'm currently working on a project where the HW was given to me as is and my task is to write the firmware for it. I need to emit three different interrupts using P5.0, P5.2 and P3.0. Each one is connected to a button and emits its own interrupt. When these buttons are pressed ERU should inform NVIC that an External Interrupt should be happening. I'm using the XMC4500 Relax Kit (not the Lite version).

I thought about activating the peripheral, which are connected to these pins, but I guess that would be plain madness, since I don't need them to be on consuming power. Any other ideas?
0 Likes
Travis
Employee
Employee
First like received
Hi gabriel306,

It's good to continue the thread here so that others are aware of it. Your suggested P5.0, P5.2 and P3.0 are not link to ERU ... 😞

To fullfil your application needs, below are my suggestion..

Method 1:
The more graceful method to save number of GPIO and interrupt resources is to use the potential divider method + ADC. All you need is one ADC interrupt which will tell you which switch is being pressed as different switch press will provide a different AD value. This also has the advantage of detecting 2 button pressed at the same time.

http://www.instructables.com/id/MicroSimon/step3/4-Switches-on-1-ADC-pin/

Method 2:
The simple and fastest way is to do polling at every 10msec on the x3 GPIO.

G@@d luck
0 Likes
Not applicable
HI,

As I want to add DACWG001 App to this current program, how do make the DACWG001 signal toggle on/off whenever button2 is pressed?
0 Likes
Not applicable
Hi Holy_dem,

You just need to add the DACWG001 start and stop function inside the ERU_ISR.

if(WaveOnOff)
{
DACWG001_Start(&DACWG001_Handle0);
WaveOnOff = 0;
}
else
{
DACWG001_Stop(&DACWG001_Handle0);
WaveOnOff = 1;
}
0 Likes
Not applicable
Jackson wrote:
Hi Holy_dem,

You just need to add the DACWG001 start and stop function inside the ERU_ISR.

if(WaveOnOff)
{
DACWG001_Start(&DACWG001_Handle0);
WaveOnOff = 0;
}
else
{
DACWG001_Stop(&DACWG001_Handle0);
WaveOnOff = 1;
}


then what about using ADC001?
use ADC001_GetResult to read & store in channel AA memory? then how to stop read & store?
0 Likes
Not applicable
Hi Holy_dem,

Can you be more specific? I don't quite understand what you really want to do.
0 Likes
Not applicable
Hi Jackson,

what I mean is how to add ADC001 into the start and stop function inside the ERU_ISR?

Thanks
0 Likes
Not applicable
Hi Holy_dem,

Do you mean you want to ON and OFF the ADC001 conversion?
If yes, you can set the ADC001_EnableBackGroundEvent and ADC001_DisableBackGroundEvent into the ERU_ISR start and stop function.
0 Likes
Not applicable
thanks for the infomation
0 Likes
Not applicable
I would like to see how the aps are configured in this example.
But when I open it, I cant see any aps in the SW connectivity view.

Any ideas? Would it be because it used older version of the aps?

Specifically I want to see the configuration of ERU002.
0 Likes
Travis
Employee
Employee
First like received
Maybe you can try to close DAVE3 and reopen it again.
0 Likes