Stock/er9x Rotary Encoder

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa »

Exactly, hence my suggestion above :)
The EXT pins are the old 9x trims that are now free as the 9xtreme handles the trims. There are 8 of them and I'm using a few for 4 pushbuttons, and another for making the ELE switch 3 position. I'f I'm not mistaken, there are 8 of them :)

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
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Lets wait for Mike to decide wether its possible or not. As fas as i see your idea is good but technically i dont know if it will work.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa »

Why not? The old trims, as far as I know are digital pins, the same as the other pins on the processor where my encoder is connected..
The old trims are even already configured as inputs in the firmware ;) :) But yeah, let's see what Mike says, he is the one that know for sure if it is possible or not :)

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: Stock/er9x Rotary Encoder

Post by MikeB »

The problem with using the old trim inputs is they have a 0.1 uF capacitor across them. This significantly limits the rate at which rotary encoder changes may be detected.
There are two ways currently supported for an encoder on the 9Xtreme. One is as described on the first post of this thread. The other is to us an Arduino Pro Mini connected to the I2C/COM3 connection as described here: viewtopic.php?f=126&t=7714&p=103696&hil ... er#p103696.

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: Stock/er9x Rotary Encoder

Post by jhsa »

Forgot about the capacitors ;) Also forgot about the arduino as I can't use the I2c on board :)

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
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Maybe it would be easy enough for me to handle it. Is there any "how to" for the mod with the arduino?
thx.

@Mike
This mini pro is good right?
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

That Pro Mini (3.3V, 8MHz) should be fine, only a '168, but the program is very small.
I don't think I've written anything up, I'll see if I can do something.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Here is a .pdf with some instructions (and pictures), of how I wired mine.
Enc_Arduino.pdf
(104.69 KiB) Downloaded 369 times
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Many thx mike.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Hi Mike, regarding the pull up resistors, is there any specs i should be looking for?
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Nothing special, just 3.3K as the value. They only have 1mA passing through, so the power is only 3.3mW.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

With this rotary encoder installed, the midle key should be the "ok" or "select" button, like the menu button is with the default layout, right? Is there any chance of making this menu button configurable for other functions? If so, what about a ersky9x version for the tx's with the encoder in which a feature is added for assigning diverse functionality to that "menu" button. Im blank here, dont really know if that is possible.
thx
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

That might be possible. If enabled as a different function, it would be disabled from it's normal function, which is a sort of combined MENU and EXIT button (a long press acts as EXIT).

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: Stock/er9x Rotary Encoder

Post by jhsa »

Mike, to eliminate completely the use of the menu and exit keys (thinking of the ArUni board) you could for example implement also a double click of the centre button.. Then you would have
normal press, double press (right timing to be tested) and long press, that you could keep as exit??

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
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

That's great, you could put a line in the hardware menu for instance, in which a user could assign it for a feature from a list, for example edit present model menu. Use it for a shortcut to whatever feature availabe on the radio.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

MikeB wrote:Here is a .pdf with some instructions (and pictures), of how I wired mine.

Enc_Arduino.pdf

Mike.
Hi Mike,
reading what you wrote here, im making some progress. Since my arduino's layout differ a bit from yours i would like you to have a look and see if im on the right path.
Please check if the wire disposition is right. I've been looking at older boards and i think its right, but i need your avail.
Please check if the wire disposition is right. I've been looking at older boards and i think its right, but i need your avail.
Here you can see that the A4 and A5 are not at the same spot as the arduino you have in the sketch.
Here you can see that the A4 and A5 are not at the same spot as the arduino you have in the sketch.
Are the pull up resistor ok? As you did, they go from vcc to A4 and A5.
Are the pull up resistor ok? As you did, they go from vcc to A4 and A5.
My real doubt is here. There are four wires coming from the arduino and the I2C plug has five. Which goes where?
My real doubt is here. There are four wires coming from the arduino and the I2C plug has five. Which goes where?
Thanks in advance for your time.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Here is the expansion grid:
Xgrid.jpg
Xgrid.jpg (83.69 KiB) Viewed 14778 times
The top row of connections is copied onto the 5-way connector labelled I2C above it, so you may use either the connector, or the connections on the expansion grid.
For the encoder you need 3.3V (pad 5), GND (pad3), and SDA (pad 2) and SCL (pad 4).

Your pull up resistors look OK.

If the connections to the encoder board are not correct, no damage to the encoder or the Arduino will occur.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

@Mike
I must be cursed, i followed the instructions meticulously and the encoder only works as the normal up/down/left/right.
I have no words.
Any thoughts out there?

EDIT: It was my mistake. Sorry. Damn.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Hi Mike, in the pdf you wrote, the I04 connection of the arduino goes to the encoder center switch right?
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Correct. IO2 and IO3 are the encoder connections, IO4 is the switch.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Is there a specific order for the I02 and I03? This is not clear in the pdf you wrote.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

There is, but you don't know what it is until you connect and test! If you have them 'wrong' then the rotary operates in the 'wrong' direction, that is rotating clockwise moves left or reduces a value.

There is no electrical problem if they are 'wrong'.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Ok, the problem is that i thought i had the connections wrong, but i checked and they are ok. Only the cross buttons work. No center switch and no rotary. i will post pictures soon.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Have you set the "I2C Function" in the Hardware menu to "I2C"?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

yes.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Double checking that A5 on the Arduino goes to SCL (pad 4) and A4 goes to SDA (pad 2).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Yes, thats right, that connection is ok.
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

I plugged the Arduino with an encoder into my 9Xtreme, set the I2C option and it is working.
I assume you have flashed the Arduino from the Arduino IDE, with the correct processor selected ('168).
When the program starts running on the Arduino, it enables pull ups on the three connections to the encoder. Please check to see the encoder switch input is at VCC normally, and switches to 0V when you press the encoder switch.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
OctavioS
Posts: 657
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS »

Yes, i have flashed to the right arduino with arduino ide.
regarding the last part i really dont get it, its a little bit too technical for me. Where do i see that? is it in the radio menu where you check if the buttons are ok?
2x - Turnigy 9X with 9xtreme board;
2x - Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s;
Radiomaster TX16S Max mark II.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB »

Using a test meter measure the voltage on the connection on the Arduino.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “er9x”