circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 141 March 2002
You Too Can Design with SoC

A Design Challenge 2002 Primer


byJeff Bachiochi

Project Application

Oops! This application is so simple I forgot an important part. A small signal input of the sensor is amplified and filtered prior to the 8-bit A/D converter. I need a conversion to take place at periodic intervals and the conversion data sent to the UART transmitter. I forgot to place a counter to divide one of the clocks down to the appropriate interval. I will need a 16-bit counter for this and it will create a periodic interrupt upon which the rest of the application code will be executed. Changing, adding, or deleting modules or configurations is not a problem with the PSoC Designer, because all of the files are easily regenerated to keep the project current.

With the project application code finished, use the Build command to assemble the pieces into a single ROM file. Before programming a chip, you may want to debug to find out how accurately you’ve defined the project’s logic.

Debug

The development kit from Cypress includes an in-circuit emulator (ICE). Debugging your code takes place in your hardware environment and not just simulated by your PC. A short CAT-5 patch cable connects the ICE to one of many possible pods. Each device size and package type has a pod that makes the physical connection to your PCB. Debugging begins with a solid parallel port connection to the ICE and downloading the project.rom file. The standard debug commands include read and write to the program and data memory and I/O, CPU, and RAM registers. The other commands supported are run, halt, step, set, clear breakpoints, trace, watch, and dynamic event points.

Let’s take a closer look at some of these. Trace has three modes of logging. The PC-only mode logs the instructions executed. The PC/registers mode adds all of the CPU registers and the external 8-bit input of the ICE. The PC/time stamp adds a time stamp to each log entry. You can monitor other TTL signals from your PCB with the external inputs of the ICE.

A watch variable can be input as an address or label within RAM or flash memory and be formatted as decimal or hex in the watch window. Dynamic event points (DEP) differ from breakpoints (BP) in two ways. Breakpoints halt execution upon a program counter (PC) match whereas dynamic event points use a match of any or all of the PC, data bus, address bus, instruction type, external logic input signal, x register, accumulator, SP, and F register to trigger an event. A DEP can halt, turn on or off trace monitoring, or set an external trigger. With this flexibility, complex series and parallel monitoring can help find the causes of stack overflow, memory trashing, and out-of-bounds operation.

Your Turn

It is amazing the amount of stuff that can be packed into an 8-pin chip these days. Except for the memory size and number of I/Os (depending on package size), all of the CY8C2xxx micros are comparable to eight digital and 12 analog PSoC blocks. The 8-pin versions are less than $3 in 100-unit quantities and the big guys are less than $6, making these extremely cost effective in eliminating external circuitry. The availability of helpful low-cost tools that you get with this product, is of high importance to most designers.

One of the advantages of flash memory devices is, of course, reprogramming of the device. Think about this, with a CY8C2xxx microcontroller you have to ability to write code to reprogram your device on the fly. Your application could change from one module arrangement configured for data input into a new module configuration for data output. That’s really fitting 10 lb into a 5-lb bag.