⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example_lpm3_aclk.asm

📁 MSP 430 timer_uart,tmA3的片子可直接使用模块
💻 ASM
字号:
;******************************************************************************
;  MSP430x11x1 Demo - Timer_A, LPM3, UART 4800 Echo, 32kHz ACLK
;  Description: TX is called in ISR, ACLK drives Timer_A and remains on in LPM3
;
;  L. Westlund
;  Texas Instruments Inc.
;  Feb 2006
;  Built with Code Composer Essentials 1.0
;*****************************************************************************
 .cdecls C,LIST,    "msp430x11x1.h"

 .ref    TI_initTimer, TI_TX_Byte, TI_RXData, TI_TA_UART_StatusFlags

TI_TA_TX_READY .set    0x01
TI_TA_RX_RECEIVED .set 0x02
;------------------------------------------------------------------------------
            .text
;------------------------------------------------------------------------------
RESET       mov.w   #0x300,        SP       ; Initialize stackpointer
StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
            mov.w   #callBack,     R12      ; move function ptr, 1st param
            mov.w   #0x07,         R13      ; Bitime for 4800, 2nd param
            mov.w   #TASSEL_1,     R14      ; Select Clock Source, 3rd param
            call    #TI_initTimer
Mainloop    bis.w   #LPM3+GIE,     SR       ; Enter LPM3, enable interrupts

callBack
            bic.b   #TI_TA_RX_RECEIVED, &TI_TA_UART_StatusFlags
            call    #TI_TX_Byte
            mov.w   #0x00,         R12      ; return 1 to exit LPM3
            ret
;------------------------------------------------------------------------------
;           Interrupt Vectors
;------------------------------------------------------------------------------
            .sect   ".reset"                ; MSP430 RESET Vector
            .short  RESET                   ;
            .end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -