Lab 6: PIC24 System Startup

This lab has you wire the dsPIC33EP128GP502 on a breadboard. You will test to see that you are powering the PIC properly. Next you will program the PIC with the serial bootloader firmware. You will download a C program to your PIC with BullyCPP and modify the program. Finally, you will measure the operating current of the PIC.

Basics

Correct.

Very incorrect.

So, bring a multimeter to labs 6-10.

This is why.

Prelab (20)

From Microchip DS70000657J

Optional placement guide wire has been moved to right of PIC.

Pins 15-28

Prelab Checkoff

Task 1 - Testing Power (10)

First, remove your PIC from the board.

Starkville students: Give your PIC to a TA so they can program it with the serial bootloader firmware. If you haven't soldered your power connector yet, now is the time to do so.

Distance students: Program your PIC with the serial bootloader firmware. Directions are here.

Make sure that you have removed your PIC from the board. Verify that your multimeter is configured to measure DC voltage (not current – you will blow the meter’s fuse!). Plug the USB cable into your computer. Your power LED should turn on solidly. With the COM (black) lead of your meter connected to the ground rail of the breadboard, use the red lead to measure the voltage at the following points.

TA Checkoff

Reporting

Plug your PIC back into the board. Take a picture of your board with your NetID visible. Take a nice clear picture so you can use it for reference later if something gets disconnected.

Task 2 - Downloading a Program using BullyCPP (10)

  Ensure that you have your USB-to-Serial cable plugged into the board and into your PC. When you press the reset button on your board, the LED should flicker rapidly for a couple of seconds. The same thing should happen when you start BullyCPP or when you program the PIC with the MCLR box checked. (If the MCLR box is not checked you can program the PIC by hitting the reset button and then quickly clicking Program while the LED is still flickering.)

Just this part, not the "Loading code from" or the three periods.

5. Click on the ‘Program!’ button in BullyCPP in order to download the program into your PIC. (Note if you have already built a project, you can click Open and find the hex file in the /dist/default/production/ directory of the project.)

6. Test the echo.c program functionality by clicking in the BullyCPP window and typing. You should see the characters you type echoed back, incremented by 1. (So if you type "1", you should see "2".)

7.  Modify the echo.c program to increment the character by 2 instead of by 1. (So if you type "1", you see "3".) Type ECE3724 and capture a screenshot of BullyCPP showing the results, e.g. G......

TA Checkoff

Task 3 – Current Measurement (40)

Chapter 7 lecture notes (p35-36) cover the difference between idle, doze, and sleep modes.

 

Note: You must actually connect this - you cannot hold the meter probes in your hand.

3.  Before turning power back on, let a TA check your connection. Plug board back in, turn power on, and verify that you are getting a valid current measurement (it should be somewhere in the range of 30-40 mA). You may have to restart BullyCPP.  Record the current measurement for the following modes: Normal operation, Idle, Sleep, Doze (/2), Doze (/4), Doze (/128). For sleep mode, you need to set your meter to measure microamps of current to get an accurate reading.

3a. (Distance students and those completing task without TA present only) Take a picture showing Doze (/4) current measurement. The picture should clearly show your multimeter reading as well as the location in the circuit where you are measuring. The value on your meter should match the value you submit in your table.

TA Checkoff

Your reset.c menu has an option for Doze (/4) mode, located between Doze (/128) and Doze (/2). You are correctly measuring the current in Doze (/4) mode.

Report (20)

Doze current (/N mode) = idle current + ((normal current – idle current) / N)

 %error = ((expected – measured) / expected) x 100% 

Grading

The report is worth 20 points for neatly and coherently presenting your information to a reader.

The tasks are worth 60 points. If your report indicates that you did not successfully complete or do not understand a task, you will lose credit, even if you performed it during the lab. The same is true for tasks performed during the prelab.

There are three tasks. The first two tasks are worth 10 points each. The third task is worth 40 points and has 4 subtasks, each worth 10 points (menu options, current prediction, current measurement table, error computation). 

The following non-exhaustive list of errors will result in losing full credit for a task/subtask:

The following non-exhaustive list of errors will result in losing partial credit for a task/subtask:

Lab reports that flagrantly violate submission policy (wrong lab, no screenshots, no title page, no text besides headings/labels, mostly blank, code pasted into pdf, paragraphs of lab text pasted in, extremely sloppy/unprofessional, missing code etc.) will not be accepted. The student will receive a zero for the lab and may resubmit with late penalty.

Adequate Calculations

I used Ohm's law to find the current in the circuit. [explanation of what you're calculating]


V = IR  [the formula]

120 = I (60) [numbers plugged into the formula]


I = 2 A [answer with units]

You do not need to show intermediate algebraic or mathematical steps. Do not write "[explanation of what you're calculating]" etc. next to your calculations.

Notes

Troubleshooting