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#035 – UART, I2C, and SPI Joystick 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 20 replies
  • Subscribers 32 subscribers
  • Views 6782 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#035 – UART, I2C, and SPI Joystick Example

cy.wbz
cy.wbz over 12 years ago

Hello!

 

This Project demonstrates the simultaneous use of UART, SPI and I2C protocols of communication in one single project. SPI is used to communicate the position of the Joystick in the Pmod JSTK Joystick Module. The I2C is used to obtain the current time from the Real Time Clock (RTC). UART is used to print the time obtained via I2C on the Hyperterminal and move its position in accordance with the Joystick.

image

  • PSoC 4 Pioneer Kit
  • PmodJSTK – 2 Axis joystick
  • Real Time Clock DS1307

 

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:

  • SPI
  • I2C
  • UART
  • CyPins
  • CyClock

 

The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.

 

Firmware Description:

 

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

 

This firmware example is an excellent demonstration of how the PSoC 4 can interface using three different serial interfaces (SPI, I2C, and UART). The example reads in the time data from the RTC using I2C, then pulls the positioning data from the Joystick using the SPI interface, and then completes the example by sending the RTC value to hyperterminal and using the joystick to control where the RTC value is displayed on the screen.

 

While the example almost seems like a game, please step back and consider how this type of system dynamic would be common in an end design. We can imagine pulling in data from two separate inputs and having to relay those values up to a main host or PC. In many case the input data may affect other data and require some type of data manipulation.

 

Hardware Connections:

 

The user will need to populate and solder the 6 pin Pmod header to the Pioneer kit. This header will allow the user to connect the Pmod Joystick module. The SPI interface that reads the values from the joystick will be configured and set in the PSoC 4 project. There is already a physical connection between the Pmod module and the PSoC 4 device. The SPI pins on the PSoC 4 will be: P3[0], P3[1], P3[5], P0[6], and P0[7].

 

Next connect the Pioneer board to the Real Time Clock board. First connect the Vdd and GND lines from the Pioneer kit to the Clock board. Next connect your I2C lines from the Pioneer board to the Clock board. The I2C lines are: P4[0] and P4[1].

 

Also connect the PSoC 4 UART connections to the PSoC 5LP device so the UART positioning can be relayed up to the host.

 

PSoC 4 P3[7] -> P5LP P12[6]

PSoC 4 P0[5] -> P5LP P12[7]

 


image

 

Test Your Project:

 

After connecting your project please program the example into the PSoC 4 device. Once programmed then launch your Hyperterminal software to view the UART data traffic. Then use the joystick to control the output on the hyperterminal software.

 


image

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
I2C_SPI_UART.cyprj.Archive01.zip
0447.Project Images.zip
  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 12 years ago in reply to jesusantoniocar +1
    Hello Jesus, There are two types of SPI component available for the PSoC 4 in the PSoC Creator 1) UDB based 2) SCB based For providing the external clock to the UDB based SPI, open the Advanced tab in…
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to jesusantoniocar +1
    Hi. It is an interesting article to share: PSoC 4 Chained Clocks http://www.cypress.com/?rID=81829&source=home_cdc best regards, Jesus Antonio
  • icemanfiveoh
    icemanfiveoh over 11 years ago in reply to icemanfiveoh +1
    Hi, I was successfully able to get the terminal to display the DS1307 RTC Time but it is all over the terminal window. I am going to see if i can strip away some code to stop that from happening. Also…
Parents
  • arshtab45
    arshtab45 over 7 years ago

    Hi,

     

    I am new to PSoC and trying to understand it one bit a time. I need help in a project I am working on in which I intend to serially transmit data using NTX0 ,NRX0 (Radiometrix)RF transmitter and receiver modules respectively. I am using two PSoC 4 kits . I have made hardware connections with one PSoC4 kit and NTX0 and other PSoC 4 kit to NRX0 module.

     

    Components used:

     

    PSoC Kit:

     

    CY8CKIT-042CY8CKIT-042PSoC 4 Pioneer Kit

     

    RF module:

    NTX0-27.095-4(Transmitter)

    NRX0-27.095-4 (Receiver)

     

    I have some doubts which I was hoping could get cleared here at the community;

     

    1. What are the blocks I should use in the schematics?(I am using ADC and UART  at TX end, and only UART at the Receiving end)

    2. How to configure the pins in PSoC creator at the transmitting end and at the receiving end?

    3. How to program the receiver (PSoC  4) to receive the data from the other kit(TX)?

    4. How to show this communication using PuTTy?

     

    Awaiting response.

     

    Thank you,

    Arshiya Tabassum

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • koudelad
    koudelad over 7 years ago in reply to arshtab45

    Hello,

     

    Have a look at the PSoC 101 videos, there are great tutorials:

    http://www.cypress.com/video-library/PSoC/psoc-101-lesson-12-uart/387666

     

    David

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • koudelad
    koudelad over 7 years ago in reply to arshtab45

    Hello,

     

    Have a look at the PSoC 101 videos, there are great tutorials:

    http://www.cypress.com/video-library/PSoC/psoc-101-lesson-12-uart/387666

     

    David

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