Question: ;Fill in the blank using CCS ;MSP432 microcontroller ; Setting the RGB LEDs color according to the status of the switches. ; Question 1 (Switches)
;Fill in the blank using CCS
;MSP432 microcontroller
; Setting the RGB LEDs color according to the status of the switches.
; Question 1 (Switches)
; Switch S1:
; From the evaluation board schematics determine: which I/O port and bit#
; is connected to S1, and is it connected as positive or negative logic?
; Switch S2:
; From the evaluation board schematics determine: which I/O port and bit#
; is connected to S2, and is it connected as positive or negative logic?
; (Hints: you need a pull-up resistor for negative logic input)
; Question 2 (LEDs)
; built-in red LED is connected to which I/O port and bit#?
; built-in green LED is connected to which I/O port and bit#?
; built-in blue LED is connected to which I/O port and bit#?
.thumb
.text
.align 2
; I/O mapping for I/O port x used for input
; (replace x with the correct number)
P1IN .field 0x40004C00 ,32 ; Port x Input
P1OUT .field 0x40004C02 ,32 ; Port x Output
P1DIR .field 0x40004C04 ,32 ; Port x Direction
P1REN .field 0x40004C06 ,32 ; Port x Resistor Enable
P1DS .field 0x40004C08 ,32 ; Port x Drive Strength
P1SEL0 .field 0x40004C0A ,32 ; Port x Select 0
P1SEL1 .field 0x40004C0C ,32 ; Port x Select 1
; I/O mapping for I/O port y used for output
; (replace y with the correct number)
P2IN .field 0x40004C01 ,32 ; Port y Input
P2OUT .field 0x40004C03 ,32 ; Port y Output
P2DIR .field 0x40004C05 ,32 ; Port y Direction
P2REN .field 0x40004C07 ,32 ; Port y Resistor Enable
P2DS .field 0x40004C09 ,32 ; Port y Drive Strength
P2SEL0 .field 0x40004C0B ,32 ; Port y Select 0
P2SEL1 .field 0x40004C0D ,32 ; Port y Select 1
; LED color constant
RED .equ ____ ; constant to turn Red ON
GREEN .equ ____ ; constant to turn Grn ON
BLUE .equ ____; constant to turn Blu ON
NONE .equ ____ ; constant to turn all OFF
; Switch status constant
SW1 .equ ____ ; input value S1 pressed
SW2 .equ ____ ; input value S2 pressed
SW12 .equ ____ ; value S1 and S2 pressed
NOSW .equ ____ ; S1 and S2 not pressed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
