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
Connected Cloud Challenge
  • Challenges & Projects
  • Design Challenges
  • Connected Cloud Challenge
  • More
  • Cancel
Connected Cloud Challenge
Blog Super Smart Home #12 PSoC6 Local Node: Application Skeleton
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balearicdynamics
  • Date Created: 24 May 2020 10:10 PM Date Created
  • Views 4036 views
  • Likes 4 likes
  • Comments 19 comments
  • segger emwin
  • wifi connection
  • environmental noise
  • super smart home
  • remote connection
  • tft display
  • segger
  • grpahic library emwin
  • sound level detection
  • emwin
  • real time notification
  • cypress psoc6
Related
Recommended

Super Smart Home #12 PSoC6 Local Node: Application Skeleton

balearicdynamics
balearicdynamics
24 May 2020

  • Introduction
  • Software Skeleton
    • Display Monitoring Pages
  • Software Development
    • Managing the UI: a Challenging Development
      • The Segger emWin Kit
  • Full Content
      • Already Posted (until now)
      • Sources, Circuits, and Documentation
      • Thanks to

Introduction

The Cypress PSoC6 WiFi BLE kit is a great and powerful board that includes several features it is worth to use locally, regardless of its role to connect to the AWS IoT Cloud. For example, one of the interesting features available through the TFT display and sensors module is the environmental sound level detection via the sound level microphone sensor. On the path to complete the features of the PSoC6-based Super Smart Home node, I have implemented the skeleton of the double function of the board; while it is working as the AWS gateway can also control the environmental light and noise levels, as well as replicate the Control Center Raspberry Pi 4B through the local WiFi network.

Determining the PSoC6 node features and how to implement them in a good way has been the first step of this path; as it is obvious, I met also some challenging problems I had to solve, basically to create the Cloud Node basic architecture, as shown in the short sequence below.

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

 

Software Skeleton

Conditioned by the roled of the PSoC6 Cloud Node the scheme below shows the software skeleton and the UI schema:

image

While the PSoC6 is one of the endpoints of the Super Smart Home IoT network its UI role is for monitoring and consultation only for which I planned to use the FTF screen included with the PSoC6 Kit. The application active part instead should connect in a secure way to the Raspberry Pi 4B Control Center receiving the log, buffered on one of the monitoring pages of the interface (there is not a story of the log saved locally, as it is already done by the Control Center), as well as sending its status to the Raspberry Pi.

The other active part is dedicated to the timed acquisition of the light level and noise level; these two environmental values are acquired and interpolated by the PSoC6 program while only the alarm triggered values – daylight and dark light changes, and over the preset limits of the noise level – are sent to the Control Center.

Both the logged statuses from the Control Center and the environmental sensor values are updated through the MQTT shadows to the  AWS IoT console to be displayed on the SiteWise web.

 

Display Monitoring Pages

image

The above scheme shows the strategy I adopted to monitor all the data through a simple user interaction; due to the reduced TFT screen resolution of the PSoC6 kit every group of data has been organized on a page (a single view of the TFT display). The pages are visible in sequence scrolling in both directions with the two Capsense buttons. Also if I plan to add more pages in the future it is not difficult to add others in the middle.

 

Software Development

The PSoC6 node has not to accomplish special tasks that require the real-time processing features of the RTOS (that by the point of view of the software development is an extra layer added to the Cypress libraries and a further complication); the PSoC6 can do its job using some threading and the interrupts, as well as the two sensor triggers for light and sound, so I adopted the Mbed OS as the development platform on the Modus Toolbox IDE.

 

Managing the UI: a Challenging Development

UI development has been the most complex part and I had to spend a full day to understand the logic to control the TFT display, very few documented in the Cypress Tools. The main page of the UI is the Super Smart Home graphic image; I discovered how to proceed with the UI design just when I tried to discover how it was possible to convert a bitmap to something usable by the device firmware.

image

 

The above image is the graphic screen for the first page (shown at power-on) I prepared and exported in PNG format at the TFT resolution (320x240 pixel). Digging on the net I finally discovered that the TFT display component – and only this, all the other parts of the same Arduino Compatible board are managed by the Cypress libraries – uses the Segger third-party components. It is included in the library configurator of the Modus Toolbox IDE but is undocumented by Cypress.

 

The Segger emWin Kit

All the graphic features available on the TFT – as for a lot of other industrial displays used with the microcontrollers – adopted the Segger emWin standard. It is a powerful library supporting multiple text modes and 2D graphics on the PSoC6 TFT. The strange fact is that the library is included in the library manager but selecting the TFT in the devices the library is only included but nothing about it is mentioned at all; it is like Cypress considering the TFT board of the kit only for the sensors included onboard.

After discovering that it was this library my problem I investigated and found the emWin specifications on the Segger site. The documented API of the library, are available from the Segger emWin site, as well as in the document attached to this post.

Also in the same site emWin includes a lot of useful software utilities (Window only) to convert images, videos, and fonts in the format accepted by the emWin library. It is possible to access this stuff and download it for free only after registering on the Segger portal. Ther I found the bitmap conversion program to generate the code for the PSoC6 TFT display.

image

The above image shows the image conversion tool I have used to generate the graphic content shown on the main page of the PSoC6 TFT on boot.

 

image

Above: the final result, shown on the TFT display of the PSoC6 WiFi BT Pioneer kit.

 

Full Content

 

Already Posted (until now)

Super Smart Home #1 The project

Super Smart Home #2 The Door Opener

Super Smart Home #3 Designing the Control Center

Super Smart Home #4 Activating the Door Opener

Super Smart Home #5 Connecting the First Node to the Control Center

Super Smart Home #6 PSoC6 On the Cloud

Super Smart Home #7 From AWS IoT Core to AWS SiteWise

Super Smart Home #8 The Kitchen Node: Parts, Design and Components

Super Smart Home #9 The Kitchen Node: Circuit and Software

Super Smart Home #10 Building IoT nodes with PSoC6-WiFi-Bt and Mbed OS

Super Smart Home #11 Project Summary, Highlights, and More...

Super Smart Home #12 PSoC6 Local Node: Application Skeleton

Super Smart Home #13 PSoC6 Protection Case

 

Sources, Circuits, and Documentation

All the software sources, scripts, circuits schematics, and more are available as Open Source material on the SuperSmartHome GitHub repository.

The video episodes of this challenge are repurposed on the blog posts of the site we-are-borg.com

 

Thanks to

Element14, AWS, and Cypress, main sponsors

Elegoo for 3D printers ad printing material

Digitspace for sensors, actuators, and boards

The friends and community members Jan Cumps and shabaz always available with advice and suggestions.

Attachments:
imageUM03001_emWin.pdf
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 5 years ago in reply to balearicdynamics +3
    The library was also part of the Renesas RX65N MCU EV Kit . Easy to use, good touch screen integration. The PC tools and utilities you use to define the screens are somewhat old style.
  • phoenixcomm
    phoenixcomm over 5 years ago +2
    balearicdynamics nice
  • shabaz
    shabaz over 5 years ago +2
    Hi Enrico, Nice display! I've never used Segger emWin before, but it seems to have a lot of functionality - just downloaded the 3000 page user guide/reference manual : )
Parents
  • phoenixcomm
    phoenixcomm over 5 years ago

    balearicdynamics nice

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 5 years ago in reply to phoenixcomm

    Thank you phoenixcomm (Cristina image )!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • balearicdynamics
    balearicdynamics over 5 years ago in reply to phoenixcomm

    Thank you phoenixcomm (Cristina image )!

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