Add two switches to the Devo 7e

More
26 Feb 2013 14:05 #7085 by RandMental
Replied by RandMental on topic Add two switches to the Devo 7e

RoGuE_StreaK wrote: So you could have none, either, or both, from the one switch, without going through intermediary steps.


That make sense and with a 4 way multipole switch, it should not be to difficult do.

Please Log in or Create an account to join the conversation.

More
26 Feb 2013 14:46 - 26 Feb 2013 14:47 #7087 by cmpang
Replied by cmpang on topic Add two switches to the Devo 7e

RoGuE_StreaK wrote:
....give
1 - both off
2 - sw1 on, sw2 off
3 - sw1 off, sw2 on
4 - sw1 on, sw2 on


should you perfer it, a two pole 4 position switch will do..
in fact, it is the logical output of a 2 bit binary encoder..
Last edit: 26 Feb 2013 14:47 by cmpang.

Please Log in or Create an account to join the conversation.

More
03 Mar 2013 06:04 #7262 by mwm
Replied by mwm on topic Add two switches to the Devo 7e
While I haven't found any 4-position toggle switches, I have found some five-position toggle switches (or were they slides?)! They get used in guitars, for selecting between pickups (back, back+middle, middle, middle+front, front).

While I agree that two two-way toggles is more states, I have more use for a three-way toggle than two more two-way toggles. A four-way might be ideal, but there are other options!

For instance, if the goal is as many states as possible, a trimmer switch is two momentary switches. Hit one to go up, one to go down, and the number of states is limited to the range of a trim switch in software. Since other Devo Tx's have extra trim switches, this is possible.

If we could make it work, the one I'd like to see is two extra switches, a three-way toggle whose three states are the three with at least one off, and a single momentary toggle that puts them both on.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
03 Mar 2013 07:13 #7266 by cmpang
Replied by cmpang on topic Add two switches to the Devo 7e
should we care to do some precision soldering (and more risky), may be there are some more unused hardware I/Os that we can make use of... that gives us even more options..

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
03 Mar 2013 09:50 #7273 by rbe2012
Replied by rbe2012 on topic Add two switches to the Devo 7e
I have done this for adding a vibration motor in my Devo8. It is not easy, but possible.
In the Devo8 there are about 10-12 unused i/o-pins.
When I have looked correctly there should be the pins PA4, PA8, PA15, PB3, PB4 and PB9 available in Devo7e so it could be done (or at least tested).
There are three problems coming up with this:
  1. How can be guaranteed that the model files will stay compatible to such tx without hardware mods? This is one of the design goals of PhracturedBlue and there are many reasons for this.
  2. The code will probably not be included in the main deviation releases because only a small group of users will do this modification. Every firmware extension needs RAM/ROM space so including them with no use makes no sense for most users.
  3. How can the code necessary to use additional inputs integrated in a firmware, which is still under developement and will change without respect to the mod as long as it is not "officially integrated"? Somebody must be found who maintains this extension and has a look to the main line. Otherwise only those who know how to build the dfu-files can use them or they will be bound to a special (maybe old) version.
Maybe you could integrate the additional switches in a way no modifications to the model files are needed. It still needs a piece of code to initialize the ports and read their states (although it will not be so much). One of the main questions is how to tell deviation at runtime (easy at compile time) that these switches are built in.

I do not want to say: don't do this. But I want you to know that it is not easy when you look a little bit further and see the whole thing.

Please Log in or Create an account to join the conversation.

More
03 Mar 2013 12:38 #7280 by cmpang
Replied by cmpang on topic Add two switches to the Devo 7e

rbe2012 wrote: ..... look a little bit further and see the whole thing.


and it is the point why we need a tx.ini,

think of it this way, different transmitter get its inherent stick calibration data.. where is the data stored at the moment?

Any chance that your tx.ini would be the same as mine?

so it is only a step further..

One way is to have a set of default configuration in the tx.ini

