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
Steve
Software Controlled PWM
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Software Controlled PWM
Hi Steve,
A single timer may be all that is required.
There is a software PWM example here that should hopefully help.
https://www.matrixtsl.com/wiki/index.ph ... Interrupts
Let us know how you're getting on.
A single timer may be all that is required.
There is a software PWM example here that should hopefully help.
https://www.matrixtsl.com/wiki/index.ph ... Interrupts
Let us know how you're getting on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Software Controlled PWM
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)
Steve
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)
Steve
Success always occurs in private and failure in full view.
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Software Controlled PWM
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
PIC16F1828-I/P
https://uk.rs-online.com/web/p/microcon ... s/7154393/
PIC16F1825-E/P
https://uk.rs-online.com/web/p/microcon ... s/7434700/
Steve
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
PIC16F1828-I/P
https://uk.rs-online.com/web/p/microcon ... s/7154393/
PIC16F1825-E/P
https://uk.rs-online.com/web/p/microcon ... s/7434700/
Steve
Success always occurs in private and failure in full view.