Problem tick value with Wheel encoder SEN0038

userHead Account cancelled 2013-05-23 19:37:58 2571 Views1 Replies

I have 2 encoders SEN0038 on the 2 front motors right and left of my 4WD DFRobot.
They are connected to the pins INT3 and INT4 of a ChipKit MAX32 micro controller and I use the hardware interrupts to count the ticks like this:

#define EncoderTickRightINT  4 // INT used by the encoder for motor right connected to interrupt pin INT4 J4-02(AETXEN/SDA1/INT4/RA15) Use INT4
#define EncoderTickRightPin  20
#define EncoderTickLeftINT  3 // INT used by the encoder for motor left connected to interrupt pin INT3 J4-01(AETXCLK/SCL1/INT3/RA14) Use INT3
#define EncoderTickLeftPin    21

volatile int TickRight = 0;
volatile int TickLeft = 0;

// interrupts setup
  pinMode(EncoderTickRightPin, INPUT); // set the pin as input
  pinMode(EncoderTickLeftPin, INPUT); // set the pin as input
  attachInterrupt(EncoderTickRightINT, IntrTickRight, FALLING); // set right tick interrupt
  attachInterrupt(EncoderTickLeftINT, IntrTickLeft, FALLING); // set left tick interrupt
  void IntrTickRight() // right tick interrupt

void IntrTickLeft() // left tick interrupt

The problem is that when I start only one motor, the value of the tick related to the second motor increases also.
Do you know why? if the motor doesn't move, do you confirm that the encoder will not deliver a signal to the INT pin?

Thanks for your help
2015-01-07 00:57:18 Hi
  I am having same issue with a UNO using the sample code on the web site for interrupts on pins 2 and 3. Did you ever solve this? I assume power noise but not sure where to start. This is on a DFRobot Baron.

Thanks Rodling
userHeadPic Rodling