EETN DC Circuits – 109507011.

doc Last updated September 16, 2012

Name ______________________________

Digital Output Lab
1. Download today’s files and launch MPLAB (see screencast) 2. Type your program into the *.c file in MPLAB a. Make sure to fill in your own information in the comment at the top of the file 3. Compile your program a. Fix any typos, if needed 4. Program your chip a. Find out what your program does b. In your program’s header comment, type a one-sentence description of your program’s effects.

5. Copy your program into the chart below, with one line in every row.
Program statement #include <htc.h> void main() { ANSEL = 0; ANSELH = 0; PORTB = 0; TRISB = 0b11110000; RB0 = 1; RB1 = 1; RB2 = 1; RB3 = 1; while(1==1); } Explain in English what this means Why does it have to be here?

6. Work with the person on your left to fill in the chart below. Their name: _______________________________________________
List all the differences between their program and yours (make a new row in the table for each difference) What effect does this have, and why?

EETN AC Circuits – 109507011.doc Last updated September 16, 2012 7. Work with the person on your right to fill in the chart below. Their name: __________________________________________
List all the differences between their program and yours (make a new row in the table for each difference) What effect does this have, and why?

8. Summarize the following key points from today’s lab. Here are some references that will help: a. PIC microcontroller datasheet, model PIC16F887 (http://bit.ly/ryydYc) b. C Language reference, Wikibook in PDF format (http://bit.ly/SP9i0S) c. MPLAB Compiler, Assembler, and Linker quick reference guide (http://bit.ly/O5NYme)
Category PIC Microcontroller PIC Microcontroller PIC Microcontroller PIC Microcontroller PIC Microcontroller PIC Microcontroller PIC Microcontroller PIC Microcontroller PIC Microcontroller C Language C Language C Language C Language C Language C Language C Language MPLAB Idea or item Register Port General purpose register Special Function Register ANSEL ANSELH PORTB TRISB RB0 #include void main {} ; = == 0b Description, official name if applicable, and useful info for the future Questions I’m still not sure about…

9. Propose your own digital output effect. a. STOP! Type your plan below and show to instructor before proceeding. 10. Modify your program to accomplish your plan.

EETN AC Circuits – 109507011.doc Last updated September 16, 2012 11. Demonstrate to instructor when everything is complete.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.