I would get the two talking directly without any MIDI interface. Just connect the TX from the PIC running the transmission code, to the RX on the receiving PIC using a simple jumper wire. If you need to send data back the connect the receiving PICs TX pin to the RX pin on the other PIC. I would then use the HSEROUT and HSERIN commands to send data.
You could write a short test routine so that the receiving PIC sends a character to the transmitting PIC when its ready to receive data (say by pressing a button), the transmission is made and the data displayed on the LCD.
So your transmission PIC has something like
You would then have your receiving PIC set up so that when you want to receive data it sends a Q to the transmitting PIC. The transmitting PIC is always looking at the serial port buffer to see if there is something in it, and when it finds something jumps to the comms subroutine, which checks to see what character has been received an for a match. If its Q then it transmits the data. You could use other characters to jump to other routines and do other things if you wanted.Code:RCIF VAR PIR1.5 ' USART receive flag GIE VAR INTCON.7 ' Comms TempWD VAR WORD ' temporary WORD variable nTest var byte FOR TempWD = 0 TO 1000 IF RCIF=1 THEN GOTO coms ; Check to see if somethings in the buffer, if there is something goto Comms PAUSE 2 NEXT TempWD coms: HSERIN [nTest] SELECT CASE nTest CASE "Q" ; if Q then send data GOTO Term_TX: Term_TX Hserout [DEC3 insert variable here] ; sends three digits of variable eg 123
The only caveat here is that I've only ever sent numeric data this way. Sending ASCII or strings may need more work.
Whilst the code is clunky it could always be tidied up and made more efficient once you have the two talking.




Bookmarks