University Programs Knowledge Base

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

University Programs Knowledge Base

Discussions

Sort by:
Data acquisition system for Kinetis K Family Author : Mauro Padin (Student) Supervisors : Professor Daniel A. Jacoby, Juan Pablo Vega (Teacher Assistant)   Summary:   This project is based on the FRDM-K64F board, a HC-05 Bluetooth module, and a smartphone. In this application, an analog signal is sampled and transmitted wirelessly to a smartphone, using an external Bluetooth module, where it is displayed. The complete CodeWarrior C code and MIT App Inventor code can be found in the .zip file. System Structure SysTick Module: Periodically triggers ADC conversions and UART transmissions. ADC Module: Samples the analog signal and manages the ADC input buffer. UART Module: Manages the UART output buffer and transmits the digitized data. Bluetooth Module: When connected, wirelessly transmits the data coming from the UART module. Smartphone App: Handles Bluetooth connection, receives the digitized data and manages the display.   Software Structure   A project template is provided to the students in order to establish a simple, and easy, program organization for the duration of the course. A portion of the template was built with the help of the Processor Expert so that, later on, the students would be able to understand its structure and limitations, and transition to this new tool. A wrapper was built around this auto-generated code and the resulting function, void __LDM_init (void), is to be used at the very beginning of the project given. This function mainly configures internal processor registers related to clock configuration.   The project is composed of separate files for each hardware and software module:   The template is composed of four files: LDM.c/h, main.c, and misc.h. The application is found in: App.c/h RTI, ADC, UART, LED Drivers are defined in: RTI.c/h, adc.c/h, uart.c/h, and LED.c/h.   The basic Driver structure consists of a void DRV_init(void) initialization, a set of void DRV_x_ISR(void) interrupt handlers, a set of void DRV_x_PISR(void) periodic interrupt handlers, and a set of void DRV_x services function. Only the initialization function is mandatory, the others being optional and dependent on the driver purpose. Service functions are interfaces between the application and the Driver and do not necessarily access any subjacent hardware. Indeed, this Driver structure can be nested and thus not handle any hardware at all. When a Driver function does access hardware, it is recommended to further use a Hardware Abstraction Layer to enhance productivity and improve portability.   Extracts of the system   As an example of the Driver Structure, the LED Driver is described below:   init void LED_init  (void)   ISR N/A   PISR void LED_PISR  (void)    Services void LED_write  (color_t color, bool value) void LED_set  (color_t color) void LED_clear  (color_t color) void LED_toggle (color_t color)   The entire application is interrupt driven, so that only initialization are necessary and the run loop is empty:   void App_init(void) {   LED_init();  // LED driver init function   uart_init();  // UART driver init function   adc_init();  // ADC driver init function   RTI_init();  // RTI driver init function }   void App_run(void) { }       Hardware interrupts are not serviced in their specific handler but referred to external handlers for readability and organization. The SysTick interrupt handler is composed of a ISR and a Service:   ISR_t SysTick_Handler(void) {   LED_isr code   ADC_conv code } The code for the smartphone side is depicted below:     Finally, a screenshot of the result:       Original Attachment has been moved to: -ADC-bluetooth-TP6.zip
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
Updated: May 7, 2013 - Added 6 new chapters Author(s): Ken Hsu, Rochester Institute of Technology Dan Cheung, Rochester Institute of Technology Sam Skalicky, Rochester Institute of Technology Overview Written using the TWR-K40N512. Most of the knowledge is transferable to any of the Kinetis K family of devices. The Freescale Tower System is a modular development platform that allows rapid prototyping and re-use through interchangeable modules. A few of the modules are serial modules for Ethernet and other serial interfaces, wireless modules, audio modules, and blank proto-boards to build your own circuit. CodeWarrior 10.1 Integrated Development Environment (IDE) is a new version of CodeWarrior based on the Eclipse IDE. It provides features such as instruction level debugging, disassembly, access to device registers while debugging, processor expert, and more. It is designed to be used with Freescale’s latest microcontrollers. Modules Introduction General Purpose I/O Multipurpose Clock Generator Interrupts and Timers Serial I/O I2C Digital to Analog Converter Analog to Digital Converter Analog to Digital Interrupts Flex Timer Module Real Time Clock Cyclic Redundancy Check (CRC) Digital Signal Processing (DSP)  [Draft State] Capacitive Touch Complete course files restricted to verified faculty only.  Available for download in the Faculty-Portal
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
The Embedded World trade show is a European reference for Embedded Technologies. The exhibition and conference continues to grow and attract exhibitors and attendees from all regions of EMEA. Freescale has a large demonstration booth in Hall 4A and, for the 2nd year in a row, we also have a Freescale University Programs presentation area in the entrance all, right outside Hall 4A. The 25m2 demo space for the University Programs this year include robotics and automotive demonstrations from the following Universities: Technical University of Munich: eCARus electric buggy featuring S12 and Qorivva CAN & FlexRay automotive networks and i.MX display University of Applied Sciences Munich with K60 Tower kits running Pong tennis game University of Applied Sciences Ingolstadt with a MPC5604B 3 dimensional camera stabilization system mounted on a 6-copter drone University of Applied Sciences Deggendorf with Kinetis Tower mini-robots University of Applied Sciences Landshut with ColdFire FSLBOT University of Applied Sciences Nuremberg with a ROS communication robotic arm demo ported on i.MX535 Technical University of Ostrava with a search/rescue robot featuring i.MX31 HMI interface on remote control and HCS12 radar control system In addition we have a video presentation of the Freescale Cup.
View full article
The Freescale Cup competition was new to Convergence this year. College-age and young professionals' teams are challenged to achieve the fastest time around a designed track with a battery operated kit RC car. All parts for the car are provided along with information on how to build and code the car. The teams must design their own algorithms that drive the car over the black line on the white track as quickly as possible. SAE Convergence 2012 Freescale Cup Winners! More photos from the event: This pretty much sums it up! Qualification Track Team TRW in the foreground working on the car. Team Freescale's show car, er..van. Cutting the corner. Team "Success" Continental car.  This car was unique in that they utilized two cameras.
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
Campeão Brasileiro 2011 POLIposition Team PSI USP
View full article
Freescale S12 C-Family Specific Device Used = APS12C128SLK Courses Developed by Fredrick M. Cady Related Textbook: Oxford University Press: Software and Hardware Engineering: Fredrick M. Cady Files: All files related to this course are at bottom of this page. Summary: Introductory level course.  Covers basic microcontroller concepts and exercises in both assembly and C programming language.  Instructor editions of the laboratory include answers to questions and additional commentary by author especially for instructors. The following is a laboratory short courses developed applying the Process Oriented Guided Inquiry Learning (POGIL) pedagogy.  POGIL uses guided inquiry – a learning cycle of exploration, concept invention and application – as the basis for many of the carefully designed materials that students use to guide them to construct new knowledge.  POGIL is a student-centered strategy; students work in small groups with individual roles to ensure that all students are fully engaged in the learning process. POGIL activities focus on core concepts and encourage a deep understanding of the course material while developing higher-order thinking skills. POGIL develops process skills such as critical thinking, problem solving, and communication through cooperation and reflection, helping students become lifelong learners and preparing them to be more competitive in a global market. Course Contents: Title Topic Document Name Objective S/W Required H/W Required The Microcontroller - General Principles General Principles – The MCU LABSS12CINTRO01.pdf Show architecture of typical microcontroller; define terms. None None Software Development General Principles – S/W Development LABS12CINTRO02.pdf Show S/W/firmware development tools and process. None None Introduction to CodeWarrior - Simluating the Microcontroller in Assembly Language Introduction to the Laboratory – I LABSS12CINTRO03.pdf Introduce the S/W development system used in the lab. CW Introduction to CodeWarrior - Running Assembly Programs on the Microcontroller Introduction to the Laboratory – II LABSS12CINTRO04.pdf Continue above and introduce hardware used in the lab. CW SLK The Assembler Assembler Program LABSS12CINTRO05.pdf Learn the fundamentals of the assembler. CW Exploring Embedded C Programming The C Compiler LABS12CINTRO06.pdf Learn about using C in embedded systems. CW Introduction to CodeWarrior - Simulating the Microcontroller in C Intro to uC Hardware LABSS12CINTRO07.pdf Learn programmer's model and addressing modes None None Introduction to Your Microcontroller Hardware Intro to uC Hardware LABS12CINTRO08.pdf Learn programmer's model and addressing modes None None The Microcontroller Instruction Set I Instructions – I LABSS12CINTRO09.pdf Start to learn the instruction set; memory addressing; conditional branching. None None The Microcontroller Instruction Set II Instructions – II LABS12CINTRO10.pdf Continue ". CW SLK The Bouncing Switch in Assembly Switch Debouncing in Assembly LABS12CINTRO27.pdf Demonstrate switch debouncing and solutions CW SLK The Timer – Introduction to Timer Overflows With C Timers – I LABSS12CINTRO11.pdf Generating a delay using the timer overflow. CW SLK Digital Input and Output Digital Input and Output LABSS12CINTRO12.pdf Input from switches, output to LEDs. CW SLK Digital Input and Output With C Digital Input and Output LABS12CINTRO13.pdf Input from switches, output to LEDs. CW SLK I/O Software Synchronization Digital I/O software LABSS12CINTRO14.pdf I/O software synchronization CW SLK Introduction to Interrupts Using C Interrupts – I LABS12CINTRO15.pdf Learn fundamentals of interrupt vectors, etc. CW SLK The Bouncing Switch in C Switch Debouncing in C LABS12CINTRO28.pdf Demonstrate switch debouncing and solutions CW SLK Introduction to Interrupts Interrupts – I LABS12CINTRO16.pdf Learn fundamentals of interrupt vectors, etc. CW SLK Sources of Multiple Interrupts Interrupts – II LABS12CINTRO32.pdf Multiple sources of interrupts. CW SLK and scope The Timer – Introduction to Timer Overflows The Timer – Intro to Timer Overflows LABS12CINTRO17.pdf Generating a delay by polling the timer overflow. CW SLK The Timer – Timer Overflow Interrupts The Timer – Timer Overflow Interrupts LABS12CINTRO18.pdf Generating a delay using timer overflow interrupts CW SLK The Timer – Output Compare The Timer – Output Compare LABS12CINTRO19.pdf Waveform generation using output compare and interrupts. CW SLK and scope The Timer – Input Capture The Timer – Input Capture LABS12CINTRO20.pdf Using input capture to measure pulse width CW SLK The Timer – Pulse Accumulator The Timer – Pulse Accumulator LABS12CINTRO21.pdf Using pulse accumulator in event counting and gated time mode CW SLK and signal generator Analog Input using Assembly ATD – I LABSS12CINTRO22.pdf Introduce analog-to-digital conversion CW SLK Analog Input using C ATD – I LABSS12CINTRO26.pdf Introduce analog-to-digital conversion CW SLK Sampling and Resolution for Analog Input ATD- II LABS12CINTRO23.pdf ATD Sampling None None HCS12 A/D Digital I/O ATD – III LABSS12CINTRO24.pdf Digital I/O using the ATD CW SLK COP Coming Soon Using the COP CW SLK MSCAN Coming Soon Using the CAN module CW SLK SERIAL I/O – SCI SCI LABS12CINTRO29.pdf Introduction to SCI CW SLK and terminal SERIAL I/O INTERFACES – RS-232-C SCI-II LABS12CINTRO30.pdf Creating an RS-232-C communication Interface SERIAL I/O – The Serial Peripheral Interface SPI – I LABSS12CINTRO31.pdf Introduction to the SPI CW SLK, scope, SPI device SPI – II Coming Soon LCD CW SLK, LCD Register Listing HCS12C Family Register Listing HCS12C Family LABS12CINTRO25.pdf Complete course files restricted to verified faculty only.  Available for download in the Faculty-Portal
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
Freescale cup 2012 Team 3.14 Slovakia Bratislava High speed camera 400fps
View full article
What is a microcontroller (MCU)? A microcontroller includes a microprocessor (CPU) as well as a number of other components like RAM, flash and EEPROM to store your programs and constants. While a microprocessor requires external devices to control things like input/output, or timers to implement periodic tasks, and digital to analog converters, a microcontroller is all inclusive. Contrast this all-in-one approach with a typical personal computer which contains an INTEL or AMD CPU, as well as separate chips for RAM, a separate video card, a dedicated hard drive, silicon chips or PCI circuit boards to enable the processor to access USB, serial and video card signals Microcontroller pins are general purpose, whereas CPU pins are specific. This means that each pin is tied to a multiplexer which you must set to choose the particular use for the pin. For example, in a microcontroller, one pin pin might be re-purposed for the following tasks 1. The output of a timer 2. Send a signal to a motor 3. Receive an input from a sensor or analog device
View full article
Lab exercise supporting the i.MX53QSB for Master Student level student prepared by massimoviolante from the Politecnico of Torino. Complete course file(s) restricted to verified faculty only.  Available for download in the Faculty-Portal
View full article
Freescale cup 2011 India....trials ... line follower
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
This tutorial will discuss Timer Peripheral Modules, DC Motors, motor controllers, and configuration of your chip to output a PWM or Pulse Width Modulated Signal. The first section of this this tutorial provides the basics of DC (Direct Current) motors. The electronic circuits created to control these motors and schematics for PCBs, tips to reduce noise over important signals are also contained within this tutorial. Usage A dc-motor is an electrical device that converts energy into rotational movement. The motor moves a gear in one direction if current flows through the terminals (clockwise or counterclockwise), and in the opposite direction if current flows backwards through the same terminals. If there is a force opposing the motor, then the terminals are short circuited and the current through the terminals can go as high as 14 A or more. The voltage or current that must be delivered to the motor to work is too much for a microcontroller output port so an intermediary device must be used, such as the mc33932evb motor control board. Pulse Width Modulation (PWM) For a refresher in Pulse Width Modulation. Once you feel comfortable that you understand the concepts behind a duty cycle signal, you may move to the next step of understanding H bridge circuits. Circuit Amplification A microcontroller is typically not designed to directly drive DC motors.  Keep in mind MCU's are low-power devices and motors usually draw a lot of power.  So what is one to do?  Amplification!  There are lots of ways to do this and each has it's trade-offs.  Below are the most popular... Discrete Components A few MOSFETSs should do the trick.  This is a great learning exercise, you can probably get more oomph out of your circuit but it takes time to build and troubleshoot. If you search the web for motor driver board, you should find plenty of resources, designs, etc. Half-Bridge (aka H-bridge) These are integrated circuits with the aforementioned discrete components already configured for you.  Because these are integrated (into a very small footprint) these tend to be  power limited due to thermal issues.  Generally speaking, the better a device is at dissipating heat the more power it can handle. Get a basic view of H bridge circuit. Click here which describes H bridge circuits. DC Motor Describes how a DC motor works: here Microcontroller Reference Manual: Timer Information You will find high level information about Timer usage in several different areas of a reference manual. See the reference-manual article for more specific information on how best to navigate through to the areas which are relevant. Relevant Timer 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 Motor cup-car-motor: In testing the motor, we found that it drew between 0.35A and 0.5A with no load on the wheels and peaked at a little over 14A at stall. With this Data and 150% value for the H-Bridge or Motor Controller we need one with a current rating of 20A at least. The Motor has a Resistance between 0.9 and 1.0 ohm.  For motor control you can use the Freescale H-Bridge such as MC33931or MC33932, however these controllers peak at ~5 amps, so you will not be able to maximize speed Power & Current Requirements Additional Theory Training Resources Freescale Motor Control Tutorial Freescale Lecture 1: Introduction and Motor Basics Freescale Lecture 2: Pulse Width Modulaiton Freescale Lecture 3: Control Design Freesacle Lecture 4: Speed and Position Freescale Lecture 5: MPC5607B Overview
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