When using the s/f MIDI shield, the default serial connection is h/w to pins 0 and 1. If I access this in a sketch, it seems that the USB serial is active at the same time, i.e., data written to one is also written to the other. Questions:
Does h/w serial always use both the USB and h/w pins 0, 1? If so, how is data to be read from the interface handled (differentiated) between the two?
Is there a way to run each h/w interface separately?
Can I use s/w serial on pins 8, 9 and h/w serial on pins 0, 1, each with different communications?
The switch ONLY disconnect the hardware RX. The TX is not switched and also connected through the solder pads. To set the RX/input to s/w you will have to "play"with SJ1 and SJ2 solder pats. SJ1 determines the RX, where the SJ2 determines the TX. By default the middle solder-pad is connected to the hardware pin (0 or 1). You will have to cut out the link in SJ1 between the 2 (very carefully with a sharp knife like a Stanley mess) and then solder a connection between the middle pad and and the other pad. (see the schematics and hookup guide)
So, the rcv side (SJ1) can be switched hard or soft (and then read using the appropriate call), but the xmit side (SJ2), if set to hard, will always send to pin 1 and USB, or if set to soft, will send to pin 9 (again, using the appropriate call).
Pin 0/rx is going to the switch (run/prog). When set to “run” it is then connected with right pad of the SJ1, which is by default connected with a tin line to the pad in the middle. If you want to use SoftSerial pin 8 instead, cut the thin line and connect the left pad with the middle.
Pin 1/tx is connected with the right pad of SJ2, which is by default connected with a tin line to the pad in the middle.If you want to use SoftSerial pin 9 instead, cut the thin line and connect the left pad with the middle.
The RX and TX for the USB (coming from the ATMEGA16U2 to which the USB is connected) are hardware connected with a resistor to the pin 0 and pin 1. The ATMEGA328 does not have a separate USB connection. Whatever is received on P0 is automatically going to both the ATMEGA328 and the USB.