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

cross mob
Anonymous
Not applicable

 Hey Everybody

   

We are trying to use our first touch starter kit to make a self balancing robot. But it seems that the system won't let us use two custom build clock driven ISRs in the same time? Has anyone in here expirienced some similar problems, or does anyone know a solution?

   

Best Regards

   

Anders

0 Likes
2 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think it should work - in a recent project I had 2 ISRr trigger by timer components (one with 10Hz and the other one with 1000Hz). What do you want to do exactly?

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

There is no such restriction. As a rule of thumb:

   

Declare your interrupt handlers with CY_ISR_PROTO() and define them with CY_ISR() macros. Both explained in short in the System Reference Guide (Help -> Documentation -> System Reference ->)

   

Use isr_StartEx() to tell which handler will use which isr.

   

Keep the handlers short, no output to LCD, do not wait for anything.

   

 

   

Since you are going to program a closed loop (PID) you'll need a (relatively) constant time-base (20 to 50 ms) get the 3 values of the on-board accellerometer and call your PID-function.

   

 

   

Bob

0 Likes