USB timing

Status
Not open for further replies.

ColinE

New Member
I have a project that requires a USB interface, but also has to process events on a strict timer schedule.

So does anybody know the maximum number of cycles that the USB interface will take, before releasing control back to the main code?

What I'm after is three PWM outputs, with 8 bit resolution at greater than 250Hz, which only gives 16uS steps.
 
You can do one of these:

1) Use hardware modules for PWM. Most PICs have them. Look for CCP or OC. All the PWM will be done in the hardware and you can get busy doing USB at your own pace.

2) Create a timer interrupt and process your PWMs inside the interrupt. The USB code will run in the background and your interrupt will interrupt it when needed.
 
1) I need three PWMs and I can't find a PIC that has that and USB.

2) Now that could well be the answer. Many thanks.
 
Try a combo....

The pic16f14XX has 2 PWM hardware modules..... So USB and two hardware PWM's.. Then one software PWM

Can't you use a pic18f26j53... This has 7 CPP modules
 
Thanks, but this design has to be as cheap as possible, as we'll be building thousands.

So the remaining question is: Will the USB code work with interrupts enabled?
 
The short answer is yes!

As long as you call the HID service as often as you can...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…