共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网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
每周了解几个硬件知识+485硬件知识分享被打赏10分 | |
【换取手持示波器】树莓派PICOW网页烟花被打赏18分 | |
【换取手持示波器】树莓派PICO逻辑分析仪被打赏16分 | |
【分享评测,赢取加热台】教你五分钟本地部署蒸馏版本的DeepSeekR1-7B被打赏12分 | |
【换取手持示波器】蓝牙音箱更换电池被打赏8分 | |
【换取手持示波器】鼠标更换微动开关被打赏10分 | |
【我要开发板】4.传感器移植被打赏50分 | |
【换取手持数字示波器】RISC-VGCC使用-fno-omit-frame-pointer编译选项实现栈回溯被打赏29分 | |
【分享评测,赢取加热台】+开关电源简述被打赏7分 | |
STM32WBA55ADC采集电池电压任务2被打赏1分 |