PDA

View Full Version : need help!!! >> 2 channel SPWM variable duty cycle.



Antorbd04
- 29th March 2014, 07:10
I modified SPWM software and add a more SPWMpin but I need a variable duty cycle. (see the photo)
7281


define OSC 10
SPWMpin var PORTC.2
SPWMpin1 var PORTC.3
Include "SSPWM.INC"

START:
Freq = 50
DutyCycle = 50
gosub StartSPWM

MAIN:
'MY CODE HERE
GOTO MAIN


7282

HOW I ADD VARIABLE CODE TO MY PROJECT????
HELP ME ANYBODY PLZ.......

Antorbd04
- 29th March 2014, 14:22
I hoped that is site is useful but I never get any help from this site. So this is my last post if I will not get any response I never post in this site.


Proteus File: 7283

Heckler
- 29th March 2014, 15:12
Antorbd,

to add a variable to your code you simply declair it at the beginning like this...

AdjustPWM VAR BYTE


Then you can read the AD converter connected to your variable resistor like this...

ADCIN 5, AdjustPWM

then you can use the value you read in to your variable "AdjustPWM" in your PWM adjust command, something like the...

HPWM 1, AdjustPWM, 500


--------------------------------------

are you using PicBasic ?? or some other basic language??

If PicBasic do you have the manual?

----------------------------------

for a beginner it is extremely helpful to read and study other working code examples.
Use the search function at the top of the forum and enter a couple of search terms and you will find lots of examples.

Also go to the WIKI section at the top also and look at the projects there.

Good luck and keep asking questions.

Darrel Taylor
- 29th March 2014, 19:22
HOW I ADD VARIABLE CODE TO MY PROJECT????

SSPWM was only for 1 channel.

For multiple channels, use Multi_SPWM
http://www.pbpgroup.com/modules/wfsection/article.php?articleid=12

Antorbd04
- 30th March 2014, 19:34
sspwm was only for 1 channel.

For multiple channels, use multi_spwm
http://www.pbpgroup.com/modules/wfsection/article.php?articleid=12

i want a pwm which as output as:
7285

but multi_spwm give me a output which as:
7286

how i will get my expected output from multi_spwm????

Antorbd04
- 30th March 2014, 20:23
sspwm was only for 1 channel.for multiple channels, use multi_spwmhttp://www.pbpgroup.com/modules/wfsection/article.php?articleid=12i expect output from this project as picture for inverter slow pwm:::::7287

Demon
- 30th March 2014, 22:59
http://en.m.wikipedia.org/wiki/Inverter_(logic_gate)

Robert

Antorbd04
- 31st March 2014, 09:42
http://en.m.wikipedia.org/wiki/Inverter_(logic_gate)

Robert

I unable to find something helpful from your link.

Antorbd04
- 31st March 2014, 09:49
SSPWM was only for 1 channel.

For multiple channels, use Multi_SPWM
http://www.pbpgroup.com/modules/wfsection/article.php?articleid=12

Multi_SPWM not suitable for Inverter project & I tested this for Inverter and the result was worst. Plz modify this Multi_SPWM software.

Acetronics2
- 31st March 2014, 10:01
What else ???

a cup of "Nespresso" ???

May be you want to rent someone's knowledge ???

Alain

Antorbd04
- 31st March 2014, 10:25
What else ???

a cup of "Nespresso" ???

May be you want to rent someone's knowledge ???

Alain

hello bro,
I just need help that I post. But you mean something different. I don't want to rent someone knowledge.

Dave
- 31st March 2014, 13:09
What he is trying to say is, when you make a statement like the following:
"Multi_SPWM not suitable for Inverter project & I tested this for Inverter and the result was worst. Plz modify this Multi_SPWM software."
it makes us think you want us to do the project for you. You got the routine for free but you don't understand how it works. Now you want someone to please fix it for you. Don't you know any thing about the language? Don't you understand the processor you are working with. People are here to help but, not to re-write someone elses code to suite you. I see this all the time, someone asking for the forum members to write there code for them.

Just my 2 cents worth.....

Demon
- 31st March 2014, 13:58
I unable to find something helpful from your link.

You want channel 2 to be the exact opposite of channel 1 and don't see how an inverter could be handy?

I suggest you google <electronic tutorial logic gates>.

Robert