Upload
micaela-gentile
View
218
Download
0
Tags:
Embed Size (px)
Citation preview
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
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
04/11/23 3 / 28
04/11/23 4 / 28
All true, the third timeyou try using it
However, that’s what you do inan industrial environment
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?”
04/11/23 6 / 28
?????
Also need to add the drivers
Step 1 – Look at main( )
04/11/23 7 / 28
Lots of concepts tounderstand
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;
No real difference from before – still need to know manual details AND more about services
04/11/23 9 / 28
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
04/11/23
SPI and LCD , Copyright M. Smith, ECE, University of
Calgary, Canada 11 / 30
LCD Connection information
13 key connections
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
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
04/11/23 14 / 28
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
04/11/23 16 / 28
SPI – DMA set up
04/11/23 17 / 28
Alreadycovered inOctoberLectureNotes
OPEN DEVICE
SET DEVICE MMR
04/11/23 18 / 28
04/11/23 19 / 28
04/11/23 20 / 28
04/11/23 21 / 28
04/11/23 22 / 28
Describing a data buffer
04/11/23 23 / 28
Code to init LCD
04/11/23 24 / 28
Code for other commandsSame as previous lectures, except function name
04/11/23 25 / 28
Code to display temperature
04/11/23 26 / 28
Code to cause Array DMA
04/11/23 27 / 28
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
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