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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
Sudden Impact Wearables Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sudden Impact Wearables Design Challenge
  • More
  • Cancel
Sudden Impact Wearables Design Challenge
Blog Skier impact monitor 12 - some words about PSoC
  • 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: hlipka
  • Date Created: 26 Apr 2015 11:24 PM Date Created
  • Views 470 views
  • Likes 1 like
  • Comments 0 comments
  • impact_skiers
  • sudden_impact
Related
Recommended

Skier impact monitor 12 - some words about PSoC

hlipka
hlipka
26 Apr 2015

(Complete list of all blog entries in this series)

I have mentioned multiple times that for my project I'm using s PSoC4 MCU from Cypress. But I never explained what is so special about these chips and what made them so useful for my application.

PSoC is short for "Programmable System on a Chip". Its a combination of a MCU core with a number of PLDs (programmable logic devices) and programmable analog components on a single chip. In contrast to a "normal" MCU where you write code that executes your program logic, configures some internal fixed-function peripheral components and maybe connects to some external devices, the PSoC series allows you to define your own hardware right on the chip.

Some history

The history of PSoC goes back until 2002 when the PSoC1 series was released. It is based on a proprietary M8C core (8bit, 4MIPS) and ist still the entry-level and mass-market chip. The devices are rather cheap - prices start at $0.9 in 1k quantity. In contrast to later series one has direct access to the hardware configuration. This is more complicated and takes more learning, but allows e.g. re-configuration during runtime. The PSoC1 comes with a large number of analog design blocks that can be combined into many different functionalities.

The next series is the PSoC3. It has been released in 2009 and was a real step forward. It is based on a 8051 core (up to 67MHz with single-cycle execution). It was the first series that incorporated the programmable digital blocks, as well as it was the first series that used PSoC Creator as development environment (more on that later).

The PSoC5 series, based on the Cortex-M3, was announced with the PSoC3 but was available only in fall of 2010. Later on it was replaced by the PSoC5LP series which are basically compatible, but have a lower power consumption and fixed some issues with the PSoC5 series. Their core can run up to 80MHz, and it is the series with the highest capabilities (fastest core, large RAM, large flash memory). With the SAR ADC it also introduced a new analog block.

The latest member in the series is not the PSoC7 as one might guess, but its the PSoC4 series. Its based on the Cortex-M0 and sits somewhere between PSoC1 and PSoC5LP. Its target is the existing PSoC1 base, since it much more capable but comes at about the same price point (the smallest members of the family are under $1 in 1k quantities). The price for that is that there is less configurability in this series. There are more fixed-function blocks, and less configurable elements available.

The PSoC4 series is also the place where new development happens and some diversification sets in. In Q4/2014 the PSoC4 BLE series was announced, combining a larger PSoC4 core with a complete BLE radio module on a single chip. Just a month ago the new PSoC4M series was announced which adds some more features to the series that come from the PSoC3 and 5 (DMA, CAN blocks).

For the PSoC4 BLE module a less capable sister series exists, called the PRoC BLE. Its a PSoC4 BLE without the configurable stuff, so it has just the fixed-function components (Timer, PWM, serial communication, SAR ADC). Its intended to be used in applications with a limited feature set (like remote controls or wireless controllers).

Developing for PSoC

Since the PSoC incorporates not only a MCU core, but also configurable analog and digital blocks, its not feasible to program it in code only. So Cypress came up with the PSoC Creator, which is kind of a mixture between your normal IDE and a schematic entry program (e.g KiCad). One typically starts with a hardware design, by placing logic gates, preconfigured components, IO-pins or analog components on the sheet and then connects them together. Having done that the IDE provides for each placed component a API which allows access to its functionality. This avoids looking into big data sheets and lits of registers - everything is neatly available as function calls.

This way of development means that one needs to "think in PSoC". That is, the developer needs to think  more in hardware than in software first. Many problems that performance- or timing-critical are difficult in your normal MCU. But when they are solved in hardware they can be trivial.

Lets consider for example the first project I ever did with a PSoC: my analog-digital-mixed scope. It combines a two-channel scope with an 8bit logic analyzer, a sample rate of 700ksps and a sample depth of up to 24kb. All of that, together with a flexible triggering circuit did fit into a single PSoC5 chip (and with a PSoC5LP it would even go up top 1Msps). Lets consider the triggering:

  • for each of the 8 digital inputs the logic level needs to be checked with the trigger definition
  • optionally each channel can be excluded from triggering
  • for each analog channels, the trigger level must be checked, and the flank (rising or falling)
  • and then the analog channels are handled as the digital ones (means they can be excluded)

In software this will be quite difficult, even with a core going faster than 80 MHz. But in hardware its quite straightforward, and looks as if you are looking a a normal scope:

imageimage

(I skipped the digital input parts since its schematic is quite messy).

On the left you see the analog input - each channel can select from one of two inputs, and the runs through a PGA (so the input level goes from 5V full-scale down to 100mV full-scale). The trigger level is set with a DAC combined with a comparator.

On the right is the trigger circuit. The flank for the analog triggers is set with a XOR, and they are masked with AND gates (as is the digital trigger). When the trigger fires, is just starts the DMA engine that stores the sample in memory. So in the actual acquisition, there is no software involved at all. It is only needed for setup and display.

When you get the "PSoC way" of development, testing out a new idea can be quite simple. Especially when it involves a combination of hardware and software.  Quite often, when I want to try a small digital or analog circuit (or a combination) I just fire up Creator, draw my circuit, write a small program that handles whats left in logic and can see within minutes whether my idea works. Its much simpler than a breadboard. And the provided APIs for all the components make software also much easier to write (and to read!) - I never ever had the need to write into a register to get something working.

When you really need, Creator provides the means to create your own component. This is done mostly with Verilog, so its not too complicated.

Thats why

So there you have it - for me the PSoC is one of the fastest ways to gets any project going. The huge flexibility means you can do nearly anything (provided you fit it into the number of resources. When new requirements come up, they usually can be solved by just a reconfiguration. And in the combination with the BLE radio it meant even a small form factor.

Whats next

As mentioned already I started work on my PCB. Unfortunately I found that I probably cannot make it as small as I wanted it to be. To do so would have meant to work with 0402 components which is something I don't want to solder manually. Also it means that the PCB runs with clearances of just 6 mil which will be tricky.

Fortunately Cypress released the new EZ-BLE module, which is a PRoC BLE chip, with an antenna and all support components (capacitors and so on) on a small 10x10 mm module. So I will redesign my PCB to have this module on one side and the Qi charger and the Accelerometer on the other side. Doing so should make it much more easily to shrink it down to the 25x30mm which is the size of my battery (and in the end the stack might be about 15mm thick).

I will see whether I can get a EZ-BLE module fast enough, otherwise I will use just my prototype for this contest. Software-wise I already reconfigured my PSoC4 solution to run with just the components available in the PRoC chips which worked quite well.

  • Sign in to reply
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