$29.99
ELEC 3300
LAB 5: ADC FUNCTIONS
A. OBJECTIVE:
1. To familiarize yourself with the MINI-V3 Development Board.
2. To understand programming of the ADC function.
B. PRE-LAB ASSIGNMENT:
1. Study the information about MINI-V3 Development Board from the course website.
2. Study the ADC Section of the Reference Manual of STM32.
3. Study the Tutorial for LAB5.
C. LAB SETUP DETAILS
1. Connect the Fire Debugger according to the information about Fire debugger. Make sure that the Green LED of the Fire Debugger is ON.
2. Follow the Tutorial for CubeMX, and information on Tutorial for LAB5 generate a Project for LAB5 Task 1 to Task 4 using CubeMX. Please be reminded to set the external clock and debugger interface in CubeMX
D. EXPERIMENT
In this LAB, there are 4 tasks.
Task 1 – Display Single ADC Conversion result of the external VR on LCD when K2 is pressed.
Task 2 – Display Continuous Conversion ADC results of the external VR on LCD.
Task 3 – LDR Measurements.
Task 4 – Light Intensity System.
E. PROCEDURES
This LAB is an extension from LAB2 and LAB3, it will use the LCD to display the ADC information and K2 for input. You need to refer to Tutorial for LAB2 and LAB3 for corresponding information.
Task 1 – Display Single ADC Conversion result of the external VR on LCD when K2 is pressed.
You need to write a program to display an ADC conversion result in both decimal and hex.
The converted value will be updated when K2 is pressed.
Task 2 – Display Continuous Conversion ADC results of the external VR on LCD.
Change your program such that the LCD will be able to update the result at a certain period without pressing K2.
Task 3 – LDR Measurements.
Step 1: Replace your Variable Resistor circuit with a LDR circuit.
Channel input depends on your Student ID
Figure 1: Light Dependent Resistor Circuit
Step 3: Run your program, observe LCD display and the value shown on Display
Step 4: Cover the Light Sensor by hand.
What is the value shown on LCD Display? _______________________3200 _____
Step 5: Use some light to shine on the Light Sensor
What is the value shown on LCD Display? _______________________no _____
Step 6: Stop the your program and swap the position of the sensors. i.e.
Channel input depends on your Student ID
Figure 2: Swapped LDR Circuit
Step 7: Run your program, observe LCD display and the value shown on Display
Step 8: Observe LCD display and the value shown on Display
Step 9: Cover the Light Sensor by hand.
What is the value shown on LCD Display? _______________________920 _____
Step 10: Use some light to shine on the Light Sensor
What is the value shown on LCD Display? _______________________3770 _____
What is the relationship between the intensity to the resistance of LDR?
__if_____________________decr____e_a_s__e_________resis_t_a__n__ce_____in___cr_e__a______se ________
intensity
Task 4 – Light Intensity System.
Using your knowledge from Task 3 and LAB2, together with the RGB LED on MINI V3 Development Board, implement a five-level Light Intensity System such that..
Light Intensity
Very Dark Dark Medium Bright Very Bright
RGB LED
Color WHITE RED GREEN BLUE OFF
You can use either Figure 1 or Figure 2 on Page 2 of the LAB sheet to implement the system, as long as it follows above requirement.
Use fig 2
NO for 1400 how 2600 bro l l l l l 1
OFF WHITE bright c y dark