Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multi-threaded projects Services and Drivers Alternate ways of doing Labs 1, 2, 3 and 4.

Similar presentations


Presentation on theme: "Multi-threaded projects Services and Drivers Alternate ways of doing Labs 1, 2, 3 and 4."— Presentation transcript:

1 Multi-threaded projects Services and Drivers Alternate ways of doing Labs 1, 2, 3 and 4.

2 ENCM415 – “Ideal” final project zPlans for a “complete” Lab. 4 yRun the audio input and output (Lab. 0) yReading the light sensor (Lab. 2) yReading the thermal sensor (Lab. 3) yDisplaying values in the Flash LED (Lab. 1) yDisplaying values on the external LCD screen over the SPI interface (Lab. 4) yUsing interrupts (Labs. 2, 3 and 4) yControl that robot car (Lab. 17) and plane (Lab. 22000) yDo-able with knowledge we already have ySpend 40 hours to complete – is there a simpler way 12/7/20152 / 28

3 A simpler way zSome teams prefer to use development approaches essentially equivalent to what we have done in Labs 1, 2 and 3 zBecomes easier with practice, but does not come easy. zOther teams are using “prepared” code from the manufacturer. yThreads yServices and Drivers yReliability issues “forcing” manufacturers to ensure “prepared code” works well 12/7/20153 / 28

4 Doing Lab. 4 project in industry zWe might not develop a final “.dxe” executable zWe might get each task to run by its self zThen add each task as a “thread” inside a multi- threaded operating system. zThe processor (using core timer interrupts) would automatically switch between tasks as each data became available zEasier to integrate new Lab. with the previous labs z Straight forward to do with Analog Devices VDK – Visual DSP Kernel, uCLinux, uC-OS etc etc 12/7/20154 / 28

5 12/7/2015 Initialization Thread

6 12/7/20156 / 45 Main Thread – example Each Lab. 4 task has its own thread function which replaces the sleep While task “pends” (wait till ready), it automatically gets switched out of the processor

7 12/7/20157 / 45 VDK History shows tasks switched out when they have to wait Concept of task priority

8 Would VDK make 415 easier zNO, using VDK would make 415 harder as you have another interface to learn yHow do you debug a function (LED display) when the function works with one thread and not with another? yAnswer – with great difficulty zBut learning VDK would make the ENCM491 (real time) and ENCM515 (DSP architectures) easier to learn as you could cut 6 weeks out of each class because of the extra 6 weeks needed in ENCM415 (a saving of 6 weeks). 12/7/20158 / 28

9 Would threads make industry easier? zPROBABLY NOT, using threads the first time makes the project harder, you have another interface to learn zHowever “PROVIDED” the real-time operating system is “inexpensive” and “reliable” you have a common interface that many developers on your team can all use. Product is shorter time and lower cost zHowever, many developers don’t want to use “commercial” OS as “too slow”, “too difficult to customize” for the product. They would rather use the techniques you have used in ENCM415. zAlso, using threads only changes about 20% of the code you have to develop. Basically all you have is better “while loops” and “easier semaphores” and”messaging” 12/7/20159 / 28

10 System Services zMuch of this presentation is based on Analog Devices on-line Blackfin training by David Lannigan at my.analog.com/onlinetraining/Static/BOLDList.html There are audio and video presentations on Blackfin® Device Drivers (May 2006) Blackfin System Services (Jan. 2006) Introduction to VDK (Sept. 2006) It is recommended that users have some understanding of the Blackfin architecture, basic knowledge of software terminology and experience in embedded systems. Meaning have taken ENCM415 12/7/201510 / 28

11 12/7/201511 / 28

12 Would system services help in ENCM415? zFor Labs. 1, 2 and 3 – No yYou have to know the sort of thing that is supposed to happen with the hardware in some very simple cases (Flash memory, GPIO, LEDs) yHow do you start an interrupt? yHow do you build an interrupt service routine? yHow can you build a fast ISR in assembly code? 12/7/201512 / 28

13 Would system services help in Lab. 4? zSystem services provide you all the functions that you developed in Labs. 1, 2 and 3 for GPIO etc zIf the services are simple to learn how to use for GPIO control, then perhaps we can quickly get it to work for the SPI interface. zAnalog Devices has just recently updated their “services” software, so using services has potential 12/7/201513 / 28

14 Proposed Lab. 4 – Demo-based zDemonstrate in class using services to do Labs. 1 and 2 z50% -- 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” z30% -- Demonstrate Lab. 4 Temperature and Light sensor using – You will need to add a modified “CalculateTemperature( )” from Lab. 3 and the PF9 service z20% -- Add a “SPI SERVICE” to transfer the commands from the Blackfin to the LCD 12/7/201514 / 28

15 12/7/201515 / 28 All true, the third time you try using it However, that’s what you do in an industrial environment

16 12/7/201516 / 28 All the non-hardware stuff from Lab. 1, 2 and 3 stays the same VDK All the hardware stuff from Lab. 1, 2 and 3 – “better?”

17 12/7/201517 / 28

18 12/7/201518 / 28 Powerful – once we know how to use it

19 Lots of new syntax to learn 12/7/201519 / 28

20 Something related to Lab. 2 12/7/201520 / 28

21 Some of these functions are recognizable 12/7/201521 / 28

22 12/7/201522 / 28

23 Interrupt handler hidden 12/7/201523 / 28

24 But there is much to learn 12/7/201524 / 28

25 Service for fast memory transfer 12/7/201525 / 28

26 12/7/201526 / 28

27 Sounds like Lab. 2 12/7/201527 / 28

28 12/7/201528 / 28

29 Many functions recognizable 12/7/201529 / 28

30 12/7/201530 / 28

31 Perhaps try for Lab. 4 12/7/201531 / 28


Download ppt "Multi-threaded projects Services and Drivers Alternate ways of doing Labs 1, 2, 3 and 4."

Similar presentations


Ads by Google