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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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 013
  • 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: 16 Nov 2013 9:09 AM Date Created
  • Views 349 views
  • Likes 1 like
  • Comments 3 comments
  • psoc4
  • psoc_4
  • smarter_life_challenge
  • psoc_4200
  • compact_xmas_display
  • smarter_life
  • psoc
Related
Recommended

A Very Compact Christmas Display - Part 013

COMPACT
COMPACT
16 Nov 2013

It's all in the Timing

image

 

Fig 1. The Timer Component in its simplest configuration driving a LED.

 

It's always handy to know how each mechanism works properly.

This article discusses what can be done with the Timer (V2.5) Component.

Note:The PSoC 4 with the Pioneer Kit supports the UDB version.

 

I've worked through this component step by step to develop a decent understanding of it.

The first task is to get the timer working in its default and simplest configuration.

This is a continuous periodic timer that is a down counter that is loaded with a starting value.

When its counter reaches zero it outputs this status through its TC pin.

The TC asserted state only lasts for a single clock cycle before it is automatically reset to the negated state.

Adding human detectable feedback

I've configured the above timer for a 500ms period by using the following settings.

image

It is just the default settings but with the Resolution changed to 24-bit and the Period adjusted to 500ms.

 

The timer can be used to blink an LED but if the source clock cycle period is too short nothing can be seen.

To overcome this a Toggle FF(Flip-Flop) (with its T pin at logic '1') can be used with the TC output feeding the Toggle FF's clock input.

This means any LED connected to the Toggle FF's Q output will toggle its state at the beginning of a TC pulse.

The LED will therefore remain it its new state until another TC pulse is encountered (which is at the defined period of the Timer).

 

So with no code other than Timer_1_Start() in the initialisation portion of the main.c, we can make an LED blink at half the selected Timer frequency.

 

In later posts I'll discuss slightly more complex configurations.

  • Sign in to reply

Top Comments

  • COMPACT
    COMPACT over 12 years ago in reply to cy.gul +1
    Hi Gagan, Thanks for the comment. I am aware of the other Timers and Counters but wanted to work through the Timer component to demonstrate its capabilities. Very Compact
Parents
  • cy.gul
    cy.gul over 12 years ago

    Monte,

    Good usage of the PSoC 4's UDBs (Universal Digital Blocks), in this case by using the Timer (UDB-based) Components.

    Note, with PSoC 4 you also have 4 x TCPWM blocks which are fully configurable timer/counter/pwm blocks, in addition to the UDB-based ones above. Its a nice way to get more timers on the hardware.

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

    Hi Gagan,

    Thanks for the comment.

    I am aware of the other Timers and Counters but wanted to work through the Timer component to demonstrate its capabilities.

     

    Very Compact

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • COMPACT
    COMPACT over 12 years ago in reply to cy.gul

    Hi Gagan,

    Thanks for the comment.

    I am aware of the other Timers and Counters but wanted to work through the Timer component to demonstrate its capabilities.

     

    Very Compact

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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