It is up to the individual user who has done his particular mod to edit the file in order to signify the fw to accomplish the functions. That section of ini file cannot be modified in the transmitter and must be done in a pc.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
03 Mar 2013 13:52 #7287 by rbe2012
Replied by rbe2012 on topic Add two switches to the Devo 7e

cmpang wrote: stick calibration data.. where is the data stored at the moment?

Maybe you don't expect an answer but: yep, in the tx.ini.

In deviation reading the tx.ini-file (and every other *.ini) selects only the known values. So you are quite free to add new name=value-pairs in the given sections (have not looked what happens with unknown sections - maybe the section name will be discarded and the name=value will be associated to wrong sections).
But the tx would not write these values if it does not know its name and how to get its value (and it writes the config every time you change something). This is the point where we need a mechanism to be really independent from the deviation version running at the specific tx.
Ok, you're right when you say that you should be able to control your tx.ini and it is not likely that it will be distributed to others. But I would have a better feeling if there were no possibility to misconfigure a tx rather than to watch for it...
Let's play with our imagination: what about adding a four-way-switch for FMODE? We would have a new state FMODE3. You would probably design a model which makes use of this, maybe for autorotation... So it will be stored in the model*.ini-file and suddenly the model config is not longer freely distributeable.

I code my own addons for my Devo8 and I really would appreciate a mechanism integrated in the main deviation releases which allows addons of any kind without making the exchange of model files or other configs impossible or harder.
We discussed in other threads e.g. the use of a tx-hardware-specific value to allow the use of extended values in ini-files. Another way could be the versioning of the ini-files to allow to distinguish. A third one: using additional files where only the extensions are stored and which can easily be ignored by deviation versions which don't know them (the more I think about this new idea I like it, but it can have impacts to the flash space because every file needs 4k even if only one character is inside).

I think we will have to think about this further (and quite sure we are not the right persons to decide at last). But I would appreciate a discussion how addons can be integrated without splitting deviation into different forks.

Please Log in or Create an account to join the conversation.

More
03 Mar 2013 14:51 #7290 by Nibborg
Replied by Nibborg on topic Add two switches to the Devo 7e
First, hello to everybody!

I'm reading this forum some time ago, because i have a 7e on the way.
I must say all of you are doing a very good job, very helpfull. Thank you!

Now i'm very interested in doing some hardware modding to the TX. Push it to the limit!

Just star to do some research about the i/o pin configuration of the Devo 7e, and seen this

rbe2012 wrote:

When I have looked correctly there should be the pins PA4, PA8, PA15, PB3, PB4 and PB9 available in Devo7e so it could be done (or at least tested).


I know if look at the "DEVO-7E Hardware Connections" by PB, this pins are unlisted, but maybe are they used for another task?

¿Can someone confirm what pins are really unused? Just to start some development while TX arrive! :)

About the four/five way switch, maybe you can use the ADC in PA4, and some resistors on the switch to get some fixed inputs for the desired effect?

P.D.:¡Sorry for my extrange spanglish! :P

Please Log in or Create an account to join the conversation.

More
03 Mar 2013 15:59 - 03 Mar 2013 16:09 #7291 by cmpang
Replied by cmpang on topic Add two switches to the Devo 7e

rbe2012 wrote:

cmpang wrote:
...In deviation reading the tx.ini-file ....


in simple speaking, my idea is the tx.ini file consists of two sections.. the first one is for the normal which is the same as it is now...

the second section contains all the hardware mode flags that has been implemented up to the current release.. however, this section is hidden in the transmitter and thus not accessable. All settings for the hardware mod are default to NIL. Any user who has done a particular hardware mod has to gain access to the ini file from his computer to activate the settings.. this would prevent a usual user from changing the settings by mistake..in fact, it is not necessary for a usual user to aware the existance of the second section of the ini file..

during boot up, the fw would parse both sections in the tx.ini file. So all hardware mod would be read as NIL as it is in default. It is only the modded ones that will place a flag inside the fw for the desire additional manipulation. In the example of a 4 way switch, a Fmod3 switch is only availble in the model set up menu if and only if the corresponing flag is set in the tx.ini file.

