A TPU (Time Processing Unit) is a custom piece of silicon available from Freescale on a variety of microcontrollers. Because the eTPU executes code, just like a CPU does, the designer can be led into the mistaken view that the TPU is simply a co-processor. Actually, from a design standpoint, the TPU is similar to an ASIC or a FPGA in that a wide variety of circuitry can be replaced with a single device. But, unlike an ASIC or a FPGA, the TPU is free, assuming that the decision to use a microcontroller that contains a TPU such as a 683xx or HC16 has already been made.An eTPU (Enhanced Time Processing Unit) is Freescale's successor to the TPU. Conceptually similar to the TPU, the eTPU contains more channels, has more sophisticated channel hardware, and supports angle mode in addition to timer mode.
When considering the types of circuitry that the eTPU can replace, it is important to keep in mind that the eTPU can be programmed using your custom microcode. Thus, many applications for which the eTPU is suited are not supported by a standard mask and are not found in Freescale's custom eTPU microcode library. The following is a list of a few notable devices and circuits that the eTPU can replace.
The key feature of the eTPU is its proactive approach to handling events and the resulting fine resolution achieved for waveform generation and measurement. The eTPU consists of a single microsequencer and dedicated channel hardware (there are 16 channels in the TPU and 64 total channels in the eTPU). The microsequencer prepares the channel-specific hardware to react to possible future events. When a particular event actually occurs, the hardware autonomously performs some action and requests microsequencer servicing. Because the hardware is autonomous, the usual latency penalties associated with an undedicated microsequencer are not incurred. The microsequencer responds to the service request (after servicing any existing requests based on an optimized scheduling mechanism) and prepares the channel hardware for the next event.A helpful example of this mechanism is found in the off-the-shelf frequency-to-digital conversion routine. For a particular eTPU channel the microsequencer arms an edge detector to respond to an I/O pin transition. When the I/O pin transition occurs the edge detector causes the value from a free running counter to be stored in a channel-specific register. Microsequencer servicing is also requested. Upon servicing the channel the microsequencer updates a running pin edge count, rearms the edge detector, and uses the free running counter value to maintain a 24-bit cumulative counter count. After a programmable number of edges, the microsequencer also interrupts the CPU. The CPU, using the cumulative counter count and the I/O pin edge count, calculates the I/O pin edge frequency. This mechanism allows a 68332 running at 20 MHz, for example, to achieve up to 200 ns resolution on frequency measurement.
When a particular application is not supported by the existing standard library of eTPU code, the developer must create custom eTPU C code. The ASH WARE ETEC eTPU/eTPU2 C Compiler can be used to create your custom eTPU "C" code. The code can consist of a combination of both the standard library code and your custom eTPU code. ASH WARE Inc.'s eTPU/eTPU2 simulator can be used to verify that the eTPU "C" code meets the requirements of the application.
While dramatically easier than TPU microccoding, eTPU coding has a learning curve. The eTPU coding course is therefore highly recommended. The cost of approximately $1000 is well worth it. See our web page on training services.
Newcomers to writing custom TPU microcode have been hampered by a dearth of readily available information. Amy Dyson and Munir Bannoura have addressed this issue by publishing a book called "TPU Microcoding for Beginners". This book is available though ASH WARE. Please contact us to get your copy! Detailed descriptions of all microcode functions are compiled in a single notebook titled TPULITPAK/0. For more information, contact your local Freescale FAE or the Literature Distribution Center at 602.303.5454
For the eTPU the book "eTPU Programming Made Easy" is available through ASH WARE. Last, the ETEC Compiler manuals, which can downloaded for free from this website, can be a helpful reference.
A freeware TPU microcode assembler is available from Freescale's freeware Web server. Freescale also sells a released version of the TPU assembler that includes documentation for approximately $500. Contact your local Freescale sales office for further information about the TPU microcode assembler.
ASH WARE offers the only commercially available TPU simulator. Capabilities include script and test vector languages, a graphical logic analyzer, and source-level debugging. A free demonstration version is available upon request.
ASH WARE's eTPU Simulator is the debugging tool of choice for companies around the world doing eTPU development. Feature-rich, it quickly allows developers to test and debug their code, create regression tests, and characterize performance.