MSP430-assembly language part-2.1-TIMER

Photo of author

By Jackson Taylor

Timer A — high speed blinking using up/down mode
Time  = (65000*2)+1/1.1MHz = 0.118182727
.include “msp430g2x31.inc”
org 0xf800                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_3|TAIE), &TACTL
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      bic #1,&TACTL
      xor.b #41h, &P1OUT
      reti
ORG     0FFF0h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800
Timer A — high speed blinking using up mode & CCIFG
.include “msp430g2x31.inc”
org f800h                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_1), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800 
Timer A — high speed blinking using up/down mode & CCIFG
.include “msp430g2x31.inc”
org 0xf800                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_3), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800
Next    Arithmetic operations
http://jimmyjosep.blogspot.in/2013/12/msp430-assembly-language-part-3.html
.include “msp430g2x31.inc”
org 0xf800                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_3|TAIE), &TACTL
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      bic #1,&TACTL
      xor.b #41h, &P1OUT
      reti
ORG     0FFF0h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800
Timer A — high speed blinking using up mode & CCIFG
.include “msp430g2x31.inc”
org f800h                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_1), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800 
Timer A — high speed blinking using up/down mode & CCIFG
.include “msp430g2x31.inc”
org 0xf800                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_3), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800
Next    Arithmetic operations
http://jimmyjosep.blogspot.in/2013/12/msp430-assembly-language-part-3.html
org f800h                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_1), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800 
Timer A — high speed blinking using up/down mode & CCIFG
.include “msp430g2x31.inc”
org 0xf800                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_3), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800
Next    Arithmetic operations
http://jimmyjosep.blogspot.in/2013/12/msp430-assembly-language-part-3.html
org 0xf800                 
      mov #(WDTPW|WDTHOLD), &WDTCTL
      mov #0x280, SP
      mov.b #0x41,&P1DIR
      mov.b #0x41,P1OUT  
      mov #(TASSEL_2|MC_3), &TACTL
      mov #CCIE, &TACCTL0
      mov #65000, &TACCR0
      eint
jimmyloop:
      jmp jimmyloop          
jimmyisr:
      xor.b #41h, &P1OUT
      reti
ORG     0FFF2h                 
DW      jimmyisr
ORG     0FFFEh                 
DW      0xf800
Next    Arithmetic operations
http://jimmyjosep.blogspot.in/2013/12/msp430-assembly-language-part-3.html

See also
UART - DSPIC30F2010