Added activity 1 exercise for next lab

This commit is contained in:
Jonathan Chan 2018-01-13 13:14:22 -08:00
parent c393d0c6d3
commit 199f2b2b2c
5 changed files with 26 additions and 16 deletions

10
lab2/activity1.asm Normal file
View File

@ -0,0 +1,10 @@
.include "msp430g2553.inc"
org 0xc000
START:
mov.b #11111111b, &P1DIR
mov.b &P1IN, R7 ;R7 = 0x01
bis.w #CPUOFF, SR
org 0xfffe
dw START

3
lab2/activity1.hex Normal file
View File

@ -0,0 +1,3 @@
:0CC00000F24322005742200032D0100012
:02FFFE0000C041
:00000001FF

View File

@ -8,13 +8,9 @@ START:
mov.b #11110111b, &P1DIR mov.b #11110111b, &P1DIR
; set digits ; set digits
mov.b #0, &P1OUT
mov.b #01100001b, &P1OUT ; xxx6 mov.b #01100001b, &P1OUT ; xxx6
mov.b #01000011b, &P1OUT ; xx46 mov.b #01000011b, &P1OUT ; xx46
mov.b #00010101b, &P1OUT ; x146 mov.b #00010101b, &P1OUT ; x146
mov.b #01000111b, &P1OUT ; 4146 mov.b #01000111b, &P1OUT ; 4146
; disable ; disable

View File

@ -1,5 +1,5 @@
:10C0000031400004B240805A2001F240F700220083 :10C0000031400004B240805A2001F240F700220083
:10C01000C2432100F24061002100F24043002100B0 :10C01000F24061002100F24043002100F24015008F
:10C02000F24015002100F2404700210032D01000FC :0CC020002100F2404700210032D0100047
:02FFFE0000C041 :02FFFE0000C041
:00000001FF :00000001FF

View File

@ -1,8 +1,9 @@
.include "msp430g2553.inc" .include "msp430g2553.inc"
org 0xc000 org 0xc000
start: start:
mov.w #WDTPW|WDTHOLD, &WDTCTL mov.w #WDTPW|WDTHOLD, &WDTCTL
mov.b #0x41, &P1DIR mov.b #0x41, &P1DIR ; 01000001b
mov.w #0x01, r8 mov.w #0x01, r8
repeat: repeat:
mov.b r8, &P1OUT mov.b r8, &P1OUT