No, don't do that whatever You do. That's the index into the 512 cell sine table and after index 511 it must turn to 0, not continue out in space.
The frequency is not controlled. It's set by the delay caused by the wire communication.
Yes, that's exactly why I want OP to remove it. With a DVM, you're not going to be able to visualize the sine wave: you'll just see a flickering value. If it outputs a constant voltage, the DVM should represent that.
My guess is that it's working perfectly, but the DVM is the wrong tool to use in this application.
That doesn't matter. The point is that it's too fast for the DVM to accurately reflect what's happening.
Okey, only sending the value in cell [0]....
Didn't spot that. Using the strategy in "Blink without delay" could fix a controlled frequency, lower than what it's now.
@OP: see my edit to post #19.
@cedarlakeinstruments @Railroader Both very insightful thoughts, so valuable when sat on my own narrowing my perspective down a rabbit hole!
OK so absolutely the digital multimeter could not handle the frequency. Solution was to send a single value or array of single values in the loop and indeed the DAC works perfectly. Delay (1500) removed the jitter around the central value the multi meter could read and gave a solid "average" I guess of the sin wave.
Controlling the frequency "blink without delay" I will look at.
Great thankyou knowing that it works I can now look at trying to map the PWM input of approx 963-2001 (1038 range) output from my radio receiver to a DAC output of 0-5V. Steep learning curve thanks again.
Thanks. The topic is laying here for 6 months so adding eventually new questions ought work if it will be needed.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.