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

cross mob
baye_4029466
Level 1
Level 1
First question asked 5 replies posted First reply posted

Hi,

I'm using PSOC4 on my project.

I have a DC motor connected to a PWM (through H bridge) and the motor axle is connected to encoder that is counting the motor steps.

I want to stop a motor on exact place using the quadrature decoder peripheral.

I tried to configure the encoder to set an interrupt on specific value (not 0x0 or 0xFFFF) using the TCPWM_CNT1_CC register, but I don't get the desired interrupt.

Is it possible to get such an interrupt on quadrature decoder mode?

Thanks,

Barak.

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

This method would work, That is setting the initial counter value to something other than 0x8000 to obtain interrupt at desired value.

If the program is simple, you can also try polling method by continuously monitoring the counter value. However, this will work only for programs without any heavy processing.

Thanks and regards

Harigovind

View solution in original post

0 Likes
4 Replies