View previous topic :: View next topic |
Author |
Message |
nagaparimi
Joined: 23 May 2014 Posts: 3 Location: banglore
|
pic 16f877a sinewave |
Posted: Fri May 23, 2014 10:15 pm |
|
|
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... _________________ pns controller |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
nagaparimi
Joined: 23 May 2014 Posts: 3 Location: banglore
|
|
Posted: Sat May 24, 2014 3:05 am |
|
|
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
|
|
Posted: Sat May 24, 2014 6:40 am |
|
|
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
|
|
Posted: Sat May 24, 2014 9:17 am |
|
|
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
|
|
Posted: Sat May 24, 2014 11:49 am |
|
|
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
|
|
Posted: Sat May 24, 2014 12:04 pm |
|
|
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
|
mr oxo |
Posted: Mon May 26, 2014 12:36 am |
|
|
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
|
|
Posted: Mon May 26, 2014 7:15 am |
|
|
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
|
|
|
|