- Posts: 174
Devo7E beta15 + Switch Mod will not fit in ROM
- robca
- Offline
victzh wrote: @HappyHarry - using galee's code is problematic, it is very heavily repackaged Deviation, no direct correspondence.
What is so special about this code in contrast to Deviation that you'd want to bring in?
Mostly because it cleverly manages to implement two 3-way switches, by using more diodes and implementing a scanning algorithm pulling pins high and low as needed
I started looking into it, but my coding skills are weak and I didn't find enough time to look at it yet.
If you look at the repository posted earlier, the relevant file is Fkey.c.
I found two versions of that file, one before and one after the addition of the two-way switches (with a lot of help from cmpang from this forum).
By comparing the files, you can see how the matrix is scanned using GPIO_CNF_OUTPUT_OPENDRAIN instead of GPIO_CNF_OUTPUT_PUSHPULL, and adding two section:
if(result==KEY_MASK)
{
//PC6 ¿ªÂ©Êä³ö²¢ÀµÍ
gpio_set_mode(KEY_ROW_PORT,GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, GPIO6);
gpio_clear(KEY_ROW_PORT, GPIO6);
KeySwExt=(~(gpio_port_read(KEY_COL_PORT)>>5))&0xf;
//»¹ÔPC6
gpio_set_mode(KEY_ROW_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, GPIO6);
gpio_set(KEY_ROW_PORT, GPIO6);
}
and
s=gpio_port_read(KEY_SW_PORT);
sw=0;
if(s&(1L<<10)) sw|=SW_FMOD;
if(s&(1L<<11)) sw|=SW_HOLD;
if(KeySwExt&1) sw|=SW_FLAP0;
if(KeySwExt&2) sw|=SW_FLAP1;
if(KeySwExt&4) sw|=SW_GEAR0;
if(KeySwExt& sw|=SW_GEAR1;
if(sw==SwBuf) SwStat=sw;
else SwBuf=sw;
}
I'm enclosing the two files (old and new) and a XPS (can be opened with any new-ish Windows OS) with the description of the HW mod (in Chinese, but the pictures are self-explanatory)
Please Log in or Create an account to join the conversation.
- robca
- Offline
- Posts: 174
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- robca
- Offline
- Posts: 174
PhracturedBlue wrote: I think I gave him that code way back when. It is pretty intrusive to add to the default build though.
definitely a significant change, but for people adding the two 2-way switches, the soldering and hw changes are pretty much identical. A Devo 7e with two additional 3-way switches becomes a significantly more flexible beast
I'd be delighted if anyone could write a patch for adventurous people . I can build any repository (thanks to the VM), it would just take me a long time to figure out how to make it work without being familiar with the code
Cmpang also has the HW modification done already (and he's using Galee's builds, who are pretty old by now), so I'm sure he'd only be too happy to test (sorry cmpang for putting words in your mouth )
I'm soldering my switches tomorrow, will flash Galee's build to test them, and then I should be able to test as well
If there's nobody willing to do it, sooner or later I still hope to find the time to look into it
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
setting NO_STANDARD_GUI should remove the entire 'src/pages/128x64x1/standard' directory.
This is currently done by modifying targe/devo7e/Makefile.inc to uncomment:
#NO_STANDARD_GUI := 1
that modifies the Makefile behavior. It would be better to do in target_defs.h though. That just requires placing the relevant #ifdefs in each of the files in the src/pages/128x64x1/standard directory
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- HappyHarry
- Offline
- Posts: 1136
victzh wrote: @HappyHarry - using galee's code is problematic, it is very heavily repackaged Deviation, no direct correspondence.
What is so special about this code in contrast to Deviation that you'd want to bring in?
the addition of 2 extra 3 pos switches, and 2 extra fully analogue channels for starters
[edit]
oops should re-read the thread before replying lol
[/edit]
Please Log in or Create an account to join the conversation.
- robca
- Offline
- Posts: 174
victzh wrote: It was my impression that we had some Switch Mod for Devo7E, is not this whole thread about it? What's the benefit of galee's code/modification compared to what people did with standard Deviation code? More switches? How many do you need? (It's not a rhetoric question, I plan to include extra switch ability to multi-module board, so it's for real.)
Standard mod is two 2-way switches or one 3-way switch. With the same amount of soldering and cost (well, couple diodes extra, but those are sold in packages ot 10 anyway), you could have two 3-way switches. Given that the Devo 7e already has two 2-way switches as base functionality, the ability to add two more 3-way switches is significant (and all for the cost of a dozen new lines of code )
Many quadcopter controllers use 3 way switches for flying mode. My KK2 flight controller (with 1.6++ CPPM firmware) can use a 3-way switch for Acro/SL-mix/SL and another to control the default positions of a 2-way gimbal
I guess I could live with only one 3-way switch and either using the throttle-trim trick (but it's not very user friendly: no tactile feedback), or limit the options using 2-way switches... but having two 3-way switch would be perfect, and leave the remaining two 2-way switches for retractables, lights or anything else
more importantly for me, currently the patch to enable the two 2-way switches is not part of the main build, so it's already something users have to build/find. Assuming it can be coded, a 3-way switch seems a simple superset of the 2-way switches and adds a lot more value
And, to answer your question, two additional 3-way switches are all I can think of (on top of the existing two), for a form factor as small as the 7e. Possibly an extra analog channel (rotary), but that would really be a "just in case" (3 axis gimbal)
Please Log in or Create an account to join the conversation.
- cmpang
- Offline
- Posts: 296
Plane pilots using flaps are using it for the 3-stage settings too. Scale boat modellers found it useful for the 3 stage lighting..
Don't let the 7e's toy-size outlook fools you.. there is never a short-coming in using it in a formal flying field.. no lack of feature compared with the big boys by F and J.. and it just surprises the other pilots how well it performed..
With the good work of Deviation, the 7e bcomes a 12 channels capable Tx and it is just a waste that this capability is limited by the number of available input devices ( switches and pots).
The good thing is the mod is much much easier than that of the diode mod. Cost and labor in doing that is just about the same as doing the 2-way switch mod.
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- robca
- Offline
- Posts: 174
victzh wrote: And about fitting in ROM - it is true that Devo7E is at the brink of its memory capability, but some extra life can be breathed in by using only advanced GUI. I think for people wanting some extra controls - switches, POTs - it's no barrier, they're advanced by definition. Am I correct?
that would definitely be ok by me
as for your previous question, cmpang helped translate some of the content in the fkey.c file, and here's something that should help:
// B.5 B.6 B.7 B.8
//C.6 Rudder TL Rudder TR Elevator TU Elevator TD
//C.7 NC Ent R+ L-
//C.8 Throttle TU Throttle TD Aileron TR Aileron TL
//C.9 NC DN- UP+ Ext
//
//Comment:
//TL: Trim Left TR: Trim Right
//TU: Trim Up TD: Trim down
//
//OP:
// 红RED PB5 蓝Blue PB8 白White PB6 黄Yellow PB7 Brown棕PC6 This seems to match the color of the wire used to connect the switches
Basically it should tell you (together with the picture) where to the GPIO B the wires/switches connect, with the brown wire connected to GPIO C6
from the Devo HW table:
GPIO B
5: Button Matrix Col 1 - Red
6: Button Matrix Col 2 - White
7: Button Matrix Col 3 - Yellow
8: Button Matrix Col 4 - Blue
GPIO C
6: Button Matrix Row 1 - Brown
GPIO C6, Brown goes to the center contact of the 3-way switch (makes sense), and the GPIO B5-8 are connected to the outer contacts thru diodes. Basically it seems to be using Button Matrix Row 1 set high and low, then reading what happens to the GPIO B5-8, with some help from the diodes to prevent wrongly detecting other buttons status
does it help? I can try and draw a real diagram, if you think it's helpful
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
www.deviationtx.com/forum/7-development/...-work?start=320#6312
May or may not help
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
cmpang wrote: I have been using the two 3-way switch version since May and Rob is right that no multi-rotor pilots can live without it.. say the Phantom, Walkera QR X350 and any rotors that are using GPS functions.
Plane pilots using flaps are using it for the 3-stage settings too. Scale boat modellers found it useful for the 3 stage lighting..
Don't let the 7e's toy-size outlook fools you.. there is never a short-coming in using it in a formal flying field.. no lack of feature compared with the big boys by F and J.. and it just surprises the other pilots how well it performed..
With the good work of Deviation, the 7e bcomes a 12 channels capable Tx and it is just a waste that this capability is limited by the number of available input devices ( switches and pots).
The good thing is the mod is much much easier than that of the diode mod. Cost and labor in doing that is just about the same as doing the 2-way switch mod.
I was not aware that you can even install some pot for devo7E ... With such capacitied it's more or less a devo10S
You have a link how to install pot ?
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Galee scans the key matrix in both directions - from col to row and if no key is pressed (otherwise the result will be falsified) from row to col. He uses only one row for the reverse scan - could be four to have 16 additional switch positions (= 16 2-way-switches or 8 3-way-switches or something in between). Good idea.robca wrote:
Mostly because it cleverly manages to implement two 3-way switches, by using more diodes and implementing a scanning algorithm pulling pins high and low as neededvictzh wrote: @HappyHarry - using galee's code is problematic, it is very heavily repackaged Deviation, no direct correspondence.
What is so special about this code in contrast to Deviation that you'd want to bring in?
The 2-switch-mod and the 3-switch-mod are using the free places in the key matrix where no buttons are installed. It should be possible to integrate this in one solution (without the need to change the existing 2/3-sw-mods).
Give me some time to think about.
Edit: I missed the last 2 hours of discussion while reading some code - I hope I am not outdated...
Please Log in or Create an account to join the conversation.
- cmpang
- Offline
- Posts: 296
The idea is simple. Making use of the PPM in function and use an existing PPM encoder (something aurdino) to feed in as the higher channels and you are done.
Please Log in or Create an account to join the conversation.
- cmpang
- Offline
- Posts: 296
that is what Gale has explained in his thread .. too bad the thread is too long and I cannot dig out the exact wording in the orginal post ... anyway, scanning in both directions is the key ...
(for some unknown reason, Gale has not been online for more than 3 months, otherwise I would ask him to give a me full description on the algorithm so that I can translate it in English. It is just an English language barrier afterall)
cmPang
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Builds
- Devo7E beta15 + Switch Mod will not fit in ROM