I'm using an AVR microcontroller and a 10-bit quad DAC to draw lines on an oscilloscope in XY mode. I'm using two DAC channels, one for X and one for Y. To draw a line, the microcontroller steps from the starting point to the ending point using Bresenham's algorithm, gradually increasing/decreasing the output voltages in discrete steps.
However, for long lines, Bresenham's algorithm is slow. If I use the full 10-bit precision of the DAC, 1,024 points will be plotted to draw a horizontal line that spans the full width of the screen. Since it takes about 2.5 microseconds to plot a point (checked with a digital scope), it will take almost 3 milliseconds to draw the line, which is too long. If I limit coordinates to 8 bits, the lines look pixelated, which is obviously not the effect I'm trying to achieve on an analog scope.
I've tried adding capacitors on the outputs, they just make the lines blurry.
Since the DAC has four channels, I can output both starting and ending X and Y voltages if necessary. Maybe I could build a circuit like this (apologies for crude diagram) to :
where a pulse on the trigger line causes the output to ramp from the start voltage to the end voltage. I'm not sure how to build such a circuit or what it would be called. Op amps come to mind (maybe a unity-gain differential amp fed into an integrator?) but it's been a while since I've used them. Any ideas?
However, for long lines, Bresenham's algorithm is slow. If I use the full 10-bit precision of the DAC, 1,024 points will be plotted to draw a horizontal line that spans the full width of the screen. Since it takes about 2.5 microseconds to plot a point (checked with a digital scope), it will take almost 3 milliseconds to draw the line, which is too long. If I limit coordinates to 8 bits, the lines look pixelated, which is obviously not the effect I'm trying to achieve on an analog scope.
I've tried adding capacitors on the outputs, they just make the lines blurry.
Since the DAC has four channels, I can output both starting and ending X and Y voltages if necessary. Maybe I could build a circuit like this (apologies for crude diagram) to :
Rich (BB code):
Trigger
|
_|_
Start X voltage ----| |
| ? |---- Output X voltage
End X voltage ------|___|