Question: Write an assembly program that turn LED on as soon as the ambient air relative humidity gets over 8 0 % and turns it off

Write an assembly program that turn LED on as soon as the ambient air relative humidity gets over 80% and turns it off when it gets below 75%. For humidity between those marks the LED state must not be modified from previously set value. Print current humidity value to the terminal with 100ms period handled by LETIMER0. Make sure to handle LETIMER0 event in NVIC.
Hint: think on implementing FSM (Finite State Machine) for changing the LED states.
do it following this:
INCLUDE EFR32BG22.inc ; CPU register definitions
INCLUDE terminal.inc ; terminal function definitions
EXPORT main
IMPORT LETIMER_setup ; import names from other code files
IMPORT GPIO_setup
;------------------------------------- ; non-initialized DATA segment in RAM
AREA RAM, DATA, NOINIT, READWRITE, ALIGN=3
;myWord SPACE 4 ; 32-bit variable (MUST BE ALIGHED!)
;myHalf SPACE 2 ; 16-bit variable (MUST BE ALIGHED!)
;myByte SPACE 1 ; 8-bit variable (NO alighment required)
;------------------------------------- ; CODE segment in flash (ROM)
AREA |.text|, CODE, READONLY
main PROC ; main user code
bl Terminal_setup ; setup TeraTerm communication
; bl GPIO_setup ; configure port pins
; bl LETIMER_setup ; start 1-sec timer for periodic events
; your code starts here
loop ; periodic task starts here
b loop ; repeat periodic task
ENDP
;-------------------------------------
;prompt DCB "Enter a number: ",0 ; allocate constant strings here
ALIGN
;constW DCD 15 ; initialized 32-bit constant
;constH DCW 23 ; initialized 16-bit constant
;constB DCB 17 ; initialized 8-bit constant
ALIGN
END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!