ユニバーシティ・プログラムのナレッジベース

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

University Programs Knowledge Base

ディスカッション

ソート順:
On September 14-15, 2015, The Freescale Cup Worldwide Finals will be held at the Fraunhofer Institute of Integrated Circuits (Fraunhofer IIS) in Erlangen, Germany You can follow along and see the regional champion teams from South Korea, China, India, Taiwan, Malaysia, Mexico, Brazil, USA and Switzerland train and compete for the World Title. Agenda of the event covered by the LiveCast is (all times are Central Europe Time): September 14th 14:00 - 15:00 Opening Ceremony 15:00 - 17:30 Training Session 17:30 - 18:00 High Schools and Innovation Challenge Demonstrations September 15th 9:00 - 13:00 Training Session 13:00 - 14:30 Technical Inspection and preparation for the Finals Race 14:30 - 15:00 Finals Race 15:00 - 15:45 Preparation for the Awards 15:45 - 17:30 Awards Ceremony Download and print the attached poster with the embedded QR-Code for posting the link of the LiveCast Direct LiveCast URL is http://www2.iis.fraunhofer.de/freescale
記事全体を表示
                                                       Robô Explorador      O sistema de investigação feita por robôs através da análise de imagens capturadas está sendo utilizado nas pequenas e grandes empresas. Através da análise de imagens, é possível verificar se um produto está com defeito ou não. Dependendo da imagem, ou até mesmo se a peça estiver em mãos, um operador poderá analisar e qualificar como peça boa, mas através da conversão de uma figura em matriz binária, será possível encontrar um erro. Desta forma o produto final poderá ser adquirido pelo consumidor com mais qualidade e com custo reduzido.      Para sistemas de segurança, é possível analisar um espaço, fotografar o local e saber se existe perigo para o operador, ou até mesmo localizar pessoas em situações de risco de vida.
記事全体を表示
Below is one example process of creating a PCB. Create a Bill of Materials (BOM) In other words, decide which devices you want to use and what you will need to construct your circuit. If space is a constraint, picking the right device package is crucial. Create a Pin List Once you have all your devices. Create a simple Excel sheet of the various pin-outs from each of these devices. The goal here is to create a reference of which pin goes to which. This will greatly increase your accuracy in the next step… Create a Schematic You will need to download and install a schematic-and-layout-program. Using your schematic program create any needed device libraries and then create the schematic for the board. Create a Layout Once your done with the schematic, layout is just routing the traces around the PCB as efficiently as possible. Some tips for good routing. Use a ground plane (aka solid fill) - This helps with transient signals, and reduces trace congestion. Keep any noisy signals away from data signals (keep the motor driving lines away from data lines) Generate Gerbers and Drill Files Read the website of the Manufacturer that will be building your boards. Most of them do a good job of explaining what format the design needs to be in for them to do the job correctly. Some manufactures support the layout files from certain software toolsets (usually their own). Gerbers are pretty much the universal language though. Send to Board Manufacturer and order your BOM. Below are some of the most popular ones in the USA. If you have a resource in your area please add to the list below. pcbexpress.com sunstonecircuits.com Related Links Training by Freescale on Effective PCB Design General PCB design Engineering Articles from Quick-teck PCBs
記事全体を表示
Nosotros creemos que es más importante el “porque lo hacemos” a el “que hacemos” por eso nos enfocamos a un proyecto centrado a pacientes con parálisis cerebral. Tratamos de establecer un medio más cómodo y fácil de usar. Planeamos lograr nuestro objetivo con “Sen-Silla” una silla móvil manipulada por sensores y con esto lograr desplazarse de una manera más accesible a sus capacidades.         Sensilla - YouTube
記事全体を表示
Welcome to the NXP Cup!  The following pages are designed to introduce students to the concepts of robotics and the components of the NXP Cup Car. Programming microcontrollers is challenging, and the content here is developed to facilitate the process of becoming a successful embedded programmer. General Information Marketplace Special offers from our Global Sponsors History of the NXP Cup Where to buy a racetrack? Mathworks Support for The NXP Cup Race Track Information Community created accessories FAQ's Assembly Directions Keil Software Offer Rules Cameras Regulations Teams' Technical Reports Hardware Concepts Embedded Systems Concepts Real world usage (Practical) Line Scan Camera MCU 101 Tutorials Kinetis FRDM-KL25Z Servo Motor NXP Cup related video series by Prof. Eli Hughes https://community.nxp.com/docs/DOC-1096 Drive (DC) Motors MathWorks basic model for using wide angle lenses on The NXP Cup Car The NXP Cup Technical Reports https://community.nxp.com/docs/DOC-1283 Motor Driver (H-Bridge) https://community.nxp.com/docs/DOC-1057 Battery New Supply location for NXP Cup kits and replacement parts with global delivery possibilities: www.landzo.com CCD sensor: http://www.landzo.com/?product-52.html CCD camera: http://www.landzo.com/?product-51.html Power Motor control unit: http://www.landzo.com/?product-50.html Car kit without Electronics: http://www.landzo.com/?product-49.html In case of any questions or issues, please contact Bella at 汪瑞 <wangrui@landzo.cn> Connect with teams in your region! Brazil EMEA Malaysia Mexico North America Taiwan
記事全体を表示
This page will guide you through the attachment of the servo to the Freescale Cup chassis.   The servo steers the vehicle and is controlled using Pulse-width modulation . Video Tutorial (no sound): Step-by-Step: (Click any image to enlarge) Servo Plate Inside the kit are various mounting options for different servo manufacturers. Look for the bushing of the servo that you are using. You will need the three pieces shown below. You will screw this into the servo. Pieces are notched, so assembly is straight forward. Remove the screw and black servo plate. Mount the yellow servo plate assembly to the servo as shown below. Make sure to add the small yellow washer (pictured below) in between the servo plate and the screw. Tighten well, a servo produces a good amount of torque and will slip if not tight. Steering Bar Assembly Assemble the short arm. Assemble the long arm.   Putting the Two Together Attach the short arm to the yellow bracket. First, insert the bearing into the control arm. This allows the joint to flex and move. Screw this assembly into the servo plate. Attach the long arm to the yellow bracket. Mounting the Servo Motor Attach the motor mount blocks to the back of the servo on both sides. Screw in the attachment blocks from the bottom of the car. Words of Wisdom Be sure to have servo motor in the 0 degree position before securing the control arms. Failure to do so will result in not being utilize the full range of motion. Do not change the position of the steering servomotor by hand. The position of the steering servomotor should be changed through electrical input only. Don’t move the steering servo motor beyond the maximum limit of the movement and this will damage the servo motor
記事全体を表示
Added by Richard Balogh on April 3, 2012 Teams from the Slovak University of Technology at the EMEA 2012 Finals in Prague The cars for the finals.... ready to compete. The race track is built....training can start.
記事全体を表示
The Tower System is a simple concept. Take basic hardware modules, connect them together and start designing. There are two types of hardware modules, MCU/MPU and peripheral (i.e. serial, memory, LCD, etc.), which plug into backplane "elevator" boards. The Tower System supports up to four prototyping boards. The boards are installed into one of the slots in the Tower System, the signals from each installed module are shared between modules and made easily accessible through exterior headers on the Tower System. For an overview of the Tower System and some of the available modules for use, read the fact sheet here. Notes The Tower System has a "Primary" and a "Secondary" side. Most of the Tower Modules only send signals through the primary side. Many of the signals within your chip are not brought out to the tower pins. During the Hardware design process, be careful of this fact. Most often people plug the USB directly into the module, instead of using the tower USB port. You can use the Tower System modules without the tower. Designing your own Tower Module: Due to the common PCI Express standard pinouts for the tower connector, it is easy to fabricate your own tower module. See the external links section for examples. Important Documents Tower System Data Sheet Rev. 4, 5/2000 Tower Mechanical Drawing Tower System Schematics External Links Tower System Freescale Webpage Tower Geeks Website
記事全体を表示
Congratulations to all the East Coast teams and to UC-Berkeley for the overall fastest car in the USA!  More photos/videos from the event. West vs. East Winner: Jolt - UC-Berekley 17:35 East Coast Teams: First Place: Relativistic Robotic Racers - University of Rhode Island - 22.04 seconds Second Place: Vulcar - California University of Pennsylvania - 25.15 seconds Third Place: Temple Made - Temple University - 25.72 seconds See complete results
記事全体を表示
Option #1 Camera Mount Designed by Eli Hughes of WaveNumber LLC. You can order these parts through Shapeway.com which 3D prints on demand. You can choose from all sorts of materials depending on how much you want to spend. Option #2 To attach the camera we found useful to prepare two metal L-shaped pieces made from aluminium. With the help of black plastic distance posts (already available in the kit) and these metal stands, you may freely change the position of the camera over the surface. You may use following files to cut the required shapes (drawing was made using the QCad program): Preview (.pdf) CAD file (.dxf)
記事全体を表示
Thanks Team Jolt @ UC Berkeley for this awesome first-person perspective of the Freescale Cup car going around the track!
記事全体を表示
Pulse-width modulation (PWM), is a technique utilized in robotics for controlling motors and servos. Through the use of internal counters, the microcontroller modulates the duty cycle of a square wave to control the amount of power delivered to a device. The Duty Cycle referes to the porportion of time the square wave is 'on' as compared to the repeating signal period. The higher the duty cycle the higher the power carried in the signal. Duty cycle is expressed as a percentage of time the signal is 'on', with 100% being consistently on. Configuring the Timer The generation of a PWM signal using is based on hardware comparisons between register values and free running hardware counters. The timer module offers similar hardware comparison in the form of output compare circuitry. The contents of a register are continually compared to the master free-running timer. When a match occurs, a hardware output event can be configured to take place and an interrupt can then call a service routine. Timer I/O The Timer I/O port control registers are located in the Port Integration Module (PIM). Each port can be configured on a pin-by-pin basis and each timer input capture/output compare channel is associated with a single pin. On reset, timer modules are disabled and the appropriate I/O port defaults to a high impedance input. The initial state of a pin can be defined by configuring the appropriate general purpose I/O pin as an output in the Data Direction Register (DDRT) and writing the Port Data Register (PTx) to the appropriate state. An external pull device is required to control the level during reset.Setting the Timer Enable (TEN) bit in the Timer System Control Register (TSCR1) enables the timer module. The output compare functionality is disabled in the default module reset state. In this mode, the Data Direction bits (DDRTx) control the I/O state of the pins while the Input Compare logic monitors transitions on the pins. Setting the appropriate bit in the Timer Input Capture/Output Compare Select (TIOS) register enables a timer channel for output compare, as needed for PWM generation. In output compare mode, the Output Mode (OMn) and Output Level (OLn) bits in the Timer Control Registers (TCTL1/2) simultaneously select the compare event action and enable the connection of the output compare output logic to the relevant pin. If the OMn:OLn control bits for a channel are both zero the DDRTx and PTx bits control the state of the I/O pin. Setting either (or both) of the OMn:OLn bits connects the output compare circuitry to the pin, over-riding the DDRTx and PTx settings. Following a reset, the output state for each output compare circuit is zero. For PWM generation, the OM bit is set (= 1) so that the output compare output follows the state of the associated OL bit on each compare event. The state of the OL bit is inverted every time the timer channel interrupt is serviced to produce a toggling output. Clearing or setting the TEN bit disables or enables the timer module respectively, but does not modify the contents of any other timer control registers or the state of the output compare output logic A number of considerations have to be made when configuring the timer module for PWM. From a high-level point of view, the main considerations are: • PWM Frequency • PWM Duty Cycle In order to generate the required PWM frequency, the bus clock frequency must be known, and the timer prescaler must be set. These values will depend on the range of PWM frequencies that will be generated and the degree of resolution of the PWM signal. Maximum resolution and PWM frequency are limited by the maximum timer clock frequency. Lower PWM frequencies are limited by the minimum timer clock frequency. This can sometimes result in a trade-off and can be evaluated as shown in Figure 1. Once the timer channel is configured, the PWM signal can be generated using the timer channel interrupt. This should be configured to call an interrupt service routine (ISR) to load the timer compare register with the appropriate compare value (mark or space). This is achieved by identifying whether the last action was a negative or a positive edge transition, switching the transition status and loading the compare register with the next appropriate value. References to the master timer count register can be avoided by simply adding consecutive mark and space values to the timer compare register on successive ISR function calls as shown in Figure 3. Timer roll-over is seamless when using unsigned integer addition. Using the previous compare value as a reference for generating the next compare value allows precise output timing even though the ISR latency may vary. Starting the PWM is a task that requires careful consideration. In order to start the PWM generation using the interrupt, it is necessary to configure the first compare event manually. It is necessary to configure a forced compare by setting a compare to switch the output pin to the first transition state. After the initial compare event, interrupts will handle the PWM generation. The HCS12 does not support hardware forced compare, but a forced compare can be configured by setting a normal compare a few cycles ahead of the current free-running timer value. The cycles are necessary to compensate for internal latency within the MCU. The number of cycles will vary depending on the core and module clocks. When stopping the PWM generation, it is important to consider runt pulses (pulses with width shorter than the prescribed mark or space ratio as appropriate). To avoid these pulses, disable the PWM generation by setting the appropriate local interrupt mask within the associated interrupt service routine. The appropriate state of the pin at stop time can be set by disabling the interrupt in either part of the ISR; either the rising or falling edge portion. Additional Tutorial Resource: Introduction to DC Motor Control - Part II Lecture 2: Pulse Width Modulation
記事全体を表示
Congratulations to the winning teams!! First Place Second Place Third Place Mach Pi- Universidade de Sao Paulo Poli - Gryphon- Universidade de Sao Paulo Zohan- Universidade do Estado de Santa Catarina Final Time: 15.52 Final Time: 18.27 Final Time: 20.1 David Nissimoff Diego Negrao Coordinator: Vitor Nascimento William Ricardo Kishimoto Diniz Jéssica Barbosa Heluany Wesley Wein Chen Coordinator: Fuad Kassab Junior Jean Ribeiro Fernandes Marcus Vieira Soares Rodolfo Lauro Weinert Coordinator: Ana Watanabe *Download zip file for more pictures.
記事全体を表示
Which Platform to use?  Qorivva or Kinetis? Both are 32-bit devices. The Qorivva products, a Power architecture, are used widely in the automotive industry.  It has specialized peripherals such as CAN and LIN.  Automotive products are built tough, to high industry standards. The Kinetis products, ARM M4 architecture, are widely used.  You will find it in lots of everyday devices and industrial automation (such as robotics). It can support a lot of consumer peripherals such as USB, WiFi, and Graphical Displays. Which platform is more powerful or easy to use? Both supported processors are powerful 32 bit microcontrollers with similar software peripherals. Take an hour or two to research the evaluation boards on the Freescale sites and their underlying technologies. Think through the design and implementation process of connecting various components like the motor, battery and servo, to the evaluation board. The Tower System provides a modular prototyping platform, and the TRK evaluation board has many features. What level of support does a technology have? For the Cup Challenge, you may use any Freescale microcontroller. There are reference designs here on the wiki and TONS of code and examples on the Freescale site. Students should speak with their professor, and check out their respective documentation and software examples to make a choice. Having on campus support is invaluable in this case. There are online communities for the respective technologies as well. Research which technologies are have more active user communities which best complement the teams design approach? Obviously the Freescale Cup Wiki itself is a resource, and provides details on how to use two different microcontrollers - so it might be best to limit choices to one of these two supported platforms.
記事全体を表示
1. Download CodeWarrior 10 Evaluation Version (Eclipse, Windows-hosted) To Program your microcontroller you will need to set up the CodeWarrior Integrated Development Environment. CodeWarrior is available on the Freescale.com Website. Method 1: Direct Link direct download link (Caution - link may not be up to date) Method 2: Navigate to the Download Link From Freescale.com click on: "Design Resources" tab at the top of the page, then navigate to "Software and Tools", and then to "Codewarrior Devleopment Tools" Click on the "Download CodeWarrior now link" Click on the Download Evaluation Versions link" Within this page, use your browser "find" feature (Typically CTRL-F) to search for the text string "Kinetis." Click the "download" button next to "Evaluation: CodeWarrior for Microcontrollers(Eclipse, Windows-hosted) version". and save it to your computer. 2. Install CodeWarrior To install CodeWarrior Development Studio for Microcontrollers v10, double-click the installation package and a wizard will guide you through the installation process. Installation Notes: Are you using Windows Vista or Windows 7? 1. The CodeWarrior installer should be run using the ‘Run as administrator’ option. CodeWarrior service packs are installed with the Eclipse Updater. The updater should also be run with this option. To start the Eclipse Updater select ‘Window > Install new software’ in the menu. 2. Eclipse needs read/write access to the installation folder. Make sure the eclipse installation folder has the appropriate permissions for all users. 3. Make sure your project workspace has read and write permissions Evaluation Edition User: If you are installing the Evaluation Edition, the Evaluation license is automatically installed with your product and you do not need to register it. This license allows you to develop projects as Professional Edition within the 30-day evaluation period. After 30 days, the license works as Special Edition license (free permanent, but feature limited) which supports unlimited assembly code, up to 32KB of C code for HCS08/RS08 derivatives, up to 64KB of C code for V1 ColdFire derivatives and up to 128KB of C code for V2-V4 ColdFire and Kinetis derivatives and up to 512KB of C code for MPC56xx derivatives. Once you have finished downloading and installing CodeWarrior, users can return to Downloading and Installing P&E as part of the Blink a LED on Kinetis Tutorial Additional Resources: CW10 User Manual —The Above user manual has a list of other helpful docs which can be found within your CodeWarrior installation directory. (i.e. <CWInstallDir>\MCU\Help\PDF\)
記事全体を表示
2013 Global Freescale Cup Participant: USA Car Specs: -Custom motor driving circuitry -FRDM-KL25Z -Dual line scan camera Related Videos             
記事全体を表示
2013 Global Freescale Cup Participant: Brazil Car Specs: -Freescale "Bolero" MPC5604B 32-bit MCU
記事全体を表示
After completing the LED, Motor Control and servo tutorials, students should be comfortable with many of the subjects necessary to enable and input data from the Line Scan Camera. The line scan camera module consists of a CMOS linear sensor array of 128 pixels and an adjustable lens. This camera has a 1x128 resolution. The camera is mounted on a boom above the car to ensure the greatest field of view. Determining the angle of orientation about the pivot at the top of the boom will change the “look ahead” distance of the camera and enable more efficient steering algorithms Solution Overview One method of implementation is to take the entire readout of the camera and store it in the memory. Then a line detection algorithm can be used to locate the position of the black line. Due to varying lighting conditions, some level of pixel thresholding may be necessary as the intensity differences across the data may not always produce a clear indication of the line location. A good approach is to use an algorithm that looks for changes in the magnitude of voltage from one portion of the array to another, since the camera’s AO magnitude is directly related to the brightness the pixel array senses. If the microcontroller finds a significant decrease in magnitude followed by large increase in magnitude this would give us a good indication of the location of the line. For this a derivative function can be utilized. Once we have successfully determined the position of the black line, immediately adjust the wheels to adjust the direction of the car so that the black line will remain in the center of the camera’s view. Sample camera output (for illustrative purposes only) The camera outputs an analog signal from 0 to 5V depending on the grey-scale value of the image. to simplify our sample we will assume that we have set limits for the line and have transformed the data to digital bits using a threshold value. 0’s are high intensity (non-line locations), 1’s are low intensity (black or line locations) 10000000000000000000000000000000001111101000000000000000000010000000000000000 Since the camera provides a 128x1 bit picture, and the camera will be pointing down at the track which is a fixed width. A control algorithm should be developed to line up the 1’s in the center of the 128 bits. The center of the field of view will be require calibration and testing, but it is assumed that the camera will remain in a fixed location pointing down the center of the forward looking axis of rotation. Usage For normal operation of the camera, the following signals must be produced and processed: CK (clock) - latches SI and clocks pixels out (low to high) continuous signal SI (serial input to sensor) begins a scan / exposure discrete pulses, pulse must go low before rising edge of next clock pulse AO (analog output) - Analog pixel input from the sensor (0-Vdd) or or tri-stated The CK and SI signals are simple ON/OFF signals which can be produce using a GPIO Pin, setting the pin high and low corresponding to the desired exposure time of the camera. The only other requirement is to read the Analog Output of the camera which requires the initialization of the Analog Module and setting it to the proper pinout.  Actual camera output, below:                                                                                                                        Yellow = SI, Green = Camera Signal, Purple = clock More camera waveforms and information (Power Point) available here This link shows a video of the camera connected to the oscilloscope http://www.youtube.com/watch?v=YOAd3ERnXiQ To obtain this signal, connect channel 1, 2 and 3 of an oscilloscope to the SI pulse (Trigger off this signal), CLK, and AO signals. GPIO Details are provided in the LED tutorial. The timing for creation and read of the signals is crucial and is detailed in the diagram below. This information can also be found in the Line Scan Datasheet. Analog Read: The Analog Output (AO) signal from the camera needs to be processed and read by the microcontroller's Analog to Digital Converter (ADC). This ADC device converts a continuous signal into a discrete number which is proportional to the signal voltage. An 8 bit ADC has 256 discrete levels (2^8). If a analog signal between 0 and 5 volts is sampled, a digital discrete number of 0 would correspond to zero volts, and a digital discrete number of 255 would correspond to 5 volts. A number such as 145w would correspond to about 2.8 volts. The maximum signal sample rate is limited by the microcontroller. Proper configuration of the ADC peripheral and the multiplexer of the chip will configure a pin to read in an analog signal when calling the function. More details on analog to digital converters can be found on the wikipedia site here. Read/Write In write mode, the GPIO pin can be set, cleared, or toggled via software initiated register settings. Microcontroller Reference Manual: Analog to Digital Converter You will find high level information about GPIO usage in several different areas of a reference manual. See the reference-manual article for more general information. Relevant Chapters: (see GPIO chapters for clock and SI Creation)  Introduction: System Modules: System Integration Modules (SIM) - provides system control and chip configuration registers Chip Configuration: Signal Multiplexing: Port control and interrupts Hardware The device discussed within this tutorial is the Line Scan Camera featuring TAOS 1401  Focusing the camera: Once the sensor is perfectly working the next step is to find the best position of the lens that will generate the clearest images. The best way to do it is using an oscilloscope: Connect the SI and AO signals to the oscilloscope Set the SI pulse so that it can be clearly seen and then trig the AO signal with the SI signal using the trig function Fix the camera looking at a sheet of paper with a black line in the center The image of the black line will appear on the oscilloscope screen Screw the camera until you find the position where the line seems the clearest Camera Circuit   5 wires must be connected  ground power SI CLK AO Camera Limitations According to the datasheet:  "The sensor consists of 128 photodiodes arranged in a linear array. Light energy impinging on a photodiode generates photocurrent, which is integrated by the active integration circuitry associated with that pixel. During the integration period, a sampling capacitor connects to the output of the integrator through an analog switch. The amount of charge accumulated at each pixel is directly proportional to the light intensity and the integration time." Integration Time: T T = (1/fmax)*(n-18)pixels + 20us, where n is the number of pixels Minimum integration time: 33.75us Maximum integration time: capacitors will saturate if exceeding 100ms frequency range 5 Khz - 8 Mhz (8 Mhz is fmax in equation above) The integration time is the following: It occurs between the 19th CLK cycle and the next SI pulse. The CLK frequency itself has little to do with the integration time. One each rising edge, the clock outputs one of the previously sampled intensity values. This means that integration time should be set by varying the time between SI pulses, not changing the clock frequency. Make the CLK frequency high, and have as much time as needed between the two SI pulses to obtain the desired intensity value. Helpful Hints Light can be transmitted through the pcb on the back of the camera. This unwanted extra light shining on the CMOS linear sensor can induce significant errors into your signals received. A shroud or housing for the camera unit can easily eliminate this problem. One of the easiest solutions is to place a piece of electrical tape across the back of the camera in the highlighted area indicated in the picture below. When testing the car on the track or transporting it, it is not uncommon for the focus on the camera to loosen or change. Therefore it is recommended that after adjusting your camera focus for maximum performance you make mark (ex. metallic sharpie) between the lens and its body so you can realign the camera lens to it's proper position easily if it does shift.   *When hooking up the linescan camera, regardless of position or focus there is a drop off at each end of the image data. This is easily viewed with an oscilloscope. This effect is undesirable, particularly when you are finding your line position utilizing a derivative approach. These fallouts cause erroneous derivative values, and hence a poor line position solution. Two solutions we found useful were: (1) Ignoring the first 10-15 pixels and last 10-15 pixels of the image data array, and then determining the line position; (2) Often when making decisions in the code as to where the line was at it was found useful to use a threshold value for the difference in the derivative position, and secondly a binary threshold on the camera data. Note that the falloff depends on camera focus, position, etc. Therefore, these threshold values and pixels in which to ignore are relative to a specific instance. The problem however is common to the camera.  * Saving previous line position values Since the camera can read the line very quickly while the servo can only update every 20ms, there are multiple camera reads before the servo can update, if you are reading the camera fast and then overriding without saving them in some form then those camera reads are being wasted and are better off not having occurred. What can help is to create some sort of filter by bringing new values into an array with previous values and preforming some sort of averaging. The following code will take the new line position value and place it in a 1xA array where A is defined by CAMERA_AVG. NO AVERAGING IS OCCURRING HERE all that is happening is the camera values are being saved in a simple array, what is done with them is up to you. The way this works is that it shifts the entire array so the oldest data point is discarded in order to make room for the new line position at the other end of the array. It will only adds the new value if there is one available if not it copies the previous first position value to the new first position value. CAMERA_AVG => an integer value for how long the averaging length will occur gfpLineAverage => global floating point array of camera center line values fpLinePos => returned from read camera this is the center line position ReadCamera() => is the read camera function call returns a floating point value of fpLinePos // this will shift the values up and throw away the oldest value // then add a new reading for (i=CAMERA_AVG;i>0;i—) { gfpLineAverage[i]=gfpLineAverage[i-1]; } // if no line was detected the previous camera value will be passed on if (fpLinePos=ReadCamera()) { gfpLineAverage[0]= fpLinePos; } For example an array of of center line position values ranging from 0-127 could look like. Initial values [51 50 52 54 58 55] New position of 45 read [45 51 50 52 54 58] New position of 44 read [44 45 51 50 52 58] No value read [44 44 45 51 50 52] No value read [44 44 44 45 51 50] New position of 50 read [50 44 44 44 45 51] Tutorials Line Scan Camera: Kinetis ARM Cortex M4 Tutorial Specifics of how to configure the K40 ADC, to create the delay code is covered in the K40: Line Scan Camera Tutorial. Line Scan Camera: Qorivva Tutorial Specifics of how to configure and program the trk-mpc5604b board to blink an LED is covered in the qorivva:line-scan-camera Tutorial. Additional Resources Freescale app note on interfacing with a linescan camera Freescale app note on interfacing with an RCA camera
記事全体を表示
This tutorial covers the details of Blinking an LED on the TRK-MPC5604B: MPC5604B StarterTRAK evaluation board. It will introduce the evaluation board, and some basic CodeWarrior features. Overview Hardware Set up the Software Development Environment A. Download and Install Codewarrior B. Download and Install Drivers Sample Code Serial Debugging: I made the hardware modifications for serial debugging: I did not make the hardware modifications for serial debugging: Download/Debug/Run Learning Step: LED Code Description Functions Blink the LED(s): Other Qorivva Tutorials Useful Links to Technical Data Overview In this exercise students will run sample code and build an application which enables testing of the Qorivva TRK-MPC5604B board. Students will: Configure the Software Development Environment Configure the evaluation board hardware Learn how to open CodeWarrior project example files Build a project Download and run the code on TRK-MPC5604B board Learn how to utilize the GPIO Peripheral to blink a LED   To successfully complete this exercise, students will need the following board and development environment. TRK-MPC5604B evaluation board CWX-MPC-5500P-EX: Evaluation: CodeWarrior for MPC55xx/MPC56xx Microcontrollers V2.8 (Classic) RAppID initialization Tool P&E Micro Driver Software Hardware Read the MCU 101: LEDs article for general information on LED circuits. The LED's are located on the board and visible in the board schematic on page 4 as below: This schematic is found here. Set up the Software Development Environment There are several steps necessary to prepare the evaluation board and PC for microcontroller programming and development. Interfacing the evaluation board with a PC requires downloading and installing the CodeWarrior IDE, as well as the device drivers for programming the microcontroller via USB. A. Download and Install Codewarrior Before completing this example project, download and install CodeWarrior for MPC56xx 2.8 or the latest version. B. Download and Install Drivers In addition to CodeWarrior, it may (needs verified) be necessary to install one or both of the following tools: RAppID initialization tool- RAppID comes on the DVD provided with your evaluation board. In the main directory of the DVD, click on the "TRK_MPC5604B.html" file to open the DVD interface which provides user manuals, software, schematics and documentation for the evaluation board. P&E Microcomputer Systems, Inc drivers- P&E is a a computer driver for the TRK-MPC5604B device, enabling evaluation board programming via USB through the CodeWarrior debug OSJTAG interface. This driver can be downloaded here Because this isn't found on the disk. Sample Code To use the Hyperterminal communications features described in the following sections and in the attached sample code you must populate the U5 on your TRK-MPC5604B board. Qorivva Sample Code Download Serial Debugging: To use hyperterminal style debugging through the Serial port you must populate U5 with a RS232 transceiver and C55. I made the hardware modifications for serial debugging: From the Start menu Run the hyper terminal by using All programs> Accessories> Communications> HyperTerminal and make COMx properties port s ettings as Baud rate 115200, Data bits 8, Parity None, Stop bits 1 and Flow control None. 8. In the project menu select make (or F7) you will get few warning messages. I did not make the hardware modifications for serial debugging: In the project menu select MAKE (or F7) you will get few warning messages and can ignore them. Next select Debug option (or F5) from project menu. The debug window opens with few sub windows such as Code, Status and CPU etc. To run the program, select the Source GO menu button. Note: Much of the code in the sample file is utilized to send and receive messages serially. Some quick, minor changes can be applied as follows: Open main.c within the for loop, remove or comment out all the code. Now, manually call the specific function desired, in this case: for (; ; )      {           LED();      } Download/Debug/Run In sample.mcp project manager window target selection window is set to the default RAM. This means the code runs in the RAM. This target option can be changed using the drop down menu to internal_FLASH. This means the code runs in the flash and this code can run without debugger when the board is powered up. You can select either RAM target or internal_FLASH target for the following test procedure. If you select internal_FLASH target you can test the standalone operation of the board. If you encounter errors, look in the Problems view and resolve them. You can ignore any warnings. If the project builds correctly, it is time to download to the board and watch it work. Ensure that the USB cable that came with the board connects the board to the host computer’s USB port. There are multiple ways to issue the Debug command. Right click the project in the projects view and choose Debug As->CodeWarrior Download. Alternatively, y go to the Run menu and choose Debug (F11). Learning Step: LED Code Description Within the sample code, there is a for loop which calls a switch statement. With working hyper-terminal and proper serial connector interface into a PC, entering the numerical characters "1" - "9" into the hyper-terminal will call each separate function initiating the following actions Blinks Leds & outputs text strings to hyperterminal Calls the Switch function - which sends text strings to hyperterminal indicating which switch has been pressed Calls the Servo function which sweeps the servo back and forth; sends text strings to hyperterminal Calls the motor function which enables and disables the left motor; sends status text strings to hyperterminal Calls the motor function which enables and disables the right motor; sends status text strings to hyperterminal Calls the Camera function which sends the correct signals to the camera and reads the data; sends status text strings to hyperterminal Calls the Left_Motor_Current function; sends status text strings to hyperterminal Calls the Right_Motor_Current function; sends status text strings to hyperterminal   (hyperterminal code documentation needs verified ) TransmitData("\n\r**The Freescale Cup**");         TransmitData("\n\r*********************");         TransmitData("\n\r1.Led\n\r");         TransmitData("2.Switch\n\r");         TransmitData("3.Servo\n\r");         TransmitData("4.Motor Left\n\r");         TransmitData("5.Motor Right\n\r");         TransmitData("6.Camera\n\r");         TransmitData("7.Left Motor Current\n\r");         TransmitData("8.Right Motor Current");         TransmitData("\n\r**********************"); option = ReadData(); option = 1;     switch(option)         {             case '1':                 LED();             break;             case '2':                 SWITCH();             break;             case '3':                 SERVO();             break;             case '4':                 MOTOR_LEFT();             break;             case '5':                 MOTOR_RIGHT();             break;             case '6':                 CAMERA();             break;             case '7':                 LEFT_MOTOR_CURRENT();             break;             case '8':                 RIGHT_MOTOR_CURRENT();             break;             default:             break;          } As visible from the schematic - the LED's are accessed via the following ports. Hardware Chip Port/Pin Comment LED1 PE4 LED2 PE5 LED3 PE6 LED4 PE7 Functions The following function is utilized in the code to blink the LED's This function is located in main.c void LED(void) {    SIU.PCR[68].R = 0x0200;  /* Program the drive enable pin of LED1 (PE4) as output*/    SIU.PCR[69].R = 0x0200;  /* Program the drive enable pin of LED2 (PE5) as output*/    SIU.PCR[70].R = 0x0200;  /* Program the drive enable pin of LED3 (PE6) as output*/    SIU.PCR[71].R = 0x0200;  /* Program the drive enable pin of LED4 (PE7) as output*/    TransmitData("****Led Test****\n\r");    TransmitData("All Led ON\n\r");    Delayled();    SIU.PGPDO[2].R |= 0x0f000000;  /* Disable LEDs*/    SIU.PGPDO[2].R &= 0x07000000;  /* Enable LED1*/    TransmitData("Led 1 ON\n\r");    Delayled();    SIU.PGPDO[2].R |= 0x08000000;  /* Disable LED1*/    SIU.PGPDO[2].R &= 0x0b000000;  /* Enable LED2*/    TransmitData("Led 2 ON\n\r");    Delayled();    SIU.PGPDO[2].R |= 0x04000000;  /* Disable LED2*/    SIU.PGPDO[2].R &= 0x0d000000;  /* Enable LED3*/    TransmitData("Led 3 ON\n\r");    Delayled();    SIU.PGPDO[2].R |= 0x02000000;  /* Disable LED3*/    SIU.PGPDO[2].R &= 0x0e000000;  /* Enable LED4*/    TransmitData("Led 4 ON\n\r");    Delayled();    SIU.PGPDO[2].R |= 0x01000000;  /* Disable LED4*/ } Code Details: SIU - System Integration Unit PCR - Port Configuration Register PGPDO - Parallel GPIO Pad Data Output Registers : definition From viewing the user manual, under Functional port pin descriptions, it is Blink the LED(s): Within the main find the infinite for loop. for ( ; ; )      {      } loop of Main.c, remove all code, and add the LED's with the following function: for(;;) { LED(); } To alter the behavior of the LEDs, change the function itself, or pull specific code from the function and insert it within loops of a program for testing purposes. LED's are often used for testing important parts of an algorithm. By connecting an oscilloscope to a LED, it is possible to test the duration of a key algorithm, or to verify if signal timing is as expected along with the visual cue. Other Qorivva Tutorials Qorivva: Drive DC Motor Tutorial Qorivva: Turning A Servo Qorivva: Line Scan Camera Tutorial Useful Links to Technical Data TRK-MPC5064B Freescale Webpage TRK-MPC5064B Freescale Reference Manual TRK-MPC5064B Freescale Schematic
記事全体を表示
Academic Textbooks Collection of textbooks related to or using Freescale processors and/or covering general embedded engineering concepts. Additional resources including lab manuals, sample projects and more are available in the Faculty Portal.  These resources are only available to to verified faculty partners. 32-bit Microprocessor and Microcontrollers Kinetis (ARM Cortex-M) Title: uC/OS-III The Real Time Kernel for the Kinetis Cortex M4 Author: Jean Labrosse ISBN:9780982337523 Publisher: Micrium Press Released: 2011 ColdFire™ (MC51xx, MC52xx, MC53xx, MC54xx) Title: ColdFire Microprocessors and Microcontrollers Author: Munir Bannoura, Rudan Bettelheim, Richard Soja ISBN: 0976297302 Publisher URL: www.amtpublishing.com Released: 2006 Power™ Architectures (MC5xx, MC55xx) Title: MPC5554/MPC5553 Revealed Author: Munir Bannoura, Richard Soja ISBN: 0976297353 Publisher URL: www.amtpublishing.com Released: 2005 Title: eTPU Programming Made Easy  **Now Available in Japanese Author: Munir Bannoura, Margaret Frances ISBN: 0976297310 Publisher URL: www.amtpublishing.com Released: 2004 Title: TPU Microcoding for Beginners Author: Amy Dyson, Munir Bannoura ISBN: Publisher URL: www.amtpublishing.com Released: 1999 Digital Signal Processing Title: DSP for Embedded and Real-Time Systems Author: Robert Oshana ISBN: 9780123865359 Publiser: Elsevier Released: 2012 Title: DSP Filter Cookbook (Electronics Cookbook Series) Author: John Lane, Jayant Datta, Brent Karley, Jay Norwood ISBN: 0790612046 Publisher URL:  No Data Released: 2004 Title: Digital Signal Processing Fundamentals Author: Ashfaq Khan ISBN: 1584502819 Publisher URL: www.oup.com/us/he Released: 2000 Title: Digital Signal Processing Applications with Motorola's DSP56002 Processor Author: Mohammed El-Sharkawy ISBN: 0135694760 Publisher URL:  No Data Available www.oup.com/us/he Released: 1996 Title: Foundations of Digital Signal Processing: Theory, Algorithms and Hardware Design Author: Patrick Gaydecki ISBN-10: 0852964315 ISBN-13: 978-0852964316 Publisher: IEE; General 32-bit topics Title: Modern Micoprocessors 3rd Edition Author: V. Korneev / A.Kiselev ISBN: 1584503688 Publisher URL: www.charlesriver.com Released: 2004 Title: Micrcontrollers and Microcomputers: Principles of Software and Hardware Engineering Author: Fredrick M. Cady ISBN: 0195110080 Publisher URL: www.oup.com/us/he Released: 1997 Title: Programming Microcontrollers in C Author: Ted Van Sickle ISBN: 1878707140 Publisher URL: Released: 1994 Title: Real-Time Programming: A Guide to 32-bit Embedded Development Author: Rick Grehan, Ingo Cyliax, Robert Moote ISBN: 0201485400 Publisher URL:  www.aw.com Released: 1998 Title: Embedded Systems Design: A Unified Hardware/Software Introduction Author: Frank Vahid, Tony D. Givargis ISBN: 0471386782 Publisher URL:  No Data Available Released: 2001 Title: Microcontrollers in Practice Author: Marian Mitescu ISBN: 3540253017 Publisher URL:  No Data Available Released: 2005 Title: Embedded Systems Architecture: A Comprehensive Guide for Engineers and Programmers Author: Tammy Noergaard ISBN: 0750677929 Publisher URL:  books.elsevier.com/newnes/ Released: 2005 Title: MEMS: Applications Author: Mohamed Gad-el-Hak ISBN: 0849391393 Publisher URL:  crcpress.com Released: 2005 Title: High-Performance Embedded Computing: Architectures, Applications, and Methodologies Author: Wayne Wolf ISBN: 012369485X Publisher URL:  No Data Available Released: 2006 Title: Hardware and Computer Organization Author: Arnold S. Berger ISBN: 0750678860 Publisher URL:  www.elsevier.com Released: 2005 8- and 16-bit Microcontrollers HCS12 Title:  Microcontroller Programming For Engineers Author: Harlan Talley ISBN-13: 978-0-557-09570-4 Publisher URL: http://lulu.com Released: 2009 Title:  Learning by Example Using C – Programming the DRAGON12-Plus Author: Richard E. Haskell and Darrin M. Hanna ISBN: Publisher URL: http://www.lbebooks.com Released: Title:  Learning by Example Using C – Programming the mini DRAGON12 Author: Richard E. Haskell and Darrin M. Hanna ISBN: Publisher URL: http://www.lbebooks.com Released: Title:  HCS12 Microcontrollers and Embedded Systems Author: Muhammad Ali Mazidi, Danny Causey, Janice Mazidi ISBN: 978013672294 Publisher URL: http://www.pearsonhighered.com Released: 2008 Title: Assembly and C Programming for the Freescale HCS12 Microcontroller Second Edition Author: Fredrick M. Cady ISBN: 9780195308266 Publisher URL: www.oup.com/us/he Released: 2007 Title: The HCS12/9S12, An Introduction to Hardware and Software Interfacing Author: Han-Way Huang ISBN: 1401898122 Publisher URL: http://www.delmarlearning.com/electronics/ Released: 2006 Title: Embedded Microcomputer Systems: Real Time Interfacing 2nd Edition Author: Jonathan W. Valvano ISBN: 0534551629 Publisher URL: http://engineering.thomsonlearning.com/ Released: 2006 Title: MicroC/OS-II: The Real-Time Kernel Author: Jean J. Labrosse ISBN: 1578201039 Publisher URL: www.cmpbooks.com Released: 2002 HCS08 Title: Microcomputer Architecture - Low Level Programming Methods and Applications of the M68HC908GP32 Author: Dimosthenis E. Bolanakis, Euripidis Glavas, Georgios A. Evangelakis, Konstantinos T. Kotsis, Theodore Laopoulos ISBN: 978-960-93-4536-1 (English version of the book) ISBN: 978-960-357-101-8 (Greek version of the book: delivered with an educational board) Title: HCS08 Unleashed: Designer's Guide To the HCS08 Microcontrollers Author: Fabio Pereira ISBN-10: 1419685929 Publisher URL: http://www.booksurge.com/ Released: March 24, 2008 Title: Using Microprocessors and Microcomputers: The Motorola Family 4th Edition Author: William Wray, Joseph Greenfield, Ross Bannatyne ISBN: 0138404062 Publisher URL:  www.prenhall.com Released: 1998 Title: The Official Robosapien Hacker's Guide Author: Dave Prochnow ISBN: 0071463097 Publisher URL:  /www.mhprofessional.com Released: 2005 Title: Robot Building for Beginners Author: Dave Cook ISBN: 1893115445 Publisher URL:  http://www.robotroom.com Released: 2002 Title: Intermediate Robot Building Author: Dave Cook ISBN: 1590593731 Publisher URL:  http://www.robotroom.com Released: 2004 HC11/HC12 (Legacy Devices) Title: Software and Hardware Engineering Motorola M68HC12 Author: Fredrick M. Cady, James M. Sibigtroth ISBN: 0195110463 Publisher URL: www.oup.com/us/he Released: 2000 Title: Software and Hardware Engineering Motorola M68HC11 Author: Fredrick M. Cady ISBN: 0195110463 Publisher URL: www.oup.com/us/he Released: 1997 Title: MC68HC12 An Introduction: Software and Hardware Interfacing Author: Han-Way Huang ISBN: 0766834484 Publisher URL: http://www.delmarlearning.com/electronics/ Released: 2002 Title: MC68HC11 An Introduction: Software and Hardware Interfacing 2nd Edition Author: Han-Way Huang ISBN: 0766816001 Publisher URL: http://www.delmarlearning.com/electronics/ Released: 2002 Title: Programming the Motorola M68HC12 Family Author: Gordon Doughman ISBN: 0929392671 Publisher URL:  No Data Available Released: 2000 Title: Embedded Systems: Design and Applications with the 68HC12 and HCS12 Author: Steven F. Barrett, Daniel J. Pack ISBN: 0131401416 Publisher URL:  www.prenhall.com Released: 2004 Title: Introduction to Microcontrollers Architecture, Programming, and Interfacing for the Freescale 68HC12 Author: G. Jack Lipovski ISBN: 0124518389 Publisher URL:  books.elsevier.com Released: 2004 Title: Single and Multiple Chip Microcomputer Interfacing Author: G. Jack Lipovski ISBN: 0138105731 Publisher URL:  No Data Available Released:  No Data Available Title: Microcomputer Engineering, Third Edition Author: Gene H. Miller ISBN: 0131428047 Publisher URL: www.prenhall.com Released:  2003
記事全体を表示