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#090 – Comparator Example
  • 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 5 replies
  • Subscribers 26 subscribers
  • Views 1381 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#090 – Comparator Example

cy.wbz
cy.wbz over 12 years ago

Hello!

 

In today’s example we are examining the comparator component and creating a simple example using the Pioneer board. In the example you will use a wire to connect one of two inputs to the comparator to a 5V source. By connecting one of two pins to the voltage we will either turn on or turn off an LED. The output state of the comparator will be displayed over the UART to a hyperterminal application.

 

In the schematic below the user is given drawing to connect two potentiometers. This is not necessary to examine the functionality of the comparator. To see how to use the comparator we will need only a loose wire.

 


image

 

Forum Post Attachments:

 

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

  • Example Project Zip File
  • Project Images

 

Components Used: 

 

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

  • Comparator
  • LCD
  • UART
  • 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 are using a simple wire to trigger high conditions on the two inputs for the comparator. In the schematic layout of the project we include external annotated components in the design. These annotated components are external potentiometers. You would be able to breadboard up this setup if you have the available hardware. In the example we used a simple wire to trigger the high state. In a real world example you may have variable voltage inputs that vary over time.

 

We include two components, UART and the LCD. In this example you can target the CY8CKit-038 and CY8CKit-001 that include an LCD module. In this example we wanted to use the Pioneer board so we enabled the UART bridge. The LCD code is commented out and can be added if needed.

 

Hardware Connections:

 

For this example the user will need to connect GPS module to the UART component outputs.

 

We must connect P4.1 and P4.0 to the PSoC 5LP header P12.6 and P12.7 to enabled the UART bridge on the PSoC 5LP

 

We will also connect a wire to the 5V source on the Arduino headers. We will then connect this wire into one of the two input sources for the PSoC 4 device. This will force one of the two inputs to be higher than the other thus enabling the component output.

 

Test Your Project:

 

Program the example into the Pioneer board. Launch the hyperterminal application to display the comparator output. Take a wire and trigger one of the two inputs using the 5V source on the Arduino headers. See that the output changes depending on which input you connect.

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
imageComp_P4_v1_0.pdf
1016.Project Images.zip
Comparator_PSoC4_Example01.zip
  • Sign in to reply
  • Cancel
Parents
  • jesusantoniocar
    jesusantoniocar over 12 years ago

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

    Thanks for this project.

    One question, i downloaded the program to the DVK001, it works ,the led power on when V1>V2  but i can not see the comparator value in the lcd.

     

    Regards,

     

    Jesus.

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

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

    Thanks for this project.

    One question, i downloaded the program to the DVK001, it works ,the led power on when V1>V2  but i can not see the comparator value in the lcd.

     

    Regards,

     

    Jesus.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • cy.wbz
    cy.wbz over 12 years ago in reply to jesusantoniocar

    Jesus,

     

    Did you uncomment the LCD code in main.c?

     

    -MattB

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

    Hello Matt.

    I am sorry, yes, i forgot  uncomment the code of LCD in the main file.

     

    Thanks for your help.

     

    Jesus.

    • 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