1 Reply Latest reply on Oct 11, 2017 2:06 AM by anks

    USBCOM interrupt priority and debugging

    marcov

      Good afternoon. I'm facing a question about USBCOM (virtual serial over USB). My project has an interrupt driven data acquisition (with a message queue) and a USBCOM component to send the processed reads to the computer.

      Everything works as expected but I have a doubt about interrupt priority. My 'input' PIN and all the USB interrupts have been assigned 7 as priority. Since my data is made of 'bursts' of packet, I thought that I should give my 'data capture' ISR a lower priority than USB (eg:6).

      The queue should 'smooth' the peaks. What I find is that if I lower my ISR priority, USB seems to go wild, with the computer not responding to mouse anymore.

       

      My ISR looks like this (DataReady is the interrupt pin):

       

      CY_ISR(ByteArrivedISR)

      {  

          EventRegister_InterruptDisable();

          DataReady_Disable();

        

      ... write input to queue

        

          DataReady_ClearPending();

          EventRegister_InterruptEnable();

          DataReady_Enable();

      }

       

      My main program writes to serial with a loop of

       

                       USBCOM_PutString(lineStr);

                      while (0u == USBCOM_CDCIsReady());    

       

      This is my first PSOC project and I must say that I'm impressed with the possibilities of the hardware and PSOC Creator (it REALLY rocks!!!).

       

      More questions:

      -is there a way to debug only 'main' program and not ISR ? Every step that I do moves to some interrupt handling routine for USB.

      -is there some 'official' guideline to promote PSOC DIY opensource applications (logos/links to web hosting etc)

        • 1. Re: USBCOM interrupt priority and debugging
          anks

          Priority – This is used to enter the interrupt priority. The valid range is displayed in the header. The smaller the number, the higher priority.

          From the discussion it seems that the USB is required to be of Higher priority in the application

          For debugging query-

          You can post opensource applications using  PSoC  on hackster-

          Cypress Projects

          1 of 1 people found this helpful