3. ASAP! tq
Posted: Fri Jul 01, 2022 6:15 am
3.
ASAP! tq
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. 100 PBO O PB1 PB2 PB3 VDD VDD R7 10k R8 10k O Led4 HI. R4 330 SW3 SW4 D4 spen 0- R3 330 Hi Led2 R2 330 D3 D2 VDD VDD 100 R5 10k R6 10k R1 330 D1 Figure 4 SW1 SW2 SW1 SW2 SW3 SW4 OOOO PBO O PB1 PB2 O PB3 O Led1 Led2 O Led2 Led3 O 10 11 12 13 14 15 16 17 29 30 31 32 33 34 37 38 18 19 20 39 40 41 42 43 45 46 21 22 25 26 27 28 U1 PAO-WKUP PA1 PA2 PA3 PA4 PAS PA6 PA7 PAB PA9 PA10 PA11 PA12 PA13 PA14 PA15 PBO PB1 PB2 PB3 PB4 PB5 PB6 PB7 PBB PB9 PB10 PB11 PB12 PB13 PB14 PB15 NRST PC13 RTC PC14-OSC32_IN PC15-OSC32_OUT STM32F103C6 OSCIN PDO OSCOUT PD1 VBAT BOOTO VDD √ F 44 [25 Marks]
ASAP! tq
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. 100 PBO O PB1 PB2 PB3 VDD VDD R7 10k R8 10k O Led4 HI. R4 330 SW3 SW4 D4 spen 0- R3 330 Hi Led2 R2 330 D3 D2 VDD VDD 100 R5 10k R6 10k R1 330 D1 Figure 4 SW1 SW2 SW1 SW2 SW3 SW4 OOOO PBO O PB1 PB2 O PB3 O Led1 Led2 O Led2 Led3 O 10 11 12 13 14 15 16 17 29 30 31 32 33 34 37 38 18 19 20 39 40 41 42 43 45 46 21 22 25 26 27 28 U1 PAO-WKUP PA1 PA2 PA3 PA4 PAS PA6 PA7 PAB PA9 PA10 PA11 PA12 PA13 PA14 PA15 PBO PB1 PB2 PB3 PB4 PB5 PB6 PB7 PBB PB9 PB10 PB11 PB12 PB13 PB14 PB15 NRST PC13 RTC PC14-OSC32_IN PC15-OSC32_OUT STM32F103C6 OSCIN PDO OSCOUT PD1 VBAT BOOTO VDD √ F 44 [25 Marks]