User Tools

Site Tools


lab4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lab4 [2010/03/19 15:55] natalialab4 [2014/02/26 15:39] (current) allison
Line 1: Line 1:
 ==== Background ==== ==== Background ====
-=== Servo Motor === +=== BeagleBone PRUSS ===
-A Servo ((Based on http://www.seattlerobotics.org/guide/servos.html)) is a device that has an output shaft that can be positioned to a specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. As the coded signal changes, the angular position of the shaft changes. Servos are topically have 3 wires; one is for power (+5 volts), ground, and the yellow wire is the control wire.+
  
-The servo motor has control circuit and a potentiometer (a variable resistor also known as pot) that is connected to the output shaftThe pot allows the control circuitry to monitor the current angle of the servo motor. If the shaft is at the correct angle, then the motor shuts offIf the circuit finds that the angle is not correct, it will turn the motor the correct direction until the angle is correct. The output shaft of the servo is capable of traveling somewhere around 180 degrees. A normal servo is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear.+The BeagleBone Black  is low-cost, high-performance embedded platform for hobbyists and other usesIt is based upon a TI AM335x 1GHz ARM® Cortex-A8Features (from the  [[http://beagleboard.org/Products/BeagleBone+Black|product website]]) include:
  
-=== Infrared Range Finder === + 
-An Infrared Range Finder ((Based on http://www.societyofrobots.com/sensors_sharpirrange.shtml)works by the process of triangulationA pulse of infrared light is emitted and then reflected back (or not reflected at all). When the light returns it comes back at an angle that is dependent on the distance of the reflecting object. The infrared range finder receiver has special precision lens that transmits the reflected light onto an enclosed linear CCD array based on the triangulation angle. The CCD array then determines the angle and causes the rangefinder to then give a corresponding analog value to be read by external microcontroller.+ProcessorAM335x 1GHz ARM® Cortex-A8 
 + 
 +  * 512MB DDR3 RAM 
 +  * 2GB 8-bit eMMC on-board flash storage 
 +  * 3D graphics accelerator 
 +  * NEON floating-point accelerator 
 +  * 2x PRU 32-bit microcontrollers 
 + 
 +Connectivity 
 + 
 +  * USB client for power & communications 
 +  * USB host 
 +  * Ethernet 
 +  * HDMI 
 +  * 2x 46 pin headers 
 + 
 +The board comes pre-loaded with and Ångström Linux distirubtion and many other options can be considered for development and operating the deviceIt is a very powerful device with a large number of peripherals built in making it well-suited for a number of soft real-time applications. 
 + 
 +To support demanding hard-real time constraints or to off load processes from the main CPU, the processor chip includes two programmable real-time (PRUcores. These are reasonably high speed,  32-bit RISC cores where every instruction takes a deterministic 5 ns to complete. The devices have dedicated peripherals, access to the main system's peripherals, and ability to communicate with the main processor through interrupts, shared memory or DMA. 
 + 
 +These devices can be used to create programmable real-time peripherals and subsystems. The downside is that they are specialized and need low-level (assembly) programming (at least until someone develops a compilerand configuration. 
 + 
 + 
 +==== Goals ==== 
 +The goal is to experiment with the PRU devices and modify a small program to send a burst of bits at a given rate. The ARM processor should query the user for 32-bit hexadecimal number and transmit it out serially on a GPIO pin LSB first. The period of transmission for each bit in microseconds should also be sent by the ARM to the PRU. A small program based on the TI examples has been provided to show two methods of sharing memory with the PRU and ARM as well as for using the PRU timer (you can also rely on the 5 ns instruction timing but then become more sensitive to code changes). 
 + 
 +Not the TI examples are not production quality code but samples for demonstration. 
 + 
 + 
 +==== Prelab ==== 
 + 
 +Familiarize yourself with the sample code and with the PRU assembly language. We will not be writing much code so you do not need to become expert but should be able to read the sample program and make modest changes. 
 + 
 +Plan modifications to accomplish the goals above and prepare your code for the lab
  
 ==== Procedure ==== ==== Procedure ====
-The goal is to have a task that every 300 ms checks the distance of the IR Rangefinder and change the servo's position accordingly. 
-  * Open the lab stationary using CodeWarrior located in: 
-<code>LAB04/Micrium/Software/EvalBoards/Freescale/MC9S12DG256B/WytecDragon12/Metrowerks/Paged/ 
-   OS-Probe-LCD/OS-Probe-LCD.mcp</code> 
-  * Add a task that every 300 ms calls ir_range(ATD0DR0) 
-  * Connect the VCC and ground wires of Servo and IR Range Finder. Make sure you have +5 volts and have a common ground between the microprocessor and your power supply. 
-  * Connect PP7 pin to servo's input signal and PAD04 pin to R Range Finder output signal. 
-  * Double check your circuitry with your TA before powering up anything. 
-  * Recompile the project and transfer the binaries to Dragon12 board. {{:icon3.jpg}} 
  
-==== Reference Manuals ==== +  - Log on to the laboratory workstation 
-  * {{:hitec_hs422_servo_motor_manual.pdf}} +  - Using antistatic precautions, unpack the BBB. Plug in the USB connection (under the 4 LEDs by the power connector) to the BBB and the PC. This will provide power as well
-  * {{:sharp_gp2d12_ir_range_finder_manual.pdf}} +  - The BBB should be visible as a flash drive. Double click on Start.html 
-  * {{:an-1456_c_os-ii_dragon12_development_board_.pdf}} +  - MORE to be added hereterminal, scp, Bonescript to shut off LEDs 
-  * {{:an1004_the_10-minute_guide_to_rtos_.pdf}} +  Copy (scp) the example files to the BBB (the zip file can either be expanded on the PC or BBB). These files should be placed in the myapp directory under the example_apps directory (~/Desktop/am335x_pru_package-master/pru_sw/app_loader/example_apps) //Note to tech: should set up a proper user and so on for these boards// 
-  * {{:ucos-ii-refman.pdf}} +  - //cd// to the example_apps directory 
-  * {{:quickrefchart-color.pdf}} +  - Edit the DIRS file to add the source and paths to the files in myappThis will allow make to find and move the files appropriately 
-  * {{:task-state-diagram.pdf}} +  - run //make// to make the sample apps and the new app 
-  * {{:an1002_mutual_exclusion_semaphores_.pdf}} +  - //cd bin// 
-  * {{:an1005_inter-process_communication_.pdf}} +  //./pru_ex// to run the program 
-  * {{:an1007a_c_os-ii_and_event_flags_.pdf}} +  - Repeat steps 5 - 10 for your version of the program to build and debug your program //Note to techwould be good to get a debugger // 
-  * {{:ucos-ii-cfgman.pdf}} +  - When your program is working demonstrate it to the TA   
-  * {{:taskassignmentworksheet.pdf}} +  - Determine the maximum frequency (minimum bit period) that you can reliably send the data and confirm with an oscilloscope
-  * {{:lcd-manual.pdf}} +  - How could you improve the performance? How could the ARM/PRU programs be altered to send the data whenever a new signal was required (do not implement)? 
-  * {{:whatsnewsince-v200.pdf}} + 
-  * {{:releasenotes.pdf}}+ 
 +==== Submission and Evaluation ==== 
 + 
 +As well as you demonstration you should submit a brief lab reportFor the lab report submit your code, documenting the changes, and the answers to the questions above using the prism submit command.  
 + 
 + 
 + 
 + 
 + 
 +==== Reference Manuals and Links ==== 
 +  * {{:bbb_srm.pdf|Beaglebone Black Reference Manual}} 
 +  * [[http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions | Assembly Instructions]] 
 +  * [[http://elinux.org/PRUSSv2_Interrupt_Controller | Interrupt controller ]] 
 +  * [[http://processors.wiki.ti.com/index.php/PRU_Assembly_Reference_Guide | Assmebly Guide ]] 
  
 ==== Resources ==== ==== Resources ====
-  *{{:lab4.zip}}+  *{{:pru_lab.zip}}
lab4.1269014121.txt.gz · Last modified: 2010/03/19 15:55 by natalia

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki