cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Contributor

 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
Reply
1 Solution
Esteemed Contributor II

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
Reply
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
Reply
Esteemed Contributor II

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

   

 

   

Bob

0 Likes
Reply
Contributor

 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
Reply
Esteemed Contributor II

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
Reply
Contributor

 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
Reply
Esteemed Contributor II

Can you post the PSoC4 project?

   

As an additional try: Switch on the glitch filtering.

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor II

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

   

 

   

Bob

0 Likes
Reply
Contributor

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

   

Thank you,
Tom

0 Likes
Reply
Esteemed Contributor II

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
Reply
Contributor

 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
Reply
Esteemed Contributor II

You are always welcome!

   

 

   

Bob

0 Likes
Reply