Thread Tools
Aug 03, 2011, 10:11 PM
Registered User
Thread OP
Discussion

DSM2 compatible TX module


Hi all,
Thanks for joining me here if you got here from the Radios thread. Anyways, over the last 6 months I have been able to put together enough information about the DSM2 protocol to create my own compatible transmitter module and have successfully tested it it with a variety of real McCoy Spektrum RX's and a few HK orange types too. I have put a few nice features into my module which is based on a PIC16F1828 chip. I originally started with a 16F877 but soon realized that I needed more horsepower and 2 more pins. Right now, my module will accept from 1 to 9 channels of PPM information, either positive or negative shift, and convert it into an appropriate 10 bit resolution DSM2 coded signal that, so far has been bench tested with 3 different AR7000's, 2 AR6100's, 1 AR500, 2 6 channel orange RX, and the little DSM2 case-less 6 channel RX sold by Hobby King. All bind to the module fine and perform normally. I have also added the ability to use a serial input format like other Spektrum transmitters (LP5DSM, DX5e...) for up to 14 proportional channels but I may need to develop my own DSM2 RX to test that out fully. My testing included the PPM signals from a Futaba Skysport 6A and a JR XP7202 and the serial signal from an LP5DSM. My initial flight testing was with a little home-made foamy parkflier and an AR6100 but I have now moved on to a Parkzone Typhoon II with a AR500 RX. Everything is looking good.

I have used both a Unigen Leto-LPA 2.4Ghz module and an Atraflex AWA24S module in my testing so far and both perform fine. I need to conduct some extreme range tests and fly with an AR7000 to use the data logging ability for comparison testing but I don't foresee any issues. Both the Unigen and Artaflex modules have more than enough RF power to reach over 1 mile in my estimation. If I was to produce the modules in any quantity, the Artaflex module would have to be used as the Unigen module is no longer available except perhaps in large quantities.

I do have a question though. Would anybody be interested in buying any of these modules? I estimate the price to be in the $55-$65 range which would give one the ability to convert just about any PPM based transmitter over to DSM2. Personally, I think just about all major brand RC radio gear is grossly overpriced and Spektrum leads the pack, in my opinion. I balk at spending $200+ dollars on a new TX when I have a perfectly fine 6 or 7 channel TX that can be adapted to do the job. Also, for those that wish to add DSM2 to a custom transmitter design, my module could fit that application too.

OK, enough of the sales pitch. The DSM2 protocol boils down to using a predetermined table of Psuedo Random noise codes to encode the data sent from the TX to the RX. Which codes to use from the table is determined by 2 things: 1st by 3 of the 6 bytes in the MFG_ID of the Cypress CYRF6936 Wireless USB RF chip that ALL Spektrum gear uses and 2nd: by the channel the TX is using at any given time. The table is 9 columns wide by 5 rows high. Each 'cell' in the table has an 8 byte PN code in it for a total of 45 unique codes. When a DSM2 TX is powered on, the MFG_ID code is read from the CYRF6936 chip and some simple math is done to come up with a value between 0 and 7. This value determines which of 8 preset combinations of columns in the table will be used during transmission. For instance, if the result of the math is 2 then column 3 is used the SOP PN code and columns 0 and 1 are used for the 16 byte DATA PN code. The 5 codes in a column are assigned to channels in sequential order. Row 0 is channel 0, row 2 is channel 2, row 3 is channel 3. etc...and it wraps back to row 0 at channel 5 and goes on from there up to channel 80. Although there are a huge number of different combinations using this scheme, Spektrum chose to only implement 8 combinations in DSM2. At power up, a DSM2 TX scans the band and locates 2 'quiet' channels to use, then it makes sure that no other DSM2 TX is within range by testing the channel. It does this by rotating through all PN codes in a row assigned to that channel by 'listening' to the channel in RX mode. Once both channels passes this test, its off to the races. If I am a 7 channel DX7 then I send 7 channels of data and the GUID in a packet on channel A then do it again 4ms later on channel B. If I am an 9 channel DSM2 radio then I do the 7 channel thing above then wait 7.164ms and send channels 8 and 9 in another packet on channel A then wait 4ms and send it again on channel B.

The binding process uses it own unique PN code regardless of the channel used. I have been unable to decode the 2-way binding process as I do not have a higher end DSM2 radio to do it with.

Any comments?
Sign up now
to remove ads between posts
Aug 04, 2011, 12:12 AM
Registered User
nuevo's Avatar
Quote:
Originally Posted by hammer22
Any comments?
Only one.

Wow!
Aug 04, 2011, 06:24 AM
Registered User
I second that notion.
Aug 04, 2011, 09:45 AM
Up up and away!
FpvKiwi's Avatar
Congratulations to your great work!

Quote:
Originally Posted by hammer22
I have also added the ability to use a serial input format like other Spektrum transmitters (LP5DSM, DX5e...) for up to 14 proportional channels but I may need to develop my own DSM2 RX to test that out fully.
This serial format, care to describe it or give a link? Is it an interface from Tx to the module?

Regarding sales, it's tempting but I don't need one now. I did get a replacement module for Futaba Tx and the cheapest shop selling it without a Rx was $45 from Esprit Model. They don't list a price at the moment, though. Prices with an Rx are $110 or $180 depending on Rx. I think they don't even sell the module without Rx in Europe anymore.
Aug 04, 2011, 10:43 AM
Registered User
Thread OP
Thanks for the kinds words. The serial format is a link from the transmitter encoder to the module. Most Spektrum radios these days do not generate a PPM signal except for the trainer port. Servo position data to be transmitted is sent to the RF board in a serial format. The LP5DSM, DX5e, and others use this method. The baud rate is 125K, 8N1 and it is TTL level. My module uses the same format which is 2 bytes per channel with the first 2 bytes of a 'frame' of data equal to 0x00. The servo position is a 10 bit value with 0x0000 corresponding to a PPM pulse width of 0.8ms and 0x03FF equal to a PPM pulse with of 2.2ms. Center position is 0x0200 = 1.5ms pulse These are the pulse width limits from my XP7202 radio and they seemed appropriate. Yes, I know that 11 bits per channel is also used in some Spektrum radios but I need to decode more of the binding packet data in order to take advantage of this. All of my work is based on what I have learned from a Spektrum DM9 module and it has a fixed mode of operation (9 channels, 10 bit resolution, no 2 way binding)

