AY2122-S1 Assignment 2
COvid Patients Enhanced Monitoring (COPEMON)
ARM v7-M Assembly Language and C Programming
汇编语言作业代写 Objectives After completing assignment 2, students will: be able to apply system design approaches, such as using flowcharts,
Objectives
After completing assignment 2, students will:
- be able to apply system design approaches, such as using flowcharts, to design embedded applications
- understand the interfaces between microcontrollers and peripherals
- have the ability to develop microcontroller-based systems using embedded C programming
Overview 汇编语言作业代写
In this project, we will be implementing a system to have enhanced monitoring of COVID patients, especially elderly COVID patients. We shall refer to this system as COvid Patients Enhanced MONitoring (COPEMON). This system sends data periodically to a server known as CHIP Associated Cloud Unit (CHIPACU) which simulates an Internet of Things (IoT) server.
In this assignment, it is assumed that the board is a larger prototype version of COPEMON, with several output devices to help in the debugging during development. CHIPACU is the terminal program running on the PC that communicates with the STM32 chip.
Students are required to interface with various devices on the Board for data capture and data transmission. The reasons behind the use of the main sensors are indicated in the table below.
Accelerometer: Monitors the posture of the patient, specifically for fall detection.
Gyroscope: Measures patient’s movement; specifically to sense the patient’s sudden twisting/twitching which could be an indication that the patient is in pain. A sudden movement can also cause issues with the other monitoring / life-saving equipment such as ventilators
Humidity Sensor: 汇编语言作业代写
Measures the relative humidity of the air passed into the patient’s lungs.
Magnetometer: Monitors the orientation of the patient lying on the bed. Proper orientation is important in ensuring that other monitoring / life-saving equipment remains connected properly.
Pressure Sensor: Simulates the pressure of air in the patient’s lungs. A change in pressure can be varied by varying the height at which the sensor is held. Averaging a few measurements is necessary to reduce the noise in measurements – a single measurement will not be that indicative.
Temperature Sensor: Monitors body temperature. In practice, it will be hard to achieve a temperature equal to body temperature. Hence, we consider the room temperature at the start of the program to be the normal temperature.
Detailed Description, Specifications 汇编语言作业代写
Note : This page will be updated continuously to provide clarifications regarding specifications and requirements. Please keep checking this page once in a while.
************ Updates are in BLUE colour ************
(1) There is “HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);” in the EXTI15_10_IRQHandler() in the example program demo_exti_print.zip, which was used as an indicator to verify that interrupt handler is called automatically. If you are using demo_exti_print.zip to start your assignment 2, please remove it in stm32l4xx_it.c
(2) Note that Systick interrupt is compulsory to be used for ALL timing requirements. HAL_Delay() function or counting the regular routine is FORBIDDEN to be used for timing in the final program.
(3) In conclusion, “wait by doing nothing” is FORBIDDEN.
(4) printf() function is FORBIDDEN in the final program.
- ♦ DEVICES USED
- ♦ FEATURES
- Modes of Operation
- Body Temperature Monitoring
- Fall Detection
- Pain Detection
- Orientation Monitoring
- Respiratory Monitoring
- Telemetry
- ♦ MODES
- Normal Mode
- Intensive Care Mode
- Specifications
- ♦ GENERAL CLARIFICATIONS & HINTS
♦ DEVICES USED 汇编语言作业代写
- ACCELEROMETER: 3D accelerometer LSM6DSL
- GYROSCOPE: 3D gyroscope LSM6DSL
- HUMIDITY_SENSOR: capacitive digital sensor HTS221
- TEMPERATURE_SENSOR: capacitive digital sensor HTS221
- LED: Green LED2
- MAGNETOMETER: high-performance 3-axis magnetometer LIS3MDL
- PRESSURE_SENSOR: 260-1260 hPa absolute digital output barometer LPS22HB
- MODE_TOGGLE & WARNING_CLEAR: USER Button (blue), read using interrupts
- CHIPACU: Terminal program (Tera Term) on a personal computer/laptop displaying Telemetry
- DEBUG_DEBUG_CONSOLE: The debug DEBUG_CONSOLE in STM32CubeIDE where printf() and other messages appear. These messages have to be disabled as soon as we start using CHIPACU
- WIFI/BLUETOOTH: Telemetry messages to the cloud via WiFi/Bluetooth (Optional)
♦ FEATURES 汇编语言作业代写
Modes of Operation
- Two modes of operation of the monitoring system:
- Normal
- Intensive Care
- When the system is turned ON, the system is in Normal
- The system switches from Normalmode to Intensive Care mode only when there is a warning generated from Respiratory Monitoring (refer to Respiratory Monitoring section below).
- To recover the COPEMON back from Intensive Caremode to Normal mode, press MODE_TOGGLE twice within 0.5 seconds (i.e., there is an additional press within the 0.5 seconds window following the first press). COPEMON enters the Normal mode after the second press of MODE_TOGGLE.
- Pressing MODE_TOGGLE once per second when the system is in Intensive Caremode has no effect.
Body Temperature Monitoring 汇编语言作业代写
- Essential to detect body temperature and trigger an emergency response.
- Use the TEMPERATURE_SENSOR to detect the body temperature and provide the following response when TEMPERATURE_SENSOR’s reading is greater than TEMP_THRESHOLD is detected.
- Show a warning message “Fever is detected\n” on the DEBUG_CONSOLEand send through Telemetry.
- Set the LED blinking at 5Hz.
- Body temperature monitoring should be done in both Normal and Intensive Care modes.
- In Normal mode, temperature readings need not be sent to CHIPACU, and temperature warning is enabled and sent through Telemetry every 10 seconds until the system’s mode is changed.
- In Intensive Care mode, both temperature reading and warning (if any) need to be sent to CHIPACUevery 10 seconds.
Fall Detection 汇编语言作业代写
- Essential to detect body fall and trigger emergency responses.
- Use the accelerometer to detect fall and provide the following responses when ACCELEROMETER’s reading is lowerthan ACC_THRESHOLD is detected.
- Show a warning message “Fall detected\n” on the DEBUG_CONSOLEand send through Telemetry.
- Set the LED blinking at 5Hz.
- Fall detection should be done in both Normal and Intensive Care modes, as the possibility of a fall exists in both modes.
- In Normal mode, ACCELEROMETER’s readings need not be sent to CHIPACU, and the warning is permanently enabled and sent through Telemetry 10 seconds unless the system’s mode is altered.
- In Intensive Care mode, both ACCELEROMETER’s reading and warning (if any) need to be sent to CHIPACU10 seconds.
Pain Detection 汇编语言作业代写
- Pain Detection is enabled when the system is used by hospitalized COVID-19 patients. A sudden movement can cause issues with the other monitoring / life-saving equipment such as ventilators.
- Use the GYROSCOPE to detect the patient’s movement, i.e. sense the patient’s sudden twisting/twitching which is an indication that the patient is in pain.
- provide the following responses when GYROSCOPE’s reading (combinational effect in X, Y, and Z directions) greater than GYRO_THRESHOLD is detected.
- Show a warning message “Patient in pain! \n” on the DEBUG_CONSOLEand send through Telemetry.
- Set the LED blinking at 10Hz.
- Pain Detection is only enabled in Intensive Care mode. Both GYROSCOPE’s reading and warning (if any) need to be sent to CHIPACUevery 10 seconds.
Orientation Monitoring 汇编语言作业代写
- Orientation monitoring is used by hospitalized COVID-19 patients to detect the orientation of the patient lying on the bed.
- Use the MAGNETOMETER to sense the patient’s abnormal orientation during hospitalization.
- Provide the following responses when MAGNETOMETER’s readings hit the MAG_THRESHOLD.
- Show a warning message “Check patient’s abnormal orientation! \n” on the DEBUG_CONSOLEand send through Telemetry.
- Set the LED blinking at 10Hz.
- Orientation Detection is only enabled in Intensive Care mode. Both MAGNETOMETER’s readings and warnings (if any) need to be sent and updated to CHIPACUevery 10 seconds.
Respiratory Monitoring 汇编语言作业代写
- Respiratory monitoring is used by hospitalized COVID-19 patients.
- Two sensors are used: (1) HUMIDITY_SENSOR is to detect the breath out exhale air from the patient, and (2) PRESSURE_SENSOR is used to simulate the measurement of air pressure in the patient’s lungs.
- Provide the following responses when HUMIDITY_SENSOR’s reading is below the HUMID_THRESHOLD, orwhen PRESSURE_SENSOR’s reading exceeds the PRESSURE_THRESHOLD.
- Show a warning message “Check patient’s breath! \n” on the DEBUG_CONSOLEand send through Telemetry.
- Set the LED blinking at 10Hz.
- Respiratory Monitoring is used in both Normaland Intensive Care During Normal mode, the readings from HUMIDITY_SENSOR and PRESSURE_SENSOR need not be sent, but if a warning message is generated, the system should switch to Intensive Care mode after the warning message is sent.
- During Intensive Caremode, HUMIDITY_SENSOR’s reading, PRESSURE_SENSOR’s reading, and warning (if any) should be permanently enabled and sent through Telemetry every 10 seconds if the threshold is met.
Telemetry
- Various messages and data are sent to CHIPACU, to monitor the patient’s vital conditions.The following information is sent.
- Messages regarding entering Normal and Intensive Care modes.
- Sensors’ readings and warning messages (if any) whenever they occur are also sent. Some examples are below.
-
- “Fall detected. \r\n” – when a fall is detected.
- “Fever is detected. \r\n” warning – when the body temperature exceeds the threshold.
♦ MODES 汇编语言作业代写
Normal Mode
COPEMON must be on a horizontal surface when powered on for the first time. Upon powering on, COPEMON must have the following Normal mode behaviors:
- LED_2 is off
- The TEMPERATURE_SENSOR, ACCELEROMETER, HUMIDITY_SENSOR, and PRESSURE_SENSOR are enabled.
- The GYROSCOPE, MAGNETOMETER are idle.
- The following message is sent once to CHIPACUeach time Normal mode is entered:
Entering Normal Mode.\r\n
- Once a certain threshold is exceeded and the warning is raised, the system remains in a state of warning, and you need not detect threshold crossing again.
If a respiratory warning happens during the Normal Mode, COPEMON goes into the Intensive Care MODE, and the warning messages and blinking of LED2 stop.
Intensive Care Mode 汇编语言作业代写
Intensive Care Mode for COPEMON represents the situation where the patient is diagnosed with COVID 19 in need of detailed care. As soon as COPEMON enters the Intensive Care Mode, all the sensors are active. The following behavior occurs in Intensive Care Mode:
- The following message is sent once to CHIPACUeach time Intensive Care mode is entered:
Entering Intensive Care Mode.\r\n
- LED_2 should be always on.
- The TEMPERATURE_SENSOR, ACCELEROMETER, GYROSCOPE, MAGNETOMETER, HUMIDITY_SENSOR, and PRESSURE_SENSOR are sampled once every second.
- The format of the transmitted data to CHIPACU should be as follows:
XXX TEMP_ttt.tt (degreeC) ACC_x.xx(g)_y.yy(g)_z.zz(g) \r\n
XXX GYRO nnn.n() MAGNETO X.XX() Y.YY() Z.ZZ() \r\n
XXX HUMIDITY h.hh() and PRESSURE p.pp() \r\n
-
- XXX represents a 3-digit value that starts from 000 and increments by 001 after each transmission to CHIPACU, from COPEMON.
- XXX never resets itself to 000, unless COPEMONitself is powered on from a power-off state. It is assumed that 999 will never be reached.
- tt stands for the temperature reading from the sensor up to 2 decimal places.
- xx is the x-axis reading from the accelerometer, in ‘g’s, up to 2 decimal places. Similarly, y.yy and z.zz are the accelerometer’s readings in ‘g’s on y and z axes. Note : 1 g = 9.8 m/s2.
- nn stands for the Gyroscope reading from the sensor up to 2 decimal places, it should be a combinational gyroscope reading by considering all 3 directions.
- where X.XX, Y.YY and Z.ZZ are readings from Magnetometer sensor on x, y, and z axes to 2 decimal places.
- hh stands for Humidity sensor reading and b.bb stands for Barometer reading to 2 decimal places.
- You must indicate the unit in () for all the readings from different sensors.
- If high fever or fall is detected at the instant a scheduled transmission to CHIPACU, the following message must also be sent before the usual sensor values from the TEMPERATURE_SENSOR and ACCELEROMETER:
Fever is detected.\r\n
Fall detected.
- If the patient is in pain, in abnormal orientation, or has a respiratory problem at the instant a scheduled transmission to CHIPACUis happening, the following message must also be sent before the usual sensor values from the GYROSCOPE, MAGNETOMETER, HUMIDITY, and PRESSURE SENSOR:
Patient in pain! \r\n
Check patient’s abnormal orientation! \r\n
Check patient’s breath! \r\n
- It is up to the students to determine which warning messages appear first if the events happen simultaneously.
- Once a certain threshold is exceeded and the warning is raised, the system remains in a state of warning, and you need not detect threshold crossing again.
- Transmission of the current readings from all the sensors as well as any triggered warning messages to CHIPACUoccurs every 10 seconds.
- If MODE_TOGGLE is pressed twice within 0.5 seconds during Intensive Care Mode, COPEMONreturns to Normal Mode, and the warning messages and blinking of LED2 (if any) should stop.
Specifications 汇编语言作业代写
- Students have the freedom to set appropriate thresholds for TEMP_THRESHOLD, ACC_THRESHOLD, GYRO_THRESHOLD, MAG_THRESHOLD, HUMID_THRESHOLD, PRESSURE_THRESHOLD.
- One more interrupt (in addition to SysTick and USER Button), preferably from a sensor, should be used. The interrupt to be used, as well as the use case of the interrupt, is left to the discretion of the student. Use of additional interrupts is optional (over and above the three interrupts mentioned above), not a basic requirement.
- Printf function (Printing) on Debug console should be disabledin the final program and information communication should be through Teraterm (Telemetry).
Note : Please do not damage the board by subjecting it to mechanical stress.
♦ GENERAL CLARIFICATIONS & HINTS 汇编语言作业代写
• You are required to sketch flowcharts before starting assignment 2 coding. These flowcharts should be included in your report. Having a systematic plan through flowcharts/UML diagrams etc can make your coding easier and more systematic, and this systematic design methodology is practiced widely in the industry. Writing code without a proper design/plan takes a lot more time than it should. Basically, don’t think and write code at the same time. Think, and then write code to express your thoughts/logic.
• The exact format displayed on Teraterm (Telemetry) isn’t important. The format and messages are just suggestions. Feel free to make reasonable
• Make sure that you choose appropriate thresholds which can be triggered during demo/testing without subjecting the board to unnecessary mechanical stress. While you are free to set the various thresholds based on experimentation (i.e., empirically), you should be able to explain it in terms of the physical quantities involved.
• All display of information must be done through UART or other communication devices on the board (e.g., Bluetooth/WiFi). Use of printf() which makes use of the debugger (causing unpredictable delays) in the final program will be penalized, and it will cause timing issues.
• During debugging, make use of the debug features in the IDE effectively, such as running until a breakpoint, stepping over, stepping into, and inspecting various variable/array values without having to print them.
• For a project of this nature, it is impossible to have the specifications cover all possible scenarios. We leave it to your discretion to decide how the system should respond in scenarios not covered by the above specifications.
Possible Enhancement 汇编语言作业代写
After all the requirements set out in the earlier sub-sections have been met, you are encouraged to use additional peripherals or add features, such as:
- Other peripherals not taught in the lab.
- Other methods of interfacing such as Timer, ADC, etc.
- Interrupts for the different peripherals connected to the STM32L475VG
- More complex helper functions from the device libraries
- Better visualization / remote processing in a server and sending back info to the board (two-way interaction with a server)
With these additional peripherals, application logic enhancement can be implemented, including and not limited to what is to be done with the values from the different sensors. This is an independent and self-learning task, for which help will be limited in order to prevent such enhancements from becoming too common, and therefore worth less. The more complex and rarer the enhancement, the more impressive it will be. Peripherals whose usage and codes have been discussed during the lab sessions will not be given extra credits.
You should focus on one well-thought-of application logic to showcase your enhancement, instead of several smaller application logics. 汇编语言作业代写
Your enhancement must be related to the given scenario in order to score good marks for enhancement. Marks are only given for one application logic depending on (i) the novelty and value it adds to the problem we are trying to solve (ii) the complexity in implementing it, and (iii) how well the claimed enhancement works. You should be able to state something like “My system has <<some feature of behaviour of the system>> enhanced through <<use of a new peripheral/different way to access a peripheral / some kind of optimization>>”. Mentioning a list of unrelated things you did such as “I did x, y and z” or mentioning a list of new peripherals you used such as “I used x, y, z etc.” without adding value to the system will not be very useful.
While trying out different things can be good for your learning, you have to keep in mind the fact that Assignment #2 contributes only 30% of the grades of a 4MC module. Furthermore, the enhancements carry only a limited amount of marks as compared to the basic requirements of the assignment. In other words, a program with excellent enhancements, but poor completion of basic requirements, will not score well.
During the assessment, you will be required to show all the basic requirements without your application logic enhancements. The latter should only be shown after the basic requirements have been demonstrated. You are not allowed to upload multiple programs to your STM32L475VG to demonstrate your application logic enhancements. Only one program will be allowed for upload to the STM32L475VG.
Report 汇编语言作业代写
Each group is required to submit one report (less than 10 pages, including about 3 to 4 pages reserved for flowcharts). The report should include at minimum the following information:
- Names and matriculation numbers, Group number, Lab day on the first page.
- Table of contents
- Introduction and objectives
- Flowcharts describing the system design and processes
- Detailed implementation: Describe the detailed implementation steps, especially indicate and explain your essential steps
- Enhancement: If you have implemented any enhancement, give a detailed description. You might consider including several photos of your working board at some special steps. This will help to distinguish your system and report from others
- Significant problems encountered and solutions proposed: What did you learn? What are the significant problems you encountered and how did you solve them in this assignment? If your code did not work in the lab, explain why
- Issues or suggestions: This feedback, whether positive or negative, will not affect your marks in any way, but will make the report more complete.
- Conclusion
更多代写:马来西亚C assignment代写 雅思代考 英国企业金融代上网课 论文代写台湾 论文格式apa代写 代修数学网课推荐