Hi
I am having trouble understanding RETI instruction. Being a novice at MSP430 architecture, have begun exploring by writing simple snippets. I am trying to blink a LED using a timer. I want to control the dutycycle of the flashing.
My query is that after exiting the ISR on RETI, which instruction does the control flow go to. Have tried debugging via different methods but its still unclear. Here is my code. PLzz help.
;*****************************************************************************
.cdecls C,LIST,"msp430x11x1.h" ; Include device header file
;*****************************************************************************
;----------------------------------------------------------------------------
.text ; Progam Start
;-----------------------------------------------------------------------------
RESET mov.w #300h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupP1 bis.b #04h,&P2DIR ; P1.0 output
SetupC0 mov.w #CCIE,&CCTL0 ; CCR0 interrupt enabled
mov.w #0ffffh,&CCR0 ;
SetupTA mov.w #TASSEL_2+MC_2,&TACTL ; SMCLK, contmode
;
bis.w #CPUOFF+GIE,SR ; CPU off, interrupts enabled
nop
;-----------------------------------------------------------------------------
TA0_ISR; Toggle P1.0
;-----------------------------------------------------------------------------
xor.b #04h,&P2OUT ; Toggle P1.0
add.w #10,&CCR0 ; Add Offset to CCR0
reti
;-----------------------------------------------------------------------------
; Interrupt Vectors
;-----------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET ;
.sect ".int09"
.short TA0_ISR
.end
I am having trouble understanding RETI instruction. Being a novice at MSP430 architecture, have begun exploring by writing simple snippets. I am trying to blink a LED using a timer. I want to control the dutycycle of the flashing.
My query is that after exiting the ISR on RETI, which instruction does the control flow go to. Have tried debugging via different methods but its still unclear. Here is my code. PLzz help.
;*****************************************************************************
.cdecls C,LIST,"msp430x11x1.h" ; Include device header file
;*****************************************************************************
;----------------------------------------------------------------------------
.text ; Progam Start
;-----------------------------------------------------------------------------
RESET mov.w #300h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupP1 bis.b #04h,&P2DIR ; P1.0 output
SetupC0 mov.w #CCIE,&CCTL0 ; CCR0 interrupt enabled
mov.w #0ffffh,&CCR0 ;
SetupTA mov.w #TASSEL_2+MC_2,&TACTL ; SMCLK, contmode
;
bis.w #CPUOFF+GIE,SR ; CPU off, interrupts enabled
nop
;-----------------------------------------------------------------------------
TA0_ISR; Toggle P1.0
;-----------------------------------------------------------------------------
xor.b #04h,&P2OUT ; Toggle P1.0
add.w #10,&CCR0 ; Add Offset to CCR0
reti
;-----------------------------------------------------------------------------
; Interrupt Vectors
;-----------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET ;
.sect ".int09"
.short TA0_ISR
.end