Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

CoCo_1816446
Level 4
Level 4
First like received First like given

I am new to PSoC and am trying to learn.I built a project that allows the motor to move forward when the button is pressed. Now I am trying to figure out the best way to change between the forward and reverse directions with the push a button.

I have attached my project below

0 Likes
1 Solution
DaKo_463136
Level 5
Level 5
10 likes received 10 likes given 5 likes given

Hello,

there are multiple ways to do this, but doing as much as possible in HW leads me to this.

Add another input pin to the lookup table and let it perform a mirror of the LUT.

I draw this quickly so please check the LUT before implementing it on your own, to avoid any damage. It is important to make sure that switching the direction in any state leads to a smooth transition.

pastedImage_0.png

David

View solution in original post

2 Replies
DaKo_463136
Level 5
Level 5
10 likes received 10 likes given 5 likes given

Hello,

there are multiple ways to do this, but doing as much as possible in HW leads me to this.

Add another input pin to the lookup table and let it perform a mirror of the LUT.

I draw this quickly so please check the LUT before implementing it on your own, to avoid any damage. It is important to make sure that switching the direction in any state leads to a smooth transition.

pastedImage_0.png

David

Thanks, David this worked perfectly.