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#023 – tinyprintf 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 28 subscribers
  • Views 1094 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#023 – tinyprintf Example

cy.wbz
cy.wbz over 12 years ago

Hello!


We are beginning this week with a base example that will be used by our XBee projects this week. This example is called our TinyPrintf example. In this example we include a custom component called “tinyprintf” to enable simple API calls to transmit UART data up to a PC. This building block will be used by the XBee examples posted this week. The tinyprintf code was developed by SpareTimeLabs and all credits and links are included in the main.c file.

 

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:

  • UART
  • Tinyprintf

 

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.

 

The tinyprintf component was built off of the driver module from SpareTimeLabs. Their source code is credited in the main.c file. We used their code in the custom component.

 

The custom component is only a firmware component and does not use any of the hardware resources. If you remember our LED Memory example, example #014, we saw the use of a custom driver file. In that example we could have bundled the code into a component for later use. In this example we have done just that, our tinyprintf code has been added to a custom component that we can use in later examples.

 

In our code we see a number of API’s open to use:

 

NewLine() – Defined in the main.c header to allow for easy newline additions in the hyperterminal window

printf() – associated to UARTPutString API for UART communication

sprint() – sends a string to a buffer and appends the string with a variable.

 

These API’s will ease data transfer over the UART to a hyperterminal window. This custom component will be used to display data traffic over our XBee modules in our coming examples. The custom component can also be used in any example using UART communication or hyperterminal debugging.

 

Hardware Connections:

 

The only hardware connection for this example will to connect the PSoC 4 UART connections to the PSoC 5LP.

 

PSoC 4 P4[1] -> P5LP P12[6]

PSoC 4 P4[0] -> P5LP P12[7],

 

Test Your Project:

 

Program the Pioneer kit and then launch the hyperterminal. Once the hyperterminal is running click the Reset button on the Pioneer kit and see the displayed data on the hyperterminal window. Check the UART Configuration for the baud rate. For this example the baud rate has been set to 9600 baud.

 

I hope this example can help you out in your design.

 

Best,

Matt

Attachments:
PSoC4_printf.cywrk.Archive03.zip
2818.Project Images.zip
  • Sign in to reply
  • Cancel

Top Replies

  • DAB
    DAB over 12 years ago +1
    Hi Matt, I think I can see where you are going with these demos and my interest has gone up significantly after I spent some time reading up on the PSOC internals. I am amazed at what Cypress has done…
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Thanks for this project, we can change APS parameters .

    NewLine() – Defined in the main.c header to allow for easy newline additions in the hyperterminal window

    printf() – associated to UARTPutString API for UART communication

    sprint() – sends a string to a buffer and appends the string with a variable.

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

    best regards,

     

    Jesus Antonio.

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

    Hi Matt,

     

    I think I can see where you are going with these demos and my interest has gone up significantly after I spent some time reading up on the PSOC internals.

     

    I am amazed at what Cypress has done with this system and look forward to learning more about how to exploit its capabilities.

     

    PS to all Element 14 EE's and EE want to be's, start following this series.  You are looking at the next generation of MCU type devices.

     

    Just my opinion,

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • sean444
    sean444 over 12 years ago

    Thanks Matt.  Great example and it worked first time.  Can you please expound on how to use the component in a different project?  I tried to just copy it and when I did I got an error:

     

    Error in customizer for component "tinyprintf" : Loading : (Unable to locate and customize component 'tinyprintf' used in schematic 'D:\Users\Sean\Documents\Step 2 - UART Freq PWM and now ADC\Step2.cydsn\TopDesign\TopDesign.cysch'.).

     

    Any other hints you might offer as to how to reuse this component would be much appreciated.  Thanks.

    Sean

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

    Sean,

     

    I've attached a PDF copy of the import component instructions. Let me know if this helps you.

     

    Thanks,

    Matthew Buza

    Attachments:
    imageImport_Component_Item.pdf
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • sean444
    sean444 over 12 years ago in reply to cy.wbz

    Thank you Matt.  That helped me get it transfered.  It compiled with an error...I still had stdio.h as in include so there was a conflict with tfp_sprintf.  Removed the include and viola`

     

    Now I have to hope I don't ever need stdio in this project or I will be up the creek image

    Sean

    • 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