Seems straight forward and void of any ambiguality...

Last edit: 03 Mar 2013 16:09 by cmpang.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
03 Mar 2013 19:55 #7295 by rbe2012
Replied by rbe2012 on topic Add two switches to the Devo 7e
What would be the advantage of your proposal against the use of two different ini-files like tx.ini for all and addons.ini for the modded tx? So interference can be excluded...

Please Log in or Create an account to join the conversation.

More
04 Mar 2013 01:09 #7310 by cmpang
Replied by cmpang on topic Add two switches to the Devo 7e

rbe2012 wrote: What would be the advantage of your proposal against the use of two different ini-files like tx.ini for all and addons.ini for the modded tx? So interference can be excluded...


no additional advantage here.. in principal they are the same, just one of the many possible ways to get it done..

should a two files option be used, the transmitter during booting up will looks for the existence of the mod.ini file and set up its internal flags accordingly...

may be it is even more safer since you can make the mod file hidden so a usual user cannot even aware the file in his computer..

Please Log in or Create an account to join the conversation.

More
26 Mar 2013 08:04 #8093 by CPpilot
Replied by CPpilot on topic Add two switches to the Devo 7e
Hmm...I just finished the mod and fw upgrade. I have few questions in mind. 1) I don't know if these switches are working properly or not..? 2)How do I assign these switches to D/R? 3) What channels do these switches assign to? I am still learning this.

Please Log in or Create an account to join the conversation.

More
26 Mar 2013 09:53 #8095 by RoGuE_StreaK
Replied by RoGuE_StreaK on topic Add two switches to the Devo 7e
After the FW update, I believe you should see additional options for "Switch" in your mixers etc.; AIL_DR0, AIL_DR1, ELE_DR0, ELE_DR1

Please Log in or Create an account to join the conversation.

More
16 Apr 2013 13:43 #8986 by Mullson
Replied by Mullson on topic Add two switches to the Devo 7e
I patched the latest build with the extra switches. Tested and all seems to work as expected.
I uploaded it in "How To apply "two switches" patch for Devo7e soft" if somebody wants it.

Please Log in or Create an account to join the conversation.

More
30 Jun 2013 14:34 - 27 Jul 2013 11:13 #11635 by kaworu
Replied by kaworu on topic Add two switches to the Devo 7e
Here is a modification of the patch which will add a three way F-Mode switch. The original F-Mode switch is mapped to AIL-DR.

To mod your TX follow the original description and put the red wire in the middle contact of the three way switch (on off on) the yellow and orange wire then go to the other two contacts.
diff -r 1ae61a3d88c3 src/target/devo7e/capabilities.h
--- a/src/target/devo7e/capabilities.h	Sun Apr 07 13:15:41 2013 -0700
+++ b/src/target/devo7e/capabilities.h	Sun Jun 30 14:32:36 2013 +0200
@@ -7,6 +7,9 @@
   CHANDEF(HOLD1)
   CHANDEF(FMOD0)
   CHANDEF(FMOD1)
+  CHANDEF(FMOD2)
+  CHANDEF(AIL_DR0)
+  CHANDEF(AIL_DR1)
 #endif
 
 #ifdef UNDEF_INP
@@ -14,9 +17,9 @@
 #define INP_RUD_DR1 INP_HOLD1
 #define INP_ELE_DR0 INP_HOLD0
 #define INP_ELE_DR1 INP_HOLD1
-#define INP_AIL_DR0 INP_HOLD0
-#define INP_AIL_DR1 INP_HOLD1
-#define INP_FMOD2  INP_FMOD1
+//#define INP_AIL_DR0 INP_HOLD0
+//#define INP_AIL_DR1 INP_HOLD1
+//#define INP_FMOD2  INP_FMOD1
 #define INP_MIX0   INP_FMOD0
 #define INP_MIX1   INP_FMOD1
 #define INP_MIX2   INP_FMOD1
diff -r 1ae61a3d88c3 src/target/devo7e/channels.c
--- a/src/target/devo7e/channels.c	Sun Apr 07 13:15:41 2013 -0700
+++ b/src/target/devo7e/channels.c	Sun Jun 30 14:32:36 2013 +0200
@@ -40,6 +40,7 @@
     gpio_set(GPIOC, GPIO10 | GPIO11);
 }
 
+extern u32 glbl_buttons;
 s32 CHAN_ReadRawInput(int channel)
 {
     s32 value = 0;
@@ -50,8 +51,21 @@
     case INP_ELEVATOR:  value = adc_array_raw[3]; break;  // bug fix: left vertical
     case INP_HOLD0:    value = gpio_get(GPIOC, GPIO11); break;
     case INP_HOLD1:    value = ! gpio_get(GPIOC, GPIO11); break;
-    case INP_FMOD0:    value = gpio_get(GPIOC, GPIO10); break;
-    case INP_FMOD1:    value = ! gpio_get(GPIOC, GPIO10); break;
+    //case INP_FMOD0:    value = gpio_get(GPIOC, GPIO10); break;
+    //case INP_FMOD1:    value = ! gpio_get(GPIOC, GPIO10); break;
+
+    //case INP_AIL_DR0:  value = !(glbl_buttons & (1 << 31)); break;
+    //case INP_AIL_DR1:  value = !!(glbl_buttons & (1 << 31)); break;
+
+    //case INP_ELE_DR0:  value = !(glbl_buttons & (1 << 30)); break;
+    //case INP_ELE_DR1:  value = !!(glbl_buttons & (1 << 30)); break;
+
+    case INP_FMOD0:    value = !!(glbl_buttons & (1 << 31)); break;
+    case INP_FMOD1:    value = !(glbl_buttons & (3 << 30)); break;
+    case INP_FMOD2:    value = !!(glbl_buttons & (1 << 30)); break;
+
+    case INP_AIL_DR0:  value = gpio_get(GPIOC, GPIO10); break;
+    case INP_AIL_DR1:  value = ! gpio_get(GPIOC, GPIO10); break;
     }
     return value;
 }
diff -r 1ae61a3d88c3 src/target/devo7e/tx_buttons.c
--- a/src/target/devo7e/tx_buttons.c	Sun Apr 07 13:15:41 2013 -0700
+++ b/src/target/devo7e/tx_buttons.c	Sun Jun 30 14:32:36 2013 +0200
@@ -20,9 +20,9 @@
 static const u16 rows[] = {GPIO6, GPIO7, GPIO8, GPIO9, 0xffff};
 static const u8 buttonmap[] = {
     BUT_TRIM_RH_POS, BUT_TRIM_RH_NEG, BUT_TRIM_RV_POS, BUT_TRIM_RV_NEG,
-    BUT_LAST,        BUT_ENTER,       BUT_RIGHT,       BUT_LEFT,
+    32,              BUT_ENTER,       BUT_RIGHT,       BUT_LEFT,
     BUT_TRIM_LV_POS, BUT_TRIM_LV_NEG, BUT_TRIM_LH_NEG, BUT_TRIM_LH_POS,
-    BUT_LAST,        BUT_DOWN,        BUT_UP,          BUT_EXIT,
+    31,              BUT_DOWN,        BUT_UP,          BUT_EXIT,
     };
 
 #define COL_PORT GPIOB
@@ -46,30 +46,33 @@
   gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
                 GPIO_CNF_OUTPUT_PUSHPULL, GPIO5 | GPIO6 | GPIO7 | GPIO8);
 
-  gpio_set(GPIOB, GPIO5 | GPIO6| GPIO7 | GPIO8);
+  gpio_clear(GPIOB, GPIO5 | GPIO6| GPIO7 | GPIO8);
 
   /* PortC 6-9 are pull-up inputs */
   gpio_set_mode(GPIOC, GPIO_MODE_INPUT,
                 GPIO_CNF_INPUT_PULL_UPDOWN, GPIO6 | GPIO7 | GPIO8 | GPIO9);
