ECE3724 Microprocessors/lab page
From Ece
All labs are subject to the lab policy.
Contents |
Electronic lab submission
All lab reports must be submitted electronically via the Web a PDF file; use one of the free PDF converters or the department PCs (which have Acrobat Full) to create it. Other formats (Word .doc/.docx, PostScript, .zip, etc.) will not be accepted. Use the on-line lab submission form to submit your lab. You must know your ECE login name and password to access this page. Consult the FAQ about electronic submission of lab reports --- it will also tell you how to determine your ECE login/password -- if you have any problems.
For practicums, the reporting requirements are to include a screenshot of the console output of your code and your source code. Submit this report as experiment #12 (practicum 1) or #13 (practicum 2).
FAQs
For additional information on the operation of the lab, see the FAQ.
ECE Login Accounts
As stated above, you must know your ECE login to access some private files for the lab or to submit lab reports. ALL students, regardless of major, who take an ECE course (even one that is cross listed as a CS course like ECE 3724) receives an ECE login account. You must know this account name in order to electronically submit your lab reports or check your graded lab reports. If this is the FIRST time that you have taken an ECE course, the student worker in the front desk in the ECE main office (Simrall 216) will have an account slip that has the username/password. If the student worker does not have your slip, or you have forgotten your username/password, then you will need to see Mr. Michael Lane (1st floor, office in Computer Lab, Rm 139). It usually takes a week for new accounts to be added after the 1st class day of the semester.
If you have forgotten your password or you are having trouble logging in, there is a 'password reset' station in Room 216. It is also possible for you to get your Linux password out of sync with the Windows password (can log in via SSH but not via a Window's machine); use the 'password reset' station to reset your password.
Please consult the ECE help desk for instructions on how to log into ECE Unix machines and how to access files stored there; you will need to be able to do this for the hardware labs in order to run the C compiler.
TA Assignments
- Ranjit Amgai: ra372@msstate.edu
- Office: Micro Lab (room no. 329)
Office Hours (other times may be available upon request)
| Day | Time |
| R | 12:00-1:00 |
- Krishna Turlapati : kvt11@msstate.edu
- Office: Micro Lab (room no 329)
Office Hours (other times may be available upon request)
| Day | Time |
| M | 2:00-3:00 |
Section Timings and Assignment
| Section | Day | Timings | TA |
| 3 | T | 12.30-3.20 | Ranjit |
| 7 | W | 3.00-5.50 | Ranjit |
| 4 | T | 3:30-6.20 | Krishna |
| 5 | T | 6.30-9.20 | Krishna |
| 8 | R | 3.30-6.20 | Krishna |
Lab Problems
Common C Compilation Problems
- The linker is reporting an undefined reference to a function. You have either misspelled the function name, or did not include the C/Header files that contained the function (e.g. common/pic24_timer.c, include/pic24_timer.h if the undefined function is a timer function).
Common Assembly language Problems
- Do not use the variable names as 'a' or 'b' - they are reserved names, 40 bit accumulators used by DSP instructions. Using those will give errors during assembly.
- If you have confusions on the usage of WREG and W0, refer to programming reference manual section 3 for the instruction set of PIC24.
Common Hardware Problems
- Your processor is reseting and reporting a WDT timeout with an error message mentioning an I2C function. This means that your I2C device is not responding, perhaps you have used the wrong I2C address to talk to it or your I2C bus is miswired (do you have your external pullup resistors on the I2C bus??).
- Your processor is reseting and reporting an unhandled interrupt. Look at the priority level that is printed for the unhandled interrupt - if it is 7 or lower, then you have enabled an interrupt, and do not have an ISR declared for the interrupt. If it is higher than 7, then it is a trap error and the printed priority level identifies the particular trap (see the textbook). This could be for a variety of reasons - you will get an address trap error (priority 0x0D = 13) if you leave the while(1){} loop out of your code and you fall through main and main does not have a return (if you return from main, a software reset is generated).
Debugging Checklists
Data Sheets
You will find these data sheets useful during these semester. These are used in either labs or homeworks.
- PIC 33/30/24 Programmers Reference Manual
- PIC24 Family Reference Manual
- PIC24HJ32GP202-204
- I2C Bus specification v2.1
- MAXIM 548A SPI 8-bit DAC
- Microchip 24LC515 Serial EEPROM
- LM60 Temp Sensor
- LM2940 5 V low-dropout regulator
- LM2937-3.3 3.3 V low-dropout regulator
- TI SN754410 Motor Driver
- TTL 232R USB to TTL level serial cable
Parts Kit and Parts Kit Replacement, FUSES!!
During this lab, you will build up a single board microprocessor system based on the PIC24HJ32GP202. The first hardware experiment is #6, and you will need to purchase the parts kit ($65) from the TA at least one week before then, and preferably two weeks. You will also need the protoboard that you used in Digital Devices (ECE 3714). This protoboard will be needed on a continuing basis starting with Experiment #6, with the circuit remaining on the protoboard between experiments. If you are taking another lab course that requires a protoboard, then you will need to purchase a second protoboard.
You may purchase a used part kit from a previous semester from a student, but it is your responsibility to ensure that it is complete and the parts functioning. However, you may not use a pre-assembled protoboard. If you show up for the first hardware lab with more connections than needed for that lab, you will be asked by the TA to remove those connections. Part of the learning experience of this lab is to bring a microprocessor system to life from scratch, and using a pre-assembled protoboard from a previous semester defeats this purpose.
FUSES!!! -- by far the most common part that needs replacing are fuses. The fuses in your parts kit are axial fuses that cost $0.50 and are purchased from Digi-key. Many of you may decide to operate without a fuse if you blow the ones that you have. This is risky, as you may blow your voltage regulator and wall transformer, and end up costing you far more money than what a replacement fuse would have cost.
Breadboards
The parts kit does not contain a breadboard; you will need an unpowered breadboard that has at least two rows on it (the typical breadboards sold by RadioShack are too small; some also don't connect the bus rows together, as shown in the image to the right). One breadboard source is our student IEEE chapter - e-mail them to purchase one (contains a wiring kit as well). The breadboard+wiring kit is $30. Many online stores carry breadboards also - Electronix Express carries some breadboards and wiring kits that are appropriate.
Practicum advice
- The practicum is open everything, except your neighbor.
- To get started on the practicum, use a book project that has some of the features you may think you need (I2C, timer, whatever). Do NOT use one of your own projects, as you may have left it an unuseable state or it may be modified in an incorrect manner. Save the book project under a new name, compile it, and verify that it downloads to your board. Then start modifying the project to add capability that you may need. If you need timer functions, you have to add the appropriate files to the project such as common/pic24_timer.c and include/pic24_timer.h (all library .c files are in the common/ directory, all .h files are in the include/ directory).
- You will find yourself copying sections of code from other files to solve your problem. When copying the code, you must understand what the code does. For example, if you copy a configTimer2() function from some other file, it may or may not enable the timer interrupt - you need to know if you need the timer interrupt enabled or not, and modify the function accordingly. If you enable an interrupt, then you need to also include the ISR for that interrupt! Also, in the main() code you need to call the configuration functions for whatever modules you are using, such as configTimer2() - these should be called after the configBasic() function.
- When trying to solve your problem, write a list of functionality that you need - Timer2? Timer Interrupt? I2C? SPI? ADC? If you need an external chip, like your EEPROM or DAC, use the book project that tests the functionality of this chip so that you know this is working correctly before you start modifying the program for your own needs.
- If you use 'printf', you need to have #include <stdio.h> at the top of the file.
- When testing your code, if you get an 'unhandled interrupt' error, this means that you have enabled an interrupt, but did not provide an ISR function.
- TAs will help you with C syntax errors, project build errors, etc. but they will not help you construct the logic for the program, that is up to you. You can ask the TA questions about interpretation of the problem, not about how to actually accomplish the task.




