Sujet : DDS, again
De : JL (at) *nospam* gct.com (john larkin)
Groupes : sci.electronics.designDate : 11. Dec 2024, 03:38:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <lcthlj9gl86227o6hrc4sidglalkak4qj9@4ax.com>
User-Agent : ForteAgent/8.00.32.1272
I have been unsuccessful in getting LT Spice to simulate a DDS
frequency generator. It's bad enough trying to make the NCO part, but
whenever I get close it stalls or throws convergence errors.
So I wrote a PowerBasic program that's the 32-bit NCO... GC_Num.exe.
Making a proper .WAV file would be a nightmare, so it outputs as a
text file with just time data per line, where data is the
selected number of MS bits of the phase accumulator.
LT Spice can read the file, and then do whatever it wants: sine, DAC,
filter, comparator, FFTs.
https://www.dropbox.com/scl/fo/o0mdxxqvxupg6ynz7i7rx/AMPMbv9NOY4mJFXggTGUqJ8?rlkey=9ecl38npbgy8kxuzd9bako4kr&dl=0Spice reads the file as a piecewise-linear thing, so wrecks the nice
MSB data steps. I had to fool it by outputting each clocked phase
accumulator value twice, as
bits time
bits time+0.9*clock_period
same data bits both lines. Looks pretty steppy.