if i received real time message eg. 0xFE and store it in variable "Midi_In",
the result is 0x00. what goes wrong? All messages 0xF0 and below no problem.
Program-Change message are 2 bytes, in running mode 1 byte only.
Realtime message is every time only 1 byte, the status byte. Maybe a time out problem?
Using PIC 12F1840, UART hardware on Ch1.
The custom code for midi receive:
Code: Select all
MX_UINT8 idx, current_data = 0;
%a_Received_MIDI[0] = 0; //Reset Status Byte
%a_Received_MIDI[3] = 0; //Reset Real Time Message
for (idx = 1; idx < 3; idx++)
{
%a_Received_MIDI[idx] = 255; //Clear old MIDI data
}
for (idx = 0; idx < 3; idx++)
{
current_data = %a_UART_Receive(cTimeout);
if (current_data == 255)
return 0; //Timeout Occurred
if (current_data >= 0xf8) //If real time message received
%a_Received_MIDI[3] = current_data;
else //Else normal message / data
%a_Received_MIDI[idx] = current_data;
}
return %a_Received_MIDI[0]; //Return status byte
thanks
Dirk
Edit: the same problem on all flowcode versions