msp430xg46x_mpy_01.c
来自「TI提供的MSP430开发例程,适合初学者练习各个功能模块的使用」· C语言 代码 · 共 34 行
C
34 行
//******************************************************************************
// MSP430xG46x Demo - 16x16 Unsigned Multiply
//
// Description: Hardware multiplier is used to multiply two numbers.
// The calculation is automatically initiated after the second operand is
// loaded. Results are stored in RESLO and RESHI.
//
// ACLK = 32.768kHz, MCLK = SMCLK = default DCO
//
// MSP430xG461x
// -----------------
// /|\| |
// | | |
// --|RST |
// | |
// | |
//
// M. Mitchell
// Texas Instruments Inc.
// October 2006
// Built with IAR Embedded Workbench Version: 3.41A
//******************************************************************************
#include <msp430xG46x.h>
void main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop WDT
FLL_CTL0 |= XCAP14PF; // Configure load caps
MPY = 0x1234; // Load first operand -unsigned mult
OP2 = 0x5678; // Load second operand
_BIS_SR(LPM4_bits); // LPM4
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?