University Programs Knowledge Base

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

University Programs Knowledge Base

Labels

Discussions

Sort by:
One option for mounting the camera on the Freescale Cup car.  The only additional components you need are two zip ties. [no audio]
View full article
Here is a short update via video of the activities done at the University Programs demo area at the Embedded World 2014 Exhibition that was held on 25-27 March 2014 in Nuremberg (Germany).
View full article
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
In this training video we will decompose an NTSC video signal to gaining understanding of how to capture video data from a "analog" camera.
View full article
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
In this video we will look at the example code provided for the FRDM-TFC for use with Codewarrior.  
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
This tutorial will introduce you to I 2 C and provide a framework that you can use to start communicating with various devices that use I 2 C. This tutorial is meant for the Kinetis K40 and will probably not work on any other Kinetis chip. DISCLAIMER: This has not been fully tested and may not work for you and for all devices. The header file provided does not handle errors and should not be used for critical projects. 2C signaling I2C header file Example of I2C communication using Freescale MMA8452Q 3-axis accelerometer Introduction to I 2 C signaling I 2 C is a simple two wire communication system used to connect various devices together, such as Sensory devices and microprocessors using 8 bit packets. I 2 C requires two wires: the first is called SDA and is used for transferring data, the second is called SCL and it is the clock used to drive the data to and from devices. I 2 C uses an open drain design which requires a pull up resistor to logic voltage (1.8,3.3,5) on both SDA and SCL for proper operation. I 2 C is a master-slave system where the master drives the clock and initiates communication. The I 2 C protocol has 5 parts. The Start signal which is defined as pulling the SDA line low followed by pulling SCL low. The slave device address including the Read/Write bit The register address that you will be writing to/ reading from the data The acknowledgement signal which is sent from the receiving device after 8 bits of data has been transferred successfully. the Stop signal, which is defined by SDA going high before SCL goes high. 1. The start signal is sent from the Master to intiate communication on the bus. The start and stop signals are the only time that SDA can change out of sync with SCL. Once the start signal is sent no other device can talk on the bus until the stop signal is sent. If for whatever reason another device tries to talk on the bus then there will be an error and the K40 can detect this. 2. The slave device is a 7 bit (sometimes 10bit but this will not be covered in this tutorial) address provided by the device and is specific to the device. The type of data operation (read/write) is determined by the 8 th bit. A 1 will represent a write and a 0 a read operation. 3. The register addresses are provided by the device's specifications. 4. The data you will send to a device if you are writing or the data that you receive from the device when reading. This will always be 8 bits. 5. After 8 bits of data has been transferred successfully the receiving device will pull the SDA line low to signify that it received the data. If the transmitting device does not detect an acknowledgement then there will be an error. The K40 will be able to detect this. 6. The stop signal is sent from the Master to terminate communication on the bus. Some devices require this signal to operate properly but it is required if there will be more than one master on the bus (which will not be covered in this tutorial) I2C header file This header file only has functions for reading and writing one byte at a time. Most devices support reading and writing more than one byte at a time without sending the Stop signal. Typically the device will keep incrementing the register's address to the next one during read/writes when there is no stop signal present. See your device's user manual for more information. /* * i2c.h * * Created on: Apr 5, 2012 * Author: Ian Kellogg  * Credits: Freescale for K40-I2C example */  #ifndef I2C_H_  #define I2C_H_  #include "derivative.h"  #define i2c_EnableAck() I2C1_C1 &= ~I2C_C1_TXAK_MASK #define i2c_DisableAck() I2C1_C1 |= I2C_C1_TXAK_MASK  #define i2c_RepeatedStart() I2C1_C1 |= I2C_C1_RSTA_MASK  #define i2c_Start() I2C1_C1 |= I2C_C1_TX_MASK;\    I2C1_C1 |= I2C_C1_MST_MASK  #define i2c_Stop() I2C1_C1 &= ~I2C_C1_MST_MASK;\    I2C1_C1 &= ~I2C_C1_TX_MASK  #define i2c_EnterRxMode() I2C1_C1 &= ~I2C_C1_TX_MASK;\    I2C1_C1 |= I2C_C1_TXAK_MASK  #define i2c_write_byte(data) I2C1_D = data  #define i2c_read_byte() I2C1_D  #define MWSR 0x00 /* Master write */  #define MRSW 0x01 /* Master read */  /* * Name: init_I2C * Requires: nothing * Returns: nothing * Description: Initalizes I2C and Port E for I2C1 as well as sets the I2C bus clock */  void init_I2C()  {    SIM_SCGC4 |= SIM_SCGC4_I2C1_MASK; //Turn on clock to I2C1 module    SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK; // turn on Port E which is used for I2C1    /* Configure GPIO for I2C1 function */    PORTE_PCR1 = PORT_PCR_MUX(6) | PORT_PCR_DSE_MASK;    PORTE_PCR0 = PORT_PCR_MUX(6) | PORT_PCR_DSE_MASK;    I2C1_F = 0xEF; /* set MULT and ICR This is roughly 10khz See manual for different settings*/    I2C1_C1 |= I2C_C1_IICEN_MASK; /* enable interrupt for timing signals*/  }  /* * Name: i2c_Wait * Requires: nothing * Returns: boolean, 1 if acknowledgement was received and 0 elsewise  * Description: waits until 8 bits of data has been transmitted or recieved */  short i2c_Wait() {    while((I2C1_S & I2C_S_IICIF_MASK)==0) {    }     // Clear the interrupt flag    I2C1_S |= I2C_S_IICIF_MASK;  }  /* * Name: I2C_WriteRegister * Requires: Device Address, Device Register address, Data for register * Returns: nothing * Description: Writes the data to the device's register */  void I2C_WriteRegister (unsigned char u8Address, unsigned char u8Register, unsigned char u8Data) {    /* shift ID in right position */    u8Address = (u8Address << 1)| MWSR;    /* send start signal */    i2c_Start();    /* send ID with W/R bit */    i2c_write_byte(u8Address);    i2c_Wait();    // write the register address    i2c_write_byte(u8Register);    i2c_Wait();    // write the data to the register    i2c_write_byte(u8Data);    i2c_Wait();    i2c_Stop();  }  /* * Name: I2C_ReadRegister_uc * Requires: Device Address, Device Register address * Returns: unsigned char 8 bit data received from device * Description: Reads 8 bits of data from device register and returns it */  unsigned char I2C_ReadRegister_uc (unsigned char u8Address, unsigned char u8Register ){    unsigned char u8Data;    unsigned char u8AddressW, u8AddressR;    /* shift ID in right possition */    u8AddressW = (u8Address << 1) | MWSR; // Write Address    u8AddressR = (u8Address << 1) | MRSW; // Read Address    /* send start signal */    i2c_Start();    /* send ID with Write bit */    i2c_write_byte(u8AddressW);    i2c_Wait();    // send Register address    i2c_write_byte(u8Register);    i2c_Wait();    // send repeated start to switch to read mode    i2c_RepeatedStart();    // re send device address with read bit    i2c_write_byte(u8AddressR);    i2c_Wait();    // set K40 in read mode    i2c_EnterRxMode();    u8Data = i2c_read_byte();    // send stop signal so we only read 8 bits    i2c_Stop();    return u8Data;  }  /* * Name: I2C_ReadRegister * Requires: Device Address, Device Register address, Pointer for returned data * Returns: nothing * Description: Reads device register and puts it in pointer's variable */  void I2C_ReadRegister (unsigned char u8Address, unsigned char u8Register, unsigned char *u8Data ){    /* shift ID in right possition */    u8Address = (u8Address << 1) | MWSR; // write address    u8Address = (u8Address << 1) | MRSW; // read address    /* send start signal */    i2c_Start();    /* send ID with W bit */    i2c_write_byte(u8Address);    i2c_Wait();    // send device register    i2c_write_byte(u8Register);    i2c_Wait();    // repeated start for read mode    i2c_RepeatedStart();    // resend device address for reading    i2c_write_byte(u8Address);    i2c_Wait();    // put K40 in read mode    i2c_EnterRxMode();    // clear data register for reading    *u8Data = i2c_read_byte();    i2c_Wait();    // send stop signal so we only read 8 bits    i2c_Stop();    }  #endif  Example of I2C communication using Freescale MMA8452Q 3-axis accelerometer This example is very simplistic and will do nothing more than read the WHO AM I register to make sure that I 2 C is working correctly. To see more check out the Freescale MMA8452Q Example /* Main. C */ #include <stdio.h> #include "derivative.h" /* include peripheral declarations */ #include "i2c.h" int main(void) {      // checking the WHO AM I register is a great way to test if communication is working      // The MMA8452Q has a selectable address which is either 0X1D or 0X1C depending on the SA0 pin      // For the MMA8452Q The WHO AM I register should always return 0X2A      if (I2C_ReadRegister_uc (0x1D,0x0D) != 0x2A {           printf ("Device was not found\n");      } else {           printf ("Device was found! \n");      } }
View full article
Video Highlights of 2012 Competition Photographs from the Freescale Cup Japan 2012 competition.
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
The Freescale linescan camera is based upon the TSL1401CL sensor from TAOS Inc. Design Files Schematic & 3D Render (Courtesy of eli_hughes) Images (Lens removed) Freescale Linescan Camera Specifications 128-pixel linear image sensor (TSL1401CL) Focusable imaging lens 5-pin physical interface on PCB on .100" grid Simple three-pin MCU interface with analog pixel output Lens: 7.9mm focal length, f2.4 fixed aperture, manual focus, 12mm x 0.5mm thread Exposure Time: 267µS to 68mS Resolution: 128 pixels Built-In amplifier stage to improve white/black differentiation. The lense used on the board: Alaud Optical     8.0mm f.l. Lens w/IR filter = Part Num: AB0825C        M12x.05 Lens Holder = #9 or #10 Useful links AMS TSL1401 Product Page Line Scan Camera Use Freescale App Note: Line Scan Camera
View full article