University Programs Knowledge Base

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

University Programs Knowledge Base

Discussions

Sort by:
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\)
View full article
1. Download CodeWarrior 2.8 Evaluation Version (Classic, 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 "V2.8" Click the "download" button next to "Evaluation: CodeWarrior for MPC55xx/MPC56xx Microcontrollers V2.8 (Classic)". and save it to your computer. 2. Install CodeWarrior To install CodeWarrior Development Studio for Microcontrollers v2.8, 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? 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 Qorivva Tutorial
View full article
Notes: Will ask - Do you want to add the Remote System to your workspace? Click yes Build - select flash Plug in your K40 board to the usb (tower is not needed in this step) Click on debug as it will ask you which configuration you want to launch: Select the internal flash one. Bottom right you will see it "Launching with a little green light indicating that it is programming your board. After clicking debug as, you will enter the debug Eclipse "view" nothing will happen until you press "resume" Download the Zip file which is located: LED BLINK 96MHZ How to: Set up a debug: Program the FLASH Click on project in codewarrior projects menu There is noe issue with the Kinetis chips errata 2448. The code which is in our zip file already has these changes made, but if you download Kinetis example code from the official freescale site instead of using the wiki code - it may not work. Read more about the work - around here: here ++ Test to make sure everything is working properly CodeWarrior typically defaults to a "pause" setting when the debug is first started. To test wheter the code is working you will need to press "resume"
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
There are three types of memory in a typical Micrcontroller  FLASH - where your programs are stored RAM - for manipulating variables during runtime EEPROM - stores long term information
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
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.  overview-create-a-pwm-signal Once you feel comfortable that you understand the concepts behind a duty cycle signal, return to Reference Manual: Timer Information portion of the Drive A DC Motor Tutorial
View full article
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
View full article
Lecture 1: Introduction and Motor Basics  This training module presented by Professor L. Umanand of CEDT, Indian Institute of Science, Bangalore provides an overview of the Freescale Cup – 2011. It introduces to the challenge describing the various components of the intelligent car tracker. Lecture 2: Pulse Width Modulation  This lecture provides an overview of Pulse Width Modulation Lecture 3: Control Design  This lecture describes controller design and PID control Lecture 4: Speed and Position  This Lecture discusses integrating your PID with sensor data Lecture 5: MPC5607B Overview  This training module provides an overview of the 32-bit Qorivva MPC5607B Processor. The course is targeted towards beginners in order to enable them to quick start the development of software on the MPC5607B.
View full article
Instructions There are several main hardware configuration steps. 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. Then, connect one end of the USB cable to the PC and the other end to the Power/OSJTAG mini-B connector on the TWRK60N512 module. Allow the PC to automatically configure the USB drivers if needed. Before updating the firmware, it is necessary to start a CodeWarrior Project. In this case, the easiest way to do this is to actually navigate to the sample project and click on the Sample.mcp file. This will open CodeWarior 2.8. 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. 1.     Unplug the USB cable.   2.     Look for the jumper (On the REV B Board) labeled "OSBDM_IRQ" - it is jumper 35. It will be found between the on/off switch and to the right of the the white "Lin" connectors. Remove one of the "LED Enable" jumpers for this if you don't have a   header jumper handy and put the jumper on the OSBDM_IRQ header These LED Jumpers are just above the blue potentiometer knob and marked as "J27."   3.    Reconnect the USB cable and click OK.   4.     Wait for the new firmware to download. 5.     A new dialog will appear when the process is complete.  6.    Unplug the cable, remove the jumper, return it to the location it was "borrowed from" and reconnect the cable. 7.    Then click OK.
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
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
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
View full article
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 Specific Tutorials K40 Blink LED K40 Drive DC Motor K40 Drive Servo Motor K40 Line Scan Camera 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
http://www.gpdealera.com/cgi-bin/wgainf100p.pgm?I=FUTM0043  This is the Futaba Standard Size Ball Bearing High Torque Servo. This servo can produce high-current draw from your batteries. If using NiMH or LiPo batteries, make sure they are capable of delivering approximately 2A for each servo. FEATURES: Ideal for high-torque applications requiring a standard size servo Universal connector fits Futaba, Hitec, JR, KO Propo, Airtronics Z, and Tower Hobbies. Does not fit old Airtronics A plug w/out adapter Nylon gears One bearing pre-mounted on output shaft. INCLUDES: One Futaba standard size high torque servo with; One 1.4" (35mm) diameter round servo wheel One 1.5" (39mm) diameter 4 point servo wheel One 1.25" (32mm) diameter 6 point servo wheel Four 2mm x 11mm phillips screws Four rubber grommets & Four metal eyelets REQUIRES: Small phillips screwdriver to mount to surface SPECS: Speed: 0.20 sec/60° @ 4.8V 0.16 sec/60° @ 6.0V Torque: 72 oz-in (5.2 kg-cm) @ 4.8V and 90 oz-in (6.5 kg-cm) @ 6V Dimensions: 1.6 x 0.8 x 1.5" (1-9/16 x 13/16 x 1-1/2") (40 x 20 x 38mm) Weight: 1.5oz (1-7/16oz) (41g)
View full article
There are several programs on the market which are freely available. Below is a list of the more popular [free] ones.  Eagle PCB 123
View full article
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
View full article
'''Topics we want to cover''' Advanced Components Accelerometer Gyro Ultra-sonic Temperature Humidity Pressure GPS Power Efficiency Modes Serial I/O SD Card Terminal Debugger Bluetooth Wifi RF - Zigbee Capacitive Touch Memory Data Logging Graphics Segmented Display TFT DSP CMSIS A/D conversion Advanced Motor Control Three Phase Motor Control Motor Synchronization
View full article
Sifting through technical documentation is part of an engineers job.  Sometimes these documents can be hundreds or thousands of pages long, so knowing where to makes life much easier.  This article is going to try to help you navigate smarter... Freescale has the following structure for technical documents: Reference Manuals (Usually end with "RM") - These are typically the thick manuals.  You will find sections detailing operation, registers, and electrical characteristics. Data Sheet (Usually ends with "DS") - These are quick summaries of the specifications of the device.  Includes electrical characteristics such as operating voltages, input and output minimum and maximum ranges.  In addition to environmental characteristics such as temperature ranges and graphs of performance vs. certain conditions. Schematic (_SCH) - This is typically referred in terms of board designs.  A schematic is useful in finding out how and where an external thing (LED, button, Display) is connected to the microcontroller.  Fact Sheet (_FS) - This is generally overview type information.  Useful when you are trying to determine which microcontroller you want to use.  Errata - Sometimes there are bugs in the chip.  When these are discovered the company issues an errata.  Sometimes the item get's fixed in the next revision of the chip, sometimes you just work around the problem.  If you think it should be working and it's not check the erratas! Tips and Tricks Use the search or find function all the time. Shortcut key '''(Ctrl-F).''' Use two monitors. Have the document open in one, search or browse to what you need to find and simply copy and paste the configuration information into your IDE. Search tips:  Use the pin name.  (I.e. PTC, PORTA, or FTM) Save trees only print out what you need. Commonly Used Acronyms: PDB - Programmable Delay Block FTM - Flex Timer Module ADC - Analog to Digital Converter DAC - Digital to Analog Converter MCG - Multipurpose Clock Generator SPI - Serial Programming Interface CnV - Channel n Value CNTIN - Counter Initial Value SIM - System Integration Module SIM_SCGCn - System Integration Module, System Clock Gating Control Register CMP - Comparator Module SIM - Provides system control and chip configuration registers. You will use this to turn on the clocks to particular peripherals. The SIM_SCGC
View full article
Overview An H-Bridge circuit has a control circuit, usually PWM, which then determines the switching of high-voltage supply to drive a current. Typical embedded H-Bridges can drive about 5A of current. In the case, of the Freescale Cup car the motors can sustain much more current resulting in more toque and faster speeds. Performance Tuning Tips 1. You can place H-Bridges in parallel to balance the current load. For example, if you place two 5A (peak) H-Bridge outputs in parallel, the system can support up to 10A current. 2. Keep it Cool. H-Bridge's dissipate A LOT of heat. Heat = increases inefficiency of a semiconductor, so the better job you do keeping it cool, the better (and longer) it will work for you. Operation Theory This is the simplest H-bridge, where the four gates represent for transistors. By manipulating these gates and connecting the upper and lower terminals to a voltage supply, you can control the motor in all the behaviors as below. H-Bridge States
View full article