element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
Smarter Life
  • Challenges & Projects
  • Design Challenges
  • Smarter Life
  • More
  • Cancel
Smarter Life
Blog A Very Compact Christmas Display - Part 006
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: COMPACT
  • Date Created: 5 Nov 2013 12:03 AM Date Created
  • Views 506 views
  • Likes 2 likes
  • Comments 4 comments
  • psoc4
  • smarter_life_challenge
  • psoc_4200
  • compact_xmas_display
  • smarter_life
  • psoc
Related
Recommended

A Very Compact Christmas Display - Part 006

COMPACT
COMPACT
5 Nov 2013

Local Motion

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

 

Gromit and Rocky Rhodes have come to help me demonstrate the PSoC 4 driving two servos simultaneously.

I connected two servos to a Pmod CON3 that is subsequently connected to the Pmod compatible port on the Pioneer Kit.

 

The PSoC comes with two types of PWM Components.

A Timer Counter (TCPWM)  version and is standard version.

I've used the standard version and set it to 16 bit mode with one output.

Doing this consumed 2 UDBs each.


To get this up and going quickly I chose some ballpark figures. Without any thinking I;


     Used a 100kHz source clock

     Set the PWM period to 5000 cycles for 50ms

     And set the compare value to 150 for 1.5ms (centre position value)

 

Most of the count is wasted upon the idle/dead time but what the heck! It was quick and easy to get it up and going.

To change the desired position the compare value can be changed to a value between 10 and 200 for 1ms (max CCW) and 2ms (max CW) respectively.

This configuration is satisfactory for about 99 or 101 different positions. 49 or 50 left, 49 or 50 right and centre.

The formula to calculate the value is

     150 +/- desired position value.

The actual rotation angle depends upon the servo used and its maximum deflection at the maximum and minimum acceptable values.

 

You can connect these two servos to form a simple Pan and Tilt for a small camera or crude steadycam device when used with a gyro.

 

If you need any more information or help on how to do this yourself just send me a comment.

  • Sign in to reply
  • COMPACT
    COMPACT over 12 years ago in reply to vsluiter

    Yep. This was made purely with PSoC Creator.

    Follow my instructions and give it a go.

    It'll amaze you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • vsluiter
    vsluiter over 12 years ago in reply to COMPACT

    That looks very simple image

    But you did make something in PSOC creator, might be nice to have that code available as 'golden standard' code... Thanks anyway!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • COMPACT
    COMPACT over 12 years ago in reply to vsluiter

    Victor,

    Happy to but for these examples there's such little code to do so it can look pointless.

    For example.

    main() {

         Timer_1_Start();

         for(;;);

    }

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

    Hey Monte,

     

    I really like your examples. Would it be a lot of hassle to include the source code at each post? That will make the contributions more valuable for those who look at the functions you describe.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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