- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
Solved! Go to Solution.
- Labels:
-
PSoC 5 Device Programming
-
PSoC 5LP
- Tags:
- interrupts
- usbcom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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