Lab 1
Lab 1
Lab 1
Objective:
The purpose of this lab assignment is to familiarize with:
1. QwikFlash board (which is a PIC18F452 microcontroller chip based board
with various I/O devices.)
2. MPLAB X IDE used to create PIC microchip code programs and build ‘.hex’
that will run in PIC chip.
3. XC8 is a C compiler for PIC chips.
4. The PICKit3 is the programmer used to upload your program to the PIC.
1. Copy ‘Lab1_example_1.c’ program from the ‘CSE3442 files’ folder located in the
embedded M: server to your Z: drive. Open MPLABX IDE.
15. You may now set various breakpoints within the C code, run the debugger
simulation (Debug > Debug Main Project), and Step Into (F7) a line-by-line
execution of the program.
16. Play around with the windows/watches opened up in Step 15 and see ports,
registers, variables, etc. change values as you are stepping through the code.
You may also use the Stimulus to imitate physical changes to the PIC’s input
pins on PORTB and PORTD.
If you have any questions/issues call the TA, if not you can move on to part 2.
Part 2: ‘Hello, World!’ program
The purpose of this part is to get familiar with running PIC programs using the
QwikFlash board. The code will display a message on the LCD along with an
incrementing number.
1. Copy ‘Lab1_example_2.c’ program from the ‘CSE3442 files’ folder located in the
embedded M: server to your Z: drive. Open MPLABX IDE.
12. Select the button Make and Program Device Main Project.
13. In the output console you should see a success message indicating that your
program was uploaded to the PIC.
IMPORTANT: Execute the “QwikFlash_Reset.bat” file in the shared M: drive. This code
will overwrite the PIC so no student code is left behind. Do this at the end of every lab
throughout the semester.
Assignment:
Write a lab report (using a word processor, submit as pdf) discussing the following:
1. What is the purpose of the function void Initialize_PIC()? How does this
function relate specifically to the QwikFlash board?
2. Explain the process of printing characters to the LCD module in the function
void Print_To_LCD(const char * tempPtr).
You can use reference materials for help on the two questions on the class webpage
http://omega.uta.edu/~nbb0130/CSE3442.html (Chapter-7 of Embedded Design…,
QwikFlash Board Schematic, etc.)
Submit your report via BlackBoard before the beginning of the next lab (one week).