Embedded C Programming
Embedded C Programming: Part II
Objectives:
1. To become familiar with enabling internal pull-up resistors and reading an input port
2. To learn how to wait for a pushbutton press
3. To learn how to organize a C program to read data from input ports, process the data, and display the result on a simple output device
4. To learn how to use the ROM program space for data
Results:
There are four objectives for this week lab. The first objective is to become familiar with enabling internal pull-up resistors and reading an input port. The second objective is to learn how to wait for a push button press. The third objective is to learn how to organize a C program to read data from input ports, process the data, and display the result on a simple output device. The last objective is to learn how to use the ROM program space for data.
Conclusions:
This week lab gave me a much better understanding of reading the input ports and using the push buttons on the HCS12.
Team: May Saw EET
Name Program Signature
Observations/Measurements:
1. IV. 1- A. Cut and paste the Memory window, showing the value of mybye before pressing SW1.
IV. 1-B. Cut and paste the Memory window, showing the value of mybyte after pressing SW1.
IV. 1.C – Which LED light turns ON?
IV. 1.D- What are the LED values when you press SW2?
IV. 2. A. Cut and paste the source code.
IV. 2. B. What is the value of PT1AD? Cut and paste the Memory window, showing the value of PT1AD.
IV. 2. B. What are the LED values when you press SW2? Describe what you observe when you press any of the pushbuttons.
IV. 3. A. Cut and paste the source code.
IV. 3. B. What are the LED values when you press SW4? Describe what you observe when you press a different switch when the light is ON. .
IV. 4. A. Cut and paste the source code.
IV. 4. B. Cut and paste the Memory window.
IV. 4. C. Describe how you verify that the data is stored in ROM. Cut and paste the Memory window.
IV. 4. D. Describe how you verify that the data is stored in RAM. Cut and paste the Memory window.
Questions:
1. Describe the code statement:
while ((PT1AD & 0xF0) != 0xF0);
What does this code do? Do we need the inner parenthesis for the code to work? Why?
2. When we define an array in the program ROM space, we use a const keyword. What does this keyword do? What does happen if we remove this keyword?
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
