All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran /...
-
Upload
micaela-gentile -
Category
Documents
-
view
217 -
download
0
Transcript of All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran /...
![Page 1: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/1.jpg)
All of Lab. 4 using ServicesAudio, LED, GPIO, LightSensor, Thermal Sensors, LCD
Code by A. Tran / M. SmithTalk by M. Smith with slides from D. Lannigan Analog Devices BOLD product
![Page 2: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/2.jpg)
Complete Lab. 4
There is already enough information available to code the SPI (see last week of October Lectures)
However, we are going to compare the effort to get SPI going via services
Everything has to get changed to services
04/11/23 2 / 28
![Page 3: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/3.jpg)
04/11/23 3 / 28
![Page 4: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/4.jpg)
04/11/23 4 / 28
All true, the third timeyou try using it
However, that’s what you do inan industrial environment
![Page 5: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/5.jpg)
04/11/23 5 / 28
All the non-hardwarestuff from Lab. 1, 2 and3 stays the same
VDK
All the hardwarestuff from Lab. 1, 2 and3 – “better?”
![Page 6: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/6.jpg)
04/11/23 6 / 28
?????
Also need to add the drivers
![Page 7: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/7.jpg)
Step 1 – Look at main( )
04/11/23 7 / 28
Lots of concepts tounderstand
![Page 8: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/8.jpg)
Look at Power Services Init
04/11/23 8 / 28
We need to learn what new names to call registersLook up the required information in the Hardware ManualPlace register names and values into a null terminate arrayCall a function (Power Equivalent of GPIO) that parses the arrayEssentially P0 = first thing, R0 = second thing, [P0] = R0; ssync;
![Page 9: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/9.jpg)
No real difference from before – still need to know manual details AND more about services
04/11/23 9 / 28
![Page 10: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/10.jpg)
What needs to be done with SPI
We need to set up LCD hardware to SPI interface – see previous lecture notes
04/11/23 10 / 28
![Page 11: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/11.jpg)
04/11/23
SPI and LCD , Copyright M. Smith, ECE, University of
Calgary, Canada 11 / 30
LCD Connection information
13 key connections
![Page 12: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/12.jpg)
04/11/23
SPI and LCD , Copyright M. Smith, ECE, University of
Calgary, Canada 12 / 30
Data Bus Connectionsfor LCD screen
From CJ7 connector on Blackfin interfaceBQ0BQ1BQ2BQ3BQ4BQ5BQ6BQ7
![Page 13: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/13.jpg)
What needs to be done with SPI
We need to set up LCD hardware to SPI interface – see previous lecture notes
Then we need to set up an array of commands and data to control LCD hardware – see previous lecture notes
04/11/23 13 / 28
![Page 14: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/14.jpg)
04/11/23 14 / 28
![Page 15: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/15.jpg)
What needs to be done with SPI
We need to set up LCD hardware to SPI interface – see previous lecture notes
Then we need to set up an array of commands and data to control LCD hardware – see previous lecture notes
Then we need to set up the SPI services array with the required SPI settings – see previous lecture notes
Then we need to set up a DMA channel between the array and SPI registers – EH?
Now customize SPI service for LCD speed – EH?Write all code to translate array into LCD
commands – EH?
04/11/23 15 / 28
![Page 16: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/16.jpg)
04/11/23 16 / 28
![Page 17: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/17.jpg)
SPI – DMA set up
04/11/23 17 / 28
Alreadycovered inOctoberLectureNotes
OPEN DEVICE
SET DEVICE MMR
![Page 18: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/18.jpg)
04/11/23 18 / 28
![Page 19: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/19.jpg)
04/11/23 19 / 28
![Page 20: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/20.jpg)
04/11/23 20 / 28
![Page 21: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/21.jpg)
04/11/23 21 / 28
![Page 22: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/22.jpg)
04/11/23 22 / 28
![Page 23: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/23.jpg)
Describing a data buffer
04/11/23 23 / 28
![Page 24: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/24.jpg)
Code to init LCD
04/11/23 24 / 28
![Page 25: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/25.jpg)
Code for other commandsSame as previous lectures, except function name
04/11/23 25 / 28
![Page 26: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/26.jpg)
Code to display temperature
04/11/23 26 / 28
![Page 27: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/27.jpg)
Code to cause Array DMA
04/11/23 27 / 28
![Page 28: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/28.jpg)
Proposed Lab. 4 – Demo-based
Demonstrate in class using services to do Labs. 1 and 2
50% -- Connect LCD screen to logic lab and switches. Place commands in an array. Manually (using switches) send commands to LCD screen to show “Happy 415 Christmas”
30% -- Demonstrate Lab. 4 Temperature and Light sensor using – You will need to add a modified “CalculateTemperature( )” from Lab. 3 and the PF9 service
20% -- Add a “SPI SERVICE” to transfer the commands from the Blackfin to the LCD
04/11/23 28 / 28
![Page 29: All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran / M. Smith Talk by M. Smith with slides from D. Lannigan.](https://reader035.fdocuments.us/reader035/viewer/2022062404/551a0e7c550346a4248b496c/html5/thumbnails/29.jpg)
Lab. 4 with SPI
You can download the services code, change the array and then go with it.
Design time – around a month across several years 60 hours of coding (LCD functionality) Albert’s time – 30 hours of straight coding (Services)
– Albert had Texas Instruments services and drivers experience during 16 month internship
It was easier the old way this time, but easier this way next time
Last year we had product tests, this year we don’t. Debugging the services and drivers code – no idea
04/11/23 29 / 28