AnsweredAssumed Answered

Setting up UART RX on FRDM-K64F for MIDI Communications?

Question asked by nicholasdiggle on Mar 27, 2016
Latest reply on Mar 28, 2016 by nicholasdiggle

I'm in the process of programming a MIDI input function, though the use of the K64F's UART capabilities.

 

The specs for the MIDI protocol are below:

Baudrate of 31250 (I found that using a baudrate divisor of 41, and a baudrate fine-adjust of 30 gave me the closest value at 31254.1), a HIGH start-bit, LOW stop-bit, 8 data bits between the start/stop bits, LSB first in data sequence; pretty similar what UART already is, except that the 5-pin MIDI interface is current driven, but I've got the optocoupler circuitry for that already taken care of. I'm trying to generate an interrupt each time new data is received by the UART interface, so that I can trigger other actions in-software.

 

If anyone could guide me on how to set up UART RX on the K64F for the specs I described above (through use of processor expert, baremetal code or anything else, really), that would clear things up a lot. I'm a bit of a newcomer to using UART, so any help would be appreciated.

Outcomes