Thanks for the suggestions.
It's working OK now (sine, triangle, sawtooth and square waves) with the
following code:
adder = 202500; //set up adder
acc = 0; //clear accumulator
while (1)
{
acc = acc + adder; //update phase accumulator
ptr = (acc &= 0xFF); //pointer into table
IOSET = sawtooth[ptr] << 8;
IOCLR = (~sawtooth[ptr] << 8);
}
apart from glitches - spurs on the waveforms. I think I had the ~ in the
wrong place.
I didn't get those glitches with the AVR, using the same DAC. I've got some
LEDs on some of the lines to the DAC, so I'll try disconnecting them - they
might be pulling the signals down. Although the DAC is a 5V device,
according to the spec it is LV CMOS compatible (as low as 2V for a logic
high) on the inputs, so it should be OK with the LPC2106 outputs. I might
try pulling the inputs up to 5V if I still have problems.
Leon
--
Leon Heller, G1HSM
Email: aqzf13@...
http://www.geocities.com/leon_hellerMessage
DDS working
2003-12-03 by Leon Heller
Attachments
- No local attachments were found for this message.