Question: Problem 3. The Musical Instrument Digital Interface (MIDI) uses serial communication at 31250 bits/second with 1 start bit, 8 data bits, and 1 stop bit.
Problem 3. The Musical Instrument Digital Interface (MIDI) uses serial communication at 31250 bits/second with 1 start bit, 8 data bits, and 1 stop bit. We want to use a PIC24FJ64GA002 microcontroller to communicate with a MIDI device via UART module 1. Assume the microcontroller has a 16 MHz instruction clock frequency, Fcy .
(a) For the given bit rate what is the value we should write to U1BRG? What is the corresponding error if we use this value? (b) Show the C code used to initialize the UART for transmitting this data. (c) A C function with the function prototype, \void send(unsigned char DataByte)" will be used to send each byte of data. Write the code for this function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
