Can a PIC or preferably a PICAXE generate this waveform?

Thread Starter

Roderick Young

Joined Feb 22, 2015
408
As part of a power supply, I would like to generate a PWM signal, say 10 or 20 kHz, with variable duty cycle. That's the easy part. That signal would go through a driver and turn on the main switch.

But I would also like to generate another pulse of variable duration and delay, that is enclosed within the OFF time of the first signal. The second signal would turn on the synchronous rectifier(s).

HPIM3105.JPG
 

JohnInTX

Joined Jun 26, 2012
4,787
On inspection, you probably could do something with a dual-PWM PIC and some clever interrupt handling.
The upper trace is generated by a conventional ECCP PWM. Set it up to get an interrupt at the first rising edge of the top trace (the end of the top PWMs duty cycle and where you would load any changes to the first duty register, BTW).
At that interrupt, use another timer to delay from the top leading edge to the bottom leading edge. That delay is the duty cycle count of the top PWM plus your fixed delay. From there, you could time W manually or launch the 2ed PWM for pulse width W. Stop that PWM at the 2ed leading edge of the top trace.
If you only have one PWM, use it for the top trace and use another timer to 1)delay to the 2ed leading edge, reset it for the width and then 3)shut it down, all with interrupts.

Rinse and repeat.
Don't know about PICAXE. Some have single hardware PWM facilities but interpreting tokenized code from EEPROM is going to be kind of slow.
 
Last edited:

MMcLaren

Joined Feb 14, 2010
861
Some more recent Microchip PIC devices like the 8-pin 12F1572, the 14-pin 16F1575, and the 20-pin 16F1579, offer multiple multi-mode 16-bit PWM outputs with phase/offset adjust and the ability to synchronize a 'slave' PWM output.

Good luck on your project.

Cheerful regards, Mike
 
Last edited:

Thread Starter

Roderick Young

Joined Feb 22, 2015
408
Some more recent Microchip PIC devices like the 8-pin 12F1572, the 14-pin 16F1575, and the 20-pin 16F1579, offer multiple multi-mode 16-bit PWM modules with phase/offset adjust and the ability to synchronize a 'slave' PWM module.

Good luck on your project.

Cheerful regards, Mike
Two PWM's that I could control the phase relation between, would be a dream come true. No fussing with software, just set and forget. I'll look into it.
 

Thread Starter

Roderick Young

Joined Feb 22, 2015
408
Hola Rick

Are d and W, fixed values?

EDIT
You said variable duration and delay. Sorry. /EDIT
Now that I think about it, it could with a small and fixed delay, even a delay of 0 (in that case, the delay would be accomplished by external analog components). But variable duration would be an absolute requirement.
 

atferrari

Joined Jan 6, 2004
4,764
Now that I think about it, it could with a small and fixed delay, even a delay of 0 (in that case, the delay would be accomplished by external analog components). But variable duration would be an absolute requirement.
OK Roderick, given the delay is fixed, what would regulate the duration "W"? Would it be the same that regulates the PWM's duty cycle?

In other words, any fixed relationship between DC and W?
 

Thread Starter

Roderick Young

Joined Feb 22, 2015
408
OK Roderick, given the delay is fixed, what would regulate the duration "W"? Would it be the same that regulates the PWM's duty cycle?

In other words, any fixed relationship between DC and W?
There is a relationship, but it's complicated. W depends on the duty cycle, and input voltage, the output voltage, and whether the converter has crossed from discontinuous to continuous mode. If W is too short, efficiency suffers somewhat, and the equalization of voltage across output cells (batteries or supercapacitors) may suffer, too. If W is too long, all kind of bad things happen, including ringing, and loss of regulation. That's why I would like to use a processor to compute W. There are power supply chips that do this already, but I was unable to find one that does everything I want.
 
Top