Page 1 of 1

Software Controlled PWM

Posted: Mon Jun 10, 2019 12:46 pm
by Steve001
Afternoon All,

Looking at an application that I would like 3 PWM channels my device only has two available only a cursory look on microchips part selector reviled that 4 channels tend to be on the high pin count devices. So thought of doing it in software have seen the software PWW example of a night rider LED chaser but this didn't make much sense, couldn't see how it was working.

A software PWM search - returned too many results "software" & "pwm"

Anybody got an example ?

I have toyed with the idea of a two timer approach using timer0 and timer2


Re: Software Controlled PWM

Posted: Mon Jun 10, 2019 1:01 pm
by Benj
Hi Steve,

A single timer may be all that is required.

There is a software PWM example here that should hopefully help. ... Interrupts

Let us know how you're getting on.

Re: Software Controlled PWM

Posted: Mon Jun 10, 2019 7:07 pm
by Steve001
Hi Ben

Might be a few weeks before i can get back to you mega busy at work at the moment :(

Why do you say only 1 timer ?

was thinking on the lines of timer2 for the PWM frequency timer0 for the duty or is this OTT and heading on the lines of generating a headache ?

looking for a 0 - 240 count where 240 = 100% duty (trying to make the maths easy)


Re: Software Controlled PWM

Posted: Sat Jul 06, 2019 4:48 pm
by Steve001
Afternoon All

After mooching around RS for some parts had a go with their part selector found a couple of suitable devices had another go with MPAS these parts didn't appear

Have found the following devices - so will order them and have a go. 4 PWM channels too and supported by V7 :mrgreen:

PIC16F1828-I/P ... s/7154393/

PIC16F1825-E/P ... s/7434700/