"JP.BROWN" wrote:
Hi Jose, could you tell us what your midi to parallel convertor was
designed for and what type of C lang. you used.
Thank's  John.
Yes,
This is a dumb PIC application for somebody who needs to read
4 x serial MIDI inputs and don't have 4 UARTS. With the aid of
4x PIC16C505's and probably 4x 74HC244's plus some I/O lines
can read those MIDI inputs as bytes through an 8 bit bus.
The READY/ACK logic may be inverted to let the Master MCU
use an 74HC138 as the ACK\. I prefer 74HC259's when possible
because they are more flexible.
Since each serial byte takes 10*32us=320us to be read, there is
enough time for the master MCU to check the 4 READY's pins
and read them. There is also an Overrun pin with ACK logic to
report errors.

This was envisioned by me since the 1st <4 x serial MIDI> post
has no clear information about the hardware. I just wrote this
because it's very simple and I had experience with MIDI.

The code is written in a C "dialect" for the CC5X compiler.
You can download a free version from
http://www.bknd.com/cc5x/d ownload.shtml
It will generate up to 1K code for the midrange PICmicro
devices:
      12 bits PIC core : PIC12CXXX, PIC16C5X, PIC16C5XX
      14 bits PIC core : PIC12CXXX, PIC14CXXX, PIC16CXXX, PIC16F8XX

I've been using this compiler because the generated code is
very good and the RAM usage is the best I've seen.
You may generate all Microchip instructions with intrinsic C
functions available. It's the case in the source with:
x = rr(rxBuf);
It will generate:
    rrf     rxBuf,W
    movwf   x
Cheers,
JSouto
 
 

While it's getting the next serial byte it checks the ACK input pin
and when the ACK has gone it drops the READY pin