Exam 3

docx

School

Worcester Polytechnic Institute *

*We aren’t endorsed by this school

Course

2049

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

docx

Pages

4

Uploaded by ElderResolveSalmon29

Report
Exam 3 Fisal Qutubzad 1) a) In deep-sea embedded systems, the Watchdog Timer (WDT) is pivotal for ensuring: Reliability: The WDT continually monitors system operation and automatically resets it in case of software or hardware faults, guaranteeing reliable and uninterrupted performance. Error Recovery: It plays a crucial role in automatically recovering from issues like software hang-ups or unexpected conditions, reducing the need for human intervention in remote and inaccessible locations. Data Integrity: For long-term data recording, the WDT minimizes the risk of data corruption by maintaining system stability, which is paramount to preserving data accuracy. Power Efficiency: Efficient power management is vital in deep-sea deployments. The WDT can be configured to periodically wake up the system, effectively conserving power when it's not actively recording data. b) False. Implementing the Chip Select (CS) line, even when using a single SPI slave, is a best practice. The CS line is essential for maintaining data integrity by ensuring that the correct slave device receives data. Furthermore, it allows for future scalability, as you can add more slave devices to the SPI bus while adhering to standard communication practices. This approach ensures your system remains versatile and compatible with a broader range of devices. c) 12 bits per character (8 data, 1 start, 1 parity, 2 stop). 16 characters in "ADC12_MSP430F5529." Total bits: 12 bits/character x 16 characters = 192 bits. Transmission time: 192 bits / 19200 baud ≈ 0.01 seconds. d) i) True ii) True iii) false iv) True
2) a) we would use the following __bis_SR_register(LPM2_bits); to place msp430 into low power mode 2 b) In the provided code segment, the Watchdog Timer (WDT) is running. It is configured using the WDTCTL register, and the settings specified by WDTCONFIG. However, the exact interval at which the WDT is counting is not explicitly defined within the code. The specific lines of code that could potentially be causing the problem, such as random reboots, are as follows: WDTCTL = WDTPW | WDTCONFIG; The line where the WDT is repeatedly reconfigured within the while loop: WDTCTL = WDTPW | WDTCONFIG; Also: Reconfiguring the WDT within the loop without a clear purpose could be a source of instability, especially if the interval is not set correctly. c) The WDT, as set in the provided code, may not wake the device from Low Power Mode 2 (LPM2). The reason is that the code doesn't configure the WDT to generate an interrupt when it times out. For LPM2, the WDT should be configured to generate an interruption, and the ISR should be designed to exit LPM2 when it's called. The general interrupt-enable instruction _BIS_SR(GIE) at the beginning of main() allows the processor to respond to interrupts, but it's the WDT configuration that determines its behavior in low-power modes. d)Sending data to a Sharp LCD Screen from within a Port 2 ISR is discouraged. ISRs should be brief and efficient. Data transmission to a display involves time-consuming operations that can lead to unpredictability and isn't suitable for an ISR. Instead, set flags or update variables in the ISR to signal data transmission and handle it outside the ISR in the main code to maintain ISR responsiveness and avoid blocking critical operations. 3) A) 16128 / 16383 ≈ 0.9839 Calculating the output voltage: Vout ≈ 0.9839 x (3.3V - (-3.3V)) ≈ 6.50V b) To create an output voltage of -1.5V on the AD5552 DAC, calculate the 14-bit code value: Calculate the fractional value: Fractional Value = (Desired Output Voltage - Vref-) / (Vref+ - Vref-) = (-1.5V - (-3.3V)) / (3.3V - (-3.3V)) ≈ 0.5455. Calculate the 14-bit code value: Code Value = (Fractional Value) * (Maximum Code) = 0.5455 * 16383 ≈ 8950. So, the 14-bit code value that should be sent to the AD5552 DAC via SPI to create an output voltage of -1.5V is approximately 8950.
c) Voltage Axis: -3.3V to 3.3V (the range of DAC output voltage). Time Axis 0 to 0.1 seconds (0.1 seconds of the waveform). Waveform Shape: Expect a linear change in voltage with the digital input code sent to the DAC. 4) Scenario 1: MSP430F5529 in LPM0 95.0% of the time. Calculate the average current consumption during this scenario: (0.95 * 1µA) + (0.05 * 2mA) = 0.05mA + 0.1mA = 0.15mA Calculate the runtime using the battery capacity: Battery capacity = 160 mA-hours (since they are connected in series). Runtime = Battery capacity / Average current consumption = 160 mA-hours / 0.15mA ≈ 1066.67 hours. Scenario 2: MSP430F5529 in LPM0 50.0% and LPM3 45.0% (crystal mode) of the time. Calculate the average current consumption during this scenario: (0.5 * 1µA) + (0.45 * 150µA) + (0.05 * 2mA) = 0.5µA + 67.5µA + 0.1mA = 0.167mA Calculate the runtime using the battery capacity:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Battery capacity = 160 mA-hours (since they are connected in series). Runtime = Battery capacity / Average current consumption = 160 mA-hours / 0.167mA ≈ 958.08 hours.