Low frequency using PWM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times

Low frequency using PWM

Post by Xavier »

H Guys

I was wondering is it possible to have the period of the PWM to run from 50ms up to 100ms ? Should this be the case could you tell me how should I go about it. I'm afraid that I have not used the PWM yet and am at a total loss.

All the best
Xavier

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: Low frequency using PWM

Post by brandonb »

does it matter if its delay based rather than tmr based?

Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times

Re: Low frequency using PWM

Post by Xavier »

Hi Brandonb

No it does not matter at all.

All the best
Xavier

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: Low frequency using PWM

Post by brandonb »

this is a hack concept i came up with, its delay based.... default time period is 200ms... switches from left to right... (1)increment pwm% (2)decrement pwm% (3)increase frequency (4)decrease frequency..... if this is what your looking for, i can change it to reflect your needs, i think jan came up with a timer based version that would work better, not sure if it goes this low of a frequency though
Attachments
low_freq_pwm.fcf
(19.65 KiB) Downloaded 290 times

Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times

Re: Low frequency using PWM

Post by Xavier »

Thanks Brandonb

I will toy with the idea and see what I can come up with. There was one more thing that I wanted to ask. I know that it's possible to make a sine wave is there an example that I could have a look at that you know off?

All the best
Xavier

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: Low frequency using PWM

Post by brandonb »

I know that it's possible to make a sine wave is there an example that I could have a look at that you know off?
what kind of application? you could use a ccp pwm module to do something like in the referance sheet below, i have a bunch of ccp pwms for different frequencies, or are you just trying to create a frequency and just make it a sine wave
Attachments
microchip analog notes from pwm.pdf
(67.45 KiB) Downloaded 329 times

Xavier
Posts: 99
Joined: Sat Mar 17, 2012 11:26 pm
Location: South Africa
Has thanked: 5 times
Been thanked: 3 times

Re: Low frequency using PWM

Post by Xavier »

Hi Brandonb

The sine wave would be used for a VLF metal detector. At first I will make it using only one frequency of 4Khz but the goal is the have it running at a multitude of frequencies lest just say for argument sake 4Khz 8Khz and 16Khz. I don't know if you have had to deal with metal detectors but basically the 4Khz would be for depth and the higher frequencies for smaller non ferrous items closer to the surface. My previous question about PWM is for a PI detector hence the reason why I'm after such a slow period but that has already been solved even though new problems have arise but I'm having fun trying to solve them by my self up till now LOL Thanks for posting the PDF I will be taking a closer look at it.

All the best
Xavier

Post Reply