Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.
 
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?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top