USBCOM interrupt priority and debugging

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

cross mob
Anonymous
Not applicable

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)

0 Likes
1 Solution
Anonymous
Not applicable

I found out that priority is not the issue. The problem happens when I connect the device and I start immediatly to write strings to the serial port (because interrupt are fired). Maybe this is because the board was already powered through KitProg when connecting the main USB. I confirm that lowering the interrupt priority WORKS.

Thanks for your detailed responses about debugging and hackster

View solution in original post

0 Likes
2 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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-

pastedImage_3.png

You can post opensource applications using  PSoC  on hackster-

Cypress Projects

Anonymous
Not applicable

I found out that priority is not the issue. The problem happens when I connect the device and I start immediatly to write strings to the serial port (because interrupt are fired). Maybe this is because the board was already powered through KitProg when connecting the main USB. I confirm that lowering the interrupt priority WORKS.

Thanks for your detailed responses about debugging and hackster

0 Likes