嵌入式代写|EE 代写

ACS6127 Real-time embedded system


Final Assignment
This assignment contributes 50% towards ACS6127

To allow you to demonstrate the knowledge and skills that you have developed by designing and implementing an embedded system to meet a provided system specification.

Structure of the Assignment
Date assignment is available from:
0900 Monday, week 9, semester 1

Date of assignment submission: Deadline for lab kit return:
Marks awarded:
Submission and return of the lab kit

Submission of your work will be through Blackboard. You will be required to submit the following files/documents. Failure to submit all of these documents will lead to a mark of zero for the assignment. The reason for this is that the assessor will not be able to check your project and test its functionality. You should only submit work for a single project in part B of the submission below.

  1. To Turn-it-In:

    A single text document (.doc, .docx or .rtf - not a pdf) divided into two parts, as follows:

    Part A.I: This section should explain the overall functionality of your code, how it implements each level of the required specification in part A and how you have considered robustness and efficiency in your solution. It is restricted to a maximum of 2 pages of size 12 font, single line spacing and 2.54 cm margins. A submission with part A.I greater than 2 pages will get zero for the assignment.

    Part A.II: This section should contain all of your “.c” and “.h” source files that you created for your project (e.g. main, my_headers and Thread files) copied and pasted in as text (A submission where the code is pasted as an image will get zero for the assignment). Please make sure that each file starts on a new page and is clearly labelled.

  2. To the standard Blackboard submission, the following files all attached in a single submission:

    1. A .zip compressed version (only .zip compression - no other compressed file types) of the

      complete project folder for your assignment. Please make sure that this folder contains:

      • The Keil μVision project file for your design (this is the “.UVPROJXfile found in the top folder of your project).

      • All of your individual “.c” and “.h” source files that you created for your project (e.g. main, my_headers and Thread files).

      • Your “system_stm32f4xx.c” file (found in the sub folder RTE->Device->STM32F407VGTx of your project).

      • Your “RTX_Conf_CM.c” file (found in the sub folder RTE->CMSIS of your project).

    2. The .hex file produced by the compiler. You will need to open the “Options for Target ‘Target 1’” window, select the Output tab and select the “Create HEX File” option. The “Name_of_your_project.hex” file will be created in the Objects sub-folder of your main project folder when you next run the compiler. It is the .hex file that will be run to test the functionality of your code – make sure that you run “build” before submission to ensure that you upload the latest version that matches your submitted project.

Standard penalties for late submission apply (https://students.sheffield.ac.uk/assessment/results/submission)

Lab kit should be returned to AJB reception. Unless an extension has been granted standard late

submission penalties also apply to return of the lab kit.

Restrictions

All code is to be solely developed using Keil μVision and the HAL drivers for the STM32F407. You are only allowed to use library files or functions which are developed by yourself, or which are available as part of the standard HAL drivers. Work developed using other software (including STM32CubeMX) and code using restricted sources (e.g. third-party libraries), will not be assessed.

Assessment and Feedback process

IMPORTANT: Your final source code should include your own original comments to fully explain its operation. It is not acceptable to copy and paste ANY comments provided in the teaching material (it is ok to include comments automatically generated by Keil in template files, such as Thread.c). If your code does not contain sufficiently detailed comments for the assessor to understand its operation (code where comments are copied from the teaching material will be classed as not commented) you will only be awarded 50% of the marks for that part of the specification, compared to what you could have been awarded if your code was correctly commented. This is because you will be deemed to have not been able to sufficiently explain your answer.

Your work will be marked on a number of factors, including:

a) How well your code meets the required specification (method, correctness, etc.)
b) How robust your program design and code implementation is.
c) How efficiently it runs and uses system resources (see Lecture 4)
d) How well it is documented (see the previous statement about comments and note part A.I of

the list of submitted documents).

This is the final component of assessment for the embedded systems part of the module. This means that you might receive the mark and written feedback for your assignment after the exam board and at the same time as the final marks for the rest of your semester 2 modules. Full example solutions will not be supplied as this will limit the assignments that can be set in future years.

Unfair Means

The lab should be completed individually. You should not discuss any aspect of it with other students and should not work together in completing the lab. The lab must be wholly your own work. Any suspicions of the use of unfair means will be investigated and may lead to penalties. See https://www.sheffield.ac.uk/ssid/unfair-means for more information. In addition to your Turn-it-In submission, your code will undergo additional checks. For example, MOSS is a specialist service focused solely on detecting plagiarism and collusion in code.

