

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


A+ Due Date: Friday, January 9th
Project One Introduction to the Microcontroller Development Environment
References: Chapter 2 - Low-power operation Chapter 4 - T1 template program
Before Lab
[ ] Attend the demo.
[ ] On the "team" signup sheet, put a "handle" together with your name and that of your partner. You will want to get lined up with a lab partner even though I suggest that you work on this specific project individually.
Using QwikBug
[ ] The QwikBug monitor allows you to carry on microcontroller development without the cost of a microcontroller programmer or of an emulator for debugging. You can download program code to the chip and run it. You can also set a breakpoint to monitor the chip’s performance as it goes from breakpoint to breakpoint. And you can “single- step” through successive lines of C code.
[ ] Turn on one of the PCs, if necessary.
[ ] Logon to the PC. If a warning or error occurs during login or bootup, please contact the TA.
[ ] We suggest that you do all of your work from files temporarily loaded into the C:\WORK folder while at the same time maintaining (and updating often) a copy of your source file on your network drive. In this way you will gain the speedy execution of the C compiler. Copy T1 from Source File tab of the http://www.qwikandlow.com website to the C:\WORK folder. As you change your source file, remember to periodically back up the T1.c file to your network drive.
WARNING: All user files are deleted from the PC's hard disk whenever the computer is rebooted or a new user logs on. If you ever quit your work and then realize that you have not saved your source file to your network drive, DO NOT log on again. As long as the computer is not rebooted or logged onto again, the TA can retrieve your source file for you.
[ ] Turn on the power switch for the Qwik&Low board. It should be connected to the PC via the serial cable. Click on the QwikBug icon to start it up. “Open” T1.lst and then
“Load” it into the PIC chip on the Qwik&Low board. Then run it. This program does very little. It blinks the LED on the Qwik&Low board every 4 seconds. It also turns on the LED constantly for the duration of a press of the pushbutton built into the “RPG/PB”located at the bottom of the board (the edge closest to you).
[ ] Monitor the current drawn from the coin cell. To do this, the DMM must be connected to the two banana jacks on the Qwik&Low board. Turn the DMM knob to the “2m” scale to measure with a resolution of .001 mA = 1 :A. Then toggle the power switch to the off position (toward you).
Current with serial cable connected, LCD connected, LED connected = ______ :A
Current with serial cable connected, LCD and LED disconnected = ______ :A
Current with serial cable, LCD, and LED disconnected = _______ :A
For these measurements, the LED bops up the current draw briefly every 4 seconds. The LCD controller draws just 5 :A in this application. The PC connection via the serial cable may also mess with the displayed current (up to about 30 uA). Any time you want to determine the current draw due to some code you are running, just remember that you can eliminate these three components. And for determining a change in current draw as you change some factor in your program code, it is not necessary to eliminate any of these.
[ ] Monitor the awake/sleep cycle of the PIC18LF4321 microcontroller. To do this, turn on the scope and connect the ground clip to the Qwik&Low “ground grabber” loop of wire at the bottom of the board. Remove the grabber end of the scope probe and use the sharp point to probe Test Point 6 (labeled “Fosc/4 TP6"). To return the scope to its manufacturer’s default state, press Setup - Default Setup.
What is the duration of the train of clock pulses? ____________ :s
What is the interval of time from one train of clock pulses to the next? _______ ms
What is the frequency of the clock pulses? To get this, change the time/division to show just a few clock periods. Then press Time - Freq to get a display of the frequency.
____________ MHz
[ ] Monitor the loop time of the main loop of the T1 code by connecting the scope probe to the RC2/CCP1 pin on the H4 (unpopulated) header. Use Time - Next Menu - +Width to measure the time from when RC2 goes high until it goes low again.
_____________ ms
Editing and Compiling
[ ] Open the Crimson editor. Then open the T1.c source file into the editor by sliding the T1.c icon on the desktop into the open editor window. Move and/or resize the resulting