Question about Serial Communication with MSP

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
chung2552
Posts: 8
Joined: Mon Jun 30, 2014 9:49 am

Question about Serial Communication with MSP

Post by chung2552 »

Hello everyone

I'm a Korean student studying quadcopter and I have a question about serial communication with Multiwii Serial Protocol.

Now I'm trying to get and give a data from PC to quadcopter. So I made a code with MSP in visual studio.

In that code, I give a data set, [0x24, 0x4d, 0x3c, 0x00, 0x68, 0x68, 0x00] which is $M<[data length][cmdMSP][data][checksum] and cmdMSP =0x68 is a command "MSP_RC".

According to Multiwii Serial Protocol(http://www.multiwii.com/wiki/index.php? ... l_Protocol), when a cmmand "MSP_RC" operate, mutiwii gives 16*uint16 rcData to PC.

But I get this data set, [$M> 10 69 {e9 5 d9 5 d4 5 e9 3 e6 3 dc 5 dc 5 dc 5} 4e].

firstly, as you see, data length is ten. I don't think it is right. I think data length should be 32( 16*2).

secondly, when I convert a data from HEX to DEC, I get this. [e9 05] = 59653, [d9 05] = 55557, [d4 05] = 54277 and so on... so are they right values??

I need your, geniuses's help! Could you give me some ideas???

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: Question about Serial Communication with MSP

Post by ezio »

chung2552 wrote:Hello everyone

I'm a Korean student studying quadcopter and I have a question about serial communication with Multiwii Serial Protocol.

Now I'm trying to get and give a data from PC to quadcopter. So I made a code with MSP in visual studio.

In that code, I give a data set, [0x24, 0x4d, 0x3c, 0x00, 0x68, 0x68, 0x00] which is $M<[data length][cmdMSP][data][checksum] and cmdMSP =0x68 is a command "MSP_RC".

According to Multiwii Serial Protocol(http://www.multiwii.com/wiki/index.php? ... l_Protocol), when a cmmand "MSP_RC" operate, mutiwii gives 16*uint16 rcData to PC.

But I get this data set, [$M> 10 69 {e9 5 d9 5 d4 5 e9 3 e6 3 dc 5 dc 5 dc 5} 4e].

firstly, as you see, data length is ten. I don't think it is right. I think data length should be 32( 16*2).

secondly, when I convert a data from HEX to DEC, I get this. [e9 05] = 59653, [d9 05] = 55557, [d4 05] = 54277 and so on... so are they right values??

I need your, geniuses's help! Could you give me some ideas???


Data length looks ok for me.
Hex 10 = dec 16
8channels * 2 bytes = 16
E9 05 swap the bytes 05e9=1513

Post Reply