> -----Original Message----- > From: moonshadow [SMTP:moonshadow@NTLWORLD.COM] > Sent: Monday, January 20, 2003 9:47 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Dual sine wave generation. > > I need to generate two sine waves. One fixed at 14 kHz and the other > variable between 14 kHz and 14.250 kHz. I would prefer to use Crownhill's > BASIC Compiler to do this. > Can anyone suggest how I ought to go about this please ?. I had > thought to use the two internal CCP modules and the PWM command. However > both modules have the same output frequency. Same with FREQOUT. > > John Kent. > What resolution do you need for the adjustable frequency? How much jitter can you tolerate? You can (maybe) use the hardware PWM, but not in the manner you are thinking. One idea is to build a table of SIN values and step through the table at a variable rate, outputing the table value to the CCP module. The PWM output would need to be low pass filtered to remove the PWM frequency components. This implies that the PWM frequency has to be significantly higher than 14KHz. The higher the PWM frequency the worse the PWM resolution, which will affect the the quality (e.g. distortion) of your sine wave. Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body