2 Replies Latest reply on Nov 28, 2015 11:18 AM by BoTa_264741



      Hello everyone,


      On my PSoC I have 2 interrupts one at 2000Hz and one at 100Hz as you can see in attachment.


      In the first interrupt ISR_Dyna I ask datas via UART at 460000 Baud 


      In the second interrupt ISR_Stat I ask others datas via the same UART at 460000 Baud 


      My problem is that I can't have both interrupt at same time because I receive data by UART Interrupt and if ISR_Dyna is asking datas  and ISR_Stat is asking Data at the same time there will be conflicts and I will be stuck in my sequencer.




      So to avoid that in my code I do Start and Stop each Interrupt, but I don't know if its the best way to do it?


      Actually I made a mistake in my code and it was workingbut I don"t understand why.


      My code was:


      if(countMain==100){ // ask datas at 2000Hz                    
              isr_dyna_Stop();                        //
              isr_stat_StartEx(dynamique);            //
      if (countMain==115){ // ask datas at 100Hz
              isr_dyna_Stop();                        //
              isr_stat_StartEx(statique);             //




      And as you can see my mistake is instead of write  




       I wrote in the first If


      isr_dyna_Stop();                        //
      isr_stat_StartEx(dynamique);            //




      So my code work with the mistake and I don't understand why,and if I correct my mistake, it work 3-4 time and after it stucks.




      Thank you