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#092 – Serial Communications Examples (EzI2C, I2C, SPI, UART)
  • 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 4 replies
  • Subscribers 26 subscribers
  • Views 1961 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#092 – Serial Communications Examples (EzI2C, I2C, SPI, UART)

cy.wbz
cy.wbz over 11 years ago

Hello!

 

In today’s example we are including four (4) separate basic communication examples for PSoC 4 devices. These examples have been created to target the CY8CKit-001 and CY8CKit-038 development kits. In these examples we make use of the LCD modules included in the Kit-001.

 

These examples focus on providing I2C (Master, Slave, and EzI2C), SPI (Master and Slave), and UART examples. In the master and slave examples the PSoC 4 is used as both a master and slave device echoing values between the two components. In each example we use the LCD display as a visual indicator of the data transfer.

 

If you are migrating this project to the Pioneer kit you will likely need to add a UART component like in example #090 and de-comment the LCD code. This is a simple task that you can mimic from that earlier example.

 

Forum Post Attachments:

 

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

  • Example Project Zip File

 

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
  • EZI2C
  • SPI
  • UART

 

Firmware Description:

 

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

 

In this post we are including four examples to display numerous serial interfaces available on the PSoC 4. These example projects are meant to be a starting point for new users who wish to get started or implement a serial component (configuration and code). The four examples are:

  • EzI2C (EzI2C Slave and Master)
  • I2C (Slave and Master)
  • SPI (Slave and Master)
  • UART (TX and RX)

 

In each example we have implemented both the slave and master controls on the single PSoC. The code is structured in each example with a master and slave section. This allows the user to easily copy and paste the code from the examples into their design.

 

Users can easily update these projects to support the Pioneer kit by navigating to the CYDWR screen in PSoC Creator and modifying the pin outs to match the PSoC 4 Pioneer layout.

 

The PSoC 4 Pioneer Kit does not have an LCD module so the user can update the project to support the UART bridge and the PSoC 5LP. This update is similar to example #090. Simply de-comment the LCD code and add in the UART put string commands to send the data to the PC hyperterminal application.

 

Hardware Connections:

 

The user will need to review the CYDWR pin selections and using the red wires included in the Pioneer kit to connect the master and slave connections on the PSoC 4.

 

Test Your Project:

 

Program the example project into the PSoC 4 device and view the output on the LCD screen (kit-038) or the UART hyperterminal application (kit-042).

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
SCB_UartTxRxComm01.zip
SCB_SpiComm01.zip
SCB_I2cComm01.zip
SCB_Ezi2cComm01.zip
  • Sign in to reply
  • Cancel
  • jesusantoniocar
    jesusantoniocar over 11 years ago

    Hello Matt.

    Thanks for this project.

    It is very important learn about  serial communications with psoc 4. I have a question with the #define definitions in the main program, could you explain me please  what does the function  in the code:

    #define LCD_NUM_COLUMNS (16u) , i know that is for use the lcd, but i dont understand  the number (16u).

    i another part of the code :

        count = 0u; /* Number of send characters   */
        pos   = 0u; /* LCD position to output into */

     

    best regards,

     

    Jesus Antonio.

     

     

     

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

    Jesus,

     

    I believe the 16u is an unsigned integer. If it were to be a HEX value it would be 0x16.

     

    Same for the 0u values later in the code.

     

    -Matt

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

    Thanks Matt

    I researched and really did not understand this type of definition.

     

    Best regards,

     

    Jesus Antonio.

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

    Thank you for instructive project.

    One small comment for other readers : CY8CKIT-042 does not feature out of board the connections needed for SPI master - slave communication testing.  So first be sure that you own/use one of above mentioned kits

    • 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