SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Dec 06, 2011, 07:30 PM
I don't want to "Switch Now"
pmackenzie's Avatar
Toronto (Don Mills), Canada
Joined Dec 2002
17,121 Posts
He said the module was already bound to the heli

You don't have to do that again when you simply change the source of the serial "PPM" signal.

Are you limiting the voltage swing to 0/3.3 volts?
What is the LED doing?
Do you have the protocal set right? 125K 8,N,1
One thing to watch out for is the connections. The two sets of pads have the outside connections crossed over. I posted a picture here:
http://www.rcgroups.com/forums/showp...ostcount=13602

If everything else looks fine then you could try inverting the signal.

Pat MacKenzie
pmackenzie is online now Find More Posts by pmackenzie
Reply With Quote
Sign up now
to remove ads between posts
Old Dec 06, 2011, 09:59 PM
Registered User
Joined Dec 2011
5 Posts
Here's my exact code. Keep in mind i just want the heli to connect and do nothing else.

void setup()
{
Serial.begin(125000);
}

void loop()
{
Serial.print(0x00, HEX);
Serial.print(0x00, HEX);
Serial.print(0x00, HEX);
Serial.print(0xAA, HEX);
Serial.print(0x05, HEX);
Serial.print(0xFF, HEX);
Serial.print(0x09, HEX);
Serial.print(0xFF, HEX);
Serial.print(0x0D, HEX);
Serial.print(0xFF, HEX);
Serial.print(0x13, HEX);
Serial.print(0x54, HEX);
Serial.print(0x14, HEX);
Serial.print(0xAA, HEX);
delayMicroseconds(22);
}

this is arduino C code
Dev5994 is offline Find More Posts by Dev5994
Reply With Quote
Old Dec 07, 2011, 12:22 AM
iPhly R/C with iPhone
iter's Avatar
Silicon Valley, Calif
Joined Jan 2005
1,724 Posts
Serial.print(int, int) in Arduino prints characters, not bytes. print(0x14, HEX) sends the string "14" to the serial port, which is the two bytes 0x31:0x34. Lose the HEX argument and tell us if you get any different results.

Ari.
iter is offline Find More Posts by iter
Reply With Quote
Old Dec 07, 2011, 03:36 AM
I don't want to "Switch Now"
pmackenzie's Avatar
Toronto (Don Mills), Canada
Joined Dec 2002
17,121 Posts
Or perhaps try using serial.write instead?

http://arduino.cc/en/Serial/Write
pmackenzie is online now Find More Posts by pmackenzie
Reply With Quote
Old Dec 07, 2011, 10:20 AM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by Dev5994 View Post
Here's my exact code. Keep in mind i just want the heli to connect and do nothing else.

void setup()
{
Serial.begin(125000);
}

void loop()
{
Serial.print(0x00, HEX);
Serial.print(0x00, HEX);
Serial.print(0x00, HEX);
Serial.print(0xAA, HEX);
Serial.print(0x05, HEX);
Serial.print(0xFF, HEX);
Serial.print(0x09, HEX);
Serial.print(0xFF, HEX);
Serial.print(0x0D, HEX);
Serial.print(0xFF, HEX);
Serial.print(0x13, HEX);
Serial.print(0x54, HEX);
Serial.print(0x14, HEX);
Serial.print(0xAA, HEX);
delayMicroseconds(22);
}

this is arduino C code
or

Serial.print(170, HEX); AA

if i'm reading this right? http://www.arduino.cc/en/Serial/Print
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Dec 07, 2011, 01:13 PM
avr
Registered User
Joined Jun 2005
18 Posts
Is the delay correct?

Shouldn't it be in MILLIseconds and not microseconds?
avr is offline Find More Posts by avr
Reply With Quote
Old Dec 07, 2011, 07:57 PM
I don't want to "Switch Now"
pmackenzie's Avatar
Toronto (Don Mills), Canada
Joined Dec 2002
17,121 Posts
Quote:
Originally Posted by avr View Post
Is the delay correct?

Shouldn't it be in MILLIseconds and not microseconds?
It should be msec, but he also should be subtracting for the time it takes to send the 14 bytes. Something like 10*14/125000 = ~1 msec?
Not a big deal perhaps.
Probably a better way to do the timing, but I don't know much about Arduino


Something like (pseudo code):



start_time = millis()
output the data
wait for millis() > start_time+22

repeat


