PDA

View Full Version : Discussion Build your own DSM2 transmitter module (its working!)


Pages : [1] 2

TheSteve
Jul 31, 2007, 12:38 AM
I opened up my E-Flite LP5DSM transmitter this evening to have a peak inside. This is the 1mw transmitter that is included with the Blade CX2 Helicopter.
I see the DSM2 transmitter is the size of a postage stamp and has 4 connections. Vcc(3.3volts), ground, serial data in and LED out(I believe)
I did a quick check of the serial data, running it through a level shifter it appears each frame is 14 bytes @ 115200.
EDIT - 115200 is incorrect - see newer posts for updated information

Assuming the data values for each channel can be determined and any checksums they may be adding we could easily take that module and connect it to a PPM decoder from another radio. I already have a PPM decoder that outputs serial data I have been using with an xbee radio system. If I can figure out the data I will adapt the code to drive the 1mw DSM2 module.
Not sure how useful this would really be but if it worked you could buy the LP5DSM, remove the tx module, connect it to a PPM decoder board and use it with your favorite radio for anything you intend to fly within 100 feet.
I'm going to try to do it just for fun so I can fly my Blade CX2 with my Futaba 9CAP.
If anyone else is interested crack open a LP5DSM and check out the serial data - perhaps someone else has already figured it out?

village_idiot
Jul 31, 2007, 01:11 AM
Is the data encrypted inside the 2.4Ghz transceiver chip? If you are going to reverse engineer the data set, you could probably buy the full power chip.

TheSteve
Jul 31, 2007, 01:29 AM
Not sure if the data from the radio controller(Atmel Mega8) to the radio module is encrypted or not. Thats something I'll have to look for when checking the serial data. If it is then I'll give up pretty quick. I have no real interest in the higher power version, not to mention its fully integrated with the microcontroller, this doesn't appear to be.
I'm not a big fan of Spektrum but I got this blade cx2 really cheap so what the heck, it could be a fun project.

TheSteve
Jul 31, 2007, 02:27 AM
Looking at the data further it doesn't appear encrypted.


EDIT - see newer posts for updated information

hilgert
Aug 01, 2007, 11:27 PM
Subscribing...

-Hilgert

Arthur P.
Aug 02, 2007, 03:20 PM
Here's more info on the Spektrum system:

* http://www.anderswallin.net/2005/05/inside-the-dsm-system/
* http://spektrumrc.net/default.aspx
* http://spektrumdx6.com/default.aspx
* http://www.rcgroups.com/forums/showthread.php?t=540007
* http://www.cypress.com/portal/server.pt?space=CommunityPage&control=SetCommunity&CommunityID=209&PageID=259&fid=65&rpn=CYWUSB6953