-  gpio_set(GPIOC, GPIO6 | GPIO7 | GPIO8 | GPIO9);
+  gpio_clear(GPIOC, GPIO6 | GPIO7 | GPIO8 | GPIO9);
 }
 
+u32 glbl_buttons = 0;
 u32 ScanButtons()
 {
     u8 idx = 0;
     u32 result = 0;
     const u16 *c, *r;
-    gpio_set(COL_PORT, COL_PORT_MASK);
+    gpio_clear(COL_PORT, COL_PORT_MASK);
     for(c = columns; *c != 0xffff; c++) {
+        gpio_set(COL_PORT, *c);
+        u16 but = gpio_port_read(ROW_PORT);
         gpio_clear(COL_PORT, *c);
-        u16 but = gpio_port_read(ROW_PORT);
-        gpio_set(COL_PORT, *c);
         for(r = rows; *r != 0xffff; r++) {
-            if(! (but & *r)) {
+            if((but & *r)) {
                 result |= 1 << (buttonmap[idx] - 1);
             }
             idx++;
         }
     }
-    return result;
+    if (! (result & 0x3FFFFFFF))
+        glbl_buttons = result;
+    return result & 0x3FFFFFFF;
 }
Last edit: 27 Jul 2013 11:13 by kaworu. Reason: fixed the patch

Please Log in or Create an account to join the conversation.

More
22 Jul 2013 11:55 - 22 Jul 2013 11:55 #12420 by Xermalk
Replied by Xermalk on topic Add two switches to the Devo 7e
I just applied the hardware mod, but im having troubles building the patched firmware.

This is the error i get when i try to apply the patch.
Xerx@Serenity ~/deviation
$ patch -p1 < file.patch
patching file src/target/devo7e/capabilities.h
patch: **** malformed patch at line 24: diff -r 1ae61a3d88c3 src/target/devo7e/c
hannels.c
Last edit: 22 Jul 2013 11:55 by Xermalk.

Please Log in or Create an account to join the conversation.

More
08 Aug 2013 14:26 - 09 Aug 2013 05:39 #12845 by jason4207
Replied by jason4207 on topic Add two switches to the Devo 7e
Just installed my switches last night. Do I still need to patch the FW myself or is it now implemented in the latest nightly?
Last edit: 09 Aug 2013 05:39 by jason4207.

Please Log in or Create an account to join the conversation.

More
10 Aug 2013 19:35 #12893 by Daryoon
Replied by Daryoon on topic Add two switches to the Devo 7e
I remember reading that when the switch patch makes it into the nightly by default, that it was be implemented in a way where one can edit the tx.ini to enable or disable it. Just like one does now for the power amp circuits for modules that supports it.

Please Log in or Create an account to join the conversation.

More
21 Aug 2013 08:03 #13066 by cmpang
Replied by cmpang on topic Add two switches to the Devo 7e

Daryoon wrote: I remember reading that when the switch patch makes it into the nightly by default, that it was be implemented in a way where one can edit the tx.ini to enable or disable it. Just like one does now for the power amp circuits for modules that supports it.


No, it doesn't ...

seems adding two switches to 7e does not get enough interest among users ..

would be appreciated if someone can incorporating the patch on the current nightly build

cmPang

Please Log in or Create an account to join the conversation.

More
21 Aug 2013 09:04 - 21 Aug 2013 09:07 #13070 by sllewji
Replied by sllewji on topic Add two switches to the Devo 7e
Can anyone confirm whether adding these switches actaully does make the 7E an 8(+) channel tx?

The current nightly allows toggling channels 5-8 using the trim switches, but I've been unable to get a reaction from my PUMQ on channel 8 (assuming that the satellite rx has 8channels of course!)

Given that I've effectively got two extra switches via the throttle trims (which I don't otherwise use), I'm not sure whether adding the two additional hardware switches would be a worthwhile exercise.

Ian
Last edit: 21 Aug 2013 09:07 by sllewji.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum