I want to use a callback ISR for reading incoming data using the USBUART. Which is the best ISR to use?

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

cross mob
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
1 Solution

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

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
2 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

This is my solution using a 2kHz polling for PSoC 3.  I know this is not what you want.

GitHub - noritan/Design307: FIFO Implementation for USBUART for BLOG - "CY8C5888LTI-LP097" on "CY8CK...

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.

GitHub - noritan/Design302: Bulk Source Sink project for blog article - "CY8C5888LTI-LP097" on "CY8C...

As the result of the investigation, 64 Byte packet is too small to be handled with DMA.

Regards,

Noriaki

0 Likes

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes