Orange Module running MULTI protocol

Choosing an RF Module? What modules work? What is compatible with the 9x?
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

The original Orange modules had the channel 2 error. They were sold for about a week, then HK sent replacements to all customers. The fault was simply a firmware bug and all you had to do, when the HK programmer and file was made available, was flash it again and the problem was fixed. I'm still using one those boards; the other one has been flashed to the Multi protocol and has a new lease on life.

Note that Mike provide a new file for the blue board just this week. It fixed the problem I had when I first tried the blue board. I have also successfully flashed two green boards to the Multi protocol.

EDIT: By the way, the module was never DSM2-only, though that's the way they were originally marked. It was always DSM2/DSMX.
Last edited by Daedalus66 on Wed Mar 08, 2017 2:31 pm, edited 1 time in total.

Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Hi Mike
All Orange modules working fine with the new Multi protocol. When the weather warms up a bit I'll get out and range test them properly, but all indications are positive.

One question: As I understand it, the Multi protocol can be set up for either AETR or TAER channel order. Right now I've set up the modules for AETR but would prefer to stick with the normal Spektrum TAER. Can it be done with your implementation of Orange Multi?

It's not a big deal, as it's just a matter of shuffling the Mixer entries, but it's one more thing to remember, as I also have a Spektrum hack module that is fixed on TAER.
mozgy
Posts: 14
Joined: Fri Jan 27, 2017 9:23 am
Country: Croatia

Re: Orange Module running MULTI protocol

Post by mozgy »

Hello,
one more thumbs up for TAER channel order if possible.

--
Mozz
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

The Multi firmware for the Orange module is the same, except for the bottom level hardware drivers, as the 'normal' 4-in-1, so it is a compile option to choose the default channel order from the radio.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

I went into Arduino and found the configuration file. I commented out most protocols and set it to TAER and serial. I tested the result and it indicated that it would compile OK.

That's where I get stuck. I saved the result as MultiTAER but am not sure which of the files to use. Am I on the right track?

I had to break off for baby sitting duty, so would appreciate a little guidance for when I get back to it.
Nigel

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

Because the Orange module uses a XMEGA processor, I don't think the normal Arduino IDE will compile for it, although the GCC compiler with it should work. You need a 'make' program to do the compile.
It may be possible to do something with the Arduino IDE, by editing the boards.txt file to add the XMEGA processor in.
I'll need a bit of time to investigate that.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Thanks very much, Mike. I wondered about that. There's no great rush but it would be very useful to have a version that accepts TAER input, thus removing one more source of confusion.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

I've found some things to do to the Arduino IDE that does mean it compiles for a XMEGA. I need to change some things in the Orange specific files, but I have a compile and link working. I need to check now if the compiled file actually works. It does compile to a .hex file, so I also need to change this into a .bin for flashing from the radio.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Great. Thank you.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

This is what I did to the Arduino IDE to get it to compile for the Orange module.

I added the following to "boards.txt":
##############################################################

xmega32d4.name=ATXMega32D4

xmega32d4.build.board=AVR_XMEGA32D4
xmega32d4.upload.protocol=arduino
xmega32d4.upload.maximum_size=32768
xmega32d4.upload.speed=115200
xmega32d4.build.mcu=atxmega32d4
xmega32d4.build.f_cpu=32000000L
xmega32d4.build.core=xmega
xmega32d4.build.variant=xmega32d4

##############################################################

You need to find your Aduino IDE install directory, mine is at:
C:/progs/Arduino-1.6.10
boards.txt is at
C:/progs/Arduino-1.6.10/hardware/arduino/avr/boards.txt

I also downloaded:
arduino-master.zip
(265 KiB) Downloaded 227 times
from: https://github.com/XMegaForArduino/arduino
in which is a "cores" sub-directory containing a "xmega" sub-directory.
Copy this "xmega" sub-directory to:
C:\Progs\Arduino-1.6.10\hardware\arduino\avr\cores
(you should have found an "arduino" sub-directory there already so you should end up with 2 sub-directories in "cores").

Now in the zip file find the sub-directory "variants". In there is a sub-directory "xmega64d4".
Copy this to:
C:\Progs\Arduino-1.6.10\hardware\arduino\avr\variants
so it adds another directory called "xmega64d4" there (lots of sub-directories already there including "standard").
Now RENAME this copied directory to "xmega32d4".

Next extract MultiOrange.h from:
MultiOrange_h.zip
(1.87 KiB) Downloaded 239 times
and put it in your MultiProtocol source files directory. This is actually "MultiOrange.cpp.orangetx" renamed with a few small changes.

Finally you need to edit "MultiProtocol.ino to add 3 lines to include this file:

Code: Select all

#include <avr/pgmspace.h>
//#define DEBUG_TX

#ifdef ARDUINO_AVR_XMEGA32D4
#include "MultiOrange.h"
#endif

#include "Multiprotocol.h"

//Multiprotocol module configuration file
To do the build, run the Arduino IDE, then in the tools menu select "ATXMegs32D4" as the board type, then click on the verify button.
With the way the Arduino IDE works, the resulting "MultiProtocol.ino.hex" file is in a "Build" directory located (possibly) a couple of directories up from the "MultiProtocol" directory (but I may have changed something on my setup to put "Build" there!).

If this works, and you get a .hex file, we can take it from there to convert it to a .bin file for flashing.

I did a build this way, flashed the .hex file to an Orange module (AVRISP-II programmer) and it bound to a R615X correctly.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Orange Module running MULTI protocol

Post by jhsa »

I have Arduino IDE 1.6.13 and in the "Sketch" menu there is an option called "Export Compiled Binary".
Selecting this will compile the sketch and save the hex file in the project's directory. It is a wonderful feature..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

That option is in 1.6.10 as well, I got a Multiprotocol.ino.xmega32d4.hex file when I tried it. I hadn't looked as I have a batch file that fetches the .hex and creates an assembler listing and map file that I was using.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Hi Mike

I'm getting there but have to break off to look after grandkids. Thank you for the help. I'm new to this stuff so it's taking a while.
Nigel
barjunk
Posts: 42
Joined: Thu Jun 19, 2014 2:51 am
Country: -

Re: Orange Module running MULTI protocol

Post by barjunk »

I think this now means that I can compile the Multi module code for the Orange transmitter module whenever I want.

How did this affect the flashing of the module, if at all?
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

Because I flashed a module using an AVRISP-II, I could use the .hex file the IDE produced. To flash from the radio, the .hex file needs to be converted to a .bin file.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
mozgy
Posts: 14
Joined: Fri Jan 27, 2017 9:23 am
Country: Croatia

Re: Orange Module running MULTI protocol

Post by mozgy »

Hello,
ty Mike, works on Linux as well ->
-rw-rw-r--. 1 mozgy mozgy 37132 Mar 8 16:12 Multiprotocol.ino
-rw-r--r--. 1 mozgy mozgy 4678 Mar 8 16:16 MultiOrange.h
-rw-rw-r--. 1 mozgy mozgy 41410 Mar 8 16:19 Multiprotocol.ino.xmega32d4.hex
-rw-r--r--. 1 mozgy mozgy 14712 Mar 8 16:23 Multiprotocol.ino.xmega32d4.bin

conversion done with ->
# objcopy -I ihex Multiprotocol.ino.xmega32d4.hex -O binary Multiprotocol.ino.xmega32d4.bin

--
Mozz
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Hi Mike
Does this look anything like what's need as the basis for a MultiOrange .bin file?
All I'm trying to to is change the Channel Order to TAER! (And leave out unnecessary protocols -- I'm only interest in DSM.)
Nigel
Attachments
MultiprotocolTAER.ino.xmega32d4.hex
(24.46 KiB) Downloaded 294 times
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

Looks promising. It is a bit smaller than the ones I generate, but I've been including the DEVO protocols as well.
See the "objcopy" command a couple of posts above for conversion to .bin.

I havea copy of "avr-objcopy.exe" here:
C:\Progs\Arduino-1.6.10\hardware\tools\avr\bin
so you should find one in your Arduino IDE installation.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Orange Module running MULTI protocol

Post by Daedalus66 »

Yes, I've found it in Arduino. Will figure out how to use it later this evening. Thank you.

EDIT: Well tomorrow will have to do.
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

I've spent a couple of days, on and off, educating myself about Arduino and am starting to get how the software works. What I havent found is an answer to the simple question: How do you convert a hex file to bin? I have "avr-objcopy.exe" but just don't know how to use it.

I see the mozgy post but don't get how it should be applied:
# objcopy -I ihex Multiprotocol.ino.xmega32d4.hex -O binary Multiprotocol.ino.xmega32d4.bin

Any guidance would be much appreciated! Please assume total ignorance, though I've managed to get this far.
Nigel
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

Use the command:
"avr-objcopy -I ihex Multiprotocol.ino.xmega32d4.hex -O binary Multiprotocol.ino.xmega32d4.bin"
The "-I ihex" specifies the input file is of type "intel hex" (a captial 'i').
The "Multiprotocol.ino.xmega32d4.hex" specifies the name of the input file.
The "-O binary" specifies the output file is of type "Binary".
The "Multiprotocol.ino.xmega32d4.bin" specifies the name of the output file.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Mike:
How exactly do you run from the command line in Arduino.
I know this is a dumb question, but bear with me!
Nigel
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

I don't think you can run a command line direct from the IDE, you will need to start a command window.
You need to use the option in the "sketch" menu to "Export compiled binary" to get the .hex file in your working directory, then start a command window to enter the avr-objcopy command.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

You need to use the option in the "sketch" menu to "Export compiled binary" to get the .hex file in your working directory, then start a command window to enter the avr-objcopy command.

That's exactly where I get stuck. I've compiled the hex file.

Are we talking about a Windows Command Prompt? That gets me a response of "'avr-objcopy' is not recognized as a ... command". Everything I read about Arduino says getting a windows command line is problematic.

Sorry to be a pest!
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

You may need to enter the full path to avr-objcopy, mine is here:
C:\Progs\Arduino-1.6.10\hardware\tools\avr\bin\avr-objcopy
Or you could try to get "C:\Progs\Arduino-1.6.10\hardware\tools\avr\bin" added to your PATH so windows searches there for the file.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Hi Mike
As you suggested the issue was with the path. Eventually I followed a suggestion by jj604 and stuck the files in the root of C:\. The result was finally a .bin file. Unfortunately it didn't work, but a least I have all the steps sorted out. So I'll go back to square one and retrace my steps. I'll let you know when I get there.
Thank you for the continuing support.
Nigel
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

You are nearly there. I just flashed your "MultiprotocolTAER.ino.xmega32d4.hex" using my AVRISP-II and it worked on my (green) module.
I've attached the .bin file I just created from this .hex for you to try.

Mike.
MultiprotocolTAER.ino.xmega32d4.zip
(6.18 KiB) Downloaded 149 times
Edit: I just flashed this .bin from the 9XR-PRO and that also works. I checked it is using TAER as well.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Hi Mike

Success! I flashed the .bin file you provided to my 9XR Pro (with latest ErSky9x version) and everything works as it should, including auto recognition of the receiver type.

Then I retraced my steps in the flashing attempt and found a really dumb mix-up. So my .bin file was good too.

All in all a very satisfying outcome.

One question. Will that same file work with a blue board? If not, what change is needed in the Multi file before compiling?

Thanks again.

Nigel
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Orange Module running MULTI protocol

Post by MikeB »

Near the top of what is now "multiorange.h" are two lines:
// For BLUE module use:
//#define DSM_BLUE

Just uncomment the DSM_BLUE define and re-compile.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Daedalus66
Posts: 1844
Joined: Tue Dec 27, 2011 8:22 pm
Country: -
Location: Ottawa

Re: Orange Module running MULTI protocol

Post by Daedalus66 »

Yes. I remember that now.

Post Reply

Return to “RF MODULES”