Manejo de Interrupciones con MSP430G2553
Saludos!!
Código usando interrupciones y el CLK del microcontrolador salida en lo LEDS
_____________________________________________________________________
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430G2553.h" ; Include device header file
;-------------------------------------------------------------------------------
.text ; Assemble into program memory
.retain ; Override ELF conditional linking
; and retain current section
.retainrefs ; Additionally retain any sections
; that have references to current
; section
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
mov.b &CALBC1_1MHZ,&BCSCTL1
mov.b &CALDCO_1MHZ, &DCOCTL
clr.b &P1OUT
mov.b #41h,&P1DIR
;UUUUUUCSIDMCURIF(/8)
mov.w #0000001011110110b,&TACTL
mov.w #0x7A12,&TACCR0
EINT
uno bis.b #01h,&P1OUT;enciende LED ROJO
call #Tiempo
bic.b #01h,&P1OUT ;apaga LED ROJO
call #Tiempo
jmp uno
timerA bic.w #0000000000000001b, &TACTL ; limpia bandera
xor.b #40h,&P1OUT ; LED VERDE
reti
Tiempo mov.w #0FFFFh,R6 ;subrutina
loop: dec.w R6
jnz loop
ret
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".int08"
.short timerA
.sect ".reset" ;vector del reset
.short RESET ;etiqueta de salto
Código usando interrupciones y el CLK del microcontrolador salida en lo LEDS
_____________________________________________________________________
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430G2553.h" ; Include device header file
;-------------------------------------------------------------------------------
.text ; Assemble into program memory
.retain ; Override ELF conditional linking
; and retain current section
.retainrefs ; Additionally retain any sections
; that have references to current
; section
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
mov.b &CALBC1_1MHZ,&BCSCTL1
mov.b &CALDCO_1MHZ, &DCOCTL
clr.b &P1OUT
mov.b #41h,&P1DIR
;UUUUUUCSIDMCURIF(/8)
mov.w #0000001011110110b,&TACTL
mov.w #0x7A12,&TACCR0
EINT
uno bis.b #01h,&P1OUT;enciende LED ROJO
call #Tiempo
bic.b #01h,&P1OUT ;apaga LED ROJO
call #Tiempo
jmp uno
timerA bic.w #0000000000000001b, &TACTL ; limpia bandera
xor.b #40h,&P1OUT ; LED VERDE
reti
Tiempo mov.w #0FFFFh,R6 ;subrutina
loop: dec.w R6
jnz loop
ret
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".int08"
.short timerA
.sect ".reset" ;vector del reset
.short RESET ;etiqueta de salto
Hola que tal, estoy aprendiendo a programar en ensamblador usando este micro pero la verdad me está costando mucho trabajo entender que hacen algunos mnemonicos, hay algún libro o alguna página de internet que me puedas recomendar para poder entender mejor como programar ?
ResponderEliminarSaludos, puedes descargar este libro que es en general de la familia MSP430
Eliminarhttps://www.dropbox.com/s/sfysz6ccu0o5fr7/Libro%20MSP430%20Microcontroller%20Basics.pdf?dl=0
Este comentario ha sido eliminado por el autor.
ResponderEliminar