element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#071 – Get Your Motor Runnin’!
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 27 subscribers
  • Views 766 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#071 – Get Your Motor Runnin’!

cy.wbz
cy.wbz over 12 years ago

Hello!

 

In today’s example we are exploring more motor connections. This project leverages the Pmod hardware ecosystem. We use a simple H-Bridge to control the motor. We use a human input through the CapSense slider to determine motor speed and direction, while using the Timer Counter component to calculate the RPMs of the motor and display that out via the UART.

 


image

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Zip File of Images
    • Project Schematic
    • Component Configurations

 

Components Used:

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • CapSense
  • UART
  • PWM
  • Timer Counter
  • CyTFF
  • Debouncer
  • CyClock
  • CyPins

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

In this example we showcase a good mix of both firmware and hardware design. The project implements code to handle the CapSense, UART, and RPM calculations. In some of our past examples we have seen examples implementing CapSense and UART controls providing easy inputs and ouputs for users.

 

The key to today’s example continues with the theme we’ve been stressing for the last few weeks, which are the hardware only design elements. In this example we see that the system logic has been pulled into the hardware removing unnecessary firmware. In this example we are using a Toggle Flip Flop to take in the button selections and driving an LED and starting the PWM for the motor. In this example we do not need to write any code for this control, instead we have implemented the logic in hardware. 

 


image

 

Hardware Connections:

 

For this example you will need to connect the Digilent Pmod module to the J5 header.

 

You will need to connect the UART connections from the PSoC 4 pins P0[4] and P0[5] to the PSoC 5LP header P12[6]  and P12[7].

 

Connect the PSoC 4 pin P3[5] to the Pmod DIR pin.

 

Connect the PSoC 4 pin P3[0] to the enable line of the Pmod header.

 

Connect the PSoC 4 pin P3[1] to the SA pin of the Pmod header.

 

Connect power and ground.

 

Connect the motor to the M+ and M- pins of the Pmod header. Power and Ground will be needed to power the motor.

 

The following image was included in the Digilent Pmod datasheet.

 


image

 

Test Your Project:

 

Program the Pioneer board with the example code. Then turn on the motor by pressing the SW2 button. Then select the motor speed and direction by moving your finger along the CapSense slider. Launch a hyperterminal program to see the output and speed of the motor.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
6215.Project Images.zip
motor1.cywrk.Archive01.zip
  • Sign in to reply
  • Cancel
  • DAB
    DAB over 12 years ago

    Hi Matt,

     

    I really like the approach of using the Psoc programable hardware to take on the basic motor control functions.

     

    This implementation frees up the MCU for other tasks.

     

    Very nice.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Thanks for this project. 

    The Debouncer component takes an input signal from a bouncing contact and generates a clean

    output for digital circuits. The component will not pass the signal to the output until the predetermined period of time when the switch bouncing settles down. In this way, the circuit will respond to only one pulse generation performed by the pressing or releasing of the switch and not several state transitions caused by contact bouncing. Very useful  be able to integrate this component inside of psoc creator, sparing external hardware.

    Best Regards,

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago

    It's amazing.

    I also have to implement H-Bridge for my Project.

    I have deadtime as Input from 0,5v to 3.25v. & Deadtime value from 2 to 24 (0 to 254 cycle). The Duty cycle for both PWMs should 47%.

     

    I am using PSoC 5LP.

     

    Pls share ur ideas for this.

    Regards

    Max


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube