University Programs Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

University Programs Knowledge Base

Discussions

Sort by:
This document is addressed to the participants and visitors that will join us for The Freescale Cup 2015 Worldwide Finals 2015 The Freescale Cup 2015 Worldwide Finals will be held on 14-15 September 2015 at the Fraunhofer Institute for Integrated Circuits (Fraunhofer IIS) in Erlangen, Germany. Full address is: Fraunhofer IIS Am Wolfsmantel 33 91058 Erlangen Germany Google Maps location The attendees official guide is now online at https://community.nxp.com/docs/DOC-106164 Agenda of the event for the participants (subject to change): Sunday September 13th: Arrival at Hotels Get together in the evening (approximate time 18:00) at A&O Hostel Monday September 14th: 8:30: Departure from Hotel for City Tour 11:30: Prepare for departure for Fraunhofer IIS 12:00: Buses depart for Fraunhofer IIS 13:00: Lunch 14:00: Opening session 15:00: Start of Practice 17:30: High School and Innovation Challenge Demos 18:00: End of Practice - Start of the evening event 21:00: End of evening event - boarding buses for return to hotel Tuesday September 15th: 8:00: Buses depart for Fraunhofer IIS 9:00: Practice 13:00: Technical Inspection & Lunch 14:30: Final Race 16:00: Awards Ceremony 17:30: Buses depart for Awards Dinner 20:30: Buses depart for Hotel The event will be presented via LiveCast by the Fraunhofer IIS. URL is http://www2.iis.fraunhofer.de/freescale/  Hotel information: Students Hotel: Nuremberg Hostel - Stay at the A&O Hostel & Hotel Nuremberg  Google Maps Location Professors and Press Hotel: NH Nürnberg City Center hotel in Nuremberg Bahnhofstr. 17-19 | NH Hotel Group Google Maps Location Freescale will cover the cost of travel, accommodation and meals for the event for all Freescale Cup qualified teams and one faculty advisor per the rules in place. For Visa invitation letters, please contact marion.thierry@freescale.com or flavio.stiffan@freescale.com Travel booking will be organized by your regional Freescale University Program contact. Please have your faculty advisor get in touch with them for more information
View full article
Continue discussion on the line scan camera. A completely interrupt driven approach to the interface will be illustrated.
View full article
The first step of starting your TFC project is to get to know your microcontroller. This article serves you as an introduction of Qorivva MPC560xB microcontroller. Qorivva MPC5604B Summary The Qorivva MPC560xB/C/D family of 32-bit microcontrollers (MCUs) includes the latest in integrated devices for automotive electronics applications. These scalable Power Architecture® devices are supported by an enablement ecosystem that includes software drivers, operating systems and configuration code to help you quickly implement your designs.  For the Freescale Cup Challenge, we have provided Tutorials, example code and projects which are based on the trk-mpc5604b StarterTRAK evaluation board. Which Chip do you have? The chipset mounted on the boards for the Freescale Cup can vary. Always validate your chipset to know it's full capabilities. MPC560xB Product Information Page Difference's At-a-Glance: 5604B = 512MB Flash; no DMA 5606B = 1MB Flash; Has 16-Channel DMA 5607B = 1.5Mb Flash; Has 16-Channel DMA Getting Started Presentation Getting Started with MPC5600B.pptx (2Mb) Important Resources: e200z0 Core Reference Manual TRK-MPC5604B User's Manual TRK-MPC5604BQuick Reference Guide TRK-MPC5604B Schematics Reference manual Freescale's Qorivva MPC560xB Page Power.Org
View full article
Lab exercise supporting the i.MX53QSB for Master Student level student prepared by massimoviolante from the Politecnico of Torino. Complete course file(s) restricted to verified faculty only.  Available for download in the Faculty-Portal
View full article
This video will examine how can design speed sensing into their vehicle platform.   An example of magnet and sensor placement is shown.
View full article
As a maker and a professional engineer I always try to keep up with new tools to tinker with.  Being a Freescaler I get especially jazzed about ones using our chips.  But, with so many fish in the sea it's hard to get the word out about all the options out there.  So for your viewing pleasure below is a list of up and coming "development boards" for both Makers and Professionals.  All of these boards use Freescale silicon, but the actual board/product is not made by Freescale.  Add comments below with anything I should be made aware of and any reviews or comments of the ones I mentioned. In the microcontrollers corner... Teensy 3.1 -Weighing in at 2.95 grams, don't be fooled by this one's size; it really packs a punch.  But the board is just the beginning, you can program the board using Arduino Sketch, and Paul has cooked up some cool new audio and video libraries that take advantage of the extra horsepower in the Kinetis K20 chip. WunderBar -This one wins the award for creative naming and packaging.  Basically, you have a main board and several sensor boards.  You snap off the sensor boards (like breaking off a piece of chocolate) and attach them to your desired application.  Out of the box, basic board level stuff is taken care of so you can spend more time working on your tablet/smartphone application. Enter the hybrid cross-overs These two boards have both MCU and MPU's onboard for the best of both worlds.  Generally speaking the MPU handles more multimedia rich tasks, while the MCU handles real-time operations such as controlling motors, monitoring sensors and other various functions. UDOO - After coming off a very successful Kickstarter campaign the UDOO board is gaining some serious traction. You can pick from a dual or quad core Freescale i.MX6 processor with the Atmel SAM32 (aka the Arduino chip) and let the fun begin.  UDoo has a thriving community and really caters well to the "Maker" community. Freedog -  Combines a Atheros AR9331 and Kinetis KL25Z  The Atheros processor supports Linino, a Linux distribution based on OpenWRT. The board has built-in Ethernet and WiFi support, which is a huge plus! The future of personal computing Things are really heating up in the microprocessor corner with lots of new i.MX enabled development boards.  These boards may not go toe-to-toe with your laptop or desktop PC, but the size to performance ratio is just incredible.  For grins I have listed the boards below from largest to smallest. Riot Board- Another SBC (Single Board Computer) solution featuring a single core i.MX 6 application processor.  This board is capable of many things but the focus is for Android development.  I had Netflix and Pandora running on my home TV in less than 30 minutes.  Cool if used for nothing more than a media center! Wand Board - You can pick between single, dual and quad core flavors.  Under the hood this platform is a SOM (System On Module) allowing you to pop this super small plug into your creation and accessorize!  The dual and quad core flavor comes with built in WiFi  and Bluetooth provides a lot of connectivity options. [NEW: Added 7/2/2014] Hummingboard - Several people contributed this in the comments section and I was notified this is now available for purchase.  On paper it looks pretty sweet, same price as the Rasberry Pi but with a much more powerful from a processor performance and peripheral perspective.  I am going to try to get my hands on one and will update you! CuBox - I would put this in more of the finished products camp and not really a development tool, but it is still VERY cool.  A 2 inch cube mini-computer.  Nicely polished packaging and Android O/S, it makes my desktop PC look like a relic. Warp Board - Aimed squarely at wearables, this thing is so small and oh by the way it runs Android and is cranking away at 1 GHz.  It's slated for a end of summer release, but you can start getting updates now from their website!
View full article
Using Header(.h) files provided by Freescale inside CodeWarrior - Blinking an LED
View full article
Model provided by the Mathworks Academic support team to manage wide angle lenses on the default Freescale Cup car camera.
View full article
First and foremost, be creative!! Below are just a few inspirational ideas. Option #1 - I cut-down (miter saw) a 4-position TWR-ELEVATOR to make this 2-position design. With the intent of having two boards mounted 1) TWR-PROTO and 2) MCU of choice (K40). If cutting PCB's with power tools is not your thing, you can buy a 2-position Tower Elevator here: http://wavenumber.net/twr-elev-2/ I just marked the holes on the back supportand drilled holes into the TWR-PROTO, a few stand-offs and viola! Option #2 - This option requires the removal of the rear spring. I am not sure how much value that spring honestly provides since most of the track is nice and flat. If you have a newer TWR-ELEVATOR you usually find some way to mount it to the screw holes with some form of L-Bracket. If you have an older TWR-ELEVATOR you can drill a hole in the Secondary Elevator (less PCB traces to worry about) and then mount it to the chassis with a L-Bracket. Option #3 - Check out this gallery of images: https://plus.google.com/u/0/photos/106056936857240793028/albums/5598207628299505201
View full article
Instructions There are several main hardware configuration steps. After installing the battery, once the USB cable has been connected between the evaluation board and PC, it may be necessary to update the chip firmware which requires moving a jumper pin on the evaluation board. Install the included battery into the VBAT (RTC) battery holder. Then, connect one end of the USB cable to the PC and the other end to the Power/OSJTAG mini-B connector on the TWRK40x256 module. Allow the PC to automatically configure the USB drivers if needed. Before updating the firmware, it is necessary to start a CodeWarrior Project. Open Codewarrior Navigate to File-> New ->Bareboard Project Select Kinetis K40->MK40X256VMD100 , P&E Open Source Jtag, C Language, No Rapid Application Development ,Finish Click on the main.c To get project focus Selection Project->Build Configurations->MK40X256VMD100_INTERNAL_FLASH Project-»Build All Run->Debug Configurations—> Use the Codewarrior download Filter and Select "PROJECTNAME_MK40XD256VMD100_INTERNAL_FLASH_PnE_OSJTAG" Additional step is required if the firmware is out of date: Firmware Upgrade Instructions (if needed) Firmware may change after an evaluation board has been manufactured and shipped. As a result, an alert will be displayed during the first attempt to download software to the board. Follow the instructions carefully. Unplug the USB cable. Look for the two pins labeled JM60 Boot and put a jumper on those pins Note: As it comes from the factory, the K40 board has a free jumper on the board. . Jumper J13 is labeled "JM60 BOOT." It connects two header pins which set the evaluation board in the firmware programming mode. This jumper is behind the LCD screen, and right next to LED/Touch Sensor "E3". Remove the LCD creen to gain access to the jumper. Reconnect the USB cable and click OK. Wait for the new firmware to download. A new dialog will appear when the process is complete. Unplug the cable, remove the jumper, and reconnect the cable. Then click OK. (You can store the jumper on the board, just set it so that it does not connect pins.) You may or may not encounter the firmware issue, or the multiple configurations issue. Once resolved, you should not see them again. With propertly set up hardware, users can return to Step 3: Import the LED Project of the Blink a LED on Kinetis Tutorial
View full article
Summary   This page contains the technical information for the FRDM-OLED shield.    This includes the schematics, bill of materials (BOM),  gerber files and raw design files.   Main features: Newhaven NHD-2.7-12864UCY3 128x64 pixel graphic OLED Display Electret microphone interface with gain control RS-485 Interface for doing cool things like driving a DMX lighting system. General purpose I/O (I/O is shared with A/D pins so you could make your own scope!)       Example software, video tutorials tutorials, cool demos, etc are location on the page for MonkeyListen project page located here.     Notes:   You can order PCBs through OSHPark or your favorite board house.   There is a special .zip file with files ready to go for OSHPark  (using their preferred naming convention). There is a complete design package which has the raw design files (Altium Designer Format) as well as gerbers,  a bill of materials,  assembly plots etc.  Look in the "BUILD_PACKAGE" folder for the stuff needed to make the board. A PDF Schematic is also provided for easy reference.   If you are interested in a low cost pre-fabbed board or a fully assembled version,  please leave a comment.  A kickstarter project may follow to get a bunch built!
View full article
Freescale Cup shield introduction for use with the FRDM-KL25Z or similar development board. Steps through the schematic of the FRDM-TFC shield and explain it's interfaces, logic, and use.
View full article
What is a microcontroller (MCU)? A microcontroller includes a microprocessor (CPU) as well as a number of other components like RAM, flash and EEPROM to store your programs and constants. While a microprocessor requires external devices to control things like input/output, or timers to implement periodic tasks, and digital to analog converters, a microcontroller is all inclusive. Contrast this all-in-one approach with a typical personal computer which contains an INTEL or AMD CPU, as well as separate chips for RAM, a separate video card, a dedicated hard drive, silicon chips or PCI circuit boards to enable the processor to access USB, serial and video card signals Microcontroller pins are general purpose, whereas CPU pins are specific. This means that each pin is tied to a multiplexer which you must set to choose the particular use for the pin. For example, in a microcontroller, one pin pin might be re-purposed for the following tasks 1. The output of a timer 2. Send a signal to a motor 3. Receive an input from a sensor or analog device
View full article
This article serves you as an introduction of Kinetis TWR K40 microcontroller. At the end of this part, you shall be able to answer some basic questions such as: what is Kinetis K40, and what is a Tower System. 2. Kinetis K40 32-bit Kinetis MCUs represent the most scalable portfolio of ARM® Cortex™-M4 MCUs in the industry. Enabled by innovative 90nm Thin Film Storage (TFS) flash technology with unique FlexMemory (configurable embedded EEPROM), Kinetis features the latest low-power innovations and high performance, high precision mixed-signal capability. For the Freescale Cup Challenge, we have provided several tutorials, example code and projects based on the twr-k40x256-kit. This board is part of the Freescale tower-system, a modular, reusable development platform that allows engineers to quickly prototype new designs. The K40 chip is a 144 pin package with 512KB of Flash, 245Kb of Program Flash, 4KB of EEProm, and 64KB of SRAM.      Important Documents:           Kinetis K40 Reference Manual           Besides the Reference manual and the Datasheet, the most useful document for learning to program the K40 chip is the:           Kinetis Peripheral Module Quick Reference           Data sheet           Errata      External Links           Freescale's Kinetis K40 Product Page (You can find all the information you want about Kinetis K40 over here) 3. TWR-K40X256 Kit The TWR-K40X256 Kit is a Freescale evaluation board powered by the Kinetis K40 microcontroller. The Kinetis microcontroller family is a set of 32 bit ARM Cortex M4 chips which feature flexible storage, lower power usage, high performance and optional Floating Point Unit with many useful peripherals. For more information on the Kinetis family see Freescale's Kinetis website. The Tower System is a prototyping platform with interchangeable and reusable modules along with open source design files. Freescale K40 MCU Tower Module: TWR K40X256 Hardware Setup There are several main hardware configuration steps. After installing the battery, once the USB cable has been connected between the evaluation board and PC, it may be necessary to update the chip firmware which requires moving a jumper pin on the evaluation board. TWR K40X246 Hardware Setup Instructions Board Tips The TWR-K40X256 features a socket that can accept a variety of different Tower Plug-in modules featuring sensors, RF transceivers, and more. The General Purpose TWRPI socket provides access to I2C, SPI, IRQs, GPIOs, timers, analog conversion signals, TWRPI ID signals, reset, and voltage supplies. The pinout for the TWRPI Socket is defined in Table 3 of the TWR-K40X256 User's Manual, but the user manual does not describe how to order a connector. A Samtec connector, part number: SFC-110-T2-L-D-A is the proper female mating connector for the TWR-K40X256 TWRPI socket. SIDE A/SIDE B White DOTS for counting Pins Solder Wire to GND, and to MCU VDD Pin for testing purposes      Important Documents           TWR-K40X256 User's Manual           TWR-K40X256 Schematics      External Links           TWR-K40X256-KIT Webpage           Kinetis Discussion Forum           Tower Geeks Community Website           Tower Geeks Freescale Cup Group .
View full article
How to create a basic project from scratch in Codewarrior for the the Freedom board. View Video Link : 1459
View full article
Most embedded systems must operate continuously without any user input, even if something goes wrong. Most of us have experienced having our desktop or laptop computer locking up and requiring a reboot of the system to get it working again. We simply cannot afford to do this in an embedded system. Ideally, we would write our software so that it never crashes or fails. This, as you can guess, is really hard to do and so our microcontroller manufacturer has included a hardware feature called the Computer Operating Properly, or COP, reset generator. If this hardware feature does not receive a confirmation signal that our program is running properly, it will generate a reset to restart our program from the beginning or from a restart place that we can choose. The COP is also called a watchdog timer.  The COP reset circuitry guards against our program not working properly by expecting the program to execute a particular sequence of instructions at some interval. If the COP does not receive this sequence before it times out, it generates a reset by pulling the RESET_L signal low. This can reset all peripherals connected to the reset line. The CPU then fetches a COP reset vector to restart the program again. Thus the COP is treated like other interrupts except that it cannot be masked once the COP timer has been started. Often you would like to restart at the beginning of your program but in some situations you may choose to enter some diagnostic routine, such as updating a counter that counts the number of COP restarts that have occurred or lighting an LED, before restarting the program. You may also wish to leave some debugging breadcrumbs to help you understand why the COP is resetting the program.
View full article
The TRK-MPC560xB: MPC560xB StarterTRAK (Development Kit) is a Freescale evaluation board powered by the qorivva chip. The Qorivva microcontrollers family is a set of 32 bit Power Architecture chips. Which Chip do you have? The chipset mounted on the boards for the Freescale Cup can vary. Always validate your chipset to know it's full capabilities. MPC560xB Product Information Page Difference Highlights: 5604B = 512MB Code Flash; no DMA 5606B = 1MB Code Flash; Has 16-Channel DMA 5607B = 1.5Mb Code Flash; Has 16-Channel DMA TRK-MPC5604B Hardware Setup There are several main hardware configuration steps. After installing the battery, once the USB cable has been connected between the evaluation board and PC, it may be necessary to update the chip firmware which requires moving a jumper pin on the evaluation board. TRK-MPC5604B Hardware Setup Instructions Lectures: The Freescale Cup – Lecture 5: MPC5607B Overview Overview Slides from lecture Overview Slides from Lecture (PDF) other Lectures from the Freescale Cup Lecture Series Other Qorivva Tutorials: qorivva-blink-led qorivva-drive-dc-motor qorivva-turn-a-servo qorivva-line-scan-camera Board Tips Important Documents TRK-MPC5604B User's Manual TRK-MPC5604BQuick Reference Guide TRK-MPC5604B Schematics Reference manual External Links TRK-MPC5604B Webpage
View full article
Here are some special offers from our partners from around the world: MathWorks support software for The Freescale Cup participants Stay tuned... more to come
View full article
Line scan camera data processing - Part I
View full article
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
View full article