Current Issue
Catch those Joules 4/6/2008
MORE BLOG POSTS
PCIM Europe
|
As EDN Europe reported in its December 2005 and February 2006 editions, the ARM architecture is enjoying increasing acceptance within the automotive and industrial markets that are traditionally the domain of proprietary designs (Reference 1). The recent announcement of ARM's Cortex-M—available for the first time in Luminary Micro's Stellaris family—strengthens this architecture's challenge by implementing a re-design that addresses comparative weaknesses in the original ARM7TDMI and its upwardly-compatible successors, notably within real-time-response performance. Unsurprisingly, vendors with long histories within the automotive sector are reluctant to cede market share and continue to introduce new silicon that continually raises the price/performance bar for application-specific devices. We now look at several recent 32-bit proprietary products that suit applications from general-purpose embedded control to infotainment, hard real-time, and DSP, from the perspective of the low-cost development environments that their makers intend will highlight each chip's capabilities.
In its previous Motorola Semiconductor guise, Freescale was among the first silicon makers to target the automotive sector. One of its most successful products is the PowerPC family, with devices such as the MPC565 enjoying widespread acceptance within the engine-management and powertrain-control segments. The company's product portfolio also includes the ColdFire series of 32-bit machines, many of which enjoy success within industrial control networks. Widening the application focus, the recent MCF5251 targets portable and in-vehicle audio players, with interfaces for ATA-66 hard disks, CD-ROM codec, SmartMedia, USB-on-the-go, and serial digital audio. Its V2 68K/ColdFire core includes an enhanced multiply-accumulate (MAC) unit with hardware division that helps decompress streaming multimedia, making discrete DSPs unnecessary in many applications. The chip integrates 128 kbytes of SRAM and an 8-kbyte instruction cache, together with a system bus controller and SDRAM interface to support the external memory system. A ROM bootloader allows the chip to boot from hard disk, I2C, or SPI-connected devices. Two CAN ports augment the normal complement of microcontroller peripherals, while JTAG and BDM (background-debug-mode) interfaces ease system development. The budgetary price is $10.83/1,000.
Available for $949.50, the M5251EVBWR evaluation system contains a M5251C3 single-board computer, a 2.2-in. TFT display module, a serial cable, and a universal power supply. In addition, a binder houses a 30-day evaluation copy of Wind River's Workbench software, on-chip debug edition, together with a Wind River Probe USB emulator that links the PC host to the board. Workbench provides all of the normal debugging and flash programming features, and is OS-aware for environments including Linux, ThreadX, and VxWorks. The software runs on Linux, Solaris, and Windows hosts. Presumably because this kit is so new, there's no board support information in the package—you download it from Freescale's website—while licensing issues mean that you have to obtain authorisation to download the Trio software for use with Workbench. There are no MCF5251-specific examples on the CD, but the MCF5251 homepage carries software libraries with routines such as a graphic equaliser, JPEG video, MPEG-2 advanced-audio-coding (AAC), and MP3 decoders. There's also a binary image that's useful to prove that the flash programming system is operational.
The documentation reveals that the board carries 2 Mbytes of flash, 256 kbytes of which comprise the dBUG monitor/debugger firmware that enables stand-alone operation with an RS-232 terminal. Or, that's the theory—our board resolutely refused to communicate over this port, simply sending error-break and break signals before locking up. Installing the Wind River software completed seamlessly, but did not create the HddSoftware examples directory that the printed booklet uses to introduce the system. Attaching the Wind River Probe worked fine, providing access to the microcontroller's on-chip JTAG-based debugging system at speeds that the company says are typically 3 to 10 times faster than competing solutions. The Trio software comprises a full application for an MP3 player—for which you will require an external ATA hard disk—but there are few pointers as to how to get started within this complex environment. Freescale and Wind River are working to improve the out-of-the-box experience as we go to press, so if you're considering this evaluation platform, be sure to contact these companies for the most up-to-date support material. It's also worth knowing that Wind River is currently offering a price incentive for customers who purchase this kit. For $5,000, the software bundle comprises perpetual-seat, node-locked versions of the Compiler and Workbench suites, together with ColdFire-family support for the emulator that comes with the kit.
Another recent introduction from Freescale also demonstrates the ColdFire architecture, and comes with the ubiquitous CodeWarrior environment that's familiar to virtually every Freescale user. For $349, the M5208EVB evaluation kit consists of an evaluation board from Intec Automation, P&E Micro's USB MultiLink BDM interface, all necessary cables, and a power supply. The board's MCF5208 ($7.22/1,000) shares the same core and general-purpose peripherals as the 5251, but lacks the multimedia interfaces and the CAN ports; usefully for industrial-network use, the 5208 adds a fast Ethernet port. Together with CodeWarrior, the software resources comprise a getting-started CD and Intec Automation's SBCTools board-support package for the uClinux OS. There's also evaluation software from CMX Systems, Green Hills, MQX Embedded, and Treck. A 2-Mbyte flash device carries the dBUG monitor together with the uClinux kernel, which facilitates a web browser interface, while a 32-Mbyte SDRAM provides program space. Interfaces include serial and Ethernet ports, a BDM header, and a 16-pin header that makes available a range of signals including I2C and SPI buses. Echoing Freescale's presence in the ZigBee marketplace, the board features a ZigBee transceiver with a pc-board-track antenna.
The getting-started CD auto-runs a routine that scans the board and establishes serial communications with a terminal program at 115,200 baud, booting into uClinux. Providing that you reset your terminal program from this rate to 19,200 baud, removing jumper JP3 and rebooting displays the dBUG monitor prompt. A 54-page manual describes the monitor's utilities, which include assembly/disassembly and flash programming, all of which is great fun for machine-code fans wishing to hand-craft smaller projects. The abort pushbutton is especially useful here, as it generates a level-7 interrupt that passes control from user code to dBUG while preserving the machine's state. This action also automatically displays the ColdFire's core register states. In case of accidental flash erasure, images of dBUG and uClinux appear on the M5208EVB's web page.
Larger projects will benefit from CodeWarrior, which the kit delivers in a 128-kbyte code-limited special-edition format. With features such as Stationery providing templates that generate start-up scripts, the IDE (integrated development environment) provides support for assembler and C using the P&E hardware debugger. Helpful features include the USB hardware test routine, which confirms the probe's ability to force the 5208 into background debug mode, showing that the hardware is good. You can then rebuild CodeWarrior's example hello world project for the BDM probe and run it on the evaluation board to verify the entire installation. Useful as a template for further development, there's an example program in CodeWarrior's installation directory that shows how to use the timer and GPIO to toggle the board's four LEDs. CodeWarrior licensing options are available to add features such as instruction-set simulation, RTOS support, and Abatron's high-speed JTAG/BDM interface, with the standard edition costing $2,495 and the professional version $5,995 for software that supports the entire ColdFire family.
The SBCTools board-support-package CD installs the company's standard edition for use with dBUG together with its uClinux, Eclipse edition, which helps developers keen to try this increasingly popular kernel. The Eclipse environment entertainingly describes itself as "an open extensible IDE for anything and nothing in particular", yet it contains a full-blown C/C++ compiler and debugger, enough tutorial material to be genuinely useful, and utilities to share a Samba filing system and configure IP addresses. However, getting the system to work was a struggle, starting with the TCP/IP communications and majoring on the Samba file structure. The Ethernet issues took some experimentation to fix, but there's an obscure instruction in version 2.0.0 of the user manual that claims it's essential to have a shared directory with the name SBCToolsWS for Samba to work. This is, simply, wrong—the environment doggedly directs itself to the default workspace directory and appears to ignore switch workspace commands, hence it never loads the object file from SBCToolsWS—so obey the quickstart instructions and don't stray out of workspace!
Even with a successful build and download, arcane error messages appear that state, for instance, can't get /etc/mtab~lock filesmbmnt failed: 1, which is confusing at the best of times. Help from Intec Automation's programmer, Mike Lavender, yielded a running serial I/O example program (Figure 1 (pdf is 376 kbytes)). From this point, it's easy to explore the facilities that the Eclipse environment offers, such as the tight integration between the GCC compiler and GDB debugger that unusually run under Windows without needing the Cygwin Windows/Linux interface. The GDBServer implementation runs a version of the GDB debugger on a PC host with communications via the fast Ethernet port. Lavender notes that the executable file is "flat" with no filename extensions: "This format allows the program to be placed anywhere in RAM when it is run as opposed to linking static addresses directly in the code. This allows the OS to run a program and even run multiple instances of the same program!"
See uClinux if your prime interest is news and developments for the many platforms that the OS supports, including ColdFire. Designed for microcontrollers that lack memory-management-units, several uClinux projects are now maturing, such as the Analog Devices' Blackfin port, which uses the company's Stamp board (Reference 2). Also don't forget Freescale's own ARM9-derived i.MX21 Litekit, which EDN Europe reviewed last February. This multimedia-focussed kit offers a particularly smooth introduction to the potential of uClinux.
Hard real-time focusDesigned from the ground up to satisfy the hard-real-time needs of the automotive industry, Infineon's TriCore is one of today's newer architectures. A recent addition to the family, the TC1796 is a 150-MHz evolution of the TC1775, which the company introduced back in 2000. As well as increasing the clock rate from the original chip's 40 MHz, this updated device carries 2 Mbytes of error-code-correcting flash, thereby addressing the TC1775B's principal disadvantage compared with its competitors. Other on-chip memory includes 128 kbytes of data flash that can emulate 16-kbyte segments of EEPROM, 192 kbytes of SRAM, and a 16-kbyte instruction cache. The TriCore nomenclature comes from the core's combination of a 32-bit superscalar CPU, single-precision floating-point unit, and DSP engine that exploits the best features of RISC, CISC, and DSP architectures. Separate program and data busses decouple the memory system from a wide range of I/O devices, each of which is optimised for flexibility and autonomous operation. The TC1796 also includes a 32-bit peripheral-control-processor (PCP) that's capable of autonomously handling I/O operations. The guide price for the TC1796 is €27.00/1,000.
Infineon's €400 starter kit for the TC1796 consists of a Eurocard-format board, parallel-port cable, and software resources including Infineon's starter-kit disk, an evaluation copy of Tasking's TriCore-VX toolset, and a board-support package from Hitex. Three more CDs contain sample development environments from HighTec, Lauterbach, and PLS. A getting-started booklet and a breakout board that brings the processor's I/O out to 0.1-in. headers complete the package. The kit requires an external ac or dc adapter that supplies 5.5 to 60V for the onboard power supply, which utilises Infineon's TLE6389 buck converter to derive a master 5V rail with Texas Instruments' TPS76801 linear regulators downconverting to the 3.3V and 2.5V rails that the CPU's core requires. The board's major components comprise the SAK-TC1796-256F150E processor, 4 Mbytes of burst-mode flash, 1 Mbyte of asynchronous SRAM, and the usual array of I/O and switches. Most I/O connects to four high-density connectors, which is why the breakout board is essential. The serial- and parallel-port interfaces have standard full-size connectors, while the CAN interfaces come out to 0.1-in. headers.
The starter-kit CD's QuickStart subdirectory contains a step-by-step guide to installing and running the Tasking toolset and the Hitex HiTOP debugger that form the default environment for this kit, as well as various code examples. To summarise a very long story, the out-of-the-box experience did not go well. At first, the code examples failed to compile, which was due to the version of the Tasking compiler that came with the kit being different from that used to develop the examples. It's an ongoing mystery why Tasking's developers continue to think that it's acceptable to produce tools that are incapable of tolerating forward or backward compatibility, which has been a problem since the earliest days of the TriCore (Reference 3). Having fixed the compilation problems, several of the promising-looking hands-on training exercises failed to run. Investigation revealed that the initial training exercise leaves the TriCore's program counter pointing at the default blinking LED routine in flash, hence downloaded programs will never run. There were also some obscure board-to-PC communication problems that required work-arounds, all of which conveys the impression that no one has properly tested this kit. But don't let any of this dissuade you from considering the TC1796, which is clearly capable of outstanding performance, as the sidebar "Generic platform speeds ECU development" describes. Furthermore, there are heavy hints that Infineon is working to resolve these issues, which a capable software engineer can probably also accomplish.
Hearing of these problems prompted Infineon to donate a starter kit for the new TC116x series, which the company recommends as a simpler introduction to the TriCore family. Aimed at deeply embedded industrial-control applications, the TC116x family makes available a full complement of peripherals, including the Micro Link interface for interprocessor communication and the Micro Second bus interface that provides high-speed control of external power ICs. The major operational differences between this 176-pin LQFP and the full-blown TC1796 are the absence of an external memory bus and the peripheral-control processor. The €295 starter kit comprises a Eurocard-format board whose processor's identifier has been blanked out—a note says that it's a superset of the TC1166, a standard chip that costs around €14.00/1,000—along with the power supply, RS-232 port, and a parallel port to drive the JTAG interface. You also get a short plug-to-plug parallel-port cable, a breakout board to access I/O lines, a universal-input power supply, and a starter-kit CD.
The February 2006-dated CD contains a getting started guide, the TriCore manuals, and software that includes Infineon's excellent chip-configuration code-generator DAvE (Digital Application virtual Engineer) version 2.1r22. Apart from its primary role in initialising the processor, DAvE is a tool that rewards investigation, as its layers reveal a great deal of useful information about the target chip, which can be any TriCore or 166-family device. The tool's output is a fully documented file that you can import straight into a project—and it's free. The default compiler is version 2.3r1 of Tasking's environment, which the kit couples with the universal-development-environment (UDE) from PLS. There are samplers of HighTec's GNU-based development environment and Lauterbach's Trace32 debugger, together with OS samplers from Enea and Euros. You also get a free copy of Infineon's TriLib DSP library for TriCore. The opening screen promises that you can be up-and-running within 30 minutes of unpacking the kit, which the screen assists by providing hyperlinks to install the Tasking compiler, the PLS debug engine, and DAvE that the program examples use.
Sadly, the very first hello world program failed to compile, generating over 40 error messages before giving up. This problem—which the kit did not document—is due to an incorrect linker setting for TriCores without external memory, as a release-note entry on Tasking's website for its v2.3 compiler reports. Changing the linker script file settings for internal memory so that SPRAM's Alloc attribute is ON and its Type is ROM allows the six examples to compile and run correctly. These progress from hello world, which demonstrates stdio support in an embedded environment through a blinking LED I/O-port routine to examples of handling arithmetic saturation, interrupts, serial I/O, and on-chip flash programming. The arithmetic example shows the power of Tasking's C-language extensions that map directly to TriCore instructions, slashing the example code's computation time from 262.6 nsec for 32-bit ANSI-C to just 37.7 nsec for the 64-bit Tasking implementation (Figure 2 (pdf is 396 kbytes)).
One example uses the timer array to generate a 1-sec interrupt that toggles the TriBoard's LED—meantime showing that the TriCore supports up to 255 interrupt sources, each of which can have a unique priority level set from within DAvE. While most processors load new program counter values to run interrupt service routines, the TriCore minimises interrupt latency by jumping to vectors in code memory. The serial-output routine then builds on the IRQ exercise to output an updating message to HyperTerminal. The final example uses the UDE toolset from PLS to program the TC1166's flash with a variation of the serial output routine, and this also works fine, providing that you set the tool to Infineon's DAS (device-access-server) rather than the default Starter Kit JTAG driver and power down/up the TriBoard when programming completes.
While all toolchains are subject to personal preferences, the most popular TriCore set-up combines Tasking's compiler with the HiTOP debugger from Hitex. But don't ignore the other possibilities—as well as those that appear on the starter-kit CD, Infineon's website lists compiler choices that range from GNU freeware to around €3,000 to 4,000 for a commercial product with maintenance and support. Because Infineon uses a parallel-port "wiggler" interface, it's easy to duplicate the simple logic that appears in the schematics for use with your own prototype hardware. You can then use the tools that accompany this kit to perform basic hardware and software debugging at very low cost. For "proper" development, the TriCore supports three levels of debugging via its on-chip debug system (Reference 4). Infineon reckons that the run-time control and internal access that Level 1 offers is sufficient for around 80% of applications. Level 2 adds instruction tracing, while Level 3 is full-blown real-time in-circuit emulation that includes trigger logic, trace and overlay memories, and the ability to view the chip's internal busses. The budgetary range for these tools spans starter-kit prices through €5,000 to 8,000 for Level-2 facilities to about €10,000 for Level-3 capabilities.
Don't dismiss DSPFrom audio decompression to vibration analysis, it's hard to beat a DSP engine when it comes to performing repetitive computations on chunks of data in real time. Yet many engineers shy away from the technology, believing it to be over-complex and expensive. But with a budgetary guide price that starts at $11.60/1,000 for the 100-pin BGA package, the fixed-point TMS320F2808 from Texas Instruments lies at the low-cost end of the DSP spectrum. Specifically designed for real-time control, the chip packs 36 kbytes of single-access RAM (SARAM) and 128 kbytes of flash alongside the 100-MHz C28x core, augmenting the normal complement of microcontroller peripherals with dual CAN ports and a 16-channel PWM module. It also has a 2-kbyte one-time-programmable ROM block and a separate 8-kbyte boot ROM. Crucially for real-time use, the chip features hardware debugging, which the accompanying Code Composer Studio (CCStudio) suite comprehensively exploits. Software support includes TI's DSP/BIOS kernel as well as a number of libraries, such as high-speed fixed-point arithmetic routines and digital motor-control algorithms.
Made by, and available from, Spectrum Digital for $469, the TMS320F2808 eZdsp system kit contains a compact development board, resource CD, USB cable, power supply, and the obligatory getting-started flyer. The board is home to the target 320F2808 DSP, an Actel FPGA, a TMS320DA255 chip, two switch arrays, and various support logic, including serial boot EEPROMs. Two nine-pin D-connectors bring out the primary CAN and SCI buses, with secondary instances of each available on 0.1-in. headers. The final header supports an optional JTAG emulator as the kit uses a USB connection for this purpose. Two unpopulated header layouts optionally allow you to connect GPIO and analogue signals, taking care to ensure that external signal levels don't exceed the F2808's 3.3V I/O levels. To avoid the F2808 latching up with possibly destructive effects, it's also necessary to power the eZdsp board before applying any external signals—so consider hot-pluggable level-translating transceivers for any custom interface that runs at normal automotive or industrial 5V levels.
Installing CCStudio together with the board-support package and a flash burner utility completes seamlessly in about ten minutes, when an XP Pro machine will automatically install the USB drivers that you can test by launching a desktop diagnostic icon. In this case, the installation created icons for the F2812 version of CCStudio as well as the desired F2808 instance, but this aberration didn't affect the kit's behaviour; however, it proved impossible to register CCStudio as the service code was missing from the CD case. It transpires that the software that shipped with our kit is the full Platinum version rather than the free kit version, which similarly has no code-size limit.
Visiting the F2808 section of the downloads area at Spectrum Digital yields documents that include hardware reference guides and schematics as well as the board's getting-started guide, which directs users to CCStudio's integral tutorial. This invaluable facility comprises three modules that introduce users to the IDE, the DSP/BIOS real-time kernel, and the real-time emulation facilities. Nice touches abound, such as the IDE automatically importing the appropriate include files for a project, and the ability to get help on an assembly-language instruction by clicking on it and hitting F1. But the IDE includes some truly slick features, such as the ability to import test-stimulus data from a PC file to the board and return result data using a mechanism called probe points for file I/O. Effectively a special kind of breakpoint, probe points temporarily halt the target to perform the data transfer before automatically restarting the processor—a technique that suits program development rather than real-time verification. You can graph the result data by setting parameters under the View menu and Animating the output, as Figure 3 (pdf is 370 kbytes) shows for the example sinewave input data and a processing gain of ten. Other key IDE features include a profiler that helps identify sections of code that require optimisation, and the general-extension-language (GEL) that allows you to automate CCStudio set-ups and perform runtime functions.
The DSP/BIOS kernel consists of a set of modules that you can link into an application to provide real-time scheduling, synchronisation, and host/target communications. It employs code instrumentation to monitor program activity on-the-fly, and automatically instruments any code that uses the kernel's pre-emptive multithreading ability. A configuration tool links in only the DSP/BIOS objects that are necessary for the user's program, and allows setting up memory, interrupt handlers, and thread priorities. The tutorial first describes how to measure the cycle count of the stdio.h function puts that writes the inevitable hello world message to the console. You should then be able to see how the DSP/BIOS call LOG speeds I/O, but this operation stalled—presumably due to a failure in the RTDX (real-time-data-exchange) subsystem, although the diagnostics report correct operation. By contrast, the next example that shows thread-execution measurements using the real-time analysis (RTA) functions within DSP/BIOS ran perfectly, thereby demonstrating the environment's ability to ensure that a process meets a deadline. You can see this more clearly by using the CPU load graph while testing the timeline by adding dummy cycles via the load function from the GEL environment (Figure 4 (pdf is 397 kbytes)). Other DSP/BIOS tutorial topics include analysing real-time behaviour and connecting to virtual I/O devices, and there are thoughtful "things to try" throughout the material.
The previous two modules show how to build and debug a project, refine its algorithms, and ensure that time-critical code meets its deadlines. The last module demonstrates CCStudio's real-time debugging features—that is, its ability to control background code execution while the processor continues to service time-critical interrupts. The tutorial states that the material requires an XDS-512 target system and implies an F2812 processor, but the material within the tutorialdsk2808realtime folder works just fine. There's a considerable amount of discussion regarding real-time constraints that's hugely useful, such as the necessity to safely debug time-critical interrupts when in stop mode, which is otherwise reserved for code downloading and initialising the system prior to enabling interrupts. The exercises start by stepping through background code while the processor services IRQs, and also show how to debug a non-time-critical interrupt-service-routine (ISR) while in real-time mode. There are two real-time debug modes—the normal polite and the use-with-care rude—with the latter being used, for instance, to recover from accidentally setting breakpoints where real-time debug accesses aren't enabled. The final lesson shows how to debug a section of a time-critical ISR in real-time mode, which is an unusual but useful ability.
If all of this isn't enough, there's a great deal more material available from TI's website, such as the free "getting started with DSP" material that's so popular with students and engineers alike (also see EDN Europe's coverage in Reference 5). Automotive users may be particularly interested to see the eZdspF2808 Diagnostics and Demo Source Code v2 material that appears at Spectrum Digital's F2808 page. As well as source and project files for F2808 diagnostics, this code includes a CAN loop-back test program. Converts can purchase an annual license for the TMS2000-only version of CCStudio for $495, while the universal version that permits development on any TMS320-family chip costs $3,595.
| For more information | ||
| Abatron: www.abatron.ch | Analog Devices: www.analog.com | ARM: www.arm.com |
| BigStuff3: www.bigstuff3.com | CMX Systems: www.cmx.com | Enea: www.enea.com |
| ETAS: www.etasgroup.com | Euros Embedded Systems: www.euros-embedded.com | Freescale Semiconductor: www.freescale.com |
| Green Hills Software: www.ghs.com | HighTec EDV-Systeme: www.hightec-rt.com | Hitex UK: www.hitex.co.uk |
| Infineon Technologies: www.infineon.com | Intec Automation: www.steroidmicros.com | Lauterbach: www.lauterbach.com |
| Luminary Micro: www.luminarymicro.com | MQX Embedded: www.mqxembedded.com | P&E Microcomputer Systems: www.pemicro.com |
| PLS Development Tools: www.pls-mc.com | Spectrum Digital: www.spectrumdigital.com | Tasking: www.tasking.com |
| Texas Instruments: www.ti.com | Treck: www.treck.com | Wind River: www.windriver.com |
| Author Information |
| You can reach Contributing Technical Editor David Marsh at forncett@btinternet.com. |
| References |
|
|
You want to find out more about microcontroller tutorials, analog design automation, microcontroller Ethernet programmers or wireless microcontrollers, consult the articles on the EDN Europe's site.