PSoC Creator News and Information | Cypress Semiconductor
New Project Alert!
This project shows how to use the TE/MEAS Analog Pressure Sensor (1210A-015A-3L) with the PSoC Analog Coprocessor to measure absolute pressure. The TE analog pressure sensor is spec'd to work in the 0-15 Psi range and provides a differential voltage-output that changes based on the measured pressure through a tube on the sensor. The sensor requires current excitation which is provided from the PSoC, using its internal voltage reference and opamp. The differential signal from the sensor is amplified using PSoC's internal opamps, configured as a differential amplifier circuit. The amplified signal is then fed to PSoC's internal ADC which converts the analog signals into digital values representing the absolute pressure. The digital values of pressure sensor are then sent over I2C to a PC where they can be visualized in graphs.
Click this link to learn about and download this project: Analog Pressure Sensor Project
One of the really nice features of the PSoC Creator schematic editor is the ability to copy-paste parts of the design to replicate functionality. When you copy a component instance all the parameter settings come along for the ride and so you can set things up once and use the metaphorical cookie-cutter as often as you like. The tool even renames everything to avoid name space collisions. It is a feature I use all the time.
Until it goes wrong. This happens when I decide that I need to change a parameter and start making the edits in copied components. Then someone roams up to my desk and asks a difficult question (such as "ready for lunch?"). One extra-large burrito and a bucket of chips later I have forgotten which components I had edited and the whole system stops working! As a result this I always look for alternatives to making multiple copies of components and a hobby project of mine illustrates a good example of how to do that.
When not eating burritos or writing articles for the PSoC Creator Start Page I often play with a PSoC-powered robot car. I can drive it from my phone because it has a Bluetooth module on-board, and I can set it up as either an automated line follower or maze solver. It happens to be the fastest line follower in the company by the way but that is probably more an indication of my lack of article writing than my skills as an embedded programmer. Anyway… the front of the car has a row of 5 reflectance sensors, connected to PSoC pins, that I use to detect the presence and position of the car relative to a line on the floor. The photodiodes are always powered on and the resistance of the phototransistor side varies according to the reflectance of the surface it is facing. By repeatedly charging up a capacitor and timing how long it takes to decay through the transistor I can detect a black line on a white surface (or vice versa). And it is 100% digital so I am not being forced into the kind of mathematical gymnastics I abandoned a long time ago!
Here is a picture of the circuit to handle one sensor. I am using a 2-output PWM to drive the pin's output enable terminal high, which charges up the capacitor (cap_charge). Then I disable the output and wait a "while" for it to decay. A second pulse (sensor_sample) copies the state of the pin through a flip-flop into a status register. I can read the register at any time and the flip-flop ensures the data is always good.
As you can imagine, making 5 copies of this circuit is dangerous. In my time I have messed up the PWM frequencies, the drive modes and initial states of the pins, the reset state of the flip-flop and, well, pretty much everything else! Here is a part of the full design showing just two of the five sensors.
While this design works fine, every time I edit it I manage to make a mistake. The wiring between the PWM and the status register gets complex and it is easy to make a parameter change in some, but not all, components. The fix is to use just one PWM for all the pins (pretty obvious I know) and use the other component's "size" parameter. Starting with the pin, you open the parameter editor dialog and set the "Number of pins" to 5 and, on the Mapping tab, select "Display as bus". The wire from the component becomes thick to indicate that it is a 5-bit bus rather than just a single wire. Notice how there is is just one Output Enable terminal so I can control all the pins with one PWM signal. Then you do basically the same thing with the flip-flop and the status register - give them a size of 5 and display their terminals as buses.
Et voila! Using buses allows me to compress the whole design into the minimum number of components and wiring. Best of all I can make parameter changes to all pins with just a single edit. I have a 5-sensor implementation that helps make my car super-fast but is barely more complex than the single sensor version. Best of all, it is really easy to maintain, regardless of all my burrito-fueled distractions!
In a recent blog I talked about wiring tips for faster design. One of the risks with being a wire-drawing wizard, though, is that it can lead to a bit of a messy schematic. It is tempting to just drop in your components anywhere on the page and hook them up. If you ever look at an old design and wonder what you were thinking about at the time then I recommend naming your wires.
PSoC Creator resolves wires with the same name into a single signal path when it builds a project and so two (or more) wires with the same name are functionally equivalent to a single wire with fourteen elbows meandering around a cluster of components.
Here is a design I made recently that uses a PWM with two outputs to drive a reflectance sensor. The first output (pwm1) turns the LED on briefly and the second (pwm2) triggers the D flip-flop to read the state of the pin a little while later. The reflectiveness of the surface determines how long the transistor takes to decay and so the output of the flip-flop is always a snapshot of the state of the sensor. In firmware, I read the status register and can make decisions based on the surface my board is lying on.
The problem is that I have five of these sensors and I wanted to drive them all from the same PWM and read them from one status register. I made copies of the pin and flip-flop and started wiring but it took quite a while. I kept making mistakes because I could not remember which wire should go where and I would inadvertently connect two wires that were driven by different signals. I managed to get three sensors working.
I was daunted by the prospect of more wiring and I was running out of room on the page! How would I ever maintain this project? So, in the end, I gave up and took the extra 30 seconds to just name the wires coming from the PWM and those going to the status register. You just right-click on the wire and choose "Edit Name and Width" to do this.
I then tidied up the design in no time. As you can see, naming the wires let me break the whole design into three pieces; the PWM, the pins and flip-flops, and the status register. I managed this without ever making a bad connection and it is much easier to see the connectivity when there are not wires running around and crossing each other.
Taking a few seconds to name wires can save you a lot of time drawing your schematics. Not only can you make designs (that work) quickly but you can do so in a way that is far easier for other engineers to understand. In a future blog I will expand on that idea with some more tips on making schematics with lots of repeated content, like all these pins and flip-flops, even easier to read and maintain.
[re-printed from community.arm.com]
The kits provide isolated analog and digital power domains so they are a great way to learn about Cortex-M, analog signal processing, and embedded systems programming in general. There is also a free software package called EZ-PSoC Library, which makes the job of interacting with device peripherals really simple.
I think these kits are great and so, if you're looking for a powerful but low-cost development kit with an 80MHz ARM device, don't wait too long and miss this opportunity!
We are pleased to announce a new family of PSoC devices - the PSoC Analog Coprocessor.
Cypress's PSoC Analog Coprocessor simplifies the design of sensor-based systems by delivering a scalable and reconfigurable architecture that integrates programmable Analog Front Ends (AFEs) and a signal processing engine (32-bit ARM Cortex-M0+) that can calibrate and tune the AFE in software. The PSoC Analog Coprocessor enables designs to send aggregated, pre-processed, and formatted sensor data over serial communication interfaces to host processors.
- Features programmable Analog Blocks like Opamps, PGAs, Comparators, ADCs, etc. to create custom Analog Front Ends (AFE) for sensor interfaces
- Introduces the new programmable Universal Analog Block that can be configured as Analog Filters, high-resolution ADCs, DACs, and more
- Includes a 32-bit ARM® Cortex®-M0+ Signal Processing Engine with a DMA controller
- Features embedded peripherals including Timer/Counter/PWM blocks and Serial Communication Blocks (UART/SPI/I2C)
There's also an exciting new development board featuring the new PSoC Analog Coprocessor!
The CY8CKIT-048 PSoC Analog Coprocessor Pioneer Kit is a low-cost ($49) development platform to create multi-sensor designs. It includes five on-board sensors along with PSoC Creator Code Examples for each type of fundamental electrical quantity:
- Voltage-based PIR Motion Sensor (Zilog ZRE200GE)
- Current-based Ambient Light Sensor (Vishay TEMD6200FX01)
- Resistance-based Temperature Sensor (EPCOS/TDK B57164K103J)
- Inductance-based Proximity/Contact sensor
- Capacitance-based Humidity sensor (TE HPP801A031)
Get started with the PSoC Analog Coprocessor today:
1. Download PSoC Creator 3.3 CP3 with support for the new PSoC Analog Coprocessor devices (CY8C4Axx)
2. Buy the $49 PSoC Analog Coprocessor Pioneer Kit
3. Start your first analog coprocessor design using the Getting Started with PSoC Analog Coprocessor App Note
- 1 of 41
- next ›
ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.