Programming Lab III Assignments By Prof. G.R.Shinde
SPPU Prescription 310254 Programming Laboratory-III Teaching Scheme: Examination Scheme: Practical: 4 Hrs/Week Practical: 50 Marks Oral: 50 Marks
FDP Objectives: To learn basics of Embedded Operating Systems Programming Conceptual understanding of Beagle Bone black (BBB)development board Programming on BBB
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.
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.
Assignment Group C Advance Technology Assignments (Any One) I. Develop Robotics(stepper motor) Application using Beagle Board.
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
Beagle Bone Black(BBB) Development Board contd..
Beagle Bone Black(BBB) Development Board Contd..
AM3358
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
Expansion Headers and GPIO
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
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.
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
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
Assignment 1 Develop an application using BeagleBone Black/ARM Cortex A5 development board to simulate the operations of LIFT
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
Assignment 1 Contd..
Assignment 1:GPIO Pins Configuration
Assignment 1 contd..
Assignment 2 Develop an application using BeagleBone Black/ ARM Cortex A5 development board to simulate the working of signal lights.
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
Assignment 2:GPIO Pins Configuration
Assignment 2 contd..
Assignment 3 Develop Robotics(stepper motor) Application using Beagle Board.
Assignment 3 contd..
Assignment 3 contd..
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/export echo out > /sys/class/gpio/gpio31/direction echo 50 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio50/direction
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
Assignment 3 contd..
Thank you for your kind attention !!