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 #14 PSoC6 Noise Sensor and GUI
  • 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: 8 Jun 2020 12:13 PM Date Created
  • Views 1734 views
  • Likes 9 likes
  • Comments 5 comments
  • aws node
  • tft screen
  • sensors
  • gui
  • winners
  • segger
  • node
  • iot
  • emwin
  • cypress
  • psoc6 pioneer kit
  • smart home
Related
Recommended

Super Smart Home #14 PSoC6 Noise Sensor and GUI

balearicdynamics
balearicdynamics
8 Jun 2020
  • Introduction
  • The Software Business Logic
    • The Loop Process

Introduction

I needed a considerable amount of time moving from the application skeleton described in Super Smart Home #12 PSoC6 Local Node: Application Skeleton to the first beta version of the PSoC6 Pioneer Kit. The reason is due that I have studied in depth the features of the emWin GUI library (provided by Segger) integrating the logic into the pages view and showing a continuous update when on the right page.

Before seeing in depth how I have implemented this first version of the software, as well as designing the graphic interface, take a look at the video below showing the noise level monitoring page.

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

 

So with this version showing the noise level sensor page together with the application main page I have set most of the logic to implement the other sensors and activities of the PSoC6 node.

 

The Software Business Logic

image

Developed with Mbed OS the main architecture of the software is similar to most of the microcontrollers software design, including the well-known Arduino sketch; it includes a setup part where the interrupts and the other components are initialized and a loop section. In the loop section, I have implemented a series of interrupt-driven calls so depending on the selected page on the UI the real-time visual monitoring is updated accordingly. There are three levels of priority, corresponding to the three different states, plus a fourth remote low priority level )not yet implemented) that updates periodically the AWS IoT console through shadows.

 

The Loop Process

During every loop cycle, the sensor's data structure (comprises all the information from the sensors connected to the node) are acquired and updated. Based on a timing check the lowest priority activity, sending data to the AWS IoT console is executed.

Inside the loop when a meaningful change on the sensors – for example, a new package of audio samples is available – it triggered by the highest priority interrupt. Data are collected in a global struct that is used both for sending data to the AWS IoT console (split in the different shadows) and used to eventually update the monitoring page.

When one of the monitoring pages is shown on the TFT screen only the relevant data for this specific visualization is used.

In addition, a lower priority interrupt is driven by the Capsense buttons to scroll between the available pages. When the program starts the main logo page (no activity is shown on it) is displayed. When the user press one of the two Capsense buttons the next page is shown on the TFT screen and every loop cycle the corresponding monitored data are updated.

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 5 years ago +3
    Hi Enrico, That's very responsive! : ) It's good to see there's plenty of processing power for the real-time graphics too. Nice to see mbed in use, there's been a nice mix of technologies during this challenge…
  • balearicdynamics
    balearicdynamics over 5 years ago in reply to shabaz +2
    Hi Shabaz yes, it is incredibly responsive. But there is a trick To make a state machine I arranged the GUI acting in a constrained pre-allocated memory area. This also thanks to the AutoDev feature of…
  • DAB
    DAB over 5 years ago +1
    Nice update. Are you using the 12 bit A/D on the PSOC? DAB
Parents
  • shabaz
    shabaz over 5 years ago

    Hi Enrico,

     

    That's very responsive! : ) It's good to see there's plenty of processing power for the real-time graphics too.

    Nice to see mbed in use, there's been a nice mix of technologies during this challenge.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • shabaz
    shabaz over 5 years ago

    Hi Enrico,

     

    That's very responsive! : ) It's good to see there's plenty of processing power for the real-time graphics too.

    Nice to see mbed in use, there's been a nice mix of technologies during this challenge.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • balearicdynamics
    balearicdynamics over 5 years ago in reply to shabaz

    Hi Shabaz

     

    yes, it is incredibly responsive. But there is a trick image To make a state machine I arranged the GUI acting in a constrained pre-allocated memory area. This also thanks to the AutoDev feature of the emWin GUI library. With these features, you automatically create a device GUI that, with the GUI_ALLOC_GetNumFreeBytes() call allocates initially the needed amount of memory then it is just a point that is recycled page to page.

    Not only, but the availability of a lot of drawing features (lines, fill methods, polygons, etc.) makes it possible to write inside the memory area using pointers only (so no memory move is done, and near to zero CPU is used. Meanwhile, only the area of the screen that has changed is redrawn instead of a full-screen refreshing.

     

    Enrico

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