Implementation Details

free(mm2);

free(pp);

}

cmm_func main(int argc,char *argv)

{

int m1[4],m2[4],product[9]; xfer_const(m1,M1,STR_LENGTH(4)); xfer_const(m2,M2,STR_LENGTH(4));

string_multiply(product,STR_LENGTH(9),m1,STR_LENGTH(4),m2,STR_LENGTH(4));

}

5.10.5 Programming Example, C ±± With Assembly Routines

There are several important considerations when using the C±± compiler. The ram allocation must be coordinated so that a location is not accidentally used twice. In assembly this is usually done with IRX files by making each label equal to the location of the previous one, plus whatever storage space is needed. All of the IRX files for a project are then combined in a master IRX file so that the space for each sub file can be allocated. For example ( a master IRX file ):

RAM_SIZE

equ

640

STACK

equ

2 * (RAM_SIZE ± 14)

BEGIN_RAM

equ

0

RESERVED

equ

BEGIN_RAM + 2 * 1

RAMSTART_INT

equ

RESERVED

include º..\inter\inter_ram.irxº

RAMSTART_ASM

equ

RAMEND_INT

include

º. .\asm_ram.irxº

Here the sub files are inter_ram.irx and asm_ram.irx. The allocation for inter_ram.irx begins at memory location 2. This is because the memory location 0 is reserved for use by the C±± compiler. The allocation for asm_ram.irx begins where the allocation ended for inter_ram.irx. More irx files can be chained on in this manner, and all of the allocation is kept organized. When C±± is added to a project, it is important to make sure that the C±± variables are not allocated in locations already used by assembly variables. This is accomplished with a dummy array, bogus, located in the file ram.irx. It is simply an integer array that is included in the C±± program so that it is the first variable allocated. By making its size equivalent to the amount of memory used for assembly variables, the C±± variables that the user defines are allocated in unused memory. It can be set by building the project and finding the location of the last assembly variable. This can then be converted from hexadecimal to decimal and divided by two ( because a C±± int is 16 bits ) to

Code Development Tools

5-53

Page 353
Image 353
Texas Instruments MSP50C614 manual Programming Example, C ±± With Assembly Routines

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.