nabla101
Junior Member level 3
Hi, I want to use the ECCP PWM peripheral on a PIC18F in half-bridge mode to produce an ouptu signal of 40kHz, 50% duty cycle, and I want to be able to switch this on and off so that I can produce bursts of a 40kHz carrier, with a fixed duration - i.e. have a function with "burst width" or "number of cycles" as a parameter to control it.
Is there an efficient way to 'burst' the PWM on and off, without having to disable/enable the PWM module or associated timer, and without having to reset all of the control register settings for the 40kHz wave. The application is time-critical, so the duration between the start of the burst and the end of the burst needs to be known/controlled accurately.
I believe I have the PWM and TMR2 modules initialised correctly, but I'm worried that just enabling/disabling the PWM for the burst would mean having to re-initialise the modules, and I wouldn't know the time.
Is there an efficient way to 'burst' the PWM on and off, without having to disable/enable the PWM module or associated timer, and without having to reset all of the control register settings for the 40kHz wave. The application is time-critical, so the duration between the start of the burst and the end of the burst needs to be known/controlled accurately.
I believe I have the PWM and TMR2 modules initialised correctly, but I'm worried that just enabling/disabling the PWM for the burst would mean having to re-initialise the modules, and I wouldn't know the time.