Writing MSP430 C Code
MSP430 Compiler Intrinsic Functions
Along with the symbols defined in the device specific header & linker files, it’s common to see
programmers use the compiler’s intrinsic functions. Think of these as functions that are “built-in”
to the TI compiler. In most cases, intrinsic functions correlate to hardware specific features found
in processors.
Intrinsics for MSP430 C Compiler
_bcd_add_short(); _disable_interrupt(); _never_executed();
_bcd_add_long(); _enable_interrupt(); _no_operation();
_bic_SR_register(); _even_in_range(); _op_code();
_bic_SR_register_on_exit(); _get_interrupt_state();
set_interrupt_state();
_bis_SR_register(); _get_R4_register(); _set_R4_register();
_bis_SR_register_on_exit(); _get_R5_register(); _set_R5_register();
_data16_read_addr(); _get_SP_register(); _set_SP_register();
_data16_write_addr (); _get_SR_register(); _swap_bytes();
_data20_read_char(); _get_SR_register_on_exit();
_data20_read_long(); _low_power_mode_0();
_data20_read_short(); _low_power_mode_1();
_data20_write_char(); _low_power_mode_2();
_data20_write_long(); _low_power_mode_3();
_data20_write_short(); _low_power_mode_4();
_delay_cycles();
_low_power_mode_off_on_exit();
Compiler intrinsic functions are essentially “built-in” C functions
They usually provide access to underlying hardware features of a processor;
often mapping closely to specific asm instructions
We will use some of these in today’s workshop:
We’ve circled some of the intrinsic functions we’ll use in this class. From setting and/or clearing
bits in the Status Register (SR) to putting the processor into low-power modes.
2 - 26 MSP430 Workshop - Programming C with CCS