Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for the ms430G2553 i wondering if someone can help make my code blink 3 times every 1/10th of a second This is my

This is for the ms430G2553

i wondering if someone can help make my code blink 3 times every

1/10th of a second

This is my code 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 ;------------------------------------------------------------------------------- MOV.W #0x0F,&P1DIR MOV.W #0x0F,&P2DIR

MAIN: MOV.W #0x00,R5 MOV.W #0x00,R4 MOV.W #0x000F, R6

BUTTON: BIT.B #0x10,&P1IN JNZ START JMP BUTTON

START: MOV R4, &P1OUT MOV R5, &P2OUT INC R4 CALL #DELAY CMP #10, R4 JNE START JEQ INCREASER5

INCREASER5: INC R5 MOV #0x00, R4 JMP START

DELAY: DEC.W R6 JNZ DELAY MOV.W #0x000F, R6 INC R7 CMP #10,R7 JNZ DELAY RET

;------------------------------------------------------------------------------- ; Stack Pointer definition ;------------------------------------------------------------------------------- .global __STACK_END .sect .stack

;------------------------------------------------------------------------------- ; Interrupt Vectors ;------------------------------------------------------------------------------- .sect ".reset" ; MSP430 RESET Vector .short RESET

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions