I'm fully new here, this is my first post.
I really would like to learn Arduino, so I've bought a few Nano's, and built a synth module, based on the Ginko Grains :
Actually, my module is a bit different, because I have a CV filter/booster circuit on Pin5 and Pin6 to boost the levels for modular use.
My problem is that the Ginko codes using Pin11 as the output and I really don't know, how to change it to Pin5 or Pin6
Could you please take a look?
Code :
// Changing these will also requires rewriting audioOn()
// Output is on pin 11 #define PWM_PIN 11 #define PWM_VALUE OCR2A #define LED_PIN 13 #define LED_PORT PORTB #define LED_BIT 5 #define PWM_INTERRUPT TIMER2_OVF_vect
void audioOn() {
// Set up PWM to 31.25kHz, phase accurate
TCCR2A = _BV(COM2A1) | _BV(WGM20);
TCCR2B = _BV(CS20);
TIMSK2 = _BV(TOIE2);
}
You need to study the Atmel datasheet for the Atmega 328.
There are 3 different hardware Timers and each one is linked to a pair of I/O pins. Your code uses Timer2 and you will need to change it to use the Timer that is linked to pins 5 and 6.
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Robin2:
You need to study the Atmel datasheet for the Atmega 328.
There are 3 different hardware Timers and each one is linked to a pair of I/O pins. Your code uses Timer2 and you will need to change it to use the Timer that is linked to pins 5 and 6.
...R
And the bad news is all 3 timers are different (although similar).
note that timer0 and timer2 are different in detail despite being both 8 bit, and that if you
reprogram timer0 then millis(), micros(), delay() no longer work as expected.