PSOC 3 Quadrature Decoder Component Not Counting

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 Hi,

   

I have used the Quadrature Decoder (TCPWM) in PSOC 4 with no problems, but I seem to be running into trouble with PSOC 3.  It is a different component, and seemingly simpler, but I cannot get it to count at all one way or the other.  Can someone please look over the attached project and point out any software errors you see?  I want to try to eliminate software before looking into less obvious hardware issues.  I have already tested that the pins are correct, the encoder is outputting constantly, etc.

   

Thank you,

   

Tom

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes, as I thought. in the PSoC4 project the inputs are pulluped and in the other project they aren't.

   

 

   

Bob

View solution in original post

0 Likes
11 Replies
Anonymous
Not applicable

 Hi,

   

It looks alright. I suggest you connect known clocks to PHA and PHB to check QuadDec component working. Also, I see that isr is not being used. Is it required in your design ?

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I built a test-PWM feeding the QuadDecoder. Can you please check if it now does count.

   

 

   

Bob

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 Hi,

   

Thank you for the support.  I tried the test program, and the PWM worked correctly.  I changed it and hooked the encoder back up and it still did not work.  I swapped phases, and tried it on the analog pins as well to no effect.  I know the encoder is outputting correctly (it works on a TCPWM Quad Dec on PSOC 4).  Any other ideas?  Does anyone have an example of a Quadrature Decoder component working on a PSOC 3 or 5?

   

Thank you,

   

Tom

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Are your signals coming from a mechanical or a digital signal source. What are the connections look like? do you need pullups or something similar? What is your encoder (Link to datasheet)?

   

 

   

Bob

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 Hi,

   

They are coming from a 400ppr optical rotary encoder.  No datasheet - see here:

   

http://www.ebay.com/itm/Incremental-Optical-Rotary-Encoder-400-pulse-CNC-Servo-Stepper-Motor-Control...

   

 

   

Like I said, it works fine with the Quadrature Decoder TCPWM component for PSOC 4.  

   

Thank you,

   

Tom

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you post the PSoC4 project?

   

As an additional try: Switch on the glitch filtering.

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Just checked the link to the encoder. The outputs are Open Collector, so you should define your pins as pull-ups

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 See attached.  I tried the glitch filter to no avail...

   

Thank you,
Tom

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes, as I thought. in the PSoC4 project the inputs are pulluped and in the other project they aren't.

   

 

   

Bob

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 Bingo.  Wow, all that for a foolish mistake.  Thank you so much for your support!  I thought I was carefull comparing the two, but apparently not.

   

Regards,

   

Tom

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome!

   

 

   

Bob

0 Likes