Six Rotary Encoders, which embedded system/MCU?

Discussion in 'Embedded Systems and Microcontrollers' started by wes06, Apr 10, 2014.

  1. wes06

    Thread Starter New Member

    Apr 10, 2014
    Hey all,

    I need to build an interface consisting of 6 rotary encoders (20~24 "steps" with a switch). This system will output 6 PWM signals and the rotary encoders function will change according to the button presses.

    My main question is, which microcontroller could I use, without losing too much speed (in the rotation detection)?

    I'm am familiar with arduino and have a beaglebone black which I can use/study.

    Thanks in advance.
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    It would help to know how fast the encoders are turning as that determine how much overhead they need to read the signals. If they are just manual twirly knobs that's not a huge burden and you can keep to a midrange device.

    There are devices with multiple hardware PWM modules that are just "set and forget" so they don't have a software/speed overhead.

    If the functions don't combine there is also the option of developing one controller to read the know and output a PWM signal and just use 6 of them. Bottom of the range processors off the shelf can be had for under a buck.

    I don't know either Arduino nor Beaglebone. I do know Microchip PICs, they need a custom programmer (little over or under $50 depending on the version) (get the more expensive one)(;-) but there is a free C compiler the company lets you download.

    They have tons of chips that could work.

    Microchip PIC Part Selector
  3. John P

    AAC Fanatic!

    Oct 14, 2008
    What on earth does 20~24 "steps" with a switch mean?
  4. PicoKit

    New Member

    Apr 10, 2014
    A 64 pin PIC24FJ64GA306 has 7 individual PWM channels and this is a 16bit PIC.

    or the PIC24FJ128GA306 has more memory.

    You don't really need that many pins, but no smaller PICs have 6 individual time bases for the require 6 channels of PWM

    The rotary encoders will require 2 digital input pins each (12 in total) and is it one switch or 6 that you need?

    So you might only need less than half the pins on a 64 pin device.

    These devices run at 16 MIPS max.

    About $3.50 each (individually priced) or free samples available in TQFP and QFN.

    These will run at 2V - 3.6V

    Or, software PWM is achievable depending on the frequency and bits you need - and then a 28 pin 16F part may suffice even at 8 MIPS (with internal oscillator) depending on your code.

    Any more info you can give would be helpful. Or you can normally work things out by visiting the microchip website product selector.

  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    I've worked with those manual knob type rotary encoders, 24 counts per rev is a typical type. Users can turn them fairly quick, a quick jerk can see 10 RPS speed for a short time.

    However that is still quite slow in computer terms. You can use a timer interrupt that occurs faster then the fastest change any encoder makes. Then in that one int, you read the 12 pins from 6 encoders and generate the position data (usually that is just turning a variable up/down).

    I'm guessing from the 6 PWM outputs this is a lighting controller? If so, you can manually produce the 6 PWM channels as lighting only needs low-frequency PWM.
  6. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    As an alternative, you could you 3 small, cheap PICs, each monitoring 2 rotary encoders via the Port B interrupt. They could then queue and transmit their data to a master chip via SPI or IIC.