Starting from:
$30

$24

Laboratory Exercise #5 Analog-to-Digital Converter Solution

1 Introduction




In this lab you will write a task to read the Analog-to-Digital (ADC) and display the results on the OLED. You will use the FreeRTOS framework from Lab #4.




When accessing referenced documents, copy the URL and paste into your browser.




Some browser PDF plugins cannot handle URLs spanning multiple lines.




1.1 Program Modifications




Make a copy of the FreeRTOS_LM3S1968 project from Lab #4 and rename appropriately, e.g. FreeRTOS_LM3S1968_ADC. You will add your task to this copy as described below.




1.2 ADC Background




The operation of the Analog-to-Digital converter was described in class. The steps to program the ADC and sample the analog input were discussed in class and a sample task was provided. Additional information on the ADC hardware and DriverLib software are at:




http://www.ittc.ku.edu/~gminden/Embedded_Systems/PDFs/TI_Stellaris_LM3S1968 _EvalBoard.pdf,




http://www.ittc.ku.edu/~gminden/Embedded_Systems/PDFs/TI_Stellaris_LM3S1968. pdf, and




http://www.ittc.ku.edu/~gminden/Embedded_Systems/PDFs/TI_Stellaris_DriverLib.p df.




Information on FreeRTOS APIs is at:




http://www.freertos.org




You should read those documents.




1.3 Connector Pin-outs




With the LM3S1968 evaluation board receptacle facing you, we will use twenty pins on the left-hand side to connect to off-board circuits. These pins are:




























EECS 388 Laboratory #5
1
 
Version C







Pin
Signal


Notes
66
ADC<7












65
Gnd












64
ADC<5












63
ADC<6












62
ADC<0


Used for potentiometer


analog input. See






example.
61
ADC<4












60
ADC<2












59
ADC<1












58
Gnd












57
ADC<3










56
PD<0/IDX<0!










55
Gnd












54
PD<2/U1RX!
Used to discharge
capacitor.






53
PD<1/PWM<1!










52
PG<3










51
PD<3/U1Tx!








50
PG<1/U2Tx!








49
PG<2/PWM<0!










48
PC<7/C2!
-








47
PG<0/U2Rx!
















These signals and pin numbers were extracted from the schematics of the




LM3S1968 evaluation board available in:




http://www.ittc.ku.edu/~gminden/Embedded_Systems/PDFs/TI_Stellaris_LM3S1968 _EvalBoard.pdf.




1.4 Off-board Circuit




The initial off-board circuit will be a potentiometer. The circuit is:







EECS 388 Laboratory #5
2
 
Version C





































Vdd = 3.3 VDC. As you turn the potentiometer your ADC readings should vary between 0 and 1,023.




A description of the expansion board is at:




http://www.ittc.ku.edu/~gminden/Embedded_Systems/Laboratory/EECS_388_Sensor Orientation_B70224.pdf.




1.5 New Task




Write a new task to sample ADC<0 (ADC channel 0) and display the measurement value on the OLED. The task steps are:




Initialize ADC0, Sequencer 0, to sample ADC channel 0 under processor control (e.g. Processor_Trigger) (See lecture slides.).



Insure the OLED display is initialized.



Sample ADC0/Ch0 once per second.



Write the measurement value to the OLED display using the format: "ADC: xxxx" starting at column 0 and an appropriate row.



Repeat steps 3 and 4 once per second.














































































EECS 388 Laboratory #5
3
 
Version C



More products