Getting Started With the C Compiler

5.2 Getting Started With the C Compiler

The TMS470R1x C compiler consists of many phases, including parsing, opti- mization, and code generation. The simplest way to compile is to use the shell program, which is included with the compiler. This section provides a quick walkthrough so that you can get started without reading the entire TMS470R1x Optimizing C Compiler User's Guide.

1) Create a sample file called function.c that contains the following code:

/**************************************/

/*

function.c

*/

/*

(Sample file for walkthrough)

*/

/**************************************/ int main(int i)

{

return(i < 0 ? ±i : i );

}

2)To invoke the shell program to compile and assemble function.c, enter: cl470 ±o function

By default, the TMS470R1x shell program compiles and assembles 32-bit instructions. To compile 16-bit instructions, use the ±mt option:

cl470 ±o ±mt funtion

The shell program prints the following information as it compiles the pro- gram:

[function]

 

 

TMS470 ANSI C Compiler

Version 1.20

Copyright (c) 1995±1997

Texas Instruments Incorporated

ºfunction.cº

==> main

 

TMS470 ANSI C Optimizer

Version 1.20

Copyright (c) 1995±1997

Texas Instruments Incorporated

ºfunction.cº

==> main

 

TMS470 ANSI C Codegen

Version 1.20

Copyright (c) 1995±1997

Texas Instruments Incorporated

ºfunction.cº:

==> main

 

TMS470 COFF Assembler

Version 1.20

Copyright (c) 1995±1997

Texas Instruments Incorporated

PASS 1

 

 

PASS 2

 

 

No Errors, No Warnings

By default, the shell deletes the assembly language file from the current directory after the file is assembled. If you want to inspect the assembly language output, use the ±k option to retain the assembly language file:

cl470 ±o ±k function

Getting Started With the Code Generation Tools

5-7

Page 55
Image 55
Texas Instruments TMS470R1x manual Getting Started With the C Compiler, Cl470 ±o ±mt funtion, Cl470 ±o ±k function

TMS470R1x specifications

The Texas Instruments TMS470R1x series is an advanced family of microcontrollers designed for automotive and industrial applications, renowned for their robust performance, flexibility, and reliable functionality. Built on a 32-bit RISC architecture, this series provides a powerful computing platform, tailored for embedded control systems.

One of the standout features of the TMS470R1x is its high-performance processing capabilities. Operating at clock speeds of up to 120 MHz, these microcontrollers can handle complex calculations and control algorithms efficiently. The TMS470R1x also incorporates a rich set of peripherals, including timers, pulse width modulation (PWM) modules, and communication interfaces like CAN, SPI, and UART. This versatility makes the series suitable for a wide range of applications, from automotive engine control units to industrial automation systems.

Incorporating advanced memory options, the TMS470R1x features Flash memory sizes ranging from 128 KB to 512 KB, along with RAM ranging from 20 KB to 64 KB. This ample memory is crucial for storing firmware and handling multiple data streams in real time. The microcontrollers also support in-system programming, allowing for easy updates and code modifications during the product lifecycle.

The TMS470R1x series is designed with safety in mind. It adheres to ISO 26262 standards, ensuring high levels of functional safety necessary for automotive systems. Features such as redundancy, error correction, and built-in safety mechanisms ensure operations remain reliable even in fault conditions.

Another important characteristic of the TMS470R1x is its low power consumption, making it ideal for battery-operated devices and equipment. The series employs various power management techniques, including low-power sleep modes, enabling manufacturers to optimize their systems without sacrificing performance.

The integrated Debug and Trace capabilities of the TMS470R1x facilitate effective development and troubleshooting. Engineers can debug their applications in real time, significantly reducing time-to-market and enhancing overall product quality.

In summary, the Texas Instruments TMS470R1x microcontroller series offers a powerful and versatile platform for complex automotive and industrial applications. With its high processing speed, extensive memory options, compliance with safety standards, low power consumption, and robust debugging capabilities, the TMS470R1x is a reliable choice for developers seeking to create innovative and efficient embedded systems. These features combine to position the TMS470R1x series as a leading choice in the expanding field of advanced microcontrollers.