Cristiano, > I have got the feeling it is not good spending most of the CPU time > handling interrupt routines Where the PIC is spending its time is largely irrelevant. An interrupt is just another routine > Signals change from 0V to 5V, and frequency from 0Hz to 3KHz > If anybody has a good idea, I would be very grateful. In this project of mine for a sensor exciter, the PIC generates low frequency 6-bit PWM using a timer. Frequency and duty are settable with pots. There is plenty of processing time left, which is going to be used for other controls and outputs http://www.piclist.com/techref/microchip/HV_PWM_Proto.htm At your highest frequency, 3kHz, that means at least 6,000 interrupts per second, which is not a lot for a fast PIC. That would be 1666.66 instruction cycles at 40MHz What you need to decide is the resolution and accuracy you need for these waves. If you want a 3000Hz and 2999Hz wave at the same time then obviously the timer will have to interrupt more frequently How are you handling the USB ? I'm sure it could be processed under interrupt too, without affecting the waves wbr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist