msp430x54x_mpy_10.c
来自「msp430f5438系统中文资料」· C语言 代码 · 共 39 行
C
39 行
//******************************************************************************
// MSP430F54x Demo - 32x32 Signed 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 RES0, RES1, RES2 and RES3.
//
// ACLK = 32.768kHz, MCLK = SMCLK = default DCO
//
// MSP430F5438
// -----------------
// /|\| |
// | | |
// --|RST |
// | |
// | |
//
// M Smertneck / W. Goh
// Texas Instruments Inc.
// September 2008
// Built with CCE Version: 3.2.2 and IAR Embedded Workbench Version: 4.11B
//******************************************************************************
#include "msp430x54x.h"
void main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop WDT
MPYS32L = 0x1234; // Load lower 16 bits of operand 1
MPYS32H = 0x1234; // Load upper 16 bits of operand 1
OP2L = 0x5678; // Load lower 16 bits of operand 2
OP2H = 0x5678; // Load upper 16 bits of operand 2
__bis_SR_register(LPM4_bits); // Enter LPM4
__no_operation(); // For debugger
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?