Arduino uno + atmega328 standalone + Midi Rx

Hello guys,

I think it s the most appropriate place to put this question but maybie it s more affiliate to the programming....

Here is my problem.

I did a midi reciever/transmitter with my arduino uno rev3. I m using the midi libraries with optocoupler etc.
Everything is working well !

Then I want to create a standalone box with an atmega 328
(http://fr.farnell.com/jsp/search/productdetail.jsp?SKU=1848694)
with 16mhz crystal condos etc.

I m using my uno as isp programer with arduinoisp Sketch.

I test the blink sketchon the standalone. It s working.

So I decide to send my midi sketch to my standalone mcu.

To test my sketch, I lit a light each time I recieve a "Note on" pressing a key on my keyboard.

Here is the strange behavior :
I press the key on my keyboard and get an input (the light is on) only when I press a lot of keys in a same time or pressing during few seconds lot of keys.

To test my hardware, I upload the skecth in the uno board and link the RX to the midi IN and It s working (the light is on for every note.
Here is an interesting behavior : I link the midi IN to the both RX (uno board and atmega) and the both light are on for every note !! (to be correct, the uno board light is ON since the first "Note ON", the light of the atmega standalone is ON few key pressed after )
When I disconnect the RX of the uno board, the standalone has his strange behavior again

The atmega recieve the message but not for every note, so I was thinking of baudrate problem (it s set at 31250) :

  • the fuse has to be set correctly but I have good settings (I think) FF FD 05
  • the crystal seems to be ok too.

But I repeat, If I connect the both RX to the midi IN, after a few note on, the both light are on, so the skecth is working perfectly for the both MCU.

The "after a few note" could be the key. A condo problem ? but then were ? I only have the 2 for crystal that's all !
And I tried with an other atemga328 mcu thinking the one I was using was dead. Same issue.

(I 'm using a 11Kohms resistor instead of a 10Kohms for the reset button, but I really don't think it s the problem)

I really don't understand what's happening.
I m pretty new to the arduino World, I may have done a big mistake but don't see were.

Can someone help me ?

Thanks a lot for listening

Dei