Extenuating Circumstances

If you have circumstances which mean you are unable to complete this work on time or that have affected your performance, please follow the extenuating circumstances process (https://students.sheffield.ac.uk/extenuating-circumstances). Extensions cannot be considered unless the extenuating circumstances process has been followed.

Support

If you have any problems with the equipment please contact Dr S A Pope immediately using the email address s.a.pope@sheffield.ac.uk. These inquiries should only relate to problems with the equipment, such as suspected faults. Any inquiry should include a clear description of the problem. Any general questions about the assignment should be posted to the relevant section of the Blackboard Discussion Forum.

Your task is to design and implement a multifunction embedded system. It will have two modes of operation. In the first mode it acts as a tilt switch and in the second mode it is in standby and simply blinks the LEDs on and off in a specific pattern. The mode change occurs following a click of the user button. Your design is required to meet the following specification. There are three levels to this specification, with each increasing the level of functionality and complexity of the system and therefore the marks that can be gained.

IMPORTANT:

  1. Your submitted assignment, irrespective of the specification level completed, is required to use the CMSIS-RTOS RTX real-time operating system to implement an appropriate multi-thread solution. An assignment submitted without using the CMSIS-RTOS RTX real-time operating system will receive a mark of zero.

  2. Your project is required to run correctly on any STM32F4Discovery with the same specification as the one used in this module. Your submitted code will not be tested on the STM32F4Discovery assigned to you, but on another STM32F4Discovery with the same specification.

  3. You can assume that the accelerometer provides calibrated acceleration measurements directly. This isn’t strictly true, but will be a sufficient assumption for this assignment.

  4. Configure the processor main clock to run at 168MHz.

  5. Add the following line of code immediately at the start of the int main(void){}

    function: SystemCoreClockUpdate();

Specification - Level 1
By completing this level you can achieve a maximum of 50 marks.

The STM32F4Discovery board should be programmed to operate as a two axis tilt switch. Unlike the example in the “Serial Communication, Polling and Interrupts” lab which indicated when the board was tilted more than 90 degrees from the level position, this tilt switch is required to have the following functionality and features:

  1. When the board is tilted from a flat horizontal orientation downwards in the direction of any of the four user LED’s (the centre of the pivot is the LIS3DSH) that LED should turn on i.e. the LED’s are used to indicate which edge of the board drops below the horizontal. If the board is tilted down in the direction of more than a single LED, then multiple LEDs should illuminate.

  2. Your program should include an appropriate deadzone so that for each of the single LED’s there is a range of tilt angles in which only that single LED illuminates (or no LEDs illuminate in the case of horizontal orientation).

  3. Your tilt switch should have an appropriate level of sensitivity. The LED’s should not flicker too much, nor should there be too much of a lag in updating the LED states when the board changes orientation.

    Specification - Level 2

    By completing this level you can achieve an additional 20 marks.

    1. When the blue user button is “clicked”, the tilt switch from level 1 should pause. A “click” means a press and release, so that the change in state occurs after the button is released.

    2. The detection of the “click” should initially be indicated by all four user LEDs blinking on for 1 second.

    3. Following the detection of the “click” and after all four user LEDs have turned on for 1 second, the pause state should continue to be indicated by the red LED repeatedly blinking on for 0.5 seconds and off for 0.5 seconds (the three other user LEDs should remain off). The program should stay in this pause state with the red LED blinking on and off until the blue button is clickedagain. After this clickthe blinking red LED will stop and the tilt switch from level 1 will resume.

    4. The pausing state should be continuously available on further clicks of the button.

    Specification - Level 3

    By completing this level you can achieve an additional 30 marks.

    A. The STM32F4Discovery incorporates a “CS43L22, audio DAC with integrated class D speaker driver”. You have not directly used this peripheral thus far, but you have covered all of the techniques that you need to work out how to use it and to implement the required code. This device can be used to provide an audio output when either headphones or speakers are connected to the audio jack on the STM32F4Discovery. This component should be used to provide an audible output in the form of a “beep” played through a set of headphones, to indicate, in addition to the flashing red LED, that the system is in the pause state required in Level 2. The “beep” should be clear and of an appropriate volume for headphones to be used. Your Part A.I submission should describe which communication interfaces are used by the CS43L22 to interface with the STM32F407 and it should explain how you have configured them.

    The data sheet for the CS43L22is provided on Blackboard in the same folder as the assignment briefing sheet.