Project#2: RUN Led.
In this project, you are going to add a RUN led to the embedded system that you have designed and developed in project 1. RUN Led is used to indicate continuous running of an electronic system, in general.
Hardware:
Implement the design on Explorer 16 as Project 1. LED D10 will be used as the RUN LED indicator.
Application:
Write an application (in C) which does the following:
1. Make the RUN LED(D10) toggle at every 1.45 Seconds (exact) interval using one of the Timer (Timer 1) module of the Microcontroller.
2. The Knight Rider pattern now consists of 7 LEDs (D9-D3). If the switch (S3) is open, the pattern is from Left to Right direction. If the switch (S3) is closed, the pattern is from Right to Left direction.
3. Repeat the whole process in an infinite way.
Note:
1. To toggle the RUN LED, precisely at 1.45 Seconds interval, you need to use the interrupt mechanism for the Timer1.
2. Submit reports using and following Project Report Template available in SLATE. The marking scheme and submission procedure is as stated in that template.
3. The deadline, please see the class plan.
1 answer
Hardware:
- Explorer 16 development board
- LED D10
- Switch S3
- Timer 1 module of the Microcontroller
Software:
- MPLAB IDE software
- C programming language
Here is the step-by-step guide to implement the project:
1. Connect LED D10 to the designated pin on the Explorer 16 development board.
2. Connect switch S3 to the designated pin on the Explorer 16 development board.
3. Set up the Timer 1 module of the Microcontroller to generate an interrupt at 1.45 second intervals. You can refer to the Microcontroller's datasheet for detailed instructions on setting up the Timer 1 module.
4. Write a C program that toggles the state of LED D10 in the Timer 1 interrupt service routine (ISR). When the Timer 1 interrupt occurs, check the current state of LED D10 and toggle it accordingly.
5. Implement the Knight Rider pattern using LEDs D9 to D3. If switch S3 is open, iterate through the LEDs from left to right. If switch S3 is closed, iterate through the LEDs from right to left. Use delays between the LED toggling to create the desired effect.
6. Repeat the entire process in an infinite loop.
Remember to follow the specified requirements and guidelines provided in the project description.
Don't forget to document your progress, code, and findings in a project report using the provided Project Report Template. Follow the designated marking scheme and submission procedure to ensure proper evaluation of your project.
Good luck with your project!