tword_m=pow(2,32)*dfreq/refclk; // calulate DDS new tuning word
icnt = 256 * defreq / refclk; // 256 = sizeof (sine256)
offset += icnt; if (offset > 255) offset = 0; OCR2A=pgm_read_byte_near(sine256 + offset);
volatile long long unsigned int tword_m = (4294967296LL * dfreq) / refclk; // calulate DDS new tuning word
Hello, firstly many thanks at Martin for your useful and interesting work about sine wave generation on Arduino!I build it in the same way and amplified the sinevawe with the TDA7052. It works fine. But now I need also to regulate the volume with a digital potentiometer.I found this example:http://www.instructables.com/id/Digital-Potentiometer-MCP41100-and-Arduino/all/?lang=deUnfortunately the ISP communication needs PIN 11 for MOSI.http://arduino.cc/de/Reference/SPITo solve this problem, I tried to change the frequency output pin11 to pin3,pinMode(11, OUTPUT); // pin11= PWM output / frequency output nowpinMode(3, OUTPUT); // pin3= PWM output / frequency outputTimer 2 is assigned to pin11 and pin3http://www.micha.st/?Arduino-Notizbuch:Erfahrungen:Never_touch_timer0, but it didn't work. Are there also other changes to make? Maybe anyone knows what to do?