The channel order of the incoming serial data is as follows:

Byte 1 = 0x00
byte 2 = 0x00
byte 3 = Throttle High Byte
byte 4 = Throttle Low Byte
byte 5 = Ail High Byte
byte 6 = Ail Low Byte
byte 7 = Elev High Byte
byte 8 = Elev Low Byte
byte 9 = Rudder High Byte
byte 10 = Rudder Low Byte
byte 11 = Flaps High Byte
byte 12 = Flaps Low Byte
byte 13 = Gear High Byte
byte 14 = Gear Low Byte
byte 15 = Aux1 High Byte
byte 16 = Aux1 Low Byte
byte 17 = Aux2 High Byte
byte 18 = Aux2 Low Byte
byte 19 = Aux3 High Byte
byte 20 = Aux3 Low Byte
etc... up to 14 channels. Again, this part is not fully tested as the RX with the most channels I have is the AR7000. I have tested the serial input mode successfully with 6 channels so far.

Also, there is no need to send 14 channels worth of data. You only send as many channels as you need to the module. However, they must be sent in a regularly occurring burst every 22ms just like a PPM frame. The timing of the DSM2 transmissions is based on the start of the incoming PPM frame or first received serial character.
Last edited by hammer22; Aug 04, 2011 at 12:46 PM.
Aug 04, 2011, 11:07 AM
Inciting Riots
village_idiot's Avatar
DM8 module uses a PPM frame of 25ms so things might be slightly different and you might be able to use a longer timeframe for sending the data.

Also there is the 11ms time that things like the DX7se offer so again it may not be a hard and fast rule, and there are only certain receivers that can handle the fast frames.

At any rate this is good info, please keep the details coming and save them somewhere in case someone decides to try and block the information.
Aug 04, 2011, 12:56 PM
Registered User
Thread OP
Village Idiot, thanks.
Yes, I have all of this well documented and in multiple places with instructions to publish across the internet in case of my disappearance . The Futaba Skysport 6A I have has a frame rate of right around 20ms and the 3 JR sets I have operate with 22.5ms so I think you are right about the frame rate not being that critical. What I have found is that the timing between the 4 individual data transmissions (in the case of the DM9) that make up a complete DSM2 'frame' is pretty tight and things do not work too well if there is too much deviation between the individual packets.
Aug 05, 2011, 09:39 AM
Up up and away!
FpvKiwi's Avatar
Interesting. Would be fun to interface a module sometime when I have the time. Seems like different Tx'es require some software adaptations.
(Actually I just found a little of the same info in the other DIY thread.)
Aug 05, 2011, 10:00 AM
Registered User
Thread OP
FpvKiwi, actually my software doesn't care what the first 2 bytes in the serial data stream are. It just ignores them. They could be anything. Also, its not necessary to embed the channel numbers in the data either. As long as the channel order is obeyed. If it isn't then the outputs at the RX will be different.
Aug 11, 2011, 04:10 PM
Guru Apprentice
osfcman's Avatar
VERY Interesting!!!

I did a DIY R/C system with the 6936 chips (Leto-LPA + Leto-M), but I used a completely custom protocol and bind method.
It would be REALLY useful to know the format of data coming from the Spekttum TX to the receiver, especially the bind stuff. If I had that I could use my DIY with my regular DSM2 receivers.

If you dont know the bind process, how can you use the TX with your receivers?
How do you then know the channels, SOP, PN's e.t.c.?

Would VERY much appreciate any code and infomation you have on this subject.
Aug 16, 2011, 03:41 AM
Registered User
hello,
im very interesiting in one unit for my
turnigy 9x transmitter.
i live in germany, hope thats not a problem with shipment
Aug 16, 2011, 09:33 PM
Registered User
Thread OP
xxx
Last edited by hammer22; Sep 01, 2011 at 08:50 PM.
Aug 16, 2011, 10:08 PM
Registered User
Thread OP
xxx
Last edited by hammer22; Aug 31, 2011 at 09:10 AM.
Aug 16, 2011, 10:17 PM
Registered User
Thread OP
I'm trying to figure out how to post the PN code table so that its readable in this format.
Aug 17, 2011, 11:22 AM
AndyKunz's Avatar
Use the "code" tag.


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Sold Spektrum DM9 DSM2 TX Module for JR New gliders Aircraft - General - Radio Equipment (FS/W) 18 Jul 02, 2011 09:46 AM
Wanted Spektrum TX module for JR compatible TX carlosadc Aircraft - General - Radio Equipment (FS/W) 1 Jun 30, 2011 12:54 AM
Found Spektrum DSM2 DM9 Air Module w/AR7000 JR-Compatible boggintuff Aircraft - General - Radio Equipment (FS/W) 1 Dec 19, 2009 09:24 AM
Wanted Futaba-Compatible DSM2 Module PiperCub49 Aircraft - General - Radio Equipment (FS/W) 3 Aug 22, 2009 05:21 PM
Discussion Spektrum DSM2 AIR MODULE FUT-COMPATIBLE tuheli Mexico 4 Aug 31, 2007 02:20 PM