- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To all,
This may be an obvious question. I'm a bit new in USB CDC programming. However my study and empirical experiments have not make it obvious.
I want to use a callback ISR for reading incoming data using the USBUART. I can get USBUART_SOF_ISR_ExitCallback() to do what I want. It works however ...
It polls at a 1ms rate. Is there another ISR that can be enabled to process input data from the host at a much lower polling rate?
In my current USBUART configuration the following ISRs are active:
- USBUART_SOF_ISR_ACTIVE
- USBUART_BUS_RESET_ISR_ACTIVE
- USBUART_EP0_ISR_ACTIVE
- USBUART_ARB_ISR_ACTIVE
- USBUART_DP_ISR_ACTIVE
- USBUART_EP1_ISR_ACTIVE
- USBUART_EP2_ISR_ACTIVE
- USBUART_EP3_ISR_ACTIVE
Eventually I plan to convert my IN and OUT operations for the USBUART to DMA. This should solve my issue as well. Until then, if I can implement my data input reads with a less intense ISR, it would be appreciated.
Len
"Engineering is an Art. The Art of Compromise."
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Noriaki,
Thank you for your response and your suggestion.
I actually found the solution I needed. My code had an "oops". I had a single character error in the definition of one of my callbacks.
The callback that does work is USBUART_EP_3_ISR_ExitCallback(). Once I fixed the #define of USBUART_EP_3_ISR_EXIT_CALLBACK, I now only get a single ISR call for each new data that comes from the host. I can now turn off the SOF_ISR and I'm up an running without the need of the 1ms SOF heartbeat.
Note: USBUART_EP_2_ISR_ExitCallback() is for outputing data to the host.
I hope this help someone with a similar problem.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is my solution using a 2kHz polling for PSoC 3. I know this is not what you want.
I think it is better to have a FIFO to get and put one packet at once to reduce the number of packets.
I have another repository for PSoC 5LP to investigate the three Endpoint Buffer Management methods which is specified in the USBFS component.
As the result of the investigation, 64 Byte packet is too small to be handled with DMA.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Noriaki,
Thank you for your response and your suggestion.
I actually found the solution I needed. My code had an "oops". I had a single character error in the definition of one of my callbacks.
The callback that does work is USBUART_EP_3_ISR_ExitCallback(). Once I fixed the #define of USBUART_EP_3_ISR_EXIT_CALLBACK, I now only get a single ISR call for each new data that comes from the host. I can now turn off the SOF_ISR and I'm up an running without the need of the 1ms SOF heartbeat.
Note: USBUART_EP_2_ISR_ExitCallback() is for outputing data to the host.
I hope this help someone with a similar problem.
Len
"Engineering is an Art. The Art of Compromise."