This way you could do all sorts of stuff while you are waiting, with the delay method you can't do anything.
pmackenzie is online now Find More Posts by pmackenzie
Reply With Quote
Old Dec 09, 2011, 09:17 AM
Registered User
Joined Dec 2011
5 Posts
I found a chopped together library that i'm working on improving that works perfectly for the simple purpose of building a controller from scratch. I've attached it for anyone that can make use of it. It's a good base but it stands to be improved.

Thanks to all the guys that tried to help me figure out the problem.
Dev5994 is offline Find More Posts by Dev5994
Reply With Quote
Old Dec 16, 2011, 04:48 PM
Registered User
lilvinz's Avatar
Joined Dec 2011
111 Posts
protocol analysis from a dx4e

Did some more research:

Code:
DSM2/DSMX mode:               18 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2/DSMX mode, range test:   38 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2/DSMX mode, bind:         98 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA

DSM2 mode:                    10 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2 mode, range test:        30 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2 mode, bind:              90 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA

France mode:                  00 00 AA AA BB BB CC CC DD DD EE EE FF FF
France mode, range test:      20 00 AA AA BB BB CC CC DD DD EE EE FF FF
France mode, bind:            80 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA
AA..FF means channels 1..6

For the bind sequence i am not sure if the values following the two
header bytes are relevant but they are static for my dx4e.

So this leads to the following bit meanings for the first byte:

bit 7 - 1 -> bind mode enable
bit 6 - unknown, always 0
bit 5 - 1 -> range test enable
bit 4 - 1 -> normal mode, 0 -> france mode
bit 3 - 1 -> DSMX enable
bit 2 - unknown, always 0
bit 1 - unknown, always 0
bit 0 - unknown, always 0

Note:
The manual says that in france mode DSMX cannot be enabled.
The tested device was recently bought from a retailer in germany.
lilvinz is offline Find More Posts by lilvinz
Last edited by lilvinz; Dec 16, 2011 at 04:56 PM.
Reply With Quote
Old Dec 16, 2011, 08:43 PM
I don't want to "Switch Now"
pmackenzie's Avatar
Toronto (Don Mills), Canada
Joined Dec 2002
17,121 Posts
Quote:
Originally Posted by lilvinz View Post
Did some more research:

Code:
DSM2/DSMX mode:               18 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2/DSMX mode, range test:   38 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2/DSMX mode, bind:         98 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA

DSM2 mode:                    10 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2 mode, range test:        30 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2 mode, bind:              90 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA

France mode:                  00 00 AA AA BB BB CC CC DD DD EE EE FF FF
France mode, range test:      20 00 AA AA BB BB CC CC DD DD EE EE FF FF
France mode, bind:            80 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA
AA..FF means channels 1..6

For the bind sequence i am not sure if the values following the two
header bytes are relevant but they are static for my dx4e.

So this leads to the following bit meanings for the first byte:

bit 7 - 1 -> bind mode enable
bit 6 - unknown, always 0
bit 5 - 1 -> range test enable
bit 4 - 1 -> normal mode, 0 -> france mode
bit 3 - 1 -> DSMX enable
bit 2 - unknown, always 0
bit 1 - unknown, always 0
bit 0 - unknown, always 0

Note:
The manual says that in france mode DSMX cannot be enabled.
The tested device was recently bought from a retailer in germany.
Good work!
I was planning on doing something similar but when I got my DX4e I checked the PID number and it had to sent off to be serviced

As far as the codes after the bind ones, they should probably be the stick positions so fail-safes can be set? Should be easy enough to check for that.
The DX4e definitely sends stick positions on bind. For example they are used by the MCPx to set computer radio/non computer radio mode.

Also interesting that ER9X and TH9X use the "00 00" header, and that puts the DX4e module in "France" mode which IIRC has a lower power output.

Pat MacKenzie
pmackenzie is online now Find More Posts by pmackenzie
Reply With Quote
Old Dec 17, 2011, 09:47 AM
Yes, "that" Karl...
karl k's Avatar
Canada, BC, Burnaby
Joined Mar 2007
1,681 Posts
Now I have to find a DX4e or DX5e and make a module for my Aurora.

Thanks a lot, guys...

... You just cost me a lot of money on micro aircraft...
karl k is offline Find More Posts by karl k
Reply With Quote
Old Dec 18, 2011, 06:04 AM
Registered User
Joined Dec 2011
22 Posts
Quote:
Originally Posted by lilvinz View Post
Did some more research:

