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 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#062 – Ready…Set…GO! PSoC Stopwatch
  • 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 9 replies
  • Subscribers 27 subscribers
  • Views 1462 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#062 – Ready…Set…GO! PSoC Stopwatch

cy.wbz
cy.wbz over 11 years ago

Hello!

 

In this example we are looking to expand on our earlier graphical displays by creating a stop watch. Our various LCD and GLCD examples try to cover a wide range of display options available to users. In this example we use an I2C based character LCD modules. For this project we will use the I2C Character LCD component, which allows the customer to control the Character LCD with 2 pins instead of the typical 7 required by our Parallel Character LCD component. For this example we use a Serial LCD 16x2 Blue and White LCD for Arduino kits.

 

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:

  • I2C (Master mode)
  • TCPWM
  • CyClock
  • I2C Character LCD
  • Debouncer
  • ISR
  • CyPins

 

Firmware Description:

 

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

 

The example projects uses the SCL/SDA pins on the Kit to control the LCD (via the breadboard as the shield doesn’t have a connection to SCL/SDA) and the SW2 on the Kit to control the stopwatch.

 

Any I2C Character LCD should be possible given the flexibility of the provided component in the catalog.

To setup your LCD, you will need the datasheet to be able to enter the I2C address for the LCD on the General tab of the I2C LCD component.  Unless you are able to locate a NXP PCF2119x LCD, the Command format entry on the customizer should be configured for Custom format, which will enable the fields on the Custom Commands tab.  In that tab, again from the datasheet, you will need to modify the commands to match the byte sequences defined for the device.  You can also specify additional commands (in this example we added the SetContrast and SetBrightness APIs) to control any extra functionality your I2C LCD may have that you wish to utilize.

 

The setup of the firmware will update the display every other millisecond and move the bouncing dot at the top of the display approximately every 33ms.  Pushing SW2 on the kit will clear and start the timer, pushing it again will stop the timer and the animation at the top of the display.

 

Hardware Connections:

 

Please connect a simple Breadboarding shield to the Pioneer kit. Then connect the LCD display to the Breadboard. In this example we use the SainSmart prototyping shield.

 

image

 

image

 

Test Your Project:

 

Connect your I2C display and program the Pioneer kit with the example. The setup of the firmware will update the display every other millisecond and move the bouncing dot at the top of the display approximately every 33ms.  Pushing SW2 on the kit will clear and start the timer, pushing it again will stop the timer and the animation at the top of the display.

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
I2C_LCD_Example.cywrk.Archive01.zip
2262.Project Images.zip
  • Sign in to reply
  • Cancel
  • jesusantoniocar
    jesusantoniocar over 11 years ago

    Hello Matt.

    Thanks for this project. one question the pins p4.0 and p4.1 (SCL/SDA) must be connected to the lcd. Which are the pins numbers in your lcd  to interconnect p4.0 and p4.1?.

     

    thanks again.

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB over 11 years ago

    Hi Matt,

     

    Nice project.

    You can do both a stop watch or an event counter with the same basic circuit.

     

    DAB

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

    Hi

     

    If you are using the LCD from the example, the I2C pins are 7 (SCL) and 8 (SDA).  Note from the datasheet that you will also need to jumper R1 on the board to put the LCD into I2C mode.

     

    Steven

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

    Hello Steven.

    Thanks for your reply. Yesterday night i try to build this project with an  Electrolite lcd QY 162A, right now i know that i have to buy  another lcd.

     

    best regards,

     

    Jesus Antonio.

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

    Hi

    If the LCD is I2C it should be able to work once you know the slave address and have the SCL/SDA connected.  Do you have a link to the datasheet for the device?

     

    Steven

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

    Hello Steven.

    thanks for your help.

    http://www.pongrance.com/dds-lcd.html

     

    Regards,

     

    Jesus Antonio.image

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

    Hi

     

    Ah, I see.  That's not an I2C based LCD, but the standard parallel interface type.  You are correct, you would need get a different LCD to work with this project.

     

    If you wanted to try a parallel LCD, there is a way to do that as well.

     

    Steven

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

    Hi,

    I am new to Psoc projects.

    I am using Psoc4 CY8CKIT-042 Pioneer kit for my learning's, and I have a parallel LCD display..

    How to implement the same project with parallel LCD ?

    please give guidance.

     

    Best Regards,

    Dilipkumar

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • yes_its_garen
    yes_its_garen over 5 years ago

    Hi Hope you're doing well.

     

    I want to do the same project but instead of displaying the time on a I2C LCD, i just want it to print on UART.

    Basically I am working on a project that requires me to read the x, y, z axis accelerometer values and print the time (in minutes/second/milliseconds) that it has been registered, that is for each reading. Since I am willing to read more than 84000 readings as fast as possible.

     

    I did the accelerometer part, I am stuck now on the time part, since there are no ready made implementations on Psoc 6 for this kind of project.

     

    I would greatly appreciate if you gave me some remarks or answers regarding the above.

     

    Best regards,

    Garen A.

    • 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