Need help with programming OX2 -> MM^ -> BLDC

You are not successfully sending data to the Maestro.

This line of code:

send_buffer[0] = 0x84, 0x00, 0x03, 0xE0;  // Wrong in two ways

is equivalent to this:

send_buffer[0] = 0x84;  // Only sets one byte

You should familiarize yourself with C’s comma operator, or just stop using it because it is not useful in most cases.

The other thing that’s wrong with that code is that for some reason your third data byte (0xE0) has the MSB set, so the Maestro will interpret it as a command. You should read the Maestro serial command protocols documentation to learn about data bytes vs. command bytes.

Our Maestro documentation for serial servo commands has example C code that shows how you would populate an array of bytes:

serialBytes[0] = 0x84; // Command byte: Set Target.  
serialBytes[1] = channel; // First data byte holds channel number.  
serialBytes[2] = target & 0x7F; // Second byte holds the lower 7 bits of target.  
serialBytes[3] = (target >> 7) & 0x7F;   // Third data byte holds the bits 7-13 of target.

Also, please make sure that you have configured your Maestro to use the same baud rate that you specified in your code. By default, the Maestro auto-detects the baud rate but your code isn’t sending it any 0xAA bytes so it can’t detect it.

Actually, I recommend using a higher baud rate like 115200 because both the Maestro and the X2 can handle it, but its probably better to get it working at 9600 first and then change it.

If your system still isn’t working after this advice, please simplify your code to the simplest possible thing that doesn’t work (it should only send one command), and post it again, along with all your relevant Maestro configuration settings.

–David