Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22212

CCS/MSP430FR6989: Delay with Timer A into a ISR. Assembly.

$
0
0

Part Number:MSP430FR6989

Tool/software: Code Composer Studio

Hi,

I have the msp340fr6989 and I want to do a delay in a ISR due to the rebound of a key of the BOOST-IR keyboard in assembly. 

I want to make a 10ms delay when I press any key and jump to another ISR, but I don't know how to store the TA2R value. 

My timer is working with ACLK 32kHZ in CONTINUOUS mode. Here's my code:

;---------------------------------------------------------------------------------------------------------

kbISR
          push r12

          bic.b #BIT2, &P3IFG ; Clear flags and IEs
          bic.b #BIT7, &P4IFG
          bic.b #BIT4, &P2IFG
          bic.b #BIT5, &P2IFG
          bic.b #BIT2, &P3IE 
          bic.b #BIT7, &P4IE
          bic.b #BIT4, &P2IE
          bic.b #BIT5, &P2IE


kbISR1

 mov.w &TA2R, r12 ; Store TA2R value in CCR1
cmp.w &TA2R, r12
jnz kbISR1
mov.w r12, &TA2CCR1
add.w #326,TA2CCR1  ; Wait 10ms
bic.w #CCIFG, &TA2CCTL1
bis.w #CCIE, &TA2CCTL1 ; Jump to another ISR
pop r12
reti

;--------------------------------------------------------------------------

Thanks and sorry if my english it's not good.


Viewing all articles
Browse latest Browse all 22212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>