Homework 1, Polling vs Interrupts .
Short Description:
Investigate the impact of polling on a computationally intensive program
Goals
When you finish this homework, you should have:
- Demonstrated your ability to write code for the Arduino
- Demonstrated your ability to use interrupts
- Experienced and explained the difference between interrupts and polling
Formal Description
- Using the code discussed in class explore the difference between interrupt and polling driven input. To do this
- Build/modify a computational intensive program on the Arduino Nano. Perform a baseline test to determine the time required to perform the task
- It would be reasonable to conduct the experiment n times, where n ≥ 10 and calculate the average time to perform the task.
- Add a polling driven method to check for input.
- This can be implemented at multiple places in the program, so try at least two different locations for checking for input.
- In one, add a test where the computation loop is not changed.
- In at least one, add a test test where the computation loop is changed.
- Consider testing every iteraion of the loop
- Consider testing for input every k iteraions of the loop, where k is of different sizes.
- In the end, can you find a resonable value for k?
- Consider what you are trying to balance.
- Provide an input routine that counts the number of times the input was received
- Conduct n (from above) trials for each configuration
- For each trial record
- The modified computation time.
- The number of inputs actually received.
- Do your best to try to provide a set of uniform button presses.
- You may perform actual button presses or you may use a timer to simulate button presses.
- Re-implement the code using interrupt driven input.
- Duplicate the experiment described above.
- Write a report in the IMRD format discussing your results
- The introduction section should discuss the investigation of polling vs interrupts, including a definition of each.
- The methods section should discuss the above criteria as well as the implementation your have selected. It is appropriate to include code snippets.
- For example, you should discuss where you added the polling requests in each case.
- You should describe how you tried to provide uniform button presses
- In the results section, present your data and findings. This is just a data section, no interpretation should be present.
- In the discussion section, discuss your results and any future investigations you might wish to perform.
This can be a group project. Make sure that each member contributes and is named in the report. Please have each group member submit the assignment.
Required Files
- A zip or tar file containing
- The two different versions of the code. For the multiple different polling experiments, please just comment out or deactivate the unused configuration(s).
- A word document containing your report.
Submission
Submit the assignment to the D2L folder xxx by the due date.