The LabRat: Simplify PSoC Programming

The PSoC 3 First Touch Starter Kit gives users opportunities to
learn more about the Cypress
programmable embedded system-on-chip, or PSoC. The PSoC 3 family provides a
wide array of internal capabilities and peripheral devices. But unlike most
microcontrollers (MCUs), the PSoC devices rely on internal programmable logic
that can place and route devices such as counters, timers, DMA channels and
ADCs. Some functions, such as 4- and 8-bit counters, already exist within a
PSoC chip. The PSoC Creator tools create others as needed and implements them
in Universal Digital Blocks (UDBs) of programmable logic. A single-cycle 8051
core (67 MHz) provides the PSoC processor core.

You can find the data sheet for the CY8C3866AXI-040ES2 chip used
on the board here. To me, the success of the hardware depends
greatly on the innovative PSoC Creator software that simplifies system design
and programming. Click here for information, video tutorials and data sheets for the PSoC
3 family.

I enjoyed working with this kit and except for the lack of a
workbook or reference manual for the PSoC Creator tools, it rates highly. I gave it a "4" rating for Meets
Expectations only because the kit lacks do-it-yourself projects or follow-on
exercises. If you want to concentrate on solving problems rather than becoming
enmeshed in the details of complicated functions and I/O ports, I highly
recommend the PSoC chips and the PSoC Creator software.Support for the Micrium uC/OS II and the Segger embOS should
become active soon for the higher-end PSoC 5 family of devices that include an
80-MHz ARM Cortex-M3 CPU rather than an 8051.

In addition to the PSoC chip, the board includes a CapSense
touch-sensor slider, a proximity sensor, eight LEDs, a thermistor, an
accelerometer, a USB interface and a push-button. The board communicates
directly with a host PC through a standard USB cable. The board can run from a
9-V battery or from power through the USB cable. (Disconnect the battery after
you use the board as a stand-alone device.)

Instructions on a one-page Quick Start Guide show how to connect
the board to the 9-V battery and rapidly wave the board back and forth to
display a "rasterized" message — PSoC Rocks! — in the air as the LEDs
turn on and off in response to the board's accelerometer signal. After I tested
the board, I printed the "PSoC 3 First Touch Starter Kit Guide"
provided on the CD, and followed the steps to load the PSoC Creator and PSoC
Programmer software, and four sample projects. The first project opens the PSoC
Rocks! project folders and lets users easily change any of the six messages the
board will display and the duration of each message. At first I couldn't find
the kit files, but only because my lab PC had not completed installing them on
my Windows XP lab computer. Be patient when installing the software tools.

The PSoC Rocks! project worked as expected, and my modified
message displayed "Lab Rat!" The Starter Kit Guide includes three other
projects, a bubble-level emulator, a proximity sensor, and a CapSense slider
control. I skipped them because I wanted to learn how to use the PSoC Creator
software and make up my own experiment.

The PSoC Creator software includes a schematic-capture-like
screen that lets developers select functional analog and digital building
blocks such as timers, ports, clocks, UARTs, analog multiplexers, ADCs, DACs,
and so on and move them into a TopDesign window. By using these blocks you
avoid writing low-level code to control devices and I/O ports. The LED-display
project, for example, contains three block; read the accelerometer's Y-axis
voltage, set up the accelerometer and output the 8-bit LED values. The
LED-output section uses graphical "wires" to connect an LED-control
port to a set of inverters and then to two ports of four LEDs each.

When I double clicked on a component, PSoC Creator opened a
configuration window that let me set start-up and operating conditions. Each
configuration window also links to a data sheet that explained a component's
operation, its input and output signals, configuration information, the
application program interfaces (APIs), how the APIs operate, and sample code.

I chose to create an 8-bit binary counter that would display its
count on the eight LEDs. But I couldn't figure out how to relate the
building-block schematic diagram with the code to do something useful. An
application person at Cypress
suggested I watch the video: "101 Introduction to the Architecture"
that included a simple experiment that toggles an LED on or off based on an
internal time delay. That video helped and its associated project operated properly. But I still
needed a hand with an 8-bit counter. To view the video and three others, click here.

Cypress
doesn't yet have step-by-step tutorials that explain how to do things with the
PSoC Creator software and for that reason I rated the kit's documentation a
"3." The examples in the Starter Kit Guide only have users duplicate
steps rather than solve given problems, with answers provided later.

So, I talked with a member of the PSoC Creator team at Cypress and he walked me
through a four-bit counter example. Based on his explanations, I quickly
extended the design to an eight-bit counter that evening. My online version of
this review includes or points to a tutorial that explains the steps I used to
create the 8-bit counter. You can use that explanation as a do-it-yourself
experiment that links hardware and software. My compiled programs flowed to the target PSoC chip through the USB
cable and I used debug functions to monitor chip and program actions. It felt
good to see the eight LEDs flash as expected for a binary counter.

Developing an application still requires writing C code. The
schematic approach eliminates difficulties working with chip-level functions
and devices, but the overall operation still depends on your C code. You can
see that aspect of a design in my 8-bit counter example that required only
eight lines of code to control an interrupt-driven program.

This kit and the PSoC creator have a lot of potential because
they create a code "outline" based on the PSoC functional building
blocks you use in a design and thus remove developers from the nitty-gritty
details of register controls for I/O ports, configuring a 12-bit ADC, and so
on. Schematic-diagram-like "wires" make connections as needed between
these blocks through Universal Digital Blocks (UDBs). The PSoC Creator tools automatically use the
UDBs to create any needed functions, such as 32-bit counters, and route signals
between existing resources and I/O pins. Imagine having to write the code for a
CAN-bus controller vs. dragging a CAN-bus controller into a schematic and using
several configuration screens and prebuilt API functions. The latter approach
wins every time.I enjoyed working with this kit and except for the lack of a
workbook or reference manual for the PSoC Creator tools, rate it highly.
Perhaps Cypress
will have that type of information available soon.

If you want to concentrate on solving problems rather than
becoming enmeshed in the details of complicated functions and I/O ports, I
highly recommend the PSoC chips and the PSoC Creator software. Support for the Micrium uC/OS II and the
Segger embOS should become active soon for the PSoC 5 family of devices that
include an 80-MHz ARM Cortex-M3 CPU rather than an 8051.

Focus on Fundamentals consists of 45-minute on-line classes that cover a host of technologies. You learn without leaving the comfort of your desk. All classes are taught by subject-matter experts and all are archived. So if you can't attend live, attend at your convenience.