Texas Instruments MSP50C614 manual Variable Types, External References

Models: MSP50C614

1 414
Download 414 pages 24.44 Kb
Page 341
Image 341

 

 

 

 

 

C± ± Compiler

 

5.9.2 Variable Types

 

 

 

 

 

 

 

 

 

 

 

 

 

Type Name

Mnemonic

Range

Size in Bytes

Example

 

 

 

 

 

 

 

 

 

Integer

int

[±32768,32767]

2

int i,j;

 

 

Character

char

[0,255]

1

char c,d;

 

 

Array of integer

int

Not Applicable

Not Applicable

int array[12];

 

 

Array of characters

char

Not Applicable

forced to even

char text[20]

 

 

Pointer to integer

int *

Not Applicable

2

int *j;

 

 

Pointer to character

char *

Not Applicable

2

char *string;

 

 

 

 

 

 

 

 

Notes: 1) There is a major difference between an MSP50P614/MSP50C614 integer string and an array of integers: an array of integers is an ordered set of n 16 bit integers, whereas an integer string of length n represents a single integer with 16*n bits. In C± ±, MSP50P614/MSP50C614 strings are declared as arrays of integers, but must be operated upon using the special purpose string arithmetic functions described below.

2)As in regular C, the above types can be qualified with the word unsigned.

3)There is another important qualifier that is special to C± ± : constant. We made the mnemonic purposely different from the usual C const qualifier, because it is not exactly equivalent. It is used to initialize arrays in program ROM. A good use of it would be for a sine table, for example. The syntax is simple, for example:

constant int array[10]={1,2,3,4,5,6,7,8,9,10},dummy;

4)will create a series of DATA statements in the assembly language output file. Uninitialized constants (like dummy above) generate a warning and are initialized to zero. Constants are to be handled with care. Since they cannot be accessed the same way as RAM variables, special purpose functions have to be used to utilize constants in a program. The most general of these functions is xfer_const, which transfers values from the program ROM to the RAM. Also, constants MUST BE GLOBAL. BEWARE OF PASSING A CONSTANT AS AN ARGUMENT = DON'T DO IT !!!!!

5)The common C types float, struct, union and long are not implemented. (Note that long is a subset of string of integer).

5.9.3External References

The fact that all RAM allocations in the assembler are global has the following implications for C± ± variables:

-Only the file containing the main routine can contain global variable definitions.

-Global variables referenced in other files must have been declared as ex- ternal (keyword extern) at the beginning of the file.

-A function referenced in a file but not defined in that same file must be introduced with a function prototype in the file where it is referenced (no need for the extern keyword).

Code Development Tools

5-41

Page 341
Image 341
Texas Instruments MSP50C614 manual Variable Types, External References, Type Name Mnemonic Range Size in Bytes Example

MSP50C614 specifications

The Texas Instruments MSP50C614 is a microcontroller that belongs to the MSP430 family, renowned for its low power consumption and versatile functionality. Primarily designed for embedded applications, this microcontroller is favored in various industries, including consumer electronics, industrial automation, and healthcare devices.

One of the standout features of the MSP50C614 is its ultra-low power technology, which enables it to operate in various power modes. This makes it ideal for battery-powered applications, where energy efficiency is crucial. The MSP430 architecture allows for a flexible power management system, ensuring that energy is conserved while providing robust performance.

The MSP50C614 is equipped with a 16-bit RISC CPU that delivers high performance while maintaining low power usage. With a maximum clock frequency of 16 MHz, it can execute most instructions in a single cycle, resulting in swift operation and responsive performance. This microcontroller also comes with a generous flash memory capacity, allowing developers to store large amounts of code and data conveniently.

In terms of peripherals, the MSP50C614 is highly versatile. It features a range of digital and analog input/output options, including multiple timers, GPIO ports, and various communication interfaces like UART, SPI, and I2C. This extensive set of peripherals allows for seamless integration with other components and simplifies the design of complex systems.

The integrated 12-bit Analog-to-Digital Converter (ADC) stands out as a valuable characteristic of the MSP50C614. This feature enables the microcontroller to convert physical analog signals into digital data, making it particularly useful for sensing applications and real-time monitoring.

Another noteworthy technology employed in the MSP50C614 is its support for low-voltage operations. With a broad supply voltage range, this microcontroller can function efficiently in diverse environments and is suitable for low-power applications, enhancing its practicality.

Moreover, Texas Instruments provides software support in the form of Code Composer Studio and various libraries that make it easier for developers to program and utilize the MSP50C614 effectively.

In summary, the Texas Instruments MSP50C614 microcontroller is a powerful, low-power solution equipped with the features and technologies necessary for efficient operation in a wide array of applications. Its blend of performance, flexibility, and energy efficiency makes it a popular choice among engineers and designers looking to create innovative, sustainable designs in the rapidly evolving tech landscape.