Searching \ for '[PIC]: sinusoidal signal generation from PIC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'sinusoidal signal generation from PIC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: sinusoidal signal generation from PIC'
2003\08\07@063123 by Vasile Surducan

flavicon
face
I need to generate a pour shape (10%...20% distorsions?)
sinusoidal signal with fixed amplitude and variable output frequency
from 1 to 20 KHz. AFIK there are two basic outputs from PIC:
PWM and R2R ladder(or DAC). About the sinus generation I've heard about
Goertzel algorithm, table read and other methodes (Taylor series etc).
There are also a few hardware methodes, but are even too expensive
for me (direct digital syntesis chips, wien-bridge digital potentiometer
controled, 8038 clones) or too complicated for the whole required
frequency range (square wave, second order filtering).
If you have any experience in this field I'm interested into a good
suggestion for a pure and simple software sinusoidal signal generation
with pic.

thank you in advance,
Vasile
http://surducan.netfirms.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\08\07@072436 by Bob Axtell

face picon face
I had to design a SINE-WAVE generator with fixed, precise frequencies and
low distortion for a test system. I used an 8-bit counter, an EPROM, and a
D/A converter. Simply drove the counter at the right frequency from the
processor. Needed very little filtering (R-C only).

But I think that these new flash PICs could do it with tables if the
frequency is that low.

--Bob

At 01:44 PM 8/7/2003 +0300, you wrote:
{Quote hidden}

---------------
NOTICE

1. This account can accept email & attachments up to 10M in size.
2. Federal Monitors: At request of client, some attachments are encrypted.
Please DO NOT delay traffic; please reply with credentials for password.
--------------

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\08\07@074340 by Quentin

flavicon
face
Hi
Non PIC: Try the XR2206 from Exar(.com)
PIC: Read MC App note: AN655

Quentin

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\08\07@074755 by moonshadow

picon face
Have a look at the electronics page on my website at ...

http://homepage.ntlworld.com/moonshadow/New_Folder/electronics.htm

It shows how to get sine from PWM and square wave with just two components.
A 4 MHZ 16F877 can generate 2R2 waveforms up to about 87 kHz if you open the
software loop. It is also described on the web site. If you generate the
wave points with a loop the maximum frequency drops to about 7 kHz.  Can I
ask what you are using it for ?.

John Kent
{Original Message removed}

2003\08\07@080659 by Olin Lathrop

face picon face
> I need to generate a pour shape (10%...20% distorsions?)
> sinusoidal signal with fixed amplitude and variable output frequency
> from 1 to 20 KHz. AFIK there are two basic outputs from PIC:
> PWM and R2R ladder(or DAC). About the sinus generation I've heard about
> Goertzel algorithm, table read and other methodes (Taylor series etc).
> There are also a few hardware methodes, but are even too expensive
> for me (direct digital syntesis chips, wien-bridge digital potentiometer
> controled, 8038 clones) or too complicated for the whole required
> frequency range (square wave, second order filtering).
> If you have any experience in this field I'm interested into a good
> suggestion for a pure and simple software sinusoidal signal generation
> with pic.

I had to do something similar once where the frequency was low but needed
to be very accurately controlled.  One complete sine wave was stored in a
512 entry table of 8 bit values.  The CCP module in PWM mode was used at
the fastest possible speed that still yielded 8 bit resolution.

A new value was loaded every CCP interrupt (every 64 cycles), then the
value computed for the next interrupt.  Frequency was adjusted by setting
the table increment per CCP interrupt.  To get high frequency resolution
and accuracy, this value had 16 fraction bits.  You don't need to do
interpolation between table values at that table configuration, so the
table index was just the 9 integer bits of the 9.16 table index
accumulator.  The fraction bits accumulated the fractional table entry
offset, which occasionally caused a carry into the integer part as the
accumulated fractional error exceeded 1.

With a little more addressing math you can use a 1/4 cycle table.  I had
the room, so I used a full cycle to make the code easier.  With a 20MHz
PIC, you can get 8 bit PWM resolution at 78KHz PWM frequency.  That's
about 4 times your highest output frequency, so the output filter will
need to be more than a couple or Rs and Cs, depending on how much
amplitude variation due to frequency you can live with at the high end of
the frequency range.  A PIC18 at 40MHz gives you an additional factor of 2
headroom between your highest frequency and the PWM frequency.

One problem with this method is that at high frequencies when the table
increment is a substantial portion of a cycle, you will get significant
distortion that will look like amplitude modulation at the beat frequency.
In theory, the output filter can get rid of this, but in practise that
will be nearly impossible.  Another way of looking at it is that the beat
frequency is always there, but the intermodulation products get stronger
and move closer to the desired frequency as the desired frequency
approaches half the PWM frequency.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\08\07@083001 by Wouter van Ooijen

face picon face
> I need to generate a pour shape (10%...20% distorsions?)
> sinusoidal signal with fixed amplitude and variable output frequency
> from 1 to 20 KHz.

Check the magical sine waves from Don Lancaster, use the older
(fixed-interval) version rather than the newer version.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\08\07@083410 by Denny Esterline

picon face
It's been awhile since I read any of it, but Don Lancaster did a huge amount
of sinewave generation research a few years back.
Try here:  http://www.tinaja.com/magsn01.asp   Good reading, weather you can
use it or not.

Denny
{Original Message removed}

2003\08\07@103553 by Adi Linden

flavicon
face
> I need to generate a pour shape (10%...20% distorsions?)
> sinusoidal signal with fixed amplitude and variable output frequency
> from 1 to 20 KHz.

I am working on a programmable signal generator that will produce audio
frequency with 1Hz tuning steps. The idea is to simulate a NCO (numerical
controlled oscillator) in software. Here are some links on similar
projects:

http://www.chipcenter.com/embapps/emba057.htm

AVR (not PIC):

http://www.myplace.nu/avr/minidds/
www.geocities.com/leon_heller/minidds.html
http://www.qsl.net/zl1bpu/micro/SIGGEN/Siggen.htm

Hope this helps,
Adi

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\08\08@043245 by Ishaan Dalal
flavicon
face
DDS using only a PIC & 8-bit DAC works great for me. I use a 1024-entry
full-cycle lookup table. What are the range of frequencies you are looking
at? Depending on that, you might also be able to build an internal
triangle/ramp for a 1-bit DAC in the PIC, and then use active lowpasses to
get your analog waveform.

Cheers,
Ishaan


{Original Message removed}

2003\08\08@044113 by Mike Singer

picon face
Vasile Surducan wrote:
...
> Do you know more ?

Did anybody mention PWM calculated "on-fly" (both period and
duty cycle) according to A/D input?

Mike.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...