Code:
DSM2/DSMX mode:               18 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2/DSMX mode, range test:   38 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2/DSMX mode, bind:         98 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA

DSM2 mode:                    10 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2 mode, range test:        30 00 AA AA BB BB CC CC DD DD EE EE FF FF
DSM2 mode, bind:              90 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA

France mode:                  00 00 AA AA BB BB CC CC DD DD EE EE FF FF
France mode, range test:      20 00 AA AA BB BB CC CC DD DD EE EE FF FF
France mode, bind:            80 00 00 00 05 FF 09 FF 0D FF 10 AA 14 AA
AA..FF means channels 1..6

For the bind sequence i am not sure if the values following the two
header bytes are relevant but they are static for my dx4e.

So this leads to the following bit meanings for the first byte:

bit 7 - 1 -> bind mode enable
bit 6 - unknown, always 0
bit 5 - 1 -> range test enable
bit 4 - 1 -> normal mode, 0 -> france mode
bit 3 - 1 -> DSMX enable
bit 2 - unknown, always 0
bit 1 - unknown, always 0
bit 0 - unknown, always 0

Note:
The manual says that in france mode DSMX cannot be enabled.
The tested device was recently bought from a retailer in germany.
Hi

Are You sure that bit 4 of the first header byte sets france mode? All Arduino software posted here set DSM2_header[0] to 0x00. Are all of the users operating france mode right now? Should we change to DSM2_header[0] = 0x10 for normal operation?

And could you please elaborate on computer/non computer mode for MCPx. What's the difference?

Thanks

Michael
mha1 is offline Find More Posts by mha1
Reply With Quote
Old Dec 18, 2011, 07:27 AM
I don't want to "Switch Now"
pmackenzie's Avatar
Toronto (Don Mills), Canada
Joined Dec 2002
17,121 Posts
Quote:
Originally Posted by mha1 View Post
Hi

Are You sure that bit 4 of the first header byte sets france mode? All Arduino software posted here set DSM2_header[0] to 0x00. Are all of the users operating france mode right now? Should we change to DSM2_header[0] = 0x10 for normal operation?

And could you please elaborate on computer/non computer mode for MCPx. What's the difference?

Thanks

Michael
In "non computer" mode the MCPx collective and throttle are controlled by ch1. This lets the 4 ch DX4e fly the MCPx. In computer mode ch6 controls the collective which allows for independant pitch and throttle curves.

Using the DX4e You set the mode in the MCPx by holding the rudder stick to the left at the start of the binding process, then pressing the trainer switch again once it has bound. Details are in the manual.

Pat MacKenzie
pmackenzie is online now Find More Posts by pmackenzie
Reply With Quote
Old Dec 18, 2011, 10:28 AM
Registered User
Joined Dec 2011
22 Posts
Quote:
Originally Posted by pmackenzie View Post
In "non computer" mode the MCPx collective and throttle are controlled by ch1. This lets the 4 ch DX4e fly the MCPx. In computer mode ch6 controls the collective which allows for independant pitch and throttle curves.

Using the DX4e You set the mode in the MCPx by holding the rudder stick to the left at the start of the binding process, then pressing the trainer switch again once it has bound. Details are in the manual.

Pat MacKenzie
Thanks Pat.
mha1 is offline Find More Posts by mha1
Reply With Quote
Old Dec 19, 2011, 03:14 PM
Registered User
Joined Jul 2009
4 Posts
Hey

Since the Arduino mini Board contains just a few parts, I left it away and took a single Atmega 328P. Finally I designed a PCB which a friend of mine made, and it now sticks all together in the size and at the back of the AMTX11 TX Module.
My only problem now is, that I can't find such a small case.
Thanks a lot to all who made this possible.
Cyrill
Bseudonym is offline Find More Posts by Bseudonym
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Anybody ever ask you "Why don't you build your own planes?" juantrinidad Electric Plane Talk 21 Feb 26, 2003 10:34 PM
FS: Build your Own Lithium Packs Cheap jcherry Aircraft - Electric - Airplanes (FS/W) 0 Dec 15, 2002 09:01 AM
What's A Good Program To Build Your Own Website For A Begginer? Joe Elston Life, The Universe, and Politics 12 Oct 16, 2002 05:29 AM
Sites on how to build your own batt ZAPPER Kevin Graehl Batteries and Chargers 28 Aug 29, 2002 02:53 AM
Build Your Own Defense Budget CoastalFlyer Life, The Universe, and Politics 6 Jun 02, 2002 04:12 AM