The MSP430FR4133 analogue to digital convertor (ADC) has been configured as follows. Unfortunately, the code was not com
Posted: Tue Apr 26, 2022 2:04 pm
The MSP430FR4133 analogue to digital convertor (ADC) has been configured as follows. Unfortunately, the code was not commented. Note the ADC is enabled and started elsewhere in the ode, interrupts are handled elsewhere. Make initialiseADC() configureADC) Void initialiseADC() { ADCCTLO = Ox0310; ADCCTL1 = 0x02EC; ADCCTL2 = 0x0010; ADCMCTLO = 0x17; } (a) What type of ADC is integrated into the MSP430FR4133? Successive approximation Flash converter ADC Dual slope ADC None of the above 双击看大海 2.5 marks (b) What Port/Pin should your analogue signal connect to? P1.6 P1.8 P1.3 P1.7 2.5 marks 双击看大图 1 (c) If you are using the 48 pin TSSOP package of MSP430FR4133, what IC pin is this? 双击看大图 17 19 18 21 2.5 marks (d) You code measure 255 counts from the ADC, assuming typical internal voltages, what is the voltage on the analogue pin? 双击看大图 0.37 V 1.2 V 0.3 V OV 2.5 marks (e) MCLK is set to 16 MHz, SMCLK is set to 8 MHz, ACLK is set to 40 kHz, , MODCLK is set to 5 MHz. What will be your ADC sample rate? 5 ksps 3 Msps 1 Msps Something else
(f) If you want to sample 3 inputs cycling through them in order, which register(s) do you need to change? ADCCTL2 & ADCMCTLO ADCMCTLO ADCMCTLO & ADCCTL1 ADCCTL1 2.5 marks (g) 8 LEDs are connected as follows in Figure Q3a: 2. P9.0 SW 25.1 SW 25.2 SW 5.3 S E ***** 00 ::::::史。白日白 : P2.7_SW Figure Q3a To light up only LED1 and LED3, how would you set the output register? P5OUT = 0x00; P5OUT = Ox04; P2OUT = 0x80; P2OUT = 0x00; PSOUT = Ox00; PBOUT = Ox01; PEOUT = Ox04; P2OUT = OxFF; P2OUT = 0x80; PSOUT = 0x00; P8OUT = 0x01; P8OUT = 0x00; 2.5 marks (h) Your main function contains the following code: unsigned char dialValue = 0x01; while(1) { dialValue = (dialValue>>1) (dialValue<<7); delay(100); // Delay 100ms. } 3 双击看大图 How will the dialValue transition over 8 iterations of the while 1 loop? 1,2,4,8,16,32,64,128,1 1,128,64,32,16,8,4,2,1 9,8,7,6,5,4,3,2,1 16,14,12,10,8,6,4,2 25 marks
(i) Your main function includes the following code: //LCD int to Display = 1234; showChar('V',pos1); showChar("pos2); showChar(((toDisplay _ / 1000) % 10) + 48, pos3); showChar(((toDisplay _ / 100) % 10) + 48, pos4); showChar(((to Display _ / 10) % 10) + 48, pos5); showChar(((toDisplay _ / 1) % 10) + 48,pos6); void showChar(char character, int position); //Puts a character on the LCD at the required position. What is the integer value of: ((toDisplay _ / 10) % 10) + 48 ? 50 53 52 51 2.5 marks 6) You are designing a low power application that needs to read an ADC at 1 kHz. What power mode should you be in for most of the time? LPM3 LPM1 LPM2 LPM5 2.5 marks
(f) If you want to sample 3 inputs cycling through them in order, which register(s) do you need to change? ADCCTL2 & ADCMCTLO ADCMCTLO ADCMCTLO & ADCCTL1 ADCCTL1 2.5 marks (g) 8 LEDs are connected as follows in Figure Q3a: 2. P9.0 SW 25.1 SW 25.2 SW 5.3 S E ***** 00 ::::::史。白日白 : P2.7_SW Figure Q3a To light up only LED1 and LED3, how would you set the output register? P5OUT = 0x00; P5OUT = Ox04; P2OUT = 0x80; P2OUT = 0x00; PSOUT = Ox00; PBOUT = Ox01; PEOUT = Ox04; P2OUT = OxFF; P2OUT = 0x80; PSOUT = 0x00; P8OUT = 0x01; P8OUT = 0x00; 2.5 marks (h) Your main function contains the following code: unsigned char dialValue = 0x01; while(1) { dialValue = (dialValue>>1) (dialValue<<7); delay(100); // Delay 100ms. } 3 双击看大图 How will the dialValue transition over 8 iterations of the while 1 loop? 1,2,4,8,16,32,64,128,1 1,128,64,32,16,8,4,2,1 9,8,7,6,5,4,3,2,1 16,14,12,10,8,6,4,2 25 marks
(i) Your main function includes the following code: //LCD int to Display = 1234; showChar('V',pos1); showChar("pos2); showChar(((toDisplay _ / 1000) % 10) + 48, pos3); showChar(((toDisplay _ / 100) % 10) + 48, pos4); showChar(((to Display _ / 10) % 10) + 48, pos5); showChar(((toDisplay _ / 1) % 10) + 48,pos6); void showChar(char character, int position); //Puts a character on the LCD at the required position. What is the integer value of: ((toDisplay _ / 10) % 10) + 48 ? 50 53 52 51 2.5 marks 6) You are designing a low power application that needs to read an ADC at 1 kHz. What power mode should you be in for most of the time? LPM3 LPM1 LPM2 LPM5 2.5 marks