- Posts: 296
Add two switches to the Devo 7e
- cmpang
- Topic Author
- Offline
www.deviationtx.com/articles/18-devo-7e-hardware-connections
Since the 7e is coming short of switches (that limits 7e to being a plain 6 Channels Tx, or even worse a 4 Channels Tx only if both the existing switches are assigned as "Hold" , "FMOD", "D/R"), I think it would be nice if we can make use of the two left over button matrix.
After some discussion with PB and with his kind help (he always is, isn't he?) and a bit of very easy hardware mod, the upgrade work is done and now we have a plain 8 Channel 7e Tx.
The mod goes on like this:
1. Open the Tx case, take out the four screws that hold the main PCB
2. Flip the PCB over and we can see the buttons and the wire connectors. Carefully identify the spots as shown in the photo and solder three wires perferably of different colors say Red, Yellow and Orange.
3. The schematic diagram :
4. On the Tx front cover, drill out two holes to the size of the switches you are going to use and put the switches on. Left is "Elevator D/R" and right is "Aileron D/R).
5. Connect the other end of the Red wires (you have to make a parallel connection) to the middle (toung) of both switches.
6. Solder a diode to the top contact of both switches. Pay attention to the direction of the diodes. Different doide types have different appearance. The one I am using is a low voltage rectifier 1N4001 but whatever diode type should also works. The point is to make sure current is flowing from the Yelow/Orange to the Red wire.
That's all for the hardware mod. Of course you have to upgrade to the latest fw in order for the switches to work. The one I am using now is:
www.deviationtx.com/media/kunena/attachm...ang_2013-02-12-3.zip
Thanks again to PB's patience and hardwork to make it a reality...
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
Really nice walkthrough.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
diff -r ab395d806bed src/target/devo7e/capabilities.h
--- a/src/target/devo7e/capabilities.h Thu Feb 14 20:58:25 2013 -0800
+++ b/src/target/devo7e/capabilities.h Thu Feb 14 21:06:31 2013 -0800
@@ -7,15 +7,19 @@
CHANDEF(HOLD1)
CHANDEF(FMOD0)
CHANDEF(FMOD1)
+ CHANDEF(AIL_DR0)
+ CHANDEF(AIL_DR1)
+ CHANDEF(ELE_DR0)
+ CHANDEF(ELE_DR1)
#endif
#ifdef UNDEF_INP
#define INP_RUD_DR0 INP_HOLD0
#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_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_MIX0 INP_FMOD0
#define INP_MIX1 INP_FMOD1
diff -r ab395d806bed src/target/devo7e/channels.c
--- a/src/target/devo7e/channels.c Thu Feb 14 20:58:25 2013 -0800
+++ b/src/target/devo7e/channels.c Thu Feb 14 21:06:31 2013 -0800
@@ -40,6 +40,7 @@
gpio_set(GPIOC, GPIO10 | GPIO11);
}
+extern u32 glbl_buttons;
s32 CHAN_ReadRawInput(int channel)
{
s32 value = 0;
@@ -52,6 +53,12 @@
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_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;
}
return value;
}
diff -r ab395d806bed src/target/devo7e/tx_buttons.c
--- a/src/target/devo7e/tx_buttons.c Thu Feb 14 20:58:25 2013 -0800
+++ b/src/target/devo7e/tx_buttons.c Thu Feb 14 21:06:31 2013 -0800
@@ -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;
}
patch -p1 < file.patch
Please Log in or Create an account to join the conversation.
- cmpang
- Topic Author
- Offline
- Posts: 296
Please Log in or Create an account to join the conversation.
- RandMental
- Offline
- Posts: 521
bitbucket.org/PhracturedBlue/deviation
If you develop on Windows, this can also help:
www.deviationtx.com/articles/7-development-on-windows
and Using Eclipse:
www.deviationtx.com/articles/15-using-eclipse-with-deviation
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
www.deviationtx.com/forum/how-to/1200-vm...-compiling-deviation
www.deviationtx.com/forum/7-development/...tx-build-environment
The folks who put those together will likely be happyto help you if you choose one of those paths.
Please Log in or Create an account to join the conversation.
- harmony96
- Offline
- Posts: 31
Where can I buy the toggle switch that fits with 7e?
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
Or do you have to mod the code in some way? If so how?
Please Log in or Create an account to join the conversation.
- cmpang
- Topic Author
- Offline
- Posts: 296
Go back to the Transmitter menu, Channel Monitor to double check the function.
There is one shortcoming in this version of 7e that while setting the parameters in the Mixer page, the curve can no longer be displayed. That is, no graphical display while keying in the value of points 1 and 3 in the example above.
Even with those shortcomings and may not be able to further upgrade with the future Deviation development, I still consider the addition of two switches give life to the 7e that is otherwise too limited in functionality..
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
I hope its going to be a standard so the switch configs can be more interchangeable between the TXs. Its a really easy and safe mod compared to the others.
Do you know how the 4 switches translates in 8emu? I mean if you build your ini with it?
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
They are the AIL DR and ELE DR switches similar to the builtin switches in Devo8.Mullson wrote: Do you know how the 4 switches translates in 8emu? I mean if you build your ini with it?
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
rbe2012 wrote:
They are the AIL DR and ELE DR switches similar to the builtin switches in Devo8.Mullson wrote: Do you know how the 4 switches translates in 8emu? I mean if you build your ini with it?
And the hold?
Please Log in or Create an account to join the conversation.
- cmpang
- Topic Author
- Offline
- Posts: 296
Mullson wrote:
rbe2012 wrote:
Mullson wrote: ...And the hold?...
Hold and FMode remained as it was before the mod..
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
Couldn't we "you" please implement this switches to the build?
I use the 671 bild now.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
RandMental has proposed to save a hashed-value in the tx ( Fixed ID and TX-ID ). If such a feature is implemented we could use this to decide at runtime if a hardware-mod is installed without having to fear side-effects when transferring tx.ini-files.
I would highly appreciate such a mechanism as I am going to play around with some hardware mods too.
Off topic: I thought about a forum category for hardware mods like the flysky module, the 7e-range-hack, this one and what will come later...
Please Log in or Create an account to join the conversation.
- FDR
- Offline
This way the builds would be uniform...
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
Cant it be like FMOD2 is for 7E now.rbe2012 wrote: It will not be so easy to determine if a tx has such a hw mod or not (esp. when the switch is off and no input can be read). So a build which supports this has to know while building if the mod is implemented
If you have the mod you can use it. If not you can set it to another switch or turn it of. Its just a switch setting you cant use like FMOD2 for 7E.
So the TX wouldn't have to determine, you will.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
For the flysky mod, my plan is to have a page on the tx-config screen that lets you set which modules you have and whether they have a PA or not. That way you won't need to set the power to '150mW' on the devo7e for instance. It isn't going to happen before the release though.
For the switches, I was hoping to do something similar, but I was thinking of merging it with the virtual-switch stuff that you're doing. Fundamentally in the code having switches which can be conditionally configured is a lot of work because they are predefined in a list and we can't easily skip over them without changing every spin-box that uses a switch. So I want instead to enable virtual switches and then allow mapping new hardware to them.
Please Log in or Create an account to join the conversation.
- Mullson
- Offline
- Posts: 114
I think It should be that way to. But shouldn't it be possible to set the switches for personal use? Or is it already?PhracturedBlue wrote: the issue is mostly how do I import a model from the forum if I don't know how to map the channels. the model file has no cncept of whattype of TX it is on, and I want to keep it that way.
I have bin fiddling whth a hardware diod light mod so at the front you can see what module is in use. Are the different modules power less when not in use?PhracturedBlue wrote: For the flysky mod, my plan is to have a page on the tx-config screen that lets you set which modules you have and whether they have a PA or not. That way you won't need to set the power to '150mW' on the devo7e for instance. It isn't going to happen before the release though.
How do you mean "won't need to set the power to '150mW'"? Do you mean setting the power on the start screen?
If I understand right it sounds really good. My only interest is being able to set them my self. Will it, are it possible?PhracturedBlue wrote: For the switches, I was hoping to do something similar, but I was thinking of merging it with the virtual-switch stuff that you're doing. Fundamentally in the code having switches which can be conditionally configured is a lot of work because they are predefined in a list and we can't easily skip over them without changing every spin-box that uses a switch. So I want instead to enable virtual switches and then allow mapping new hardware to them.
Another thing, is there any kind of fast bind way. With out going in to the menu's? If not shouldn't there be? For example three buttons at the same time.
Please Log in or Create an account to join the conversation.