Hi,
I am doing a project for an electronic class I am taking.
What I have to do is : Using an arduino as a counter ( 8 bits Counter) connected to a DAC0832 and in the output generating a Sine wave ( I can't use arduino for generating the sine wave. I will use amp ops later ). The last part I haven't simulate yet.
The problem is the following: I want the wave output to be triangular at first, with steps ups and downs . But now I am only getting the steps going down ( I am using an AMP OP inverter) and it's not going up ( Why not? ) . As you can see in the image, the arduino code is working 100%. It's going from 0 to 255 then 255-0. ( I am only showing part of it).
I am not sure if I was clear about what I want. The wave in the end should be like this ( With small steps increasing and decreasing ) . Do you know how can I fix ?:
hi p,
If you post your program listing I am sure one of us could help.
Looking at your print out, you seem to be incrementing the DAC input, in one bit steps, the input inc/dec should follow a Sine wave sequence.
E
Can you post the code.... The simulation shows a ramp output... Its the code you need to change.. you have decreasing amounts going to the DAC but then when it hits bottom you need to slowly increase not start all over!!
After trying a lot to solve the problem. The issue was indeed the code. It turned out that it wasn't a viable option using PORT manipulation on arduino .
Here's the new one .
The noise isn't software... This is because you dac is seeing the transition for level to level... The ouput buffer should be clocked only when the new data has been shifted in...