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 1 Low Power Kit] Project #05 – Generic HID 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 0 replies
  • Subscribers 24 subscribers
  • Views 231 views
  • Users 0 members are here
Related

[PSoC 1 Low Power Kit] Project #05 – Generic HID Example

cy.wbz
cy.wbz over 11 years ago

Hello!


In the example released today we will show the user how to create the simplest of USB projects. In this example we will be using the USB-HID driver provided across OS platforms. In this example we will take the example in project #4 (linked below) and expand to incorporate a GUI that reads data and controls features on the kit. In this example we have provided example code for GUIs running on Windows, Mac, and Linux machines. In the images below we show the windows based GUI.



image


For more information take a moment to review the earlier posts:

 

Project #1

Project #2

Project #3

Project #4


Forum Post Attachments:


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

  • Example Project Zip File
  • Project Images


User Modules Used: 


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

  • USBFS
  • LCD
  • LED
  • Timer16


Firmware Description:


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


In this example we have created a simple USB device, using the HID driver, that can be used to shuttle generic data base and forth between a computer and the PSoC over the USB drive.


In the example we define two data buffers for the USB communication, one for the data inputs and outputs. The data is processed in two separate functions, Process_EP1() and Process_EP2(). The Process_ES1() function includes the value read from the timer and the current status of the push button connected to SW2. The function updates the data buffer and is continuously called from the main function. The Process_ES2 function reads the user’s inputs into the GUI window and updates both the LED state and PWM Duty Cycle value.


Hardware Connections:


There are no hardware configurations for this example. All of the onboard connections have been made. The user will need to connect the PSoC 1 USB connector to the host computer after programming the device.


Test Your Project:


Build the project and program the PSoC 1 device using the program button in PSoC Designer, Program>Program Part. Once the device has been programmed change the USB connection to the PSoC 1 USB connector.


Once the device has connected launch the GUI application. The GUI will both read from and write to the device on the kit.


For entering in data the user will be able to set the PWM Duty Cycle and apply that value to the device. This value is displayed on the LCD module on the kit. You will see that the LCD module is updated after pressing the ‘Update’ button.



Fullscreen 3326.contentimage_31038.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>


The next feature is the checkbox for the ‘LED’. You can select and deselect the checkbox and see that the LED is turned on and off.


The item in the GUI is a text box that reads a timer value from the device. This value is put into the text box. The text box is labeled as an ADC, but since the kit does not have a POT we have output the timer value to this field instead. We provide example code in the project to change the output to a different value.


Finally there is an LED switch status that toggles between ‘OFF’ and ‘ON’ when the user presses the SW2 button on the kit.



Fullscreen 2821.contentimage_31039.html Download
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>


These inputs and output in the GUI are examples to users to create their own custom applications targeting the CY8C24x93 devices. All of the source code, for each OS, is included below as well as a link to the USB application note that will help users better understand USB.


I hope this example can help you in your design.


Best,

Matt

Attachments:
GenericHID_USB.zip
8625.pictures.zip
imageAN82072_001-82072.pdf
Note.txt.zip
  • 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