by prof. g.r.shinde. sppu prescription 310254 programming laboratory-iii teaching scheme:...

33
Programming Lab III Assignments By Prof. G.R.Shinde

Upload: lesley-hunter

Post on 24-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1
  • By Prof. G.R.Shinde
  • Slide 2
  • SPPU Prescription 310254 Programming Laboratory-III Teaching Scheme: Examination Scheme: Practical: 4 Hrs/Week Practical: 50 Marks Oral: 50 Marks
  • Slide 3
  • FDP Objectives: To learn basics of Embedded Operating Systems Programming Conceptual understanding of Beagle Bone black (BBB)development board Programming on BBB
  • Slide 4
  • Assignments Group A (Mandatory) I. Develop an application using BeagleBone Black/ARM Cortex A5 development board to simulate the operations of LIFT. II. Develop an application using Beeglebone Black/ ARM Cortex A5 development board to simulate the working of signal lights.
  • Slide 5
  • Assignments Group B Any Six Assignments, All assignments to be covered in the Batch I. Write an application to and demonstrate the change in BeagleBoard/ARM Cortex A5 /Microprocessor /CPU frequency or square wave of programmable frequency. II. Develop a network based application by setting IP address on BeagleBoard/ARM Cortex A5. II. Implement a Parallel Quick Sort algorithm using NVIDIA GPU or equivalent ARM board. III. Implement a Parallel ODD-Even Sort algorithm using GPU or ARM equivalent.
  • Slide 6
  • Assignment Group C Advance Technology Assignments (Any One) I. Develop Robotics(stepper motor) Application using Beagle Board.
  • Slide 7
  • Beagle Bone Black(BBB) Development Board Produced by Texas Instruments in association with DigiKey and Newark element14 The BeagleBone is a development board with a Sitara ARM Cortex-A8 processor The processor clock to 1 GHz, and it adds HDMI and 4 GB of eMMC flash memory RAM 512 MB Supported OS: Linux, Android, Debian, windows Embedded CE, Threadx, QNX
  • Slide 8
  • Beagle Bone Black(BBB) Development Board contd..
  • Slide 9
  • Beagle Bone Black(BBB) Development Board Contd..
  • Slide 10
  • AM3358
  • Slide 11
  • Expansion Headers The expansion headers on the beagleBone Black are comprised of two 46 pin connectors. P8 and P9 All signals on the expansion headers are 3.3V
  • Slide 12
  • Expansion Headers and GPIO
  • Slide 13
  • GPIO Programming The pins on the expansion header have multiple functions You have to identify the pin number which you would like to use as a GPIO Any GPIO you come across would be referenced as GPIOM_N. Identify M,N. Use the formula below to find the corresponding reference number in the kernel: Reference number = M * 32 + N
  • Slide 14
  • GPIO Programming contd.. For example, if you would like to use pin 23 on P8 expansion header Pin 23 is GPIO1_4 Reference number = M * 32 + N Hence, pin 23 would be referenced num RN= 1 *32 + 4 gpio 36 in the kernel.
  • Slide 15
  • Light up the LED Connect Gnd and VCC to the external board Gnd: Pin 1,2 of GPIO P9 Pin 25 VCC: Pin 5 of GPIO p9 Pin 26
  • Slide 16
  • Light up the LED contd.. Minicom : interfacing text-based modem control and terminal emulation program Export the pin echo 36 > /sys/class/gpio/export we need to configure it in the output mode. Write the following commands in your terminal echo out > /sys/class/gpio/gpio36/direction Now, let us toggle the LED by typing the following commands in terminal (First one is for turning ON and latter for OFF): echo 1 > /sys/class/gpio/gpio36/value echo 0 > /sys/class/gpio/gpio36/value
  • Slide 17
  • Assignment 1 Develop an application using BeagleBone Black/ARM Cortex A5 development board to simulate the operations of LIFT
  • Slide 18
  • Assignment 1 Contd.. Program is written in CPP Every GPIO pin is considered as a file Simple file operations used fopen, fread, fwrite, fflush, fclose Compile the code using g++ The code will execute showing current position of the lift Pressing a button external OR internal to the lift will take the lift to respective floor Current position will be displayed inside / outside the lift
  • Slide 19
  • Assignment 1 Contd..
  • Slide 20
  • Assignment 1:GPIO Pins Configuration
  • Slide 21
  • Assignment 1 contd..
  • Slide 22
  • Assignment 2 Develop an application using BeagleBone Black/ ARM Cortex A5 development board to simulate the working of signal lights.
  • Slide 23
  • Assignment 2 contd.. Program is written in C Every GPIO pin is considered as a file Simple file operations used fopen, fread, fwrite, fflush, fclose Compile the code using gcc The code will execute showing current position of the Traffic allowed e.g. side 2 & 4 with left allowed (Green) After the preset time is elapsed Yellow will flicker The sides will be changed
  • Slide 24
  • Assignment 2:GPIO Pins Configuration
  • Slide 25
  • Assignment 2 contd..
  • Slide 26
  • Assignment 3 Develop Robotics(stepper motor) Application using Beagle Board.
  • Slide 27
  • Assignment 3 contd..
  • Slide 28
  • Slide 29
  • Assignment 3:GPIO Pins Configuration echo 30 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio30/direction echo 60 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio60/direction echo 31 > /sys/class/gpio/exportecho out > /sys/class/gpio/gpio31/direction echo 50 > /sys/class/gpio/exportecho out > /sys/class/gpio/gpio50/direction
  • Slide 30
  • Assignment 3 contd.. Program is written in C Every GPIO pin is considered as a file Simple file operations used fopen, fread, fwrite, fflush, fclose Compile the code using gcc The code will execute showing stepper motor revolution in anticlockwise or clockwise direction. Stepper motor executing in full step mode
  • Slide 31
  • Assignment 3 contd..
  • Slide 32
  • Slide 33