i have an Arduino Nano project that does some MIDI activites; i have a strange problem: MIDI IN works correctly when the Nano is connected over USB to my pc; when it is powered in standalone DC, MIDI IN does not receive any messages... It's very strange, because all the other functions of my sketch work correctly in either modes (even the MIDI OUT);
MIDI IN and OUT use the D0 and D1 pins on the NANO (not softwareSerial).
Has someone faced a similar problem before or point me to what could be the problem ? The onboard DC is obtained with a 7805 and filtering capacitors (100uF and 100nF), i do not use the Vin on the Nano.
I get the power from a 9V DC adapter, and then from a 7805. Voltages measurements seem to be correct.. I'm using a 4N28 IC as an optocoupler for MIDI IN;
all of the other functions of the sketch work correctly when powered by DC (the board manages some DPDT 5V relays and leds (using several shift registers 74HC595) and pushbuttons attached to the analog inputs of the Nano (i use the 5 buttons on 1 analog pin trick);
there's also an externale EEPROM 24LC512, that also works fine when powered in DC.
For MIDI, i'm using the MIDI25 library; will try tonite to substitute this lib with che conventional Serial.begin(31250) and serial.read()...
Hmm....what pullup resistor value are you using on the 4N28 connected to the D0 pin (MIDI IN)? Maybe it's too high? It should be 330 ohms or in the ballpark.
--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected
Heh...a good lesson on why the Internet is not always right One person cooks up something that sorta works in their specific case, publishes it, then it gets wildly reproduced without verification.
Here's the definitive reference:
When USB-powered, the FTDI chip on the Nano connects to the Rx pin through a 1k resistor which serves to lower the effective pull-up resistance because the 1k resistor acts in parallel with the 3.3k resistor.
--
The QuadRAM shield: add 512 kilobytes of external RAM to your Arduino Mega/Mega2560
Thanks very much sir. I will certainly try this tonite. That document speak really clear !
(BTW, the schematic for the MIDI shield from Sparkfun has no 3k3.... sorry, i could not imagine it was wrong, having found the same values on more projects).