Prev: Durofix RL435
Next: Summing analog signals
From: John Larkin on 15 Mar 2010 22:45 On Thu, 11 Mar 2010 21:03:15 -0500, Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_(a)charter.net> wrote: >John Fields wrote: > >> On Wed, 10 Mar 2010 19:33:19 -0500, Jamie >> <jamie_ka1lpa_not_valid_after_ka1lpa_(a)charter.net> wrote: >> >> >>>Kevin Lang wrote: >>> >>> >>>>What would be the simplest way to derive a simultaneous three phase >>>>output from a sine wave produced by a single function generator IC ... >>>>that does not change as the frequency is varied? >>>> >>>>Specifically, two additional sinewaves remaining 120 and 240 degrees >>>>out of phase with the original as the frequency is varied between >>>>100Hz and 1KHz. >>>> >>>>Kevin Lang >>> >>> Learn to code a uC chip... A Pic, AVR, ATEML, ARm etc.. >>>that has at least 3 ADC outputs.. >>> The smaller family chips use a PWM (Pulse width modulator) that >>>can form a Sin wave on the output.. >>> >>> You code the math to generate the first base sine and then, offset >>>the other outputs at the proper angle. >> >> >> --- >> And how, exactly, would you do that over a 10:1 change in frequency? >> >> JF > >Never made a variable frequency generator with a uC before? > > it's very easy. Look at DDS technology. Just an old idea with a new >name on it and some alterations to make it possible for a wide range of >output. > > With 20 Mhz uC's you can get 1khz sine waves via pwm with no problem >into a padded network that is unity buffered. > > Even the slower ones can do that. Math isn't a problem, I just load a >data table with the integral coefficients to index into, for fast >computations of the PWM duty cycle. I usually think of a DDS sinewave lookup table as being, well, sines, but you could just load the table with the PWM of the sines. A 20 MHz CPU - especially an ARM - doing 32-bit math could probably do 3-phase sines up to a couple hundred KHz with milli-Hz frequency resolution. John
From: Tim Williams on 15 Mar 2010 23:24 "John Fields" <jfields(a)austininstruments.com> wrote in message news:0qetp5hfec458on5ar3dl8u58v86mdrnbl(a)4ax.com... > 20 _mega_ Hertz??? > > With an 8 bit counter, a lookup table, and a DAC, I can generate a > stand-alone 1000Hz sine wave using a 256kHz clock ... Ah, but you missed the whole point: PICs don't *have* DACs. To do it by PWM, you need big clocks. Have you not noticed Jan's entire exploration of PICs? "How much can you do with a PIC and a minimum of support hardware?" DACs are support hardware, not internal, so they are excluded as much as possible. Some hardware implementation of a count-and-compare PWM generator or sigma-delta DAC, locally PLL'd to some much higher clock (like 256MHz), and controlled by a microcontroller at much lower rates (4MHz would be enough), would be suitable. Alas, they don't make these, nor do they make PICs (or AVRs) with [parallel] DACs inside, so you're SOL as far as running the core at big MHz. The alternative is finding a uC which *does* have a DAC inside, but that directly violates the thesis: use a *PIC*. Tim -- Deep Friar: a very philosophical monk. Website: http://webpages.charter.net/dawill/tmoranwms
From: John Larkin on 16 Mar 2010 00:05 On Mon, 15 Mar 2010 22:24:47 -0500, "Tim Williams" <tmoranwms(a)charter.net> wrote: >"John Fields" <jfields(a)austininstruments.com> wrote in message >news:0qetp5hfec458on5ar3dl8u58v86mdrnbl(a)4ax.com... >> 20 _mega_ Hertz??? >> >> With an 8 bit counter, a lookup table, and a DAC, I can generate a >> stand-alone 1000Hz sine wave using a 256kHz clock ... > >Ah, but you missed the whole point: PICs don't *have* DACs. To do it by >PWM, you need big clocks. > >Have you not noticed Jan's entire exploration of PICs? "How much can you do >with a PIC and a minimum of support hardware?" DACs are support hardware, >not internal, so they are excluded as much as possible. > >Some hardware implementation of a count-and-compare PWM generator or >sigma-delta DAC, locally PLL'd to some much higher clock (like 256MHz), and >controlled by a microcontroller at much lower rates (4MHz would be enough), >would be suitable. Alas, they don't make these, nor do they make PICs (or >AVRs) with [parallel] DACs inside, so you're SOL as far as running the core >at big MHz. The alternative is finding a uC which *does* have a DAC inside, >but that directly violates the thesis: use a *PIC*. > >Tim PICs are mostly antiques. One of my guys is working with an eval board that has a sub-$1 ARM processor on board, with enough flash, ram, and i/o stuff to be useful. It could easily do DDS with 1-bit (software delta-sigma) DAC outputs at KHz sine wave rates. John
From: Bob Monsen on 16 Mar 2010 19:06 "John Larkin" <jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in message news:ul0up59q3pbta1al2jfuuss4pbm9osbuvj(a)4ax.com... > On Mon, 15 Mar 2010 22:24:47 -0500, "Tim Williams" > <tmoranwms(a)charter.net> wrote: > >>"John Fields" <jfields(a)austininstruments.com> wrote in message >>news:0qetp5hfec458on5ar3dl8u58v86mdrnbl(a)4ax.com... >>> 20 _mega_ Hertz??? >>> >>> With an 8 bit counter, a lookup table, and a DAC, I can generate a >>> stand-alone 1000Hz sine wave using a 256kHz clock ... >> >>Ah, but you missed the whole point: PICs don't *have* DACs. To do it by >>PWM, you need big clocks. >> >>Have you not noticed Jan's entire exploration of PICs? "How much can you >>do >>with a PIC and a minimum of support hardware?" DACs are support hardware, >>not internal, so they are excluded as much as possible. >> >>Some hardware implementation of a count-and-compare PWM generator or >>sigma-delta DAC, locally PLL'd to some much higher clock (like 256MHz), >>and >>controlled by a microcontroller at much lower rates (4MHz would be >>enough), >>would be suitable. Alas, they don't make these, nor do they make PICs (or >>AVRs) with [parallel] DACs inside, so you're SOL as far as running the >>core >>at big MHz. The alternative is finding a uC which *does* have a DAC >>inside, >>but that directly violates the thesis: use a *PIC*. >> >>Tim > > PICs are mostly antiques. One of my guys is working with an eval board > that has a sub-$1 ARM processor on board, with enough flash, ram, and > i/o stuff to be useful. It could easily do DDS with 1-bit (software > delta-sigma) DAC outputs at KHz sine wave rates. > > John > The ARM cortex-m3 from st has 2 built-in DACs, that can both be driven using the DMA engine, with no software intervention at all other than setup (the DMA can fetch repeatedly from a table and loop back to the start). Doesn't do DDS, but doing it in software would be easy. The one I've been playing with recently is about $5 in quantities. 512k flash, 64k ram, ADC, DAC, scads of timers, DMA engines that can interface with most of the internal devices, etc. Nice debug support using jtag. You are right, PICs are antiques. Even their new 32 bit chip is an antique; it uses the MIPS core I was programming 12 years ago. Regards, Bob Monsen
From: John Larkin on 16 Mar 2010 19:39
On Tue, 16 Mar 2010 16:06:56 -0700, "Bob Monsen" <rcmonsen(a)gmail.com> wrote: >"John Larkin" <jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in message >news:ul0up59q3pbta1al2jfuuss4pbm9osbuvj(a)4ax.com... >> On Mon, 15 Mar 2010 22:24:47 -0500, "Tim Williams" >> <tmoranwms(a)charter.net> wrote: >> >>>"John Fields" <jfields(a)austininstruments.com> wrote in message >>>news:0qetp5hfec458on5ar3dl8u58v86mdrnbl(a)4ax.com... >>>> 20 _mega_ Hertz??? >>>> >>>> With an 8 bit counter, a lookup table, and a DAC, I can generate a >>>> stand-alone 1000Hz sine wave using a 256kHz clock ... >>> >>>Ah, but you missed the whole point: PICs don't *have* DACs. To do it by >>>PWM, you need big clocks. >>> >>>Have you not noticed Jan's entire exploration of PICs? "How much can you >>>do >>>with a PIC and a minimum of support hardware?" DACs are support hardware, >>>not internal, so they are excluded as much as possible. >>> >>>Some hardware implementation of a count-and-compare PWM generator or >>>sigma-delta DAC, locally PLL'd to some much higher clock (like 256MHz), >>>and >>>controlled by a microcontroller at much lower rates (4MHz would be >>>enough), >>>would be suitable. Alas, they don't make these, nor do they make PICs (or >>>AVRs) with [parallel] DACs inside, so you're SOL as far as running the >>>core >>>at big MHz. The alternative is finding a uC which *does* have a DAC >>>inside, >>>but that directly violates the thesis: use a *PIC*. >>> >>>Tim >> >> PICs are mostly antiques. One of my guys is working with an eval board >> that has a sub-$1 ARM processor on board, with enough flash, ram, and >> i/o stuff to be useful. It could easily do DDS with 1-bit (software >> delta-sigma) DAC outputs at KHz sine wave rates. >> >> John >> > >The ARM cortex-m3 from st has 2 built-in DACs, that can both be driven using >the DMA engine, with no software intervention at all other than setup (the >DMA can fetch repeatedly from a table and loop back to the start). Doesn't >do DDS, but doing it in software would be easy. If you had, say, a 100 or 200 KHz periodic interrupt, the code to do 2-phase DDS and two multiplies for amplitude control would run in microseconds, not burning much of the CPU. That would get you an audio-range polyphase sine generator (or other waveforms if you switch lookup tables) with microhertz frequency resolution, quality limited only by the dacs. A few external 12-16 bit dacs would be even better. > >The one I've been playing with recently is about $5 in quantities. 512k >flash, 64k ram, ADC, DAC, scads of timers, DMA engines that can interface >with most of the internal devices, etc. Nice debug support using jtag. NXP and Marvell have some screamer ARMs with cache, ram, dram controllers, all sorts of peripherials, and 100M or Gbit MACs. Cheap. John |