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.
Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by Iksbob »

MikeB wrote:Using a test meter measure the voltage on the connection on the Arduino.
To expand on that:
Get a multimeter, preferably a digital one. Harbor Freight (a bargain tool store in the US) sells them for less than $10, so hunt around a little and you should be able to find something affordable.
Plug the black test lead into the COM socket on the meter, and the red one into the V / Ω / everything but A socket.
Set the meter to volts DC (VDC, or sometimes a solid line with dashes under it:). There may also be just positions for volts (V) and a switch for DC/AC. If you have a manual-ranging multimeter, there will be several numbered positions (ranges) for volts. The number represents the maximum value the meter can read on that range setting. The lower the range, the more precise the meter is, so pick the range just above the highest voltage you expect to encounter (5V in this case). If your meter only has one setting for V or VDC, it's an auto-ranging meter which will pick an appropriate range value for you.
Open your radio and power it up. Touch the black/COM test probe to the GND pin of the Arduino, or bare metal/solder of the wire connected to the GND pin. Touch the red test probe to the (bare metal/solder of the) wire you want to test, in this case one of the encoder wires, button wires and/or encoder common wire.

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 »

Iksbob wrote:
MikeB wrote:Using a test meter measure the voltage on the connection on the Arduino.
To expand on that:
Get a multimeter, preferably a digital one. Harbor Freight (a bargain tool store in the US) sells them for less than $10, so hunt around a little and you should be able to find something affordable.
Plug the black test lead into the COM socket on the meter, and the red one into the V / Ω / everything but A socket.
Set the meter to volts DC (VDC, or sometimes a solid line with dashes under it:). There may also be just positions for volts (V) and a switch for DC/AC. If you have a manual-ranging multimeter, there will be several numbered positions (ranges) for volts. The number represents the maximum value the meter can read on that range setting. The lower the range, the more precise the meter is, so pick the range just above the highest voltage you expect to encounter (5V in this case). If your meter only has one setting for V or VDC, it's an auto-ranging meter which will pick an appropriate range value for you.
Open your radio and power it up. Touch the black/COM test probe to the GND pin of the Arduino, or bare metal/solder of the wire connected to the GND pin. Touch the red test probe to the (bare metal/solder of the) wire you want to test, in this case one of the encoder wires, button wires and/or encoder common wire.
couldnt have a better explanation, thx 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
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, i measured the voltage and its 3.31v.
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 »

Does it switch 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 »

No, it stays the same. No voltage change.
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 »

OK, please remove the wire connecting the switch to the Arduino, then measure the voltage on the Arduino and also on the wire.

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 »

Hi Mike, i measured the voltage: on the arduino (wires from I2C) there were the same 3.31v. From the same GND to switch wire (the wire going to IO4), it measured -0.15volts and from the GND next the IO2 and the switch wire it was oscilating between 0.42v to 0.45v.
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'm not certain the firmware in the Arduino is running. Can you read the contents of the flash to a .hex file and 'post it for me to look at?

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 what i did to get this was: went to arduino prefernces, checked the compilation at show verbose output during: and went to the file location to get the .hex
I2Cencoder.ino.hex
(5.93 KiB) Downloaded 417 times
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 »

What Arduino IDE version are you using?

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 »

Its 1.6.12
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've just posted a specific test version for the 9Xtreme. This counts how many times the I2C encoder on the Arduino responds to the request from ersky9x. The counter is displayed on the "Debug" menu (UP LONG, then RIGHT several times). On the 5th line you should see "I2C= 0000" on the right. The number will count up if the Arduino is responding correctly.
Please flash this test version to your radio, connect the Arduino to the I2C signals and see if the counter is changing (no need to have the encoder connected to the Arduino for this test).

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 Mike, the number changes very fast.
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 »

Ok, that means the Arduino looks to be working on the I2C side. It should count be counting 20 times per second. As it is a "hex" number this means the second digit represents 256 so should take just over 12.5 seconds to change.

Have a look on the "DiagSwtch" menu. At the top left you should see a value for "Enc". This should be a '1'.
If you connect the IO4 pin on the Arduino to ground, this should change to 0, although if it stays grounded for a "long press" time, the radio will take it as an "Exit" operation and leave the menu.

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 it's "1" in the diagSwtch. But the "1" is highlighted as if it was pressed. I also see that when I press down, the left and down are highlighted at the same time. I think I will have to trim the case a little bit more, because I noticed that the up key has little down movement.
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 »

Mike i removed the board and trimed the inside of the case area where the edges of the rotary rest and the problem with pressing down and simoultaneouly activating left is solved.
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 »

OK, I got what you should see a bit wrong, I just double checked on my 9Xtreme.
With nothing connected to IO4, it should be at 3.3V and the "Enc" value on DIAGSWTCH should be '0'.
When you connect IO4 to ground, then the "Enc" value should change to '1' and be highlighted.

I suggest have a good look at the IO4 pad and make sure there is no short to anywhere on it.

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 »

IMG_4020.JPG
IMG_4020.JPG (39.7 KiB) Viewed 14198 times
Mike this is the wiring i followed, is it right?
The Ground goes to arduino GND
The center switch goes to IO4
And the other ones i dont recall right now which is wich. Is it right so far?
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 think that is correct, to be certain I'll need to find one of my (unused) 7-way switches.
If you have IO4 disconnected, you should see '0' beside the "Enc" on DIAGSWTCH.

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 »

I already soldered it back, never checked without IO4 disconnected, but ill have a look.
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 »

I forgot to mention that when I power on the radio the menu pop up shows up. this must be related to the diagswtch 1 showing hilighted. i will check all the wiring tomorrow.
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, i've unsoldered the switch wire from the arduino and enc goes to 0 in the diagswtch menu. but when i solder it again, the same problem persists. I've checked the wiring for possible shorts, but found nothing weird. Im out of options. I really dont know what to do. i'll put the radio to rest untill. There has to be a faulty rotary or even the arduino. Ill try with another arduino later. Thx for your time and patience.
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 think the Arduino is working OK. I suggest, disconnect the IO4 signal, then measure the resistance between the wire you removed and ground. It should be open circuit (very large resistance) unless you press the centre button on the encoder.

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 »

Ill give it a try as soon as i have some time.
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 »

I've tested the resistance and there's nothing, no value.
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 »

What about when you press the centre button, do you then get a (near) zero resistance?

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 just checked resistance. When the I put the leads, the value is 1, then when the button is pressed the value goes up to 500 and above and comes back to 0. A little bit the opposite of what you say.
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 think the wiring to the PCB is incorrect. Having measured the connections on a 7-way switch of mine, then the signal you show as Gnd (on the picture a few post back) one of the encoder connections. The next one is (correctly) the centre switch, then Gnd then the other encoder connection.

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, my connections are pcb gnd to Arduino gnd/ pcb center switch to IO4 and the other connections from pcb to IO2 and IO3. I didn't get which one is wrong.
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 »

On the PCB itself, you have:
Rotary - Rotary - Switch - Gnd.
I think these should be:
Rotary - Gnd - Switch - Rotary.

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

Post Reply

Return to “er9x”