The link between Rx and Tx is all done by some commercially available transceiver chips on the 2.4GHz. Unless I-m mistaken the link between Rx chips and microprocessor is and I2C link, otherwise a simple direct one wire serial link. The processor must contain firmware to compare the two sets of data received and determine which is best. There is NO PPM output out of the receiver at any point as far as I have been able to determine. I-m actually trying to regenerate a PPM signal by recombining the separate channel PWM outputs (http://www.rc-cam.com/forum/index.php?showtopic=2064&st=20). And special thanks here to Mr. RC-Cam for providing a circuit which hopefully will solve my problem.

Instead of fully copying the Spektrum DX system you could also go complete homebrew, e.g. http://webx.dk/rc/uhf-link2/uhf-link2.htm

TheSteve
Aug 02, 2007, 03:32 PM
Thanks for the links - I'm pretty familiar with the Spektrum system and the Cypress chips they use. The only reason I thought this might be fun is because they appear to use a simple serial connection to the DSM2 module in the transmitter. I already have a homemade full working 2.4Ghz system using Maxstream xbee and xbee pro modules. It works well enough I've sold off my other Spektrum equipment.
I use an Atmel tiny2313 to convert the PPM data to serial data to feed the xbee modules, so it seems with a little rework to the protocol I could directly feed the DSM2 module. This would allow me to use my Futaba 9CAP with my Blade CX2 heli and other small(short range) parkflyers using the really small Spektrum receivers. It would also mean I could stuff an xbee into the Spektrum transmitter if I felt the need.(this is unlikely)
Not sure how much of this I would really use, but I like building stuff so its a fun project. I haven't analyzed the serial data any further since my original post as other projects have taken priority. It does seem like one more evening though and I'll have the data figured out enough to use it.

TheSteve
Aug 04, 2007, 03:26 AM
Decided to play with this a little more this evening and everything fell into place.
I tried a serial port rate of 125K instead of 115200. The data is now super easy to see and follow.

The radio transmits 14 bytes per frame, 6 channels of information, 2 header bytes. Data rate is 125K 8,N,1

Each frame begins with 00 00

Each pair of bytes after that represent the channel and its value. Each channel has a valid range(1024 steps - 10 bit), the channel number is embedded in each pair of bytes.
The radio transmits a 6th channel which is a copy of channel 1 with its endpoints limited. This appears to simply be a function of the radio when in airplane mode, channel 6 is still a full 10 bit channel.

Here is a breakdown of the min and max values for each channel and the valid 10 bit range for each channel.

ch1(left stick, up/down)
bytes 3&4
0056-03AA -measured min/max
10 bit range - 000-3FF

ch2(right stick, left/right)
bytes 5&6
0455-07A9 - measured min/max
10 bit range - 400-7FF

ch3(right stick, up/down)
bytes 7&8
0855-0BA9 - measured min/max
10 bit range - 800-BFF

ch4(left stick, right/left)
bytes 9&10
0C56-0FAA - measured min/max
10 bit range - C00-FFF

ch5(knob, upper right)
bytes 11&12
1056-13AA - measured min/max
10 bit range - 1000-13FF

ch6(copy of throttle channel) - travel limited
bytes 13&14
152A-162A - measured min/max
10 bit range - 1400-17FF

Channel breakdown:

First two bits are 00
Next four bits indicate channel #
remaining 10 bits are serial values for the PPM data

00 00 00 xx xx xx xx xx - ch1 0000-03FF

00 00 01 xx xx xx xx xx - ch2 0400-07FF

00 00 10 xx xx xx xx xx - ch3 0800-0BFF

00 00 11 xx xx xx xx xx - ch4 0C00-0FFF

00 01 00 xx xx xx xx xx - ch5 1000-13FF

00 01 01 xx xx xx xx xx - ch6 1400-17FF

If supported by DSM2 low power module:

00 01 10 xx xx xx xx xx - ch7 1800-1BFF

00 01 11 xx xx xx xx xx - ch8 1C00-1FFF

So there it is, using the above data its now possible to build a 6 channel PPM to serial encoder to interface to the DSM2 module from the LP5DSM radio.


Questions or comments let me know!

village_idiot
Aug 04, 2007, 09:56 AM
Do you think there is any encryption going on in the Cypress chip so that we wouldn't be able to make our own receivers? Would be nice if they "forgot" about this because then people like Castle will start making receivers and get the price wars going!

Also you may be able to turn out a Futaba compatible (PPM) module before Spektrum manages to ship. That module has been pushed back again! I wonder what the problem is?

village_idiot
Aug 04, 2007, 10:38 AM
OK, here's an off topic question.... What is a good, cheap, easy to work with RF link that will fall under FCC part 15 regulations (900Mhz or 2.4Ghz)? The Maxstream boards are too big for my needs, are these Cypress chips worth using? I would need a PPM to serial encoder (there are a few examples posted in these forums), and then a serial to servo PWM on the receiver side (plus the glue to hold things together).

TheSteve
Aug 06, 2007, 04:11 AM
Do you think there is any encryption going on in the Cypress chip so that we wouldn't be able to make our own receivers? Would be nice if they "forgot" about this because then people like Castle will start making receivers and get the price wars going!

Also you may be able to turn out a Futaba compatible (PPM) module before Spektrum manages to ship. That module has been pushed back again! I wonder what the problem is?


Hard to say if they are using any encryption. I know the ground DSM system was trivial to reverse engineer as a third party transmitter can drive the Spektrum ground receivers.

I wouldn't doubt they have added a little something to prevent other companies from building DSM2 compatible receivers. The way to check is to grab a compatible Cypress chip on an eval board and connect the SPI up to a microcontroller and see whats being transmitted over the air.

I have no idea whats taking Spektrum so long, we know they have been doing PPM to serial data for a few years now.
Perhaps its nothing more then waiting for FCC authorization. I know one of the Futaba modules was finally approved last month.

TheSteve
Aug 06, 2007, 04:18 AM
OK, here's an off topic question.... What is a good, cheap, easy to work with RF link that will fall under FCC part 15 regulations (900Mhz or 2.4Ghz)? The Maxstream boards are too big for my needs, are these Cypress chips worth using? I would need a PPM to serial encoder (there are a few examples posted in these forums), and then a serial to servo PWM on the receiver side (plus the glue to hold things together).


There are many options out there, I haven't tried them myself though.

If you're into micro flight then perhaps using the DSM2 module out of LP5DSM with your favorite transmitter and the new AR6300(I think thats the model) micro receiver would be a nice option.
I pondered using the DSM2 module with a 3 channel car radio so that I could use the insanely small/light Spektrum receiver but my two 1/36th scale micro RC trucks already have xbee based receivers in them.(receivers are down to 7 grams or so and could be a little lighter still)

I am running my xbee based system every weekend along side other 2.4Ghz radios with flawless performance.

Anyway it will probably take a week or two but the PPM to serial converter to use my Futaba 9CAP with the DSM2 module is going to be written.
Now I need another empty Futaba transmitter module case...

village_idiot
Aug 06, 2007, 08:45 AM
Now I need another empty Futaba transmitter module case...

I've been going over ebay for those, and people keep selling them for very close to what Servo City sells the Hitec modules for, so I think I may just go ahead and buy a new Hitec for my Plantraco stuff. Wish I hadn't passed up the Servo City $10 sale a few months back :( , I wasn't thinking about prototype materials at that time :o

Kwok_Yu
Aug 06, 2007, 02:00 PM
.. If you're into micro flight then perhaps using the DSM2 module out of LP5DSM with your favorite transmitter and the new AR6300(I think thats the model) micro receiver would be a nice option.
I pondered using the DSM2 module with a 3 channel car radio so that I could use the insanely small/light Spektrum receiver but my two 1/36th scale micro RC trucks already have xbee based receivers in them.(receivers are down to 7 grams or so and could be a little lighter still)

I am running my xbee based system every weekend along side other 2.4Ghz radios with flawless performance.

Anyway it will probably take a week or two but the PPM to serial converter to use my Futaba 9CAP with the DSM2 module is going to be written.
Now I need another empty Futaba transmitter module case...
This may interest you:
http://www.rcgroups.com/forums/showthread.php?t=708854

Anyways, I have a unused LP5DSM sitting here, so it will be interesting what you come up with.

-Kwok

ccdengr
Aug 10, 2007, 12:13 AM
Decided to play with this a little more this evening and everything fell into place.

Would it be possible to rerun your channel survey with the CCPM switch set? That's DIP switch 2 on, I believe, and possibly you may need to set DIP 1 to off. I'm curious to see if it'd be possible to fly a CCPM heli in normal mode with linear throttle and pitch curves.

There are apparently some pads inside that might switch to idle-up, but I'll let that wait.

Thanks!

ccdengr
Aug 10, 2007, 12:38 AM
Would it be possible to rerun your channel survey with the CCPM switch set?
BTW, what I'd hope/expect is that moving the left stick up would increase channel 1 (throttle) up to mid-stick, and then increase channels 1, 2, 3, and 6 thereafter, and that moving the right stick left-right and up-down would change channels 2, 3, and 6 in some combination (120 degree CCPM mixing).

TheSteve
Aug 10, 2007, 05:35 AM
Wouldn't it be easier to plug servos into the receiver instead of looking at serial data?

ccdengr
Aug 10, 2007, 09:55 AM
Wouldn't it be easier to plug servos into the receiver instead of looking at serial data?
Sure, if I had a receiver like an AR6100, but all I have at the moment is a CX2 4-in-1, where I don't think I can get at the throttle channel in PPM form. Didn't want to buy one without proof-of-concept. It just sounded like you had a simple setup to look at the serial data, but I could imagine your previous characterization took more work than you'd want to duplicate. Thanks anyway, I really appreciate your efforts!

TheSteve
Aug 11, 2007, 12:26 AM
Was looking at the serial output for some other testing tonight so I tried the various dip switches. From what I can see there is no mixing implemented in software.
In the default setup channel 6 tracks the left stick with less travel. In any other setting channel 6 doesn't follow the left stick at all, no other channels do either.
DIP 9 is channel 5 reverse
DIP 10 is channel 6 reverse

TheSteve
Aug 29, 2007, 01:03 AM
I finally got around to building the hardware needed to convert the PPM data to the serial stream for the DSM2 module. Here are a few pictures of the new TX module. The hardware is outputting serial data from the PPM stream using code written for an Xbee at the moment. As you can see the pcb is a one off using perfboard and through-hole components. The CPU is an Atmel Tiny2313 clocked at 4Mhz. There is the standard programming header (10 pin) as well as a set of 8 sockets which are accessible through the original crystal hole. These were added for compatibility with my original Xbee Pro tx module. Using the 8 pins I can reprogram the Atmel as well as program and flash an Xbee without opening the case. The pcb was designed such that an Xbee Pro or the Spektrum DSM2 module from the LP5DSM will fit just fine. The power supply is currently only good enough for the low power DSM2 module but will be upgraded after Digikey delivers parts tomorrow. There is also a transistor driver to pull the RF sense pin low which will enable the LED on the front of the 9CAP. If used with the Spektrum DSM2 module this will be connected where the LP5DSM LED is normally connected, if connected to an Xbee Pro I would drive this with an output from the Atmel. Both plastic cases and the 5 pin socket connector were robbed from existing Futaba tx modules. My original Xbee Pro module has the antenna connector on the back(along with a bind button and two LEDS) as its used with a pistol grip surface radio. The new module has a small plastic project box attached to it which allows the antenna to mount on the top. Even though its close to the module release clip there are no problems getting the module out and a 2.4Ghz half wave dipole fits perfectly with a good angle. The final DSM2 compatible serial software should be done in a few days so I can give it a proper test and fully install the DSM2 pcb.
I'll take more pictures and post an update when thats done!

village_idiot
Aug 29, 2007, 09:41 AM
Did you find a way to stop the "no rf" beep for the 9C? I'd like to connect my Plantraco Monolith LED the same way, but it flashes during use, and I don't want the constant beep.

That's a pretty clever use of the hole for the crystal, I don't think I would have thought of that.

TheSteve
Aug 29, 2007, 12:44 PM
I wasn't too worried about the no RF alert as the LED from the LP5DSM only flashes for a few seconds at power on while its in binding mode. It will cause the no RF alert to go off for a few seconds but then it will stop. You're better off not powering on the receiver while the transmitter is in binding mode so I figure the alert will tell me when I'm good to power on the receiver.
Using the crystal hole has an even larger advantage on my Futaba 3PJsuper pistol grip radio as it was designed to allow the end user to swap the crystal without removing the module. This has enabled me to monitor serial/debug data while the radio is running by plugging a cable in.

Zeta Phoenix
Aug 30, 2007, 05:20 PM
I've been going over ebay for those, and people keep selling them for very close to what Servo City sells the Hitec modules for, so I think I may just go ahead and buy a new Hitec for my Plantraco stuff. Wish I hadn't passed up the Servo City $10 sale a few months back :( , I wasn't thinking about prototype materials at that time :o


What do you search for? All my keywords resulted in nothing.

Its great to see someone else came up with the same idea of using the X1OEMTX board (TX board in LP5DSM) to make their own DSM2 TX.

Steve, how close are you to releasing the software? Do you need beta testers? I want to build a module so I can fly my CX2 with my Optic 6.

-Jon

village_idiot
Aug 30, 2007, 07:17 PM
I always just search for "futaba module", but it looks like there isn't much available right now.

TheSteve
Sep 04, 2007, 06:22 PM
Steve, how close are you to releasing the software? Do you need beta testers? I want to build a module so I can fly my CX2 with my Optic 6.

-Jon

I will hopefully be flying a Heli with it this evening.
I will have to do some testing and fine tuning before any release.

TheSteve
Sep 05, 2007, 01:46 AM
It works!!!

I hovered my blade CX2 in the kitchen for 2 minutes or so.(yes yes hovering a blade CX2 is nearly trivial but its a *really* small kitchen and the wife was watching to make sure her kitchen was unharmed)

I had to add a second transistor to invert the LED output from the 2.4Ghz module. The "RF Good" indicator on the 9CAP works perfectly now. When you power it on it blinks(bind mode) just like the original LP5DSM did and then goes solid on when it exits bind mode. The 9CAP NO RF alarm goes off twice during this time because its input is blinking which is perfect, the alarm goes off just as bind mode is finished.
We also have two LED outputs on the Atmel itself, one is a power on self test LED so you know the Atmel is running, the second indicates its receiving PPM data. I didn't bother adding external LEDs for these, using the RF good LED in the 9CAP already verifies everything is working.

The Atmel tiny2313 is clocked at 4Mhz which gives 250ns or 4096 step resolution(same as XPS!, 1/4 the clock though, gotta love Atmel) The data is then shifted two bits(or divided by 4) to give 1us resolution(1024 steps) which is what the LP5DSM module requires. We then reorder the channels so they match what the LP5DSM uses(not like its easy to just unplug everything in the Blade CX2 4in1 unit to change the channel order) Finally its all directed out the UART at 125K. We are currently dumping PPM channels 7 and 8 but who knows, they might work. I'd need a 7 or 8 channel Spektrum receiver to try it. The code change would be very simple. We have limits in place so the proper 1024 bit values cannot be exceeded. The only possible way to generate an error right now we can think of would be to plug the module into a radio providing fewer then 6 PPM channels. We could add error checking for that as well if needed.
As the code is it should work in any Futaba module radio, and any other radio with the same channel layout and polarity PPM data.
I will do a more extensive range test and fly a few battery packs outdoors tomorrow.
So far though I am very pleased!

Next project is to build a third module with an xbee pro in it for the 9CAP to use with our 8 channel xbee receiver. My current xbee pro module is hardcoded to work with my 3PJs 3 channel surface radio and the antenna location isn't optimized for the 9CAP.

blanchjd
Sep 05, 2007, 10:20 AM
Great work! I have been following this thread and the Open Source 2.4Ghz transmitter thread. I'm really looking forward to schematics and code so I can start another project. This or the xbee module would be a perfect match for my planned Microstar radio conversion.

village_idiot
Sep 05, 2007, 12:55 PM
If you felt like tinkering with the Microstar code, I see no reason why you couldn't send the data directly to the RF section instead of converting it to PPM and then decoding the PPM to serial.

TheSteve
Sep 05, 2007, 01:18 PM
I haven't looked at the Microstar but assuming it has a free UART you could directly drive the DSM2 module or an xbee.

village_idiot
Sep 05, 2007, 07:28 PM
It's a PIC 18F chip, and it definitely has a spare UART, could probably just use the IO pin that it now uses for the PPM to send the serial data, I think most of the io pins are mapable to the desired function.

TheSteve
Sep 05, 2007, 07:54 PM
Possibly, usually micro controllers have a dedicated hardware UART built in thats nice to use.

Zeta Phoenix
Sep 05, 2007, 08:27 PM
Just wondering here....

Could this be done on a PIC12F275 with bit bainging serial out? Only reason I ask is I am sightly more sided to the PIC line and we only need 2 IO pins.

-Jon

village_idiot
Sep 06, 2007, 10:28 AM
Other companies seem to be able to use PIC MCUs so I don't see why not. Plantraco uses a PIC16 series, not sure what XPS is using for their stuff, but I know it is PIC based.

rmteo
Sep 06, 2007, 10:43 AM
XPS is also using PIC16 series (in particular the PIC16F91x in an SO package, if I'm not mistaken).

TheSteve
Sep 06, 2007, 01:13 PM
There is no reason a PIC can't do it. I'd select one with a ICP (input capture pin) and a UART to make your life simple though. To get the 1us timing required you only need a 4Mhz clock if using a 4:1 prescaler.
Capture the data and write each channel value to an array. Check it for min/max safe values. Re-order the channels if required, limit to 6 channels, add the Spektrum DSM2 channel marking bits and send out the UART after sending 2 bytes of 00.
That all thats required.

TheSteve
Sep 07, 2007, 04:08 AM
Having done many flights I have full confidence in the system.
I did some range testing tonight, it certainly works further then you can fly a small heli, more range then I figured 2mw would give.
Is there anyone seriously interested in building a version of this?
We do have some small PCBs that fit a smt tiny2313, regulator, crystal and a few caps, it would simplify building the ppm to serial converter(if you like soldering smt) It also happens to fit an xbee module should you ever want to go that route.
Its really quite simple in terms of hardware, PPM data into the Atmel, serial data out.
If there really are some people that want to build this I will consider posting the .hex and the C code.

village_idiot
Sep 07, 2007, 10:29 AM
I'd be interested in the schematic and C code for the PPM to anything code so I can get going on bulding my own stuff. I'll have to reread your posts about hacking out the serial data for something I want to try, probably a 900Mhz system. Since I don't have a dev kit (yet) for PIC or Atmel I'm not really favoring one over the other.

I'd like to start by making a Plantraco compatible system, then maybe getting it to frequency hopping, and then boost the power up to the 1 watt ERP that's allowed in the USA for FHSS on 900Mhz. The gear seems to work well enough now, but jumping the power up would give it full range (and then some). I'll have to look into Atmel dev kits this weekend and see what I can find.

Zeta Phoenix
Sep 07, 2007, 12:43 PM
Having done many flights I have full confidence in the system.
I did some range testing tonight, it certainly works further then you can fly a small heli, more range then I figured 2mw would give.
Is there anyone seriously interested in building a version of this?
We do have some small PCBs that fit a smt tiny2313, regulator, crystal and a few caps, it would simplify building the ppm to serial converter(if you like soldering smt) It also happens to fit an xbee module should you ever want to go that route.
Its really quite simple in terms of hardware, PPM data into the Atmel, serial data out.
If there really are some people that want to build this I will consider posting the .hex and the C code.
Well, count me in! I was asking on using the PIC chip, as I was going to build my own, but if you would be willing to release, I'm all over it!

-Jon

P.S.: I am not afraid of SMT. I have done some 0402 rework on a damaged GY240!

nihil
Sep 07, 2007, 08:04 PM
Count me in, I had my cx2 tx taken apart and was eyeballing that module myself, but never got around to messing with it:
http://nihil.rchomepage.com/helicopters/bladecx2/tx/bcx2tx1385.jpg

I've also been looking at the xbee pro, being disappointed with the bandwidth and range of bluetooth modules. On top of that, I've got some 2313's sitting here doing absolutely nothing important.

Where do we get the schematic and code? :D

blanchjd
Sep 08, 2007, 12:37 PM
I'm definately in, although I'm admittedly more interested in the possibility of a full range Xbee pro system. Now as for modifying everything to link directly to the Microstar, I'm hopeless. I know my way around circuits and schematics to build and troubleshoot, but I'm a mechanical guy. No code writing for me.

village_idiot
Sep 08, 2007, 04:16 PM
Yes, it's a challenge for me too as I have very little coding experience. But I'll never learn if I never start, so starting with examples that I can dissassemble to pair up with what I can find in a book should eventually lead to success (hopefully).

Richard Ingram
Sep 09, 2007, 08:15 AM
I have beenn following this thread and would also be interested.

Thanks

pmackenzie
Sep 09, 2007, 08:35 AM
What about binding?
Is that all handled by the DSM2 chip that came from the CX2 transmitter?

Thanks,

Pat MacKenzie

TheSteve
Sep 09, 2007, 04:11 PM
What about binding?
Is that all handled by the DSM2 chip that came from the CX2 transmitter?

Thanks,

Pat MacKenzie

Yes, thats the beauty of the DSM2 module from the LP5DSM - it handles everything. When you first power on the LP5DSM it goes into binding more for a few seconds(LED flashes) then goes to normal mode. They only do this on the LP5DSM because its very low power. The advantage to us is that we don't have to add any bind buttons or worry about it. The output to the LED thats normally flashed on the front of the LP5DSM transmitter is now connected to the RF good indicator on my Futaba 9CAP, so I still see the flashes and know when its ready to go.

pmackenzie
Sep 09, 2007, 05:37 PM
Then how does the rcvr know "your" TX from anyone elses?
Or does this only work because you bought them as a pair with the original CX2?

Pat MacKenzie

TheSteve
Sep 09, 2007, 07:42 PM
The receiver isn't always in bind mode, its like a standard Spektrum receiver, you need to connect a bind plug to put it into bind mode. The receiver will ignore bind packets in normal mode the same as any normal Spektrum receiver.
So to bind a receiver to the original LP5DSM transmitter you simply connect the bind jumper to the receiver you wish to bind and power it on, then power on the LP5DSM and it will bind and set failsafe. You then power off the receiver, remove the bind jumper and you're good to go. Its really no different then any other Spektrum transmitter other then its powers up in bind mode for 2 or 3 seconds everytime you turn it on then goes to normal mode.

pmackenzie
Sep 09, 2007, 07:50 PM
Got it. :o

I have an XPS module for outdoor stuff, but this could be a great mod for indoor flying using the small DSM2 Spektrum rcvrs.

XPS is working on a 4 gram rcvr, but their product release schedule can be pretty slow.

Just need to get a LP5DSM. Should be lots left when the CX2 owners wear them out or move on to something else.

Thanks,

Pat MacKenzie

Unterhausen
Sep 10, 2007, 01:01 AM
the Tx does seem like it should be easily available given how many people are using their CX with a DX7.

village_idiot
Sep 25, 2007, 03:19 PM
My AVR stuff should arrive any day, and I just rounded up a LP5DSM to give this a whirl. I would be very interested in code set up for 6 channels, or 1-4+6 to be able to use with other helicopters with my 9C.

Since the code is not mine, I will not make it public if you are willing to share.

henrik04
Sep 28, 2007, 07:33 PM
Decided to play with this a little more this evening and everything fell into place.
I tried a serial port rate of 125K instead of 115200. The data is now super easy to see and follow.



Questions or comments let me know!

This is very interesting! I imagine it did take some time to figured it out.. Just for info, would you know if the JR 9 or 10 channels is using something similar?

Thank you in advance.

Happy flying

village_idiot
Sep 28, 2007, 08:26 PM
Just got one of my transmitters.

village_idiot
Oct 29, 2007, 03:50 PM
Penciled out a rough schematic with some help from Steve. He strongly recommends the 0.1uf cap to ground on the reset line to help prevent unwanted resets. Guys go back and forth over this on AVRFreaks, some swear by it, some not so much. So if you intend on this make provisions to be able to add this cap if you want it to be optional, it just might be needed.

Note that there are a couple of things that have not been proven yet, this is my "working" scheme so there might be changes to things like the power supply filtering, PPM input buffer, RF OK switch, etc. I will be building this very soon to try it. If all goes well then the hex code might show up.

village_idiot
Oct 30, 2007, 10:07 PM
Well if stupidity didn't get in the way, I might have an update on this. :o

The brown wire for the LED goes low to turn the LED on, so that part of the circuit should be fine.

village_idiot
Oct 31, 2007, 08:07 PM
I threw together a really crude version of the above. No transistors, chip mounted in the dev board, just really hasty construction. Works fine so now all I have to do is build a more final version that will fit in the nice box that I have ready.

Sorry about the crumby picture, my camera has finally given up.

TheSteve
Oct 31, 2007, 09:14 PM
nice!

village_idiot
Nov 01, 2007, 10:11 AM
I'll work on getting the real version done this week, but I foresee few problems. In fact the only thing that I could see happening is that if I used the wrong buffer for the PPM, and that would be a simple fix (but unlikely that I messsed it up).

I think it would be safe to release the firmware if you are able to do so. Also this could be made into a "universal" Futaba/Hitec compatible device simply by changing the buffer to the inverting style, ignoring the RF OK connection, and connecting it to the trainer port. You could also build up a JR version with everything in the above schematic except for the connector pin out (since the PPM buffer is non inverting), and I don't think you need a pull up on the PPM line. So delete R1 and change to the 6 pin that JR uses and it should work. Maybe need to change the RF OK section, I'm not sure how JR handles that feedback.

Also the RF OK portion (Q2) will NOT need a pull up on the brown wire. So that note on the scheme should be ignored too. This should apply to all designs. Q2 is an active low switch (with PNP), which means when the input goes low (on the base), it conducts current across the emitter and collector. Since this is going to ground it turns the Futaba LED on. To make it active high, use the same circuit as the inverting buffer. It is unlikely that JR would use the active high type switch as I'm sure they are grounding the LED to make it turn on (if their radios have an LED for RF OK). Somewhere I have the pinouts for the JR modules that I guess should be dropped in here to complete the information.

An example of an inverting buffer (and active high switch) can be found here:
http://www.rcgroups.com/forums/showthread.php?t=731555

village_idiot
Nov 01, 2007, 01:28 PM
A perf board that fits the XPS new style Futaba shells. Note the amount of copper on the edges, this is the best way that I can think of to relate the acual measurements so that the connector lines up.

Radioshack 276-149 http://www.radioshack.com/sm-grid-style-pc-board-with-356-holes--pi-2102844.html

ZAGNUT
Nov 01, 2007, 06:12 PM
why not design a board and etch it? would be pretty easy for your simple schematic and could be done up single sided with SMT parts (less drilling).

or if you have to use perf board at least use the FR4 stuff with plated thru-holes.


dave

TheSteve
Nov 01, 2007, 06:40 PM
I know in my case it was much quicker to just use perf board. The board I built for this project took less then 2 hours. I would always prefer to use higher quality board but I've used radio shack boards before simply because that is what I had on hand and felt like building something. You have to be more careful with soldering iron heat, aside from that they work fine.

village_idiot
Nov 01, 2007, 08:08 PM
Soldering iron heat? It's been a really long time since I pulled one of the rings off these boards, even desoldered several and still ok. Mostly it is what I had on hand, and as Steve said, it goes together quickly, even when you are mixing surface and through hole like I will be.

One of these days I need to learn one of the circuit design applications so that it goes a little more quickly, then I'll stop using as much perf board as I do. Double sided etched boards wouls make this simple to put together, all my v+ supply and ground could be on the back side. Depending on what happens at work tomorrow I may have this done by the time I leave for the night. Should be able to knock this together in 2 hours or less now that the connector is mounted.

I'm not loving the XPS cases, probably won't buy them again.

village_idiot
Nov 02, 2007, 06:55 PM
Construction is finished, not sure if I'll try programming it tonight or not. I'll try to get some pictures up this weekend (assuming it all works again).

village_idiot
Nov 03, 2007, 08:32 PM
Messed something up and didn't bring my oscope home, so I'll have to fix this next week. :(

But it does look nice :)

TheSteve
Nov 03, 2007, 09:58 PM
Have a DMM? Should be more then enough to check everything. Verify voltages and then each connection with the schematic.

village_idiot
Nov 03, 2007, 10:22 PM
Looks OK with the voltmeter except that the PPM is only about 2.7 volts which may not be enough. Also can't see if the PPM is inverted or not, I know this made a difference with the Plantraco Monolith.

Right now the DSM module does not light which means no serial data of any kind going to it. It does have voltage on it.

Soldering wires onto the SOIC sized chip was not a lot of fun, but it does program, so I assume the other connections are good too. I did try with the internal 4Mhz osc., just to see if it could be the crystal at fault, but still nothing. Just have to wait until Monday to see if I can find the issue. It worked so well in the dev board that it has to be something simple that I messed up.

village_idiot
Nov 05, 2007, 02:53 PM
OK, something is wrong with the PPM buffer in the circuit above :( . So I removed the transistor (Q1) and then connected pin 11 of the 2313 directly to the pulled up PPM line, and it's working :) . The RF OK light flashes just like it should and I get 2 beeps (because of the length of time of the flashing).

So delete the following components until I figure out what is wrong with the buffer:

R2, R4, Q1



One thing to note, when programming the fuses, uncheck the internal divide by 8 box. I'll see if I can post some screen shots later tonight or tomorrow so that the fuse settings are clear.

village_idiot
Nov 05, 2007, 03:07 PM
I was just re-reading this... What pins do you have the extra LEDs connected to? Just incase I want more blinky lights on mine :D

TheSteve
Nov 05, 2007, 04:22 PM
Pins 8 and 9 of the microcontroller can drive LEDs.
One of them will echo the PPM data its seeing, the second will flash and then stay turned on to verify the controller is operating. They were setup this way for testing when we used the code with xbee modules. The plan is to change the one that echos the PPM into a fault light. Once the PPM channel counter/verification is added it will only turn on if it doesn't like the PPM input.

village_idiot
Nov 05, 2007, 07:25 PM
A couple quick pictures of the finished product.

TheSteve
Nov 06, 2007, 12:10 AM
Looks great!

The XPS case sure does appear to crimp the coax going to the RM-SMA.

Are you going to add LEDs in the original programming/LED holes from the XP case?

village_idiot
Nov 06, 2007, 09:45 AM
No I think I'm just going to put a sticker over the top and call it done. If I get really motivated I could put those 2 LEDs in the holes for a little feedback, but as you said the radio gives most of what you need. Maybe when I move this to my MicroStar2000 I'll put those LEDs in since the M* lacks the RF OK LED on the TX, or maybe I'll put in an RF OK LED, not really sure what I'll do yet.

And yes the XPS case does seem to crimp the coax going in, which is why I said I'll do something else the next time around. Also I'm still not happy with the way that they fit in the TX, the side slope a little too much and the tabs do not stick out far enough for a secure fit. The top tab never locks in my radio so it will need to be fixed. And with the antenna in the stock position, you can not remove the module with the antenna mounted, it completely blocks the snap tab. I have one more of these cases that I'll have to use up, then it's back to finding cheap Futaba cases to tear apart.

At this point I'm not sure who is still following this project, and who is still interested in building one of these. I do plan on taking the lead this project presented and applying it to the full power module. I have a feeling that it takes the same serial data at the RF module, so I should be able to get something faster with the M* TX encoder. I'm also going to try sending data down the PPM line to see if the full power module knows the difference between PPM and serial data, that would make things much easier for future all digital options.

village_idiot
Nov 06, 2007, 09:49 AM
BTW, I should add that the surface mounted components are held down with CA and a little kicker, just incase someone does intend on following this project and building one of these.


And I would like to thank Steve for the work, it may just lead to other discoveries with the Spektrum equipment, which might just benefit all of us that like to tinker.

Unterhausen
Nov 06, 2007, 01:35 PM
where did you get the socket for the Tx pins?

I'm thinking about doing this, but getting one of the Tx is non-trivial.

village_idiot
Nov 06, 2007, 02:30 PM
I ordered the socket from Mouser. It is the Molex KK 100 series connector #4455

http://www.mouser.com/catalog/632/1270.pdf
figure C and I bought the gold plated contacts http://www.mouser.com/search/refine.aspx?Ntt=538-22-17-3052

Kwok_Yu
Nov 06, 2007, 03:53 PM
Got a question. This diy module still has the limited range of the LP5DSM, right?

TheSteve
Nov 06, 2007, 04:41 PM
Yes, 250 to 300 feet max suggested range.

village_idiot
Nov 06, 2007, 04:57 PM
Double it with a 5db antenna, just stay clear of the antenna end because there is little signal coming off the end of the antenna (don't point the antenna at the model). It is still so low power that this isn't much of a concern. Also if you use an AR6200, AR7000, or AR9000 receiver you might get better range since the AR6100 is considered a parkflyer range receiver. I'll probably never try this last option.

If you have the LP5DSM, it's about $20 or less worth of stuff to build this, more if you don't have a programmer.

TheSteve
Nov 07, 2007, 01:18 AM
Here is the hex file for the txdsm2 project.
Please read the enclosed readme.txt if you intend to use it.

May 30th, 2008 - added version 1.1

ohmite
Nov 07, 2007, 05:15 AM
Hello, I just wanted to say I'm still following your progress, I intend to try building one of these soon, just too many projects.
Great work guys!
-Eric

gregs78cam
Nov 11, 2007, 07:22 PM
Villiage I am looking for a way to increase the range of my LP5DSM, do I understand you right that I can double it by just replacing the antenna. Double the range would probably be enough. Thanks

village_idiot
Nov 11, 2007, 08:10 PM
In theory yes. But understand how the higher gain antenna is going to affect the signal coverage, certain areas are going to have a much lower signal density. The higher the gain, the more the signal goes from a dounut to a thin disk. You would need to be very careful where you point the antenna with a 9db or higher gain. 5 to 6 db is about the highest that would be recommended.

Signal strength doubles every 3 db, but remember.... There is no free lunch.

rmteo
Nov 11, 2007, 08:27 PM
Signal strength doubles every 3dB but range requires 6dB for it to double. So 3dB will give you 1.414 (square root of 2) increase in range - or about 41% increase.

gregs78cam
Nov 11, 2007, 08:40 PM
Don't know if this is considered Hijacking the thread, but is there a specific antenna you would recommend and maybe a place to get it. I checked digikey they have a few but I do not know about THIS stuff to select the correct one

TheSteve
Nov 11, 2007, 09:37 PM
I'm using this antenna with my dsm2 module: Digikey part # 553-1309-ND

village_idiot
Nov 11, 2007, 09:57 PM
I bought a few on ebay, 2 have Linksys stamped in them, the others have nothing.

TheSteve
Nov 11, 2007, 11:57 PM
If you're brave there is this option - http://www.dealextreme.com/details.dx/sku.5265
I haven't tried it but I suspect its just as good as any of the cheapie ones Digikey etc sell.

rmteo
Nov 12, 2007, 12:27 AM
I have purchased stuff from that outfit. It is amazing that they will ship a $2 item all the way from China for free. Took about 2.5 weeks to show up. About the same amount of time to get stuff from the boys in Arizona.... :D

village_idiot
Nov 12, 2007, 09:27 AM
I have some that look identical to those, but are white. Didn't blow up the module yet, haven't checked range. Those are in the 2db area.(maybe)

Eventually I'll probably drop a 5db antenna on mine.

yurip
Dec 05, 2007, 05:19 AM
Did anyone knows of such hacking XPS protocol?
I am interested in the project, using XBee/ÕÂååPro. Is it possible to get the Ñ code txdsm2 project?

village_idiot
Dec 05, 2007, 09:56 AM
No. XPS uses an encrypted RF path, and I think it is 128 bit encryption. You could probably find the values that they use to convert the PPM to serial data, but after that I don't think it will be possible to make an XPS compatible system.

TheSteve
Dec 05, 2007, 12:28 PM
Has anyone verified its really encrypted?

village_idiot
Dec 05, 2007, 12:36 PM
Hmmm.... I see what you are saying ;)

teamdavey
Dec 05, 2007, 08:17 PM
Look around - I don't have the time at the moment but I think I remember someone took the time to look at the data and it wasn't encripted.

TheSteve
Dec 05, 2007, 08:35 PM
I recall seeing that as well, at worst it seemed perhaps the bits were re-arranged.

village_idiot
Dec 05, 2007, 09:16 PM
No AES? I thought that was built into the chips?

TheSteve
Dec 06, 2007, 12:40 AM
The xbee modules can perform the encryption but are very slow at it. In the past JD suggested the PIC was handling it. If there is any encryption it only makes sense to have it in the PIC, otherwise monitoring the serial data going to/from the xbee would be trivial.

JimDrew
Dec 06, 2007, 09:33 AM
Initially, we used AES but it was too slow. So, I opted to do the encryption in the PIC itself.

pmackenzie
Jan 12, 2008, 10:43 AM
Steve,
I am about to start working on this for a JR transmitter, possibly with a PIC instead of an ATMEL, so i will need to work on the code.
One thing has me puzzled.
How does the module know where the frames start and/or stop
Usually with character based data you would use some special value as a synch or EOF, but since the way you outlined it the data is all just hex values.
What are they doing? Leaving a gap? Some other scheme?
I know there is a 0x00 as the first byte of each frame, but there would be lots of 0x00s buried in the channel position data.

Thanks,

Pat MacKenzie

vimb
Jan 12, 2008, 11:10 AM
How does the module know where the frames start and/or stop


The frames are sent every ~15-20ms, so I would most likely guess that the module syncs on the dead time between each frame. When I was hooking up my computer to the RF module, I found that I had to add a delay (at least 8ms) between each packet that I transmitted, otherwise the RX would not recognize them.

pmackenzie
Jan 12, 2008, 11:29 AM
Thanks.

Your Wii controlled heli is very cool :cool:

Pat MacKenzie

TheSteve
Jan 13, 2008, 04:17 AM
I've never really thought about the starting/stopping. I assume it resets when it sees a new packet that begins with 00 00. I also never checked to see if it would actually transmit channels greater then 6 as I don't have a receiver that can do more channels.

The LP5DSM processor(Atmel Mega8) sends a packet the usual 60 times a second or so, after it sends the packet via serial data it generates the same as PPM for the trainer port.
With the code I am using a serial packet is sent as soon as we've received 6 PPM channels worth of data, we don't even wait for the end of the frame(to reduce latency) As I am decoding PPM from a standard radio I never really worried about the frame rate.
I've logged over 30 hours of flying time with my module, flawless operation with two different helicopters. It may all be coming to an end soon though as the x9303 I ordered back in October last year is finally supposed to be in stock on friday.