University Programs Knowledge Base

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

University Programs Knowledge Base

Labels

Discussions

Sort by:
In this training video we will examine some concepts in approaching a vehicle control system.  This includes the stages in data flow and update rates of the control software.   The concept of differential steering will be introduced.
View full article
The Team from the University of Padova in Vicenza are working in getting their race car ready for the upcoming EMEA Finals that will be held in Paris on 26-27 March. They filed this short video on a make up track. Conditions were not the best so they had to scale down the speed.
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. 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
All, The date is getting closer: 28-30 August in Seoul, South Korea. Here is the official agenda (subject to last minute modifications) and more information: Location: Olympic Gymnasium at Hanyang University in Seoul Dates: 28-30 August 2014 Hotel location: Hotel Prima http://www.prima.co.kr  / Address •536, Dosan-daero, Gangnam-gu Seoul, Seoul, Korea /  Phone +82-2-6006-9201 Agenda Date Time Event Location 28-Aug-2014 Arrival at airport Transfer to Hotel and free time Hotel Prima 29-Aug-2014 7:30 - 8:30 Breakfast Hotel Prima " 8:30 Meet in the lobby for departure Hotel Prima " 9:00 - 12:00 City Tour " 12:00 - 13:00 Lunch " 13:00 - 13:30 Transfer to Hanyang University " 13:30 - 17:00 Practice on Practice tracks Hanyang University - Olympic Gymnasium " 17:00 - 17:10 Presentation: History of the Intelligent Car Competition Hanyang University - Olympic Gymnasium " 17:10 - 17:30 Teams' Introduction Hanyang University - Olympic Gymnasium " 17:30 - 17:40 Rules and Information Hanyang University - Olympic Gymnasium " 17:40 - 18:00 Q&A Hanyang University - Olympic Gymnasium " 18:00 - 18:30 Transfer to dinner " 18:30 - 20:30 Dinner " 20:30 - 21:00 Transfer to Hotel Prima Hotel " 21:00 Free Time 30-Aug-2014 7:30 - 8:30 Breakfast Prima Hotel " 8:30 Meet in the lobby for departure Prima Hotel " 8:30 - 9:00 Transfer to Hanyang University Prima Hotel " 9:00 - 9:30 Registration and technical inspection Hanyang University - Olympic Gymnasium " 9:30 - 12:00 Practice on Practice tracks Hanyang University - Olympic Gymnasium " 12:00 - 13:00 Working Lunch (lunch boxes) Hanyang University - Olympic Gymnasium " 13:00 - 13:15 Keynote by VIP Hanyang University - Olympic Gymnasium " 13:15 - 13:30 Introduction of The Worldwide Freescale Cup Championship Hanyang University - Olympic Gymnasium " 13:30 - 15:00 Finals Race Hanyang University - Olympic Gymnasium " 15:00 - 15:30 Awards Ceremony Hanyang University - Olympic Gymnasium " 15:30 - 15:40 Introduction of The Worldwide Freescale Cup 2015 in Germany Hanyang University - Olympic Gymnasium " 15:40 - 16:30 Transfer to Tour and Dinner " 16:30 - 20:00 City Tour and Dinner " 20:00 - 20:30 Transfer to Hotel Prima Hotel " 20:30 Free Time 31-Aug-2014 Check out and Transfer to Airport
View full article
This tutorial covers the details of Turning A Servo on the Kinetis K40 using TWR-K40x256-KIT evaluation board. Overview In this exercise you will build a “bare metal” (no RTOS) application which turns a servo, targeting a Freescale K40 board. You will: Create the Servo code in CodeWarrior Build the Servo project Download and run the code on a Kinetis K40 Tower System board Learn how to utilize the FlexTimer module to control a Servo   To successfully complete this exercise you need the following board and development environment. The K40 Tower card, TWR-K40x256 Tower Elevator Panels Servo Prototyping Board Power to your servo - either utilize the 7.2v Nicad Battery or a DC power supply CodeWarrior for Microcontrollers 1. Hardware 2. Create a New CodeWarrior Project 3. Build the Code 4. Download/Debug/Run 5. Learning Step: Servo Code Description Example Code Variables Init_PWM_Servo PWM_Servo PWM_Servo_Angle Set Up a Look-Up Table for Servo Angles Other K40 Tutorials: Links 1. Hardware   The first step of this tutorial requires you read the Turn A Servo article for background information on servo's, timer modules, PWM signals and counters. You will need to connect your servo to the microcontroller and also to a separate power source. 2. Create a New CodeWarrior Project The next step is to create a new project (or add this code to an existing project). 3. Build the Code If you have more than one project in your project view, make sure the proper project is the focus. The most reliable way to do this is to right click the project and choose Build Project as shown below. You can also go to the Project menu and choose the same command. If you encounter errors, look in the Problems view and resolve them. You can ignore any warnings. 4. Download/Debug/Run This link shows a video of the servo turning the wheels from left to right in small increments http://www.youtube.com/watch?v=QgwASk9DHvU&feature=relmfu 5. Learning Step: Servo Code Description Your code will sweep your servo from max to minimum angular position, and then back again continuously. Example Code This code sets up the Pulse Width Modulation Timer Module for use by a servo. It is set to utilize Edge-Aligned PWM, and this file properly configures the period, and pulse width for use by the other modules Several important functions are contained in this file: 1. Init_PWM_Servo () - initializes the timer module 2. PWM_Servo (double duty_Cycle) - enter the desired duty cycle setting for the servo 3. PWM_Servo_Angle (int Angle) - enter the desired angle for the servo Straight forward - PWM_Servo_Angle (45) Full left - PWM_Servo_Angle (90)Full right - PWM_Servo_Angle (0)   4. Servo_Tick - interrupt routine which executes once/servo period PWM_Servo (double duty_Cycle) Init_PWM_Servo () PWM_Servo_Angle (float Angle) void ServoTick() Variables FTM0_CLK_PRESCALE TM0_OVERFLOW_FREQUENCY Pulse_Width_Low Pulse_Width_High Total_Count Low_Count Scale_Factor Angle Init_PWM_Servo Void Init_PWM_Servo () { //Enable the Clock to the FTM0 Module SIM_SCGC6 |= SIM_SCGC6_FTM0_MASK;  //Pin control Register (MUX allowing user to route the desired signal to the pin.  PORTC_PCR4  = PORT_PCR_MUX(4)  | PORT_PCR_DSE_MASK; //FTM0_MODE[WPDIS] = 1; //Disable Write Protection - enables changes to QUADEN, DECAPEN, etc.  FTM0_MODE |= FTM_MODE_WPDIS_MASK; //FTMEN is bit 0, need to set to zero so DECAPEN can be set to 0 FTM0_MODE &= ~1; //Set Edge Aligned PWM FTM0_QDCTRL &=~FTM_QDCTRL_QUADEN_MASK;  //QUADEN is Bit 1, Set Quadrature Decoder Mode (QUADEN) Enable to 0,   (disabled) // Also need to setup the FTM0C0SC channel control register FTM0_CNT = 0x0; //FTM Counter Value - reset counter to zero FTM0_MOD = (PERIPHERAL_BUS_CLOCK/(1<<FTM0_CLK_PRESCALE))/FTM0_OVERFLOW_FREQUENCY ;  // Count value of full duty cycle FTM0_CNTIN = 0; //Set the Counter Initial Value to 0 // FTMx_CnSC - contains the channel-interrupt status flag control bits FTM0_C3SC |= FTM_CnSC_ELSB_MASK; //Edge or level select FTM0_C3SC &= ~FTM_CnSC_ELSA_MASK; //Edge or level Select FTM0_C3SC |= FTM_CnSC_MSB_MASK; //Channel Mode select //Edit registers when no clock is fed to timer so the MOD value, gets pushed in immediately FTM0_SC = 0; //Make sure its Off! //FTMx_CnV contains the captured FTM counter value, this value determines the pulse width FTM0_C3V = FTM0_MOD; //Status and Control bits FTM0_SC =  FTM_SC_CLKS(1); // Selects Clock source to be "system clock" or (01) //sets pre-scale value see details below FTM0_SC |= FTM_SC_PS(FTM0_CLK_PRESCALE); /******begin FTM_SC_PS details **************************** * Sets the Prescale value for the Flex Timer Module which divides the * Peripheral bus clock -> 48Mhz by the set amount * Peripheral bus clock set up in clock.h *  * The value of the prescaler is selected by the PS[2:0] bits.  * (FTMx_SC field bits 0-2 are Prescale bits -  set above in FTM_SC Setting) *  *  000 - 0 - No divide *  001 - 1 - Divide by 2 *  010 - 2 - Divide by 4 *  011 - 3 - Divide by 8 *  100 - 4 - Divide by 16 *  101 - 5 - Divide by 32 *  110 - 6 - Divide by 64 - *  111 - 7 - Divide by 128 *  ******end FTM_SC_PS details*****************************/ // Interrupts FTM0_SC |= FTM_SC_TOIE_MASK; //Enable the interrupt mask.  timer overflow interrupt.. enables interrupt signal to come out of the module itself...  (have to enable 2x, one in the peripheral and once in the NVIC enable_irq(62);  // Set NVIC location, but you still have to change/check NVIC file sysinit.c under Project Settings Folder } PWM_Servo Void PWM_Servo (double duty_Cycle) {          FTM0_C3V =  FTM0_MOD*(duty_Cycle*.01); } PWM_Servo_Angle //PWM_Servo_Angle is an integer value between 0 and 90 //where 0 sets servo to full right, 45 sets servo to middle, 90 sets servo to full left void PWM_Servo_Angle (float Angle) {    High_Count = FTM0_MOD*(Pulse_Width_High)*FTM0_OVERFLOW_FREQUENCY;    Low_Count = FTM0_MOD*(Pulse_Width_Low)*FTM0_OVERFLOW_FREQUENCY;    Total_Count = High_Count - Low_Count;    Scale_Factor = High_Count -Total_Count*(Angle/90);     FTM0_C3V = Scale_Factor; //sets count to scaled value based on above calculations } Set Up a Look-Up Table for Servo Angles int main(void) {   //Servo angles can be stored in a look-up table for steering the car.   float table[n] = { steering_angle_0;    steering_angle_1;    steering_angle_2;   ……    steering_angle_n-1    };   Steering_Angle = table[x];   PWM_Servo_Angle (Steering_Angle); // Call PWM_Servo_Angle function. } Other K40 Tutorials: K40 Blink LED Tutorial K40 DC Motor Tutorial Kinetis K40: Turning A Servo K40 Line Scan Camera Tutorial Links Kinetis K40 TWR-K40X256-KIT
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
This guide provides all the participants of the Freescale Cup finals with the key information to get organised during the event. This is the final version
View full article
Overview: The TWR-TFC-K20  is an all-in-one tower CPU card that can be used to create an autonomous race vehicle for the the Freescale Cup.   It has all the interfaces necessary for the car to sense the track and control the vehicle    This card is also a great platform for teaching embedded systems.   The TWR-TFC-K20 uses a Freescale Kinetis K20 MCU and has some really cool I/O to keep students interested. Features: Servo Outputs 3-pin Header to connector directly to steering Servo 1 Extra Servo header. Camera Interfaces 1. 5-pin header to connect directly to a Freescale Line Scan Camera 2. Header for 2nd linescan camera (optional) 3. RCA Camera Interface. Includes an LMH1981 Sync Extraction chip and connection to MCU to allow for low resolution (64x64) image capture at 60FPS Power Accepts direct battery power – onboard switching regulator 5-18v All circuitry except for motor controller can be optionally powered over USB Connector DC Motor Drivers QTY 2 MC33887APVW : Dual, Independent 5A Motor Driving Circuit. Supports forward, reverse and braking. Independent control over each drive motor allows for an active differential implementation Current Feedback to MCU ADC to allow for closed loop torque control CPU/ Programming Integrated Kinetis MK20DN512ZVLL10MCU with OSJTAG Additional I/O Some basic I/O for debugging. 4-poistion DIP Switch + 4 LEDs + 2 pushbuttons. Inputs for Tach Signal/Speed Sensor Design Files Rev Beta [B] (Current Production version) Schematics, Assembly Prints, BOM, etc. - Includes 3d view Rev B Errata: None known! Example Code: All software relating to the TWR-TFC-K20 is held in an Google Code Subversion repository.   This is the only way the source is distributed.   Never used a version control system yet?   Now is the time to learn (Google is your friend)!   All "real" software development processes use some form of version control.  TortoiseSVN is a nice client for SVN! Google Code Repository: https://code.google.com/p/tfc-twr/ This code works with Rev B of the board. All major interfaces & peripherals have been tested. At some point we will make a video going through the code. By default, the Linescan camera code is enabled. The code in main.c is pretty easy to follow. There is also code for the NTSC camera but must enabled in the TFC_Config.h file via a pre-processor directive. There is also code used for the OSTAG interface, Labview demo applications and drivers for the USB Videos:
View full article
How to setup GPIO on the Kinetis. Includes discussion on enabled clocks to peripherals and setting up the pin control registers.
View full article
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: 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
View full article
A great exercise when first starting with a new microcontroller is to get LEDs to turn-on, flash, or dim. Depending upon the configuration of your circuit, a LED (light-emitting diode) is accessed by toggling a GPIO or 'General Purpose Input Output pin either high or low. GPIO pins can be configured either as an input (read) or output (write). A high signal is often referred to as "Asserted" or a logic "1" and a low signal designated as Negated or logic "0". The input and output voltage range for GPIO pins is typically limited to the supply voltage of the evaluation board. Usage To optimize functionality in small packages, physical microcontroller pins have several functions available via signal multiplexing. Internally, a pin will have several wires connected to it via a multiplexer (wiki) or MUX. A multiplexer selects between several inputs and sends the selected signal to its output pin. The Signal Multiplexing chapter of your reference manual illustrates which device signals are multiplexed on which external pin. The Port Control block controls which signal is present on the external pin. The configuration registers within a microcontroller require proper configuration to select the GPIO as an input or output. The same GPIO pins utilized to blink a LED can be wired to read a signal coming from an external device such as the input from a hall effect sensor. Freescale Cup participants will configure GPIO pins as outputs to control the line-scan-camera via timed pulses and clock type signals. Read/Write In write mode, the GPIO pin can be set, cleared, or toggled via software initiated register settings. To determine which pin on the microcontroller is connected to a LED and how to access it from software, refer to the schematic of the microcontroller board. This pin will have numeric or alfanumeric value as well as an descriptive designation such as PTC7. Microcontroller Reference Manual: GPIO Information You will find high level information about GPIO usage in several different areas of a reference manual. See thereference-manual article for more general information. Relevant Chapters: Introduction: Human-machine interfaces - lists the memory map and register definitions for the GPIO System Modules: System Integration Modules (SIM) - provides system control and chip configuration registers Chip Configuration: Human-Machine interfaces (HMI). Signal Multiplexing: Port control and interrupts Human-Machine Interfaces: General purpose input/output Hardware As stated before, internal registers control whether a pin is high or low. Determining the polarity or orientation of your LED is important because this will let you know whether to set the associated pin in the HIGH or LOW state. The evaluation boards from Freescale all provide LED circuits like the one shown below. LED Circuit The circuit in figure (1) demonstrates a simple way to to power a LED. The circuit consists of connecting in a LED, resistor (which limits the current) and voltage source in series. LED's are semiconductors which convert current to light. When they are forward biased (turned on), electron and holes will recombine with no change in momentum, emitting a photon or light wave. Choosing the resistor is simple if you know the operating current requirements for your LED which are determined by reading the LED datasheet or specification document. R = (Vs - VL)/ IL Where V s is the power supply voltage, and V L is the Voltage Drop across the LED, and I L is the desired current through the LED.
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
This tutorial is meant to introduce you to the use of a push button. It will give an explanation and example code of how you could implement a push button. Push buttons can be a great way to set a number of different states. Push buttons are advantageous because you can change your code physically versus pulling up the debugger every time you want to make a little change. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Usage A button can have many different functions on your autonomous vehicle. Most notably the button has been used for testing to start, stop, or put your car in a configuration mode. Configuration mode would let you test to see if all the peripherals except the motors are working. This would help you test your camera data and servo angles without always having to run after your car. During your race you can even set your button to different speed states. Since you have two chance to traverse the track you may have a slower safer speed on one state and a faster speed the pushes the limit on another state. In the end, what you do with the button is up to you and the choices are unlimited. Description of Example Code Below there will be an example of how to implement a push button. This push button will be connected to PTA16. When reading this pin a high, "1" or 5V, is considered "OFF" and a low, "0" or 0V, is considered "ON." To reduce the effects of bounce and/or the chance of a false press, additional code has been added to filter the signal. This is done by checking the button every 10ms for 50ms. If the button has been pressed for 3 or more of the 5 times we will change the state, otherwise it will not be considered a "press." Button Initialization Here is the initialization code that can be put in a header such as "Button.h." #define BUTTONLENGTH 5   // Button's Defined State   // 0 means button not pressed   // 1 means button pressed short fButton = 0; short iButtonCount=0; short iButtonTimer=0;   // Button Triggered Start time short iButtonTime; void initButton() {   //turn on clock to Port A   SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;   // configure pin to be GPIO   PORTA_PCR16 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;   // configure PTA16 to be input   GPIOA_PDDR &= (0<<16);  } See GPIO for explanation of how these specific commands work. Button Implementation Below is an example of a function that implements the button function. This function can be stored in a header file "Button.h" along with the initialization code. To call this function you would just place "readButton();" in your 10ms Flextimer source code. Read comments for description of each line Void readButton () {                  short fButtonState  = 0;   // initializes the button state to "OFF"           iButtonCount++;            // increments button count      if (GPIOA_PDIR & (1<<16)) {                    // if button read as high then its off otherwise its on           fButtonState = 0;      } else {           fButtonState = 1;      }      if (fButtonState && ! fButton) {                          // if the button is pushed and it previously wasn't then start a count           iButtonTimer++;           if (iButtonTimer <= 1) {                                                             iButtonCount = 0;                                 // Reset the Button Count if the timer is less or equal to 1           }      } else if (! fButtonState && fButton) {           iButtonTimer++;           if ( iButtonTimer <= 1) {                iButtonCount = 0;                               // Reset the Button count if the timer is less or equal to 1           }      }      if ( iButtonCount > BUTTONLENGTH && iButtonTimer >0) {     // if button has been read for 50ms check to see if we passed the test!           if ( iButtonTimer > (3*BUTTONLENGTH/4) && fButton) {                // fButton = 0;           } else if (iButtonTimer > (3*BUTTONLENGTH/4) && ! fButton) {                fButton = 1;           }           iButtonCount = 0;           iButtonTimer = 0;     } }
View full article
MCU101 (Theory Topics)   Know Your Microcontrollers   Blink LED   Drive a DC Motor   Turn a Servo   https://community.nxp.com/docs/DOC-1030   Navigating Technical Documentation   C programming for Embedded System Software Tools CodeWarrior Software Development Tools & IDE CodeWarrior Beginners Tutorial (videos)   TRK-MPC 5604B Hardware Setup   Creating a new bareboard project   Debugging a bareboard project   Importing projects and merging code   Discussion of the header files (part 1)   Discussion of the header files (part 2) Qorivva Specific (with Code) Beginners Hands-on Tutorials Blink LED Drive DC Motor Turn A Servo Line Scan Camera Hardware https://community.nxp.com/docs/DOC-1016 DIY Camera Mounting Wiring Connections for TRK-MPC5604b Batteries Advanced Tutorial Series Push-Buttons   I2C Sensors using Kinetis K40 Miscellaneous Topics PCB design tips
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
Video on YouTube done by the University of Applied Sciences of Munich about the Freescale Cup event held on March 18th Freescale Cup 2014 an der Hochschule München - YouTube
View full article
Kinetis Header Part 1 of 2
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
CW_NEW_PROJECT.wmv
View full article
This tutorial covers the details of Driving a motor on the on the Kinetis K40 using the TWR-K40x256-KIT evaluation board. Overview In this exercise students will utilize the sample project to turn a motor on and off using the TWR-K40x256-KIT evaluation board. Students will: Put together the car chassis Create a Sample Project Build the code Download and run the code on a Kinetis TWR-K40x256 board. Learn how the code works   To successfully complete this exercise students will need the following board and development environment. Kinetis TWR-K40x256 board Motor Driver Board Freescale Cup Chassis with the Motors connected 7.2v Nicad Battery CodeWarrior for Microcontrollers Recommend completing the the Blink LED Tutorial before undertaking this Tutorial Put together the Car Chassis:   There are several steps in this process: Build the Freescale Cup Car Chassis Hardware Design Step Review the Driving A DC Motor Article If needed, obtain background information on motors, timer modules, PWM signals and counters by navigating to the driving a DC motor article. Design and Implement The Hardware 1. You will need to connect the Tower K40 to the Motor Board via the TWR-PROTO or some other mechanism. 2. You will need to connect the Motor Board to the DC motors and Battery This link shows a video of the motors spinning. They start from Off and slowly pick up speed http://www.youtube.com/watch?v=kY2bRiICzwc&feature=relmfu Motor Controller Board This board takes the low-voltage, low-power "control" signals from the MCU and through an H-Bridge takes ahigh-voltage, high-power power supply (the battery) to drive the motors. Motor Board page. 1. Be careful with the wires connected to the motor. Constant flexing of the solder connection can result in joint failure. If this happens, just re-solder it. 2. The wires which protrude from the motors of The Freescale Cup Chassis are in the format of Insulated Crimp On Bullet Connectors. These can be found at Radio Shack if they are missing from the kit. Build the Code If you have more than one project in your project view, make sure the proper project is the focus. The most reliable way to do this is to right click the project and choose Build Project as shown below. You can also go to the Project menu and choose the same command. Learning Step: Motor Code Description Functions Variables The edge-aligned mode is selected when (QUADEN = 0), (DECAPEN = 0), (COMBINE 0), (CPWMS = 0), and (MSnB = 1). The EPWM period is determined by (MOD − CNTIN + 0x0001) and the pulse width (duty cycle) is determined by (CnV − CNTIN). The CHnF bit is set and the channel (n) interrupt is generated (if CHnIE = 1) at the channel (n) match (FTM counter = CnV), that is, at the end of the pulse width. This type of PWM signal is called edge-aligned because the leading edges of all PWM signals are aligned with the beginning of the period, which is the same for all channels within an FTM. Initialize the Motor void InitMotorPWM()  {     //Enable the Clock to the FTM1 Module     SIM_SCGC6 |= SIM_SCGC6_FTM1_MASK;     // PORTC_PCR4 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;   //Enable GPIO on on the pin -     //route the output of that channel 0 to the pin... (pick a different multiplexer value for routing the timer)     //ch 11.4.1 of the k40 reference manual is the pin control register     //For port c pin 1..   bits 10-8  Pin Mux Control...     PORTA_PCR8  = PORT_PCR_MUX(3)  | PORT_PCR_DSE_MASK;     PORTA_PCR9  = PORT_PCR_MUX(3)  | PORT_PCR_DSE_MASK;     // Choose EDGE-Aligned PWM:  selected when QUADEN=0, DECAPEN=0, COMBINE=0, CPWMS=0, and MSnB=1  (page 964)     // Properly set up Flex Timer Module     //FTM0_MODE[WPDIS] = 1; //Disable Write Protection - enables changes to QUADEN, DECAPEN, etc.      FTM1_MODE |= FTM_MODE_WPDIS_MASK;     //FTMEN is bit 0, need to set to zero so DECAPEN can be set to 0     FTM1_MODE &= ~1;      //Set Edge Aligned PWM     FTM1_QDCTRL &=~FTM_QDCTRL_QUADEN_MASK;      //QUADEN is Bit 1, Set Quadrature Decoder Mode (QUADEN) Enable to 0,   (disabled)     //FTM0_SC = 0x16; //Center Aligned PWM Select = 0, sets FTM Counter to operate in up counting mode,     //it is field 5 of FTMx_SC (status control) - also setting the pre-scale bits here   //   Also need to setup the FTM0C0SC channel control register  - Page 897   section 37.3.6   FTM1_CNT = 0x0; //FTM Counter Value - (initialize the CNT before writing to MOD)  (16 bit available - bits 0-15 are count)   FTM1_MOD = FTM1_MOD_VALUE; //Set the Modulo resister (16 bit available - bits 0-15), Mod is set to 24000   FTM1_CNTIN = 0; //Set the Counter Initial Value to 0   (pg 915)   //change MSnB = 1   FTM1_C0SC |= FTM_CnSC_ELSB_MASK;   FTM1_C0SC &= ~FTM_CnSC_ELSA_MASK;   FTM1_C0SC |= FTM_CnSC_MSB_MASK;   FTM1_C0V = FTM1_MOD_VALUE/2; //Set the Channel n Value to  (16 bit available - bits 0-15)   //Set the complimentary pinout   FTM1_C1SC |= FTM_CnSC_ELSB_MASK;   FTM1_C1SC &= ~FTM_CnSC_ELSA_MASK;   FTM1_C1SC |= FTM_CnSC_MSB_MASK;   FTM1_C1V = FTM1_MOD_VALUE/2;   FTM1_SC = FTM_SC_PS(0) | FTM_SC_CLKS(1);    // Interrupts   FTM1_SC |= FTM_SC_TOIE_MASK; //enable the interrupt mask   enable_irq(63);  // (79-16) Set NVIC location, but you still have to change/check NVIC file sysinit.c under Project Settings Folder } Set the PWM of the Motor void SetMotorPWM(float DutyCycle) {    //float compDuty = (float)100.0-DutyCycle;    FTM1_C0V =(int)((DutyCycle*.01)* (float)FTM1_MOD_VALUE);    FTM1_C1V =(int)((1.0-DutyCycle*.01)* (float)FTM1_MOD_VALUE); } Create Interrupt when motor functions are complete void MotorTick() { if (MotorTickVar < 0xff)//if motor tick less than 255 count up...    MotorTickVar++; //Clear the overflow mask if set    if(FTM1_SC & FTM_SC_TOF_MASK)    FTM1_SC &= ~FTM_SC_TOF_MASK;    //LED_E2_TOGGLE; // ends up being ___ Hz (correct) } Calling the Motor function The function SetMotorPWM(MotorPwm) turns the motor at the "MotorPwm" rate from 0-49 (backwards), 50 (stall) and 100 (forwards).
View full article