Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

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

cross mob
lock attach
Attachments are accessible only for community members.
AnilDhanawade
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hello All,

 

I am working on TC213L controller library. I would like to setup the GPIO as an interrupt, but I am not able to find the settings for the same. Can anyone help me out here. 

 

I am using the attached files for the same. 

 

Thanks, 

Anil Dhanawade

0 Likes
1 Solution
Prudhvi_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

Hello,

You can use ERU to trigger an interrupt for each edge change on an Input pin. Please refer to the ADS code example  ERU_Interrupt_1_KIT_TC275_LK and the training ppt for more details. Please note that the example is developed for TC275LK kit. You need to adapt to the Target derivative you're using.

Regards,

Prudhvi.

View solution in original post

9 Replies
Prudhvi_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

Hello,

You can use ERU to trigger an interrupt for each edge change on an Input pin. Please refer to the ADS code example  ERU_Interrupt_1_KIT_TC275_LK and the training ppt for more details. Please note that the example is developed for TC275LK kit. You need to adapt to the Target derivative you're using.

Regards,

Prudhvi.

lock attach
Attachments are accessible only for community members.
AnilDhanawade
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hello Prudhvi,

Greetings!!

 

I have checked the given example, but I am always getting an interrupt, I am expecting the rising edge and falling edge only it should give me an interrupt.

I have tried many other combinations of configuration, but it is not working out. Can you suggest me the changes accordingly.

I have attached the files for your reference, please suggest.

 

Thanks,

Anil Dhanawade.

0 Likes
MoD
Employee
Employee
10 likes given 50 likes received 500 replies posted

How you generate the edges on the pin?

0 Likes
AnilDhanawade
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

I am giving a high/low pulse from outside, it is 3.3V - High and GND - Low, but always it is coming to the interrupt, even after not initiating anything.

I am thinking it is because of 

IFX_INTERRUPT(SCUERU_Int0_Handler, 0, ISR_PRIORITY_SCUERU_INT0); - This I am using it for GPIO interrupt Handler.

IFX_INTERRUPT(AppIsr_Adc_M3, 0, ISR_PRIORITY_ADC_M3); - I am using this for ADC trigger Handler.

What is the significance of 0 here and the priority?

Do I need to make any changes in the Linker file for the interrupt? 

Note: I have not compiled and run the same code, which is given in the example code, I have taken a sample (.c and .h) files attached above and called that function in my application code.

 

0 Likes
MoD
Employee
Employee
10 likes given 50 likes received 500 replies posted

How you generate the high/low pulse from outside? You connect a cable which will be connected to the pin by hand or you use a generator?

0 Likes
AnilDhanawade
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

I am using the generator to generate the High and Low on the PIN. 

I separately ran the code; it is working as intended.  Only the thing now is it is not working with ADC/PWM interrupt. If require, I will post a separate question for the same. 

Thanks for the support. 

0 Likes

Hi,

Regarding the significance of '0' it determines the vector table number or the CPU Vector table the interrupt corresponds to. Please see the definition of the macro in the example.

when we compared the files, it looks like you've changed the LED mapping etc but is the same pin as used in the example P33.7  used in your board as well ? Please check that and how the priorities are configured for each interrupt?

Regards,

Prudhvi.

0 Likes
lock attach
Attachments are accessible only for community members.
AnilDhanawade
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hello,

LED and Request Pin code is working, I verified it with the different pins also.

Now the challenge in the ADC/PWM interrupt and GPIO interrupt combinly it should work.  

I have attached the file for reference. For the GPIO files - attached above. for PWM file - attached. 

void BSW_MotorControl_PWM_Drv_Init(void) - once I call this function then only my GPIO interrupt is not working properly.

 

Regards,

Anil Dhanawade.

0 Likes

Please continue the discussion in https://community.infineon.com/t5/AURIX/Interrupts-are-not-working-parallelly/td-p/403803 created on the same topic.

0 Likes