All of Lab. 4 using Services Audio, LED, GPIO, LightSensor, Thermal Sensors, LCD Code by A. Tran /...

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 Analog Devices BOLD product

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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