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 support@ccsinfo.com

generate sine wave

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



Joined: 22 Jun 2009
Posts: 4
Location: colombo

View user's profile Send private message Visit poster's website Yahoo Messenger ICQ Number

generate sine wave
PostPosted: Mon Jun 22, 2009 5:42 am     Reply with quote

I am developing an online ups system. I want to get a sine wave by using pwm method. Can anybody assist me regarding this matter? and also need some code.

Thanks
Prasa
_________________
sanjeewa
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 22, 2009 11:51 am     Reply with quote

Read these threads:
http://www.ccsinfo.com/forum/viewtopic.php?t=36540

http://www.ccsinfo.com/forum/viewtopic.php?t=26636
http://www.ccsinfo.com/forum/viewtopic.php?t=25865
http://www.ccsinfo.com/forum/viewtopic.php?t=28480
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

another way into this
PostPosted: Mon Jun 22, 2009 2:56 pm     Reply with quote

If you want HIGH purity sine functions,
and excellent frequency accuracy ( within .002% of 60 hz)
and wide frequency programmability i suggest you look at the AD9833

I use it in an instrument that has to have .01 hz accuracy from 1 hz to 100 khz - and this part does it to perfection.

The AD9833 it produces a 10 bit accuracy very high purity sine wave
with not too much SPI programming --

I use it several devices and found an EZ way to drive it - using hardware SPI on the PIC.

the secret is to use an EXACT power of 2 as the oscillator reference.
I use 8.388608 and 4.194304 mhz.

programming the part becomes pretty EZ - as all the
divisors are arrived at by simple shifting.

The basic setup is stored as a couple of constants that I initialize it with at system start, and thereafter - you just pump it new divisors to chaneg frequency or switch to square or tri wave output.

Multiple units can be digitally PHASE synchronized by the pic to create precise 3 phase 60 hz signals if you like that sort of thing too.

I admit that as a 60 hz ref its probably overkill
but you will never match the accuracy or purity with simpler circuits,
or trying to filter a PWM signal.
( BTW - you wil be hard pressed to use PWM to make a 60 hz signal
anyway unless you have a ridiculously LOW PIC master osc freq. )
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