Document Number: 001-46929 Rev. *B Page 6 of 33
Designing with User Modules
The development p rocess for the PSoC de vice differs from that
of a traditional fixed function microprocessor. The configurable
analog and digital hardware blocks give the PSoC architecture a
unique flexibility that pays dividends in managing specification
change during development and by lowering inventory costs.
These configurable resources, called PSoC Blocks, have the
ability to implement a wide variety of user-selectable functions.
Each block has several registers that determine its function and
connectivity to other blocks, multiplexers, buses and to the IO
pins. Iterative development cycles permit you to adapt the
hardware and software. This substantially lowers the risk of
having to select a different part to meet the fin al design require-
ments.
To speed the development process, the PSoC Designer IDE
provides a library of pre-built, pre-tested hardware peripheral
functions, called “User Modules.” User modules make se lecting
and implementing peripheral devices simple, and come in
analog, digital, and mixed signal varieties. The standard user
module library contains over 50 common peripherals such as
ADCs, DACs timers, counters, UARTs, and other not so common
peripherals such as DTMF generators and Bi-Quad analog filter
sections.
Each user module establishes the basic register settings that
implement the selected function. It also provides parameters that
allow you to tailor its precise configuration to your particular
application. For example, a Pulse Width Modulator User Module
configures one or more di gital PSoC blocks, one for ea ch 8 b its
of resolution. The user module parameters permit to establish
the pulse width and duty cycle. User modules also provide tested
software to cut development time. The user module appl ication
programming interface (API) provides high level functions to
control and respond to hardware events at run-time. The API
also provides optional interrupt service routines that are adapted
as needed.
The API functions are document ed in user module data sheets
that are viewed directly in the PSoC Designer IDE. These data
sheets explain the internal operation of the user module and
provide performance specifications. Each d ata sheet describes
the use of each user module parameter and documents the
setting of each register controlled by the user module.
The development process starts when you open a new project
and bring up the Device Editor, a graphical user interface (GUI)
for configuring the hardware. Pick the user modules you need for
your project and map them onto the PSoC blocks with
point-and-click simplicity. Next, build signal chains by intercon-
necting user modules to each other and the IO pins. At this stage,
also configure the clock source connections and enter parameter
values directly or by selecting values from drop-down menus.
When you are re ady to test the hardware configuration or move
on to developing code for the project, perform the “Generate
Application” step. This causes PSoC Designer to generate
source code that automatically configures the device to your
specification and provides the high level user module API
functions.
Figure 4. User Module and Source Code Development Flows
The next step is to write your main program, and any
sub-routines using PSoC Designer’s Application Editor
subsystem. The Application Editor includes a Project Manager
that allows you to open th e project source code files (inclu ding
all generated code files) from a hierarchal view . The source code
editor provides syntax coloring and advanced edit features for
both C and assembly language. File search capabilitie s include
simple string searches and recursive “grep-style” patterns. A
single mouse click invokes the Build Manager. It employs a
professional strength “makefile” system to automatically analyze
all file dependencies and run the compiler and assembler as
necessary. Project level options control optimization strategies
used by the compiler and linker . Syntax errors are displayed in a
console window. Double click the error message to view the
offending line of source code. When all is correct, the linker
builds a HEX file image suitable for programming.
The last step in the development process takes place inside the
PSoC Designer’s Debugger subsystem. The Debugger
downloads the HEX image to the ICE where it runs at full speed.
Debugger capabilities rival those of systems costing many times
more. In addition to traditional single-step, run-to-breakpoint and
watch-variable features, the Debugger provides a large trace
buffer and allows you define complex breakpoint events that
include monitoring address and data bus values, memory
locations and external signals.
Debugger
Interface
to I CE
Appl icati on Edi t or
Device Editor
Project
Manager
Source
Code
Editor
Storage
Inspector
User
Module
Selection
Placement
and
Parameter
-ization
Generate
Application
Build
All
Event &
Breakpoint
Manager
Build
Manager
Source
Code
Generator
[+] Feedback