UDB Timer with capture GPIO

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

cross mob
Anonymous
Not applicable

The requirement is the following

   

1:  PIN_0 connect to external chip, it will trigger when recv something.

   

2:  PIN_0 will connect to the capture of UDB timer

   

3:  Interrupt is connect to a ISR, and trigger when capture=1

   

 

   

With the following code, but never get a interruption.

   

 

   

Timer_1_Start();

   

CyGlobalIntEnable;

   

Timer_1_StartEx(My_Interrupt);

   

 

   

Any suggestion on UDB Timer with GPIO?

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is a program that has all of your elements. Debug is up to you. Happy coding !!

0 Likes
Anonymous
Not applicable

Thanks bobgoar.

   

The project you posted is for the GPIO pin and interruption, that works well.

   

But how this pin connected to UDP Timer?

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

I hooked up a timer for you is that not the correct component? better post your code.

0 Likes
Anonymous
Not applicable

Really thanks a lot bobgoar.

   

In the project, does this means:

   

#1.  When the Pin interrupt raised, it will pull up the LED HW and the capture of the timer.

   

#2.  In the interruption handle it will pull up the LED software.

   

I will test this tonight, it should solved my problem.

   

Thanks again.

0 Likes
Anonymous
Not applicable

Hi, bobgoar

   

I tested the solution, it works well in my board.

   

It will capture the timer value, then raising the interrupt handle,  I calculated the timer_readcounter takes about 1.375us.

   

So everything works well, only some time more than two counter captured , still working on this.

0 Likes