Embedded Programming 201 Home Assignment 2020Se´an MulleryDeadline 23:55 2nd of May 2021DescriptionUpload user.c, main.c and interrupts.cDO NOT change the names of these files when uploading e.g. sean main.c is not acceptable as it slowsdown the marking process.In this assignment I want you to control the speed of a treadmill in response to a user’s heart rate. Youwill use the PIC16f88.Assume the user’s heart-pulse has been cleaned up by external hardware and enters as logic pulse on RB1.You must count the number of rising edges that occur in a 15 second duration and from this, determinethe number of beats per minute. Note: that you cannot use External interrupt as RB0 is required forthe PWM output. While RB3 could be used for the PWM output it does not work in the simulator.Using the hardware PWM functionality you should start the program with a 50% duty cycle on RB0.This will run the treadmill at a medium speed.If after a 15 second interval, the user’s heart rate is between 80-120 bpm, then you can leave the dutycycle for the treadmill as it is, but check again every 15 seconds.If after a 15 second interval, the user’s heart rate is above 120 bpm, then reduce the duty cycle of thetreadmill by 10%, but check again every 15 seconds.If after a 15 second interval, the user’s heart rate is below 10 bpm, then increase the duty cycle of thetreadmill by 10%, but check again every 15 seconds.You should not cause any unexpected or dangerous behaviour if the logic suggests decreasing below 0%duty cycle or increasing above 100% duty cycle.In the comment header of the main file, suggest additional functionality that you feel should be addedin order to make the system safer for the user. You don’t have to know how to add it in the program,you just need to suggest it.Make sure you adhere to the IT Sligo C Coding Standard. Appropriate variable names should be used inall cases. Your code should be neat and indented properly. You will lose marks if you leave unnecessarycode in your program that shouldn’t be there.Marks• 20% for adherence to the IT Sligo Coding standard.• 10% for correct initialisation of ports, timer(s) and interrupt(s) as appropriate.• 10% for outputting a PWM 50% duty cycle at the start.• 20% for correctly counting the user’s pulse, every 15 seconds.• 10% for leaving PWM output steady if the user’s pulse is between 80-120 bpm.• 10% for increasing the PWM duty cycle by 10% if the pulse is above 120 bpm.• 10% for decreasing the PWM duty cycle by 10% if the pulse is below 80 bpm.• 10% for functional safety suggestions.
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA PhD. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS