Part Number: MSP430FR6989
Other Parts Discussed in Thread: ENERGIA
Tool/software: Code Composer Studio
Hi I was looking at TI's wiki page for playing "The Imperial March" link: http://processors.wiki.ti.com/index.php/Playing_The_Imperial_March
My goal is to produce the first beep of the song using my Buzzer in my EDUMKII Booster Pack using the MSP430FR6989 Launchpad.
My code is given below:
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430.h" ; Include device header file
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
;-------------------------------------------------------------------------------
.text ; Assemble into program memory.
.retain ; Override ELF conditional linking
; and retain current section.
.retainrefs ; And 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
;-------------------------------------------------------------------------------
bis.b #BIT7, &P2DIR
mov.w #1100, R7
Beep bis.b #BIT7, &P2OUT
mov.w #4, R6
L1 dec.w R6
jnz L1
bic.b #BIT7, &P2OUT
mov.w #4, R6
L2 dec.w R6
jnz L2
dec.w R7
jnz Beep
MainLoop jmp MainLoop
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
The idea is to replicate the code in C into Assembly, which I need for my project. However, when I run this code, nothing happens. I know the wiki code is probably using a buzzer with a different processing speed but any help regarding this would be greatly appreciated.