Practicum
Updated with Spring 2024 information!
Basics
The practicum will be held in the Micro Lab (Simrall 329), April 16-18, during your registered lab section.
If you are a distance student, you must take the practicum April 16-18, during one of the five lab sessions. You may do so via video. Contact prl83@msstate.edu at least a day prior to the session you wish to attend in order to make arrangements.
At the beginning of the practicum, you will be given a sheet of paper with three tasks on it.
When you complete a task, raise your hand, and the TAs will come over to check you off by initialing your paper and marking the time of completion.
At the end of the practicum, submit your source code and screenshot of output (BullyCPP and/or scope waveform) for each task, and turn in your paper.
Rules and Regulations
Without advance permission from your professor, you will not be allowed to take the practicum at a different time. If you do not show up for the practicum, you will receive a grade of zero.
Per MSU Academic Operating Policy 10.08, you MUST turn your cell phone off – not on vibrate, but completely off. Absolutely NO cheating is allowed. If you are caught in the attempt of, the act of, or the past action of academic dishonesty, you will receive the maximum punishment allowed by University policy. Specifically, you may not share or discuss the questions or your solutions with any MSU student.
You must use your own board (with your Net ID / name written on it in permanent marker).
You should bring your board already wired up, your parts kit, wires, tools, and multimeter. If you need any of the following parts during the practicum, raise your hand and one will be provided free of charge by the TA: resistor, capacitor, fuse, voltage regulator, LED, button, switch, potentiometer. (In-person students only.)
At the end of the practicum, submit a screenshot of your console output and/or scope waveform for each task, and each of your source code files. Submit on Canvas to the Assignment "Lab Test I (Practicum I)" in the "ECE 3724 Micros-01" course. Submit all three source code files even if you did not receive credit for a task. Name your files task1.c, task2.c, and task3.c. Put your name on each. You won't be scored on the quality of your code or comments. Hand in your paper. Submit code, outputs, and paper before time expires and before leaving the room, or you will receive a grade of zero.
There is no partial credit for a task - it is either 33% or 0%. You get 1% free. Thus there are 5 possible grades: 100% (checked off for 3 tasks), 67% (checked off for 2 tasks), 34% (checked off for 1 task), 1% (attended practicum, checked off for 0 tasks), 0% (did not take practicum, didn't turn in paper/output/source code, bit proctor, etc.)
The TAs can answer questions about the interpretation of problems ("So is it supposed to blink when we press the button or when we press it and release it?") or definition of terms ("Does 'press a key' mean a key on my computer?"). They cannot answer questions about how to accomplish a task, debug your code, operate the scope, troubleshoot your board, or fix your computer.
The practicum is open everything, except your neighbor. You may:
look at the lecture notes or books
search the web
use generative AI to write your code
use old labs, pic24_code_examples, lab9, etc as a starting point
write your own code in advance
You may not:
talk to other students in the room
communicate with anyone outside the room via email, text, chat app, messenger pigeon, etc
post to websites seeking assistance
bring in code written for you by somebody else
discuss the questions/answers with other students
As the lab will be in use, there will be no checkoffs or TA assistance during lab time the week of the practicum.
The practicum will not cover EEPROM, SPI, I2C, ADC, DAC or temperature sensing. You will not need your LC512 EEPROM, LM60 Temperature Sensor, or MAX548 DAC. The practicum will cover topics of GPIO, timers, watchdog timers, and interrupts.
You can do the tasks in any order. Raise your hand when you have completed a task.
Practicum Hints
Best way to complete a task:
Start by opening an MPLab project that seems like a good starting point for the task you have to perform.
Right click the project and select Set as Main Project.
Build the project, upload it to your board and verify that it is working.
Open the C file you are going to modify. Save it with a new filename. Use Save As - do not overwrite it.
Right click on Source Files in the Projects window and select Add Existing Item. Find your new C file and add it.
Right click the old C file and choose Exclude from Current Configuration
If you started with ledsw1, you should have something that looks like this:
8. Build the project again and upload to your board. It should work the same as the original project.
9. Write your code in the new file.
10. For each task, repeat this process anew. DON'T OVERWRITE THE SAME C FILE THREE TIMES.
Other Tips
If you're having problems with your EEPROM, remove it and all associated wiring from your board before you arrive.
Open all projects from inside a subfolder of C:\ece3724\pic24_code_examples, not, for example, by copying a project into a folder like C:\Users\Bob Student\Documents and Settings\Micro\Practicum\. The projects require header code that is only in the pic24_code_examples folder.
Do not use OneDrive.
You should have proficiency in the following skills:
Make a state machine
Output text to BullyCPP
Read characters input to BullyCPP
Output different-shaped square waves to the scope
Connect an LED, switch, or button to the PIC
Turn an LED on and off
Blink an LED at different rates
Take input from a pushbutton or switch
Write C code to do basic arithmetic and counting
If you have a sudden and inexplicable failure e.g. a program worked fine but now you get software resets or you can't upload programs to your board at all, refer to Lab 6. Check that you have capacitors on both pin 19 (1 uF, says 105) and pin 20 (10 uf, says 106), and that they are wired as in the photos.
If you use 'printf', you need to have #include <stdio.h> at the top of the file.
Practice the tasks of the sample practicum below. Don't just run the code in MPLab and call it good; actually upload each project to your board and check that everything works. Use a scope to check your waveform in sample Task 3. No solutions are provided - ask a TA if you are stuck.
Another good way to practice would be to do other cases from Lab 7. Or you and a buddy could make up your own tasks and race to see who can complete them first!
Fall 2023 mean practicum score: 62.1. Grade distribution: 100 x 20, 67 x 16, 34 x 10, 1 x 5, 0 x 4.
Sample Practicum
TASK 1
Write code that reads a pushbutton – for each press and release of the button, the code should print the message "Button pressed and released: n" where 'n' is the count of press/release actions since the last processor reset. Sample output is shown below for three presses/releases of the button. You can use any pin you wish on the PIC24 for the pushbutton.
Button pressed and released: 1
Button pressed and released: 2
Button pressed and released: 3
Use a printf statement in your C code like the following to print out the number of presses (this assumes that the variable used to count the button press/releases is named u16_count).
printf("Button pressed and released: %d\n ", u16_count);
TASK 2
Write code that reads a number from the keyboard and blinks an LED five times at one of three different rates (slow, fast, fastest) depending on the number entered. You choose the meanings of slow, fast, fastest in terms of blink speed, but they should be visibly different. You can use software delays for blink speeds. Sample output:
Enter a number (1: slow, 2: fast, 3: fastest): 1
Blinking slowly.
Enter a number (1: slow, 2: fast, 3: fastest): 2
Blinking fast
Enter a number (1: slow, 2: fast, 3: fastest): 3
Blinking fastest
TASK 3
Write code that generates exactly 10 cycles of a 5 KHz square wave from an output pin of your choosing when a character is entered from the serial port. You must use a timer for accurate timing and you must demonstrate your waveform to the TA using the VirtualBench (either the scope or the logic analyzer). You need to be within ±5% of the target frequency (4750 Hz to 5250 Hz). You CANNOT use software delay macros in your code – you must use a hardware timer approach in generating these waveforms (the TA will ask to see your code to verify this). There are multiple methods for accomplishing this task. Sample BullyCPP output:
Press any key:
10 cycles generated!
Press any key:
10 cycles generated!
Press any key:
10 cycles generated!