QUESTION 3 [25 MARKS] STM32F103C6 system consists of four common cathode LEDs, four active low Switches and a common cat
Posted: Fri Jul 01, 2022 6:15 am
QUESTION 3 [25 MARKS] STM32F103C6 system consists of four common cathode LEDs, four active low Switches and a common cathode 7-segment display as shown in Figure 4. Write a metal embedded C program that performs the following task: (a) Switch ON the LEDs based on the switch number pressed on PORTA. For example, if switch PA2 is pressed, then LED2 is switched ON. (b) Display the corresponding switch number being pressed on 7-segment. For example, if switch PA2 is pressed, 7-segment will display "2". (c) If no switch is being pressed, all LEDs and 7-segment display are switched off. VDD VDD R7 10k R8 10X 110 -Oswa R4 330 SWA D4 200700 Hi R3 330 D3 R2 330 D2 VDO VDD Lest R5 10k R6 10% R1 330 D1 Figure 4 SWI SW2 SW1 SW2 5W3 SW4 O PBO PB1 PEZ O P03 O Led! 312 14 35 17 29 311 20 40 Le O 42 Led O Led3 43 SARNAARA 46 21 22 25 27 U1 PAD-WKUP PA1 PAZ PAS PAI PAS PAD PAT PAB PAD PA10 PA11 PA12 PA13 PA14 PAIS PB0 PB1 PB2 PB3 PB4 PBS PO PB7 PBS POR PB10 PB11 PB12 כומין NRST PC13 RTC PC14-05C32 N PC15-08C32 OUT P014 PB15 STM32F10308 OSCIN POO OSCOUT POT VBAT BOOTD VDO [25 Marks] [CO2, PO3, C4]