CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PWMWizard

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SubhobrotoSinha



Joined: 10 Oct 2006
Posts: 2

View user's profile Send private message

PWMWizard
PostPosted: Tue Oct 10, 2006 10:02 am     Reply with quote

Lately, I have been doing a lot of maths on my own because of my IR Obstacle detector design.

Noticed a lot of people asking for help on configuring PWM using CCS C.

Then it struck me.

Why not make a tool to simplify the process for all ?

So I sat down today, fired up my Visual C++ IDE and got may hands dirty.

The attached EXE is hot from the compiler, and with lots of "hidden features", of which even I may not be aware of.

http://www.geocities.com/subhobrotosinha/PIC/PWMWizard.zip

Please use it a bit, and report the bugs.

Feedback, bug reports, suggestions, edge cases and tips on designing a small dual differential drive motor controller (preferably using a PIC) welcome.

Subhobroto Sinha

PS : The default values are for setting up the PWM for 38Khz, 50% duty cycle on a PIC16F877A @20Mhz
Just click on "Generate code" button to get ready code to copy paste in the CCS IDE
PhilWinder



Joined: 16 Apr 2005
Posts: 23

View user's profile Send private message

Sorted!
PostPosted: Sat Dec 09, 2006 8:57 am     Reply with quote

I was just searching for PWM related issues and came accross this and shock horror, no one has messaged back saying "How good is this!"
So simple, but super helpful.
You should email CCS and get them to put this in their software.

Cheers,

Phil
P.s. Slight bug with the code generation, it puts a space in where it shouldnt:
T2_DIV_BY_ 1 <- space before 1
SubhobrotoSinha



Joined: 10 Oct 2006
Posts: 2

View user's profile Send private message

Thank you for your valuable feedback
PostPosted: Sat Dec 16, 2006 8:13 pm     Reply with quote

Thank you for your valuable feedback.

I fixed the formatting bug, it should work straight off now...

You just don't know how much your single post of appreciation made my day.

Though I only wish more people would find it useful.

I would definitely feel honoured if CCS ever found PWMWizard useful and included it in their excellent toolchain !

Warm Regards

Subhobroto Sinha
rwskinner



Joined: 08 Dec 2006
Posts: 125
Location: Texas

View user's profile Send private message

PostPosted: Sat Dec 16, 2006 9:03 pm     Reply with quote

Nice little calculator. Thanks!
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 18, 2006 8:47 am     Reply with quote

Good stuff, I will show it to people at CCS.
_________________
I came, I saw, I compiled.
drolleman
Guest







PostPosted: Mon Dec 18, 2006 11:12 am     Reply with quote

very good helpfull tool

here are suggestions

when i hit enter the program exits. it should execute the code creater.

when i clear the edit boxes to change a value the validation creates an error. mabe change the validation code till the code creater is executed
Guest








PostPosted: Sat Jan 06, 2007 9:55 pm     Reply with quote

thank you very much, works perfect!
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Sun Apr 08, 2007 7:50 pm     Reply with quote

Subhobroto,

This is a very good utility! It’s very intuitive.

Could you post a VC++ code for it too? I want to add some code that will determine a precision with which the given duty cycle can be reached. Basically, I want to ad some code to the “Too high or low values [of the duty cycle] are not recommended” sentence. I will e-mail the new version to you so that you can publish it on your web page.

Cheers,
Nick
_________________
Read the label, before opening a can of worms.
Steve H
Guest







PostPosted: Sun May 06, 2007 9:58 am     Reply with quote

With V4.xxx you need to be careful with the set_pwm1_duty() command. As per the manual if you supply a 8 bit number (or constant) it will be shifted up by two bits to make the full ten bit word.

so "set_pwm1_duty(75)" will not give you the result you want! An as per Mr. Murphys law - it will usually give a duty cycle that will cause the PWM to stick high and not work at all - leading you to wonder what is wrong!

However this will work: "set_pwm1_duty((int16)75)"

So will this:

//
int16 duty;
duty = 75;
set_pwm1_duty(duty)
//


Yeah - that cost me 45 minutes to figure out!

Still it was time spent more enjoyable than mowing the lawn!

;-)

Steve H.
rahulbose
Guest







tat was great
PostPosted: Tue May 08, 2007 1:45 pm     Reply with quote

tat li'l window of PWMwizard is very hepful... keep up the good work
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group