I'm just getting back into some Picaxe work after a long break doing other stuff. My first problem is to generate a sine wave. I want to be able to vary the frequency so prefer not to have to do too much filtering as with pwm, so I'm trying out the DAC capability for the first time. But in trying to get a decent sine wave on the scope I find that the DAC output isn't linear. My linearity test setup is as simple as could be so I'm perplexed.
Hardware is an 08M2 on an 08 proto board, powered by 5v, with the dac output directly connected to the scope with nothing in circuit except the probe
The pic shows the scope output from the code below. There are two problems:
- the range should be 0-5v but only 0-2.5v is displaying
- the graph should be a straight line but is seemingly geometric or exponential
What have I overlooked?
I do recall seeing a fleeting mention of dac problems in some situations. But can't find a reference anywhere so may have imagined it. I get the same result on PE556 and PE6088.
Hardware is an 08M2 on an 08 proto board, powered by 5v, with the dac output directly connected to the scope with nothing in circuit except the probe
The pic shows the scope output from the code below. There are two problems:
- the range should be 0-5v but only 0-2.5v is displaying
- the graph should be a straight line but is seemingly geometric or exponential
Code:
dacsetup %10100000 'dac enabled on ext pin with supply reference
do
for B_temp = 0 to 31
daclevel B_temp
next
loop
What have I overlooked?
I do recall seeing a fleeting mention of dac problems in some situations. But can't find a reference anywhere so may have imagined it. I get the same result on PE556 and PE6088.