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

pic 16f877a sinewave

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



Joined: 23 May 2014
Posts: 3
Location: banglore

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

pic 16f877a sinewave
PostPosted: Fri May 23, 2014 10:15 pm     Reply with quote

hai geniuses,
This is my first post in ccsinfo. I want to generate a sine wave using 16f877a so i need to change the pwm for every cycle. So for that i want interrupt, in that interrupt function is going to change the duty cycle for every full cycle. How can i get ? Please help.
Thank you... Smile Smile Smile Smile Smile Smile Smile
_________________
pns controller
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 24, 2014 12:03 am     Reply with quote

Use the forum's search page:
http://www.ccsinfo.com/forum/search.php
Search for this:
Quote:
pwm sine wave set_pwm1_duty

Set it for: Search for All Terms
nagaparimi



Joined: 23 May 2014
Posts: 3
Location: banglore

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

PostPosted: Sat May 24, 2014 3:05 am     Reply with quote

sir i have seen but no where i got.... my doubt is can i get pwm intrupt function as i worked in avr am havin pwm intrupt function same as in pic i want... please help..
_________________
pns controller
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sat May 24, 2014 6:40 am     Reply with quote

You are giving us nothing to work on.

Show us your code.
The code must be short, complete and compilable.
We only need to see the essentials to generate the sine wave.

Mike
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 24, 2014 9:17 am     Reply with quote

Quote:
my doubt is can i get pwm intrupt function

The PWM interrupt occurs in #int_timer2. So change your
search terms to this:
Quote:
#int_timer2 set_pwm1_duty sine*

Set it to: Search For All Terms

CCS Forum search page:
http://www.ccsinfo.com/forum/search.php
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

PostPosted: Sat May 24, 2014 11:49 am     Reply with quote

Come on, you know he doesn't want to know how to do it !

He just wants you to post fully working code so he can cut and paste.

This forum is Soooo unhelpful.

</irony>
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat May 24, 2014 12:04 pm     Reply with quote

Actually the best way to LEARN is to cut your OWN code, try, observe what happens, read up some more and try again.
This 'cut and paste' plagerizing of code does NOT teach anyone HOW to program.

hmmm..wonder if this is another ISIS program....sigh.

Heck, you could just look at the fine examples CCS supplies and 99% of most code anyone(students ?) need is already done.

We all 'know' this is a class assignment as nobody would use a 20 year old EOL PIC in their product.Well, except for me maybe as I have a few tubes of them still.....
nagaparimi



Joined: 23 May 2014
Posts: 3
Location: banglore

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

mr oxo
PostPosted: Mon May 26, 2014 12:36 am     Reply with quote

oxo wrote:
Come on, you know he doesn't want to know how to do it !

He just wants you to post fully working code so he can cut and paste.

This forum is Soooo unhelpful.

</irony>



once again read my question i didn't ask full code just i want to know the pwm interrupt function.. not function definition
_________________
pns controller
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Mon May 26, 2014 7:15 am     Reply with quote

There is no such thing as a PWM interrupt. But the PWM is generated by Timer2, and there is a TMR2 interrupt.

So, how are you going to proceed?
chrhartz



Joined: 29 Aug 2008
Posts: 7

View user's profile Send private message

PostPosted: Mon May 26, 2014 1:17 pm     Reply with quote

Hi John,

take a look here:

http://www.ccsinfo.com/forum/viewtopic.php?t=52418
http://www.romanblack.com/onesec/Sine1kHz.htm

Best wishes,
Chris
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