Avelino's PIC page

versión en español

blog


Here I will put some of my PIC microcontroller projects and source codes:


MIDI out test for PIC16F84

An example circuit and source code for testing a MIDI out interface mounted arround PIC16F84. The circuit and the code are based upon published circuits and source code at http://www.audiomulch.com/midipic/.

Here is the source code adapted from this one to run on 4 MHz MCUs.

The PIC generates a NOTE ON message when pressing switch associated to RB0 pin and a NOTE OFF message when pressin switch associated to RB1 pin.

The MIDI stream runs at 31250 bps, thus with a 4MHz clock we have 32 machine cycles per MIDI bit. See the source code for details.

The source was patched by Yamil Saiegh. Previous source code used 35 cycles per MIDI bit, but 32 cycles per MIDI bit is a more accurate value.


Creative Commons License

this work is licensed under a Creative Commons License.