Question: Need help with a coding assignement that needs to be completed in ARM Keil Uvision 5 . The board I am using is an STM

Need help with a coding assignement that needs to be completed in ARM Keil Uvision 5. The board I am using is an STM32f4 Discovery Board.
The Constants are given below. I have already initialized LED's, the button, Timer, and Interrupt. But please specify if you are going to change anything in the initializations.
RCC EQU 0x40023800 ;base address for RCC
AHB1ENR EQU 0x30 ;offset for this
APB1ENR EQU 0x40 ;APB1ENR offset (Clock for timer)
GPIOA EQU 0x40020000 ;base address for PA# stuff
GPIOD EQU 0x40020C00 ;base address for PD# stuff
MODER EQU 0x00 ;mode selection register offset (it's 0)
IDR EQU 0x10 ;input data register offset from base
ODR EQU 0x14 ;output data register offset from base
;NVIC Registers
NVIC_ISER0 EQU 0xE000E100 ;Interrupt Set-Enable (0-7)
NVIC_ICER0 EQU 0xE000E180 ;Interrupt Clear-Enable (0-7)
NVIC_ISPR0 EQU 0xE000E200 ;Interrupt Set-Pending (0-7)
NVIC_ICPR0 EQU 0xE000E280 ;Interrupt Clear-Pending (0-7)
NVIC_IABR0 EQU 0xE000E300 ;Interrupt Active Bit (0-7)
NVIC_IPR1 EQU 0xE000E404 ;Interrupt Priority (0-59)
STIR EQU 0xE000EF00 ;Software Tigger Interrupt
;System Configuration Registers
SYSCFG EQU 0x40013800
EXTICR1 EQU 0x08 ;clock enables for GPIO ports
;External Interrupt Registers
EXTI EQU 0x40013C00 ;base address
IMR EQU 0x00 ;Interrupt Mask Register
EMR EQU 0x04 ;Event Mask Register
RTSR EQU 0x08 ;Rising Trigger Select
FTSR EQU 0x0C ;Falling Trigger Select
SWIR EQU 0x10 ;Software Interrupt Event
PR EQU 0x14 ;Pending Register
TIM4EN EQU 0x04 ;Timer 4 enable = bit 2
TIM4 EQU 0x40000800 ;Timer 4 registers
CR1 EQU 0x00 ;Control register 1
DIER EQU 0x0C ;DMA/interrupt enable register
SR EQU 0x10 ;Status register
PSC EQU 0x28 ;Prescaler (offset)
ARR EQU 0x2C ;Auto-Reload Register
TIM4_OFF EQU 0 ;Offset to ISER0/ICER0/ISPR0/ICPR0/IABR0(30/32=0) x 4
;prescale and Auto Reload Register are discussed in class
;Hertz = cycles/second
;kHz =1000, MHz =1000000, GHz =1000000000
;frequency of interrupt in Hertz =(clock frequency in Hertz)/((1+ARR)(1+PSC))
PSCVal EQU 3999
ARRVal EQU 1999
Need help with a coding assignement that needs to

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!