Shop OBEX P1 Docs P2 Docs Learn Events
Rotary Encoder Issue — Parallax Forums

Rotary Encoder Issue

HeliheadHelihead Posts: 4
edited 2009-05-18 03:22 in Accessories
Hi All,

I have been away from circuits for a while so I'm probably just missing something obvious but I have a problem with a rotary encoder on a BS2 that has me stumped.

I have an Oak Grigsby 5V 64PPR encoder PN 78016 connected to P0 and P1 on a BS2 plugged into a super carrier board.· I rotate the encoder but get no inputs.·

I breadboarded the encoder before I hooked it to the uC and it works great with 1K pull-ups.· It clocks forward and backwards just fine and switches LEDs on/off and I have confirmed the outputs with my oscilloscope.· Everything looks great on the bread board.

I confirmed by BS2 and stamp code by switching those two inputs with plain old switches.· I can toggle them by hand and watch it count up and down just pefect.

When I hook·the encoder to the BS2, I go no input although I do see the inputs swing from .1V to about .21 and back as I rotate.· I thought it was likely my selecion of pull-up resistors but at this point I have tried everthing from 50 ohms up to 100K Ohms and I get basically the same thing.

In summary:

1) The encoder works perfect on a breadboard with 1K pull-ups.
2) The BS2 and code work perfectly when switched with push button switches.
3) The encoder connected to the BS2 only swings the inputs about .2V regardless of pull-up resistors selected and never trigger the input

Any·ideas?

Even with the problem it's good to be back doodlin' with circuits again.

Thanks

Comments

  • kwinnkwinn Posts: 8,697
    edited 2009-05-17 23:37
    Try it on the BS2 board with 1K pullups without connecting it to the BS2 pins and check the output with the scope. based on the voltages you posted it looks like the input signal is loaded down or shorted.
  • HeliheadHelihead Posts: 4
    edited 2009-05-17 23:56
    Thanks for the reply.

    I disconnected the encoder inputs from Po and P1 and it clocks perfectly.· I get about .3V for the low and it switches to 4.8V for the high pulse from the encoder.· I hooked it up to P0 and I'm back to the original issue where it swings from about .2V to .45V as I clock the encoder.

    I think you are right about the input being loaded but I'm not sure what else it would be as the 2 encoder inputs are currently the only connections on the board besides the built in super carrier stuff.

    Like I said, I can jumper the input to Vdd or switch it with a switch and watch my code respond correctly.· Not sure why it is so different for these encoders.
    ·
  • HeliheadHelihead Posts: 4
    edited 2009-05-18 00:11
    I thought maybe I had misread the connections on the board so I went back and ohmed all the connections.· I got good connections (.1 Ohm) for all 4 wires going up to the encoder, a dead short from one side of the resistor and Vdd, and·a dead short from each of the two inputs to P0 and P1 respectively.· I got open circuits between P) and P1 and everything else except the two encoder A/B wires.

    Looks like it is hooked up right.
  • HeliheadHelihead Posts: 4
    edited 2009-05-18 01:03
    OK so I'm a dolt.

    The hardware was right but·I'd set my inputs as outputs in my code and that had it latched up.· Not sure where my head was but I'm blaming it on this being the first stamp·code I've done·in probably·5 years and the fact that I wrote that·with a 5 year old and a·3 year old running around tearing the house apart.

    Anyway, thanks for you help.

    If anyone has trouble getting your inputs to read... MAKE SURE YOUR INPUTS ARE SET AS INPUTS·AND NOT OUTPUTS :-)
  • WhitWhit Posts: 4,191
    edited 2009-05-18 01:23
    Helihead said...

    ·Not sure where my head was but I'm blaming it on this being the first stamp·code I've done·in probably·5 years and the fact that I wrote that·with a 5 year old and a·3 year old running around tearing the house apart.

    As someone with two children, I fully accept your explaination. wink.gif

    Glad you got it working.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • kwinnkwinn Posts: 8,697
    edited 2009-05-18 03:22
    From what you described four possibilities came to mind immediately. No power to the encoder, bad port pins, low resistance to ground, or ports in output by mistake. Lucky for you it was the last one, much easier to fix than the others.
Sign In or Register to comment.