PWM slowing

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

PWM slowing

Post by echase »

On a 16F886 I am using RC2 described as PWM1 on datasheet.

What is‘PWM Count=2’ and 'use alternate pin' in your menu. And nldx(BYTE)?

Can I slow PWM frequency to less the minimum of 7 Hz it is giving me, like to 0.1Hz? E.g. use prescalers more than 16? My clock is the 125KHz internal clock.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: PWM slowing

Post by Steve »

"PWM Count = 2" means that there are 2 PWM outputs available on this chip.

The "Use Alternate Pin" is on some chips where there is a choice of pin that the PWM output can be on (if you select this alternate setting, you will also need to set it up correctly in the chip configuration data).

nIdx refers to which PWM output you are accessing. It's 1 or 2 for those chips with 2 PWM outputs (or just 1 for those with 1 output).

You cannot slow the PWM down any further (unless you use a really slow master clock). An alternative approach is to generate the PWM output by hand using a timer interrupt.

echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Re: PWM slowing

Post by echase »

Thanks. I will have to use a timer instead. There was a post form you guys some months ago about how to do this. Need to look it up again.

Post Reply