Question: Write UART interrupt driven assembly program that controls the LED brightness by capturing keys pressed on the keyboard. Every press of the ' + '
Write UART interrupt driven assembly program that controls the LED brightness by capturing keys pressed on the keyboard. Every press of the key should increase brightness and every press of the key should decrease it Upon reaching minimum brightness further presses of the key should not modify it Similarly maximum brightness must be saturated. The space key should turn the LED off and on at the currently set brightness. The LED control must be implemented within the UART interrupt handler. Implement grades of brightness, generate PWM with period equal ms by using TIMER and use as initial brightness level. Set initial brightness at
IN THIS FORMAT PLEASE:
INCLUDE EFRBGinc ; CPU register definitions
INCLUDE terminal.inc ; terminal function definitions
EXPORT main
IMPORT LETIMERsetup ; import names from other code files
IMPORT GPIOsetup
; ; noninitialized DATA segment in RAM
AREA RAM, DATA, NOINIT, READWRITE, ALIGN
;myWord SPACE ; bit variable MUST BE ALIGHED!
;myHalf SPACE ; bit variable MUST BE ALIGHED!
;myByte SPACE ; bit variable NO alighment required
; ; CODE segment in flash ROM
AREA text CODE, READONLY
main PROC ; main user code
bl Terminalsetup ; setup TeraTerm communication
; bl GPIOsetup ; configure port pins
; bl LETIMERsetup ; start 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: ; allocate constant strings here
ALIGN
;constW DCD ; initialized bit constant
;constH DCW ; initialized bit constant
;constB DCB ; initialized bit constant
ALIGN
END
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
