共2条
1/1 1 跳转至页
msp430,lpm3,demo,lpm3 以下是msp430的lpm3的demo程序,我只改了延时的长度。为何程序一直没法从lpm3模式中出来!急呀

问
#include "MSP430x11x.h"
;------------------------------------------------------------------------------
ORG 0FC00h ; Program Start cpu=MSP430f1101
;------------------------------------------------------------------------------
RESET mov.w #300h,SP ; Initialize stackpointer
SetupBC bis.b #DIVA1,&BCSCTL1 ; ACLK/4
SetupWDT mov.w #WDT_ADLY_1000,&WDTCTL ; WDT 1s*4 interval timer
bis.b #WDTIE,&IE1 ; Enable WDT interrupt
SetupP1 mov.b #0FFh,&P1DIR ; All P1.x outputs
clr.b &P1OUT ; All P1.x reset
SetupP2 mov.b #0FFh,&P2DIR ; All P2.x outputs
clr.b &P2OUT ; All P2.x reset
eint ; Enable interrupts
;
Mainloop bis.w #GIE+CPUOFF+SCG1+SCG0,SR ; Enter LPM3
bis.b #001h,&P1OUT ; Set P1.0
push.w #20000 ; Delay to TOS
Delay dec.w 0(SP) ; Decrement TOS
jnz Delay ; Delay over?
incd.w SP ; Clean stack
bic.b #001h,&P1OUT ; Reset P1.0
jmp Mainloop ; Again
;
;------------------------------------------------------------------------------
WDT_ISR; Exit all LPMx modes, reti returns system active with GIE enabled
;------------------------------------------------------------------------------
bic.w #CPUOFF+SCG1+SCG0,0(SP) ; System active on TOS
reti ;
;
;------------------------------------------------------------------------------
; Interrupt Vectors Used MSP430x11x1
;------------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
ORG 0FFF4h ; WDT Vector
DW WDT_ISR ;
END 答 1: 可以啊。
;------------------------------------------------------------------------------
ORG 0FC00h ; Program Start cpu=MSP430f1101
;------------------------------------------------------------------------------
RESET mov.w #300h,SP ; Initialize stackpointer
SetupBC bis.b #DIVA1,&BCSCTL1 ; ACLK/4
SetupWDT mov.w #WDT_ADLY_1000,&WDTCTL ; WDT 1s*4 interval timer
bis.b #WDTIE,&IE1 ; Enable WDT interrupt
SetupP1 mov.b #0FFh,&P1DIR ; All P1.x outputs
clr.b &P1OUT ; All P1.x reset
SetupP2 mov.b #0FFh,&P2DIR ; All P2.x outputs
clr.b &P2OUT ; All P2.x reset
eint ; Enable interrupts
;
Mainloop bis.w #GIE+CPUOFF+SCG1+SCG0,SR ; Enter LPM3
bis.b #001h,&P1OUT ; Set P1.0
push.w #20000 ; Delay to TOS
Delay dec.w 0(SP) ; Decrement TOS
jnz Delay ; Delay over?
incd.w SP ; Clean stack
bic.b #001h,&P1OUT ; Reset P1.0
jmp Mainloop ; Again
;
;------------------------------------------------------------------------------
WDT_ISR; Exit all LPMx modes, reti returns system active with GIE enabled
;------------------------------------------------------------------------------
bic.w #CPUOFF+SCG1+SCG0,0(SP) ; System active on TOS
reti ;
;
;------------------------------------------------------------------------------
; Interrupt Vectors Used MSP430x11x1
;------------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
ORG 0FFF4h ; WDT Vector
DW WDT_ISR ;
END 答 1: 可以啊。
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
电流检测模块MAX4080S被打赏10分 | |
【我踩过的那些坑】calloc和malloc错误使用导致跑飞问题排查被打赏50分 | |
多组DCTODC电源方案被打赏50分 | |
【我踩过的那些坑】STM32cubeMX软件的使用过程中的“坑”被打赏50分 | |
新手必看!C语言精华知识:表驱动法被打赏50分 | |
【我踩过的那些坑】杜绑线问题被打赏50分 | |
【我踩过的那些坑】STM32的硬件通讯调试过程的“坑”被打赏50分 | |
【我踩过的那些坑】晶振使用的问题被打赏100分 | |
【我踩过的那些坑】电感选型错误导致的处理器连接不上被打赏50分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏10分 |