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
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Stock/er9x Rotary Encoder

Post by MikeB » Fri Aug 31, 2012 7:20 pm

Adding a rotary encoder to the stock board, for use with er9x, may be done in one of two ways. The the physical type of the encoder does not matter, this deals with the electrical connections.
The connections consist of a common terminal, a switch signal and two encoder signals (A and B)

One method of connection will be to use the (new) TelemetrEZ board. This will be the easiest way, but still has some development to finalise it.

This is the other way.

The three signals connect to three of the LCD data lines at the processor. This involves soldering three wires directly to the processor pins, in the same way needed by the telemetry mod.

Each signal needs a 3K3 or 3K9 resistor in series:
Encoder.png
Encoder.png (1.74 KiB) Viewed 13396 times
and here is a picture showing the three wires soldered to PORTA bits 7, 6 and 5:
RE1.jpg
I used kynar, single strand wire for this, and connected to a small piece of stripboard glued the the PCB to allow for changes so I don't need to touch these three wires again.:
RE3.jpg
Bits 7 and 6 are the encoder (A and B) signals, bit 5 is the switch signal. As different encoders may have the A and B signals connected differently it may be necessary, after assembly, to swap these two connection over to get the correct operation.

The common connection goes to a +5 volt pad, I used this one:
RE2.jpg
I'm testing using this encoder, but have also tested using a small encoder that looks rather like a pot:
RE4.jpg
I made a PCB for this encoder, as described elsewhere (viewtopic.php?f=7&t=1084&start=120#p20884), and included three, surface mount, resistors on it

Er9x r107 includes code to support these connections. The firmware is in early development (31/8/2012), so little functionality is currently available, but the driver coe is working.

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


User avatar
jhsa
Posts: 18815
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Fri Aug 31, 2012 7:30 pm

Mike If you don't mind would you let us know how did you connect those resistors please??

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: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Aug 31, 2012 7:52 pm

They are on the circular PCB I made, similar to the one linked above. I can't post a picture because it is now soldered into the radio and the resistors are on the side of the board towards the main PCB.
It is something like (I've drawn three surface mount resistors on the original image):
EncPcb.jpg
EncPcb.jpg (7.29 KiB) Viewed 13390 times
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 18815
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Fri Aug 31, 2012 7:55 pm

Thanks for the picture Mike.. I will try to put all this on the wiki when I have some time.. gotta prepare my work for tomorrow..

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

ek123
Posts: 17
Joined: Mon Aug 27, 2012 9:13 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by ek123 » Sat Sep 01, 2012 1:11 am

Hi,

Mike can you suggest a small encoder that looks like a pot? I'd prefer this approach to the larger encoder.

Thanks,
Eusebio


User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sat Sep 01, 2012 2:56 pm

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

C.João
Posts: 147
Joined: Thu Jan 12, 2012 7:49 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by C.João » Sun Sep 02, 2012 2:11 pm

Hi Mike,

on the FW wise side... does the ER9x support the encoder?
I managed to find the problem on my board so I'm modin' away! I've got some rotary encoders right now. I could get this tested sometime this week...

User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sun Sep 02, 2012 3:04 pm

The last revision (r772) includes the driver code and some application code.

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

ek123
Posts: 17
Joined: Mon Aug 27, 2012 9:13 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by ek123 » Thu Sep 06, 2012 12:30 am

Hi Mike,

I looked at the datasheet for the rotary encoder link you gave above and I'm not sure about the following: Does this encoder have 5 pins, 3 for terminals A,B and C and then 2 for the push button switch? I ask because this particular encoder is discontinued here in the US but there are many probable replacements, some I even found on ebay. However, some seem to have only 3 leads even though they say they have a switch and some have 5 leads. I can see from your schematic above that 3 leads go to the LCD as indicated on the subsequent photo. I don't see where I would even connect the other two leads.

Thanks in advance for any help.

Regards,

Eusebio

C.João
Posts: 147
Joined: Thu Jan 12, 2012 7:49 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by C.João » Thu Sep 06, 2012 1:43 am

all encoders should have 3 pins. the switch is pretty much always on "the other" to pins. I got some encoders from ebay (for other projects) they should work

User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Thu Sep 06, 2012 8:46 am

Three leads from the actual encoder, one is common and goes to the +5volts, the other 2 go to the LCD connections.
Two leads from the switch, one goes to +5volts, the other is the third connection to the LCD pins.

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

ek123
Posts: 17
Joined: Mon Aug 27, 2012 9:13 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by ek123 » Thu Sep 06, 2012 7:38 pm

Hi Mike,

Thanks. I understand now.

Eusebio

C.João
Posts: 147
Joined: Thu Jan 12, 2012 7:49 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by C.João » Sun Sep 09, 2012 5:11 pm

I've tested with an rotary encoder and the radio reads the signals :D it work.

it is a bit glitshy for now... sometimes when I rotate the encoder a little bit quicker the radio read backward or erratic.

some revisions later it could work better :D

User avatar
jhsa
Posts: 18815
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Sun Sep 09, 2012 5:59 pm

yeah, you're not supposed to attach the encoder to the dremel. You should use your fingers to turn it :D
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: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sun Sep 09, 2012 5:59 pm

I'm only polling for changes to the encoder signals every 10mS. I didn't want/can't use an interrupt because it is on the LCD lines, so there may be missed pulses on quick rotations.
I'll see if I can poll it quicker.

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

User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sun Sep 09, 2012 6:51 pm

Looks like I have found a way to poll it more often, it seems to keep up much better.
Will be in the next revision.

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

C.João
Posts: 147
Joined: Thu Jan 12, 2012 7:49 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by C.João » Sun Sep 09, 2012 9:45 pm

perfect. I'll prepare my dremel by then :D

User avatar
Kaji
Posts: 7
Joined: Wed Dec 28, 2011 8:39 pm
Country: -
Location: Lahti, Finland

Re: Stock/er9x Rotary Encoder

Post by Kaji » Thu Sep 13, 2012 6:57 pm

Managed to manufacture my own PCB. I will add those resistors and I think I'm good to go! 8-)
Attachments
002_1024.JPG
001_1024.JPG

User avatar
Kaji
Posts: 7
Joined: Wed Dec 28, 2011 8:39 pm
Country: -
Location: Lahti, Finland

Re: Stock/er9x Rotary Encoder

Post by Kaji » Fri Sep 14, 2012 4:22 pm

Rotary encoder mod is now ready and seems to be working fine!

Of course software is not yet finished and some of the functionality is missing, but overall this mod was worth the effort! :)

I noticed that unlike buttons the rotary encoder wont activate the back light. Software was r773.
Attachments
006_1024.JPG

User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Sep 14, 2012 4:48 pm

Can you confirm the rotary encoder button does turn the backlight on, but just the actual rotary bit does not. Does the rotary need to activate the backlight? You almost have to use a button to do anything?

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

User avatar
jhsa
Posts: 18815
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Fri Sep 14, 2012 5:07 pm

I vote for yes
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
Kaji
Posts: 7
Joined: Wed Dec 28, 2011 8:39 pm
Country: -
Location: Lahti, Finland

Re: Stock/er9x Rotary Encoder

Post by Kaji » Fri Sep 14, 2012 5:13 pm

Rotary encoder button activates the back light, but rotary part doesn't.

I think behavior should be same as using buttons for back light when using rotary encoder.

I can go up and down in main menu with rotary encoder and I can change some values with rotary encoder, but looks like I can't change letters in model name using rotary encoder.
MikeB wrote:Can you confirm the rotary encoder button does turn the backlight on, but just the actual rotary bit does not. Does the rotary need to activate the backlight? You almost have to use a button to do anything?

Mike.

User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Sep 14, 2012 5:19 pm

It is a work in progress, quite a bit to do. The name changing is a dedicated piece of code, will need to be done specially.

The button didn't need any extra code to handle the backlight, the rotary part will.

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

User avatar
Kaji
Posts: 7
Joined: Wed Dec 28, 2011 8:39 pm
Country: -
Location: Lahti, Finland

Re: Stock/er9x Rotary Encoder

Post by Kaji » Fri Sep 14, 2012 5:22 pm

Hmm.. I noticed some erratic behavior of the back light and tactile feed back when changing timer values, but it is same as using buttons. Light goes on but almost immediately shuts down and I think there shouldn't be tactile feed back when changing this value.

Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: Stock/er9x Rotary Encoder

Post by Iksbob » Tue Oct 09, 2012 6:48 pm

For those interested in the directional button replacement, I shot some video of PCB prep and installation. I haven't gotten around to any real editing yet, so it's an hour and 10 minutes - no audio, so put on your favorite music album and/or skip around. It's HD, so if you're having a hard time seeing what's going on, flip to a higher quality setting and go fullscreen. Hope it helps someone.
http://www.youtube.com/watch?v=DgD_VLkfgkY

Irish Steve
Posts: 149
Joined: Thu Dec 29, 2011 10:04 pm
Country: -
Location: Ashbourne Co Meath

Re: Stock/er9x Rotary Encoder

Post by Irish Steve » Tue Oct 09, 2012 9:08 pm

Need ro run some of it again, but yes, that's a BIG help, Thanks for making and posting it.
Irish Steve

If it was easy, shure, would't we all be doin it?

_

Buckmaster
Posts: 36
Joined: Sat Nov 03, 2012 4:53 pm
Country: -
Location: New Lenox, Il

Re: Stock/er9x Rotary Encoder

Post by Buckmaster » Tue Dec 11, 2012 2:41 am

Hey guys, I'm just starting to scratch/h the surface on this mod, and unfortunately am more or less electronics illiterate :( Could someone let me know what those 3 surface mount resistors were? Are that the 3k9? Thanks.

User avatar
MikeB
9x Developer
Posts: 16484
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Tue Dec 11, 2012 11:21 pm

Yes, 3K9.

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

Buckmaster
Posts: 36
Joined: Sat Nov 03, 2012 4:53 pm
Country: -
Location: New Lenox, Il

Re: Stock/er9x Rotary Encoder

Post by Buckmaster » Thu Dec 13, 2012 3:04 am

Thanks Mike! :D

Buckmaster
Posts: 36
Joined: Sat Nov 03, 2012 4:53 pm
Country: -
Location: New Lenox, Il

Re: Stock/er9x Rotary Encoder

Post by Buckmaster » Wed Jan 16, 2013 5:00 am

Does anyone know if the 3 surface mount resistors can be eliminated if hooking up through the TelemetrEZ board? I thought I read somewhere that they weren't necessary in that case, but I can't find where it was so I could verify / get details.


Post Reply

Return to “er9x”