50Hz PWM
- 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: 50Hz PWM
Hello,
I moved the post as it seems to be relating to a new topic.
Which version of Flowcode are you using? I think the Hardware PWM will not run this slow but it should be possible using a timer based software driven PWM.
I moved the post as it seems to be relating to a new topic.
Which version of Flowcode are you using? I think the Hardware PWM will not run this slow but it should be possible using a timer based software driven PWM.
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
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: 50Hz PWM
you'll have to set if up for your chip, and change c code to
Code: Select all
t2con=4; pr2=199;
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: 50Hz PWM
HELLO
sir i am having 4 MHZ crystal and 16f887 pic micro controller... plz can u draw it with my requirements please...
i shall b thank full to you..
sir i am having 4 MHZ crystal and 16f887 pic micro controller... plz can u draw it with my requirements please...
i shall b thank full to you..
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: 50Hz PWM
hello
sir if i want to add adc with 0-100% sweep .... please can you do it for me....
and thanks for the 50 hz...
saad shaarif
sir if i want to add adc with 0-100% sweep .... please can you do it for me....
and thanks for the 50 hz...
saad shaarif
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: 50Hz PWM
hello mr brandonb,
sorry for disturbing you again again... sir i want to to out puts.. which work one by one for example if port A5 is 1 then port A2 is 0 and when port A5 is 0 then port A2 is 1... in this way i want 50 hz... and duty cycle must same on both ports...
please can u draw it for me....
and i have added adc to your pwm that you uploaded it i just want to see how you add adc with it...
saad sharif..
have a nice day sir..!
sorry for disturbing you again again... sir i want to to out puts.. which work one by one for example if port A5 is 1 then port A2 is 0 and when port A5 is 0 then port A2 is 1... in this way i want 50 hz... and duty cycle must same on both ports...
please can u draw it for me....
and i have added adc to your pwm that you uploaded it i just want to see how you add adc with it...
saad sharif..
have a nice day sir..!
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: 50Hz PWM
Hello brandonb,
please kindly help me i am waiting...... is there any problem for you to do....
saad sharif
have a nice day..!
please kindly help me i am waiting...... is there any problem for you to do....
saad sharif
have a nice day..!
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 50Hz PWM
Hi saad ,
All you will need to do is use an ADC component (ReadAsByte)
use a formula to convert from 0 - 255 to 0 - 100
assigned the result to a variable called pwm.
Finally delete calculation box.
Then you will have a pwm duty thats will be controlled by ADC pot.
Can you please give it a go, then if your stuck, you can post flowchart for further assistance.
Martin
All you will need to do is use an ADC component (ReadAsByte)
use a formula to convert from 0 - 255 to 0 - 100
assigned the result to a variable called pwm.
Finally delete
Code: Select all
pwm = pwm + 1
Then you will have a pwm duty thats will be controlled by ADC pot.
Can you please give it a go, then if your stuck, you can post flowchart for further assistance.
Martin
Martin
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
Re: 50Hz PWM
HI MARTIN
i have done it as you told.. but i want two outputs of 50 hz pwm with the same duty cycle on both ports..
can you help me for that.
saad sharif
have a nice day.!
i have done it as you told.. but i want two outputs of 50 hz pwm with the same duty cycle on both ports..
can you help me for that.
saad sharif
have a nice day.!
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 50Hz PWM
If you post a flowchart, with your modifications, what you want can be easily modified for you.
Martin
Martin
Martin
-
- Posts: 16
- Joined: Sun Nov 10, 2013 12:35 pm
- Has thanked: 4 times
- Been thanked: 1 time
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 50Hz PWM
Hi saad.sharif,
You can try this Flowchart
Martin
You can try this Flowchart
Martin
- Attachments
-
- 50 Hz PWM with ADC V2.fcf
- (12 KiB) Downloaded 607 times
Martin