From c68abcfd7f26a84609f243b71986061b61f4c772 Mon Sep 17 00:00:00 2001 From: James Game Date: Sat, 1 Feb 2014 18:02:41 +0100 Subject: [PATCH 1/5] Create README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..68033bb --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +ArduinoSynth +============ + +This is a fork of Illutron's ArduinoSynth repo. + +What's to be added is: + +-Basic documentation +-Compatibility with other boards (originally only compatible with ATmega328/128 based Arduino boards) +-Choosing output pin manually, although only PWM (originally fixed to pin 6) From 4689b7bbef0bc215ee7ae8d86a13f2c02d0f7eec Mon Sep 17 00:00:00 2001 From: James Game Date: Sat, 1 Feb 2014 18:06:52 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68033bb..ddc9a77 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,6 @@ This is a fork of Illutron's ArduinoSynth repo. What's to be added is: --Basic documentation --Compatibility with other boards (originally only compatible with ATmega328/128 based Arduino boards) +-Basic documentation +-Compatibility with other boards (originally only compatible with ATmega328/128 based Arduino boards) -Choosing output pin manually, although only PWM (originally fixed to pin 6) From dffee17bcf25a649bf590584f355d2443806da14 Mon Sep 17 00:00:00 2001 From: James Game Date: Sat, 1 Feb 2014 18:13:12 +0100 Subject: [PATCH 3/5] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index e58c07cb6f71d70af9e9b19a7f7094911767378d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AiqG5S?wSrf8uT(c|K|NUPX-@DM@;Zwf8+U_}!mO&}ztNi9;V@msw6Iew2b zyIZkT1uueS9?ZVU&de_R5_YoyAe^z^0H^|hg+^Q`WAg>5dUq8_;T~eh;Pd;7!G*}1q(d)CJj{CahEbSi_4=DA6iaLC8x~@#-wR_unK;Qf z_S4HwkW4zEf9tuUE9GZyHclOPq#_q?7GOmA-6V<7@0;vi=x4!ob!R$l95rk5_+VC( z(^jiqlg-2CY*t28U##uD{gbnBL!*hB@=ZAIObw+WN!~@Klk1(%f zW(8OQR$%oNFgu^Mx%x}x6|w@Xz%Lb`{XwD;+lF(^YU{v;ejh1bA|{|ucL`!?*fyMN z#t1^_Qe<5!%oRiEa_pBT&o-QE*5x47%s7sjS(qD&P_tvdROujW&D^pAtiYlIMg3T% z^Z)ew`~PAQKd}O=z)C3~O6^YD!6liqb!l;Q)=IP+Gy>)2nm Date: Sun, 2 Feb 2014 13:53:19 +0100 Subject: [PATCH 4/5] Added Arduino MEGA(2560) boards compatibility Changed PWM registers for MEGA boards. Board is detected and code adapted at compile time (preprocessor #IF). Code was confirmed running on Arduino MEGA2560 Rev2. --- synthOriginal/the_synth.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/synthOriginal/the_synth.h b/synthOriginal/the_synth.h index 28a484c..50e64ff 100644 --- a/synthOriginal/the_synth.h +++ b/synthOriginal/the_synth.h @@ -116,8 +116,12 @@ SIGNAL(TIMER1_COMPA_vect) //------------------------------- // Synthesizer/audio mixer //------------------------------- - + + #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) //Arduino MEGA(2560) boards + OCR2A=127+ + #else //Arduino ATmega168/328 based boards OCR0A=127+ + #endif (( (((signed char)pgm_read_byte(wavs[0]+((PCW[0]+=FTW[0])>>8))*AMP[0])>>8)+ (((signed char)pgm_read_byte(wavs[1]+((PCW[1]+=FTW[1])>>8))*AMP[1])>>8)+ @@ -282,10 +286,17 @@ void initSynth() SET(TIMSK1,OCIE1A); // | sei(); //-+ + #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) //Arduino MEGA(2560) boards + TCCR2A=0x83; //-8 bit audio PWM + TCCR2B=0x01; // | + OCR2A=127; //-+ + SET(DDRB,4); //-PWM pin + #else //Arduino ATmega328/168 based boards TCCR0A=0x83; //-8 bit audio PWM TCCR0B=0x01; // | OCR0A=127; //-+ SET(DDRD,6); //-PWM pin + #endif /* UCSR0A=0x02; //-Set up serial port 31250 UCSR0B=0x18; // | From 1d89074d445b9481722e1012bb94fb9b0ad744e6 Mon Sep 17 00:00:00 2001 From: James Game Date: Sun, 2 Feb 2014 14:05:18 +0100 Subject: [PATCH 5/5] Update README.md Added implemented feature (dacb7f0f7222fe07c87fed1bc5a28b68b89b75ff) and added output pins. --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ddc9a77..8127619 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,13 @@ ArduinoSynth This is a fork of Illutron's ArduinoSynth repo. -What's to be added is: +__Arduino MEGA__ boards: Pin __10__ +__Arduino ATmega328/168 based__ boards (Duemilanove, Uno, etc.): Pin __6__ +__Implemented features:__ +-Compatibility with Arduino MEGA(2560) boards + + +__What's to be added is:__ -Basic documentation --Compatibility with other boards (originally only compatible with ATmega328/128 based Arduino boards) --Choosing output pin manually, although only PWM (originally fixed to pin 6) +-Choosing output pin manually, although only PWM (originally fixed to pin 6)