University Programs Knowledge Base

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

University Programs Knowledge Base

Labels

Discussions

Sort by:
Welcome to the NXP Cup!  The following pages are designed to introduce students to the concepts of robotics and the components of the NXP Cup Car. Programming microcontrollers is challenging, and the content here is developed to facilitate the process of becoming a successful embedded programmer. General Information Marketplace Special offers from our Global Sponsors History of the NXP Cup Where to buy a racetrack? Mathworks Support for The NXP Cup Race Track Information Community created accessories FAQ's Assembly Directions Keil Software Offer Rules Cameras Regulations Teams' Technical Reports Hardware Concepts Embedded Systems Concepts Real world usage (Practical) Line Scan Camera MCU 101 Tutorials Kinetis FRDM-KL25Z Servo Motor NXP Cup related video series by Prof. Eli Hughes https://community.nxp.com/docs/DOC-1096 Drive (DC) Motors MathWorks basic model for using wide angle lenses on The NXP Cup Car The NXP Cup Technical Reports https://community.nxp.com/docs/DOC-1283 Motor Driver (H-Bridge) https://community.nxp.com/docs/DOC-1057 Battery New Supply location for NXP Cup kits and replacement parts with global delivery possibilities: www.landzo.com CCD sensor: http://www.landzo.com/?product-52.html CCD camera: http://www.landzo.com/?product-51.html Power Motor control unit: http://www.landzo.com/?product-50.html Car kit without Electronics: http://www.landzo.com/?product-49.html In case of any questions or issues, please contact Bella at 汪瑞 <wangrui@landzo.cn> Connect with teams in your region! Brazil EMEA Malaysia Mexico North America Taiwan
View full article
Overview The FRDM-TFC is a convenient "shield" that can drive up to two DC motors (5A per channel), two servos and I/O for the Freescale cup line scan camera and Hall effect sensors.  This board mates with the KL25Z Freedom board for primary usage with a Freescale Cup car. Features: 2 channel Motor Driver ICs (MC33887APVW) 2 channel servo Outputs Dual Linescan Camera interfaces Two inputs for speed sensors Two potentiometers for user functions Two push buttons for user functions 4 Position DIP Switch for user function 4 LEDs (green) for battery indicator or user functions Design Files Rev A is attached to this document. Rev B is attached to this document Code Examples Codewarrior "Bare Metal" Example Code: All Codewarrior based code examples for the FRDM-TFC are hosted on in a Subversion repository on Google Code: frdm-tfc -   Example code for the FRDM-TFC Shield - Google Project Hosting You can check out the code with your favorite SVN client.   Static releases are available in the attachments section of this page.  The current release is "R1.0" mbed.org Example Code: https://mbed.org/components/Freescale-Cup-with-FRDM-KL25Z/ Videos FRDM TFC EXAMPLE CODE GETTING STARTED FRDM-TFC_DEMO 0 and 1 FRDM-TFC_DEMO 2 and 3
View full article
Overview This document has links to videos to give tutorials on how to getting started *from scratch* with the freedom board.    In these tutorials we build projects with bare metal code to see how things work!   It includes the basics on how to get clocks running,  lights blinking and interrupts firing *from scratch*. For more code/peripheral examples that use a "bare metal" approach,  check out the page on the FRDM-TFC board. ERRATA!!!   While working with a large number of Freedom boards in a course,  it was observed that the InitClockRoutines would *sometimes* not work.    *Some* of the crystals on the freedom boards do NOT like "HIGH_GAIN" mode.   The new code is uploaded to this page but you could also change the code yourself:   pll_init(8000000, HIGH_GAIN, CRYSTAL, 4, 24, MCGOUT); to   pll_init(8000000, LOW_POWER, CRYSTAL, 4, 24, MCGOUT); Projects From Scratch for the Freedom Board with Codewarrior 10.3 Projects From Scratch - Part 2 - Importing other projects Using the Freescale Header Files and Blinking the LED Source code for video (Codewarrior 10.3) is in the attached files at the bottom of this document. Clock Distribution Source Code for the Clock Distribution video is in the attached files at the bottom of this document. Interrupts Part 1 - Background Interrupts Part 2 - ARM Systick Timer Source Code for the ARM Systick Timer video is in the attached files at the bottom of this document. Interrupts Part 3 - TPM (Timer Pulse Width Modulator) Overflow Source Code for the TPM Overflow Interrupts video is in the attached files at the bottom of this document
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
In this video we will look at the example code provided for the FRDM-TFC for use with the mbed development environment. Alternatively, you can see the same example code as it is used with CodeWarrior here:
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
Which Platform to use?  Qorivva or Kinetis? Both are 32-bit devices. The Qorivva products, a Power architecture, are used widely in the automotive industry.  It has specialized peripherals such as CAN and LIN.  Automotive products are built tough, to high industry standards. The Kinetis products, ARM M4 architecture, are widely used.  You will find it in lots of everyday devices and industrial automation (such as robotics). It can support a lot of consumer peripherals such as USB, WiFi, and Graphical Displays. Which platform is more powerful or easy to use? Both supported processors are powerful 32 bit microcontrollers with similar software peripherals. Take an hour or two to research the evaluation boards on the Freescale sites and their underlying technologies. Think through the design and implementation process of connecting various components like the motor, battery and servo, to the evaluation board. The Tower System provides a modular prototyping platform, and the TRK evaluation board has many features. What level of support does a technology have? For the Cup Challenge, you may use any Freescale microcontroller. There are reference designs here on the wiki and TONS of code and examples on the Freescale site. Students should speak with their professor, and check out their respective documentation and software examples to make a choice. Having on campus support is invaluable in this case. There are online communities for the respective technologies as well. Research which technologies are have more active user communities which best complement the teams design approach? Obviously the Freescale Cup Wiki itself is a resource, and provides details on how to use two different microcontrollers - so it might be best to limit choices to one of these two supported platforms.
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
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
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
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
INTRODUCTION Hi everyone, Making/Developing/Porting a Bootloader is a tedious task for newbies (even for professionals) and inexperienced hobbyists who wish to use them on their custom hardware for rapid prototyping. After searching a lot on different forums I came to a conclusion that I cant develop a bootloader just like that so my next option was porting ,that too wasnt easy if you are going with old bootloaders with limited support. I then found a very easy and efficient way of rapid software development platform that can be used on almost any IDE (Keil,Codewarrior,KDS,etc.) and can be used to develop softwares like USB MSD Bootloaders,Serial Bootloaders and other applications for almost all Freedom Development Boards ,Freescale Kinetis MCUs (on a Custom Development Board ) with minimal ARM Programming Knowledge, which is perfect for newbies like me who are just starting with ARM Development using freescale or other boards.See Welcome to the homepage of the µTasker operating system with integrated TCP/IP stack, USB and target device simulator Now my project was to make custom board using MK22DX256VLF5 (48 LQFP) MCU ,my board is a rather a simple one using basic filtering circuits for powering the MCU and almost all the pinouts given as hardware pins on the dev board.Somehow I was able to flash my first blink code using Keil IDE using the OpenSDA circuitry of FRDM-KL25Z (J-11 trace cut ) with CMSIS-DAP firmware (OpenSDA app ) loaded on to it using SWD Programming. With the steps mentioned below I'll show you how to port a Mass Storage Device (MSD) Bootloader using uTasker project from scratch. REQUIREMENTS Programmer(Hardware) or Emulated Programmer(OpenSDA apps): Segger Jlink, P&E Multilink ,OpenSDA Emulators (Jlink-SDA, CMSIS-DAP,USBDM ) IDE :Keil,Codewarrior, Kinetis Design Studio etc. (I prefer CW 10.6 ) Target MCU: Choose any MCU between Kinetis,Coldfire V2,STM32  (I am using Freescale Kinetis MK22DX256VLF5 ,48 LQFP ) refer - http://www.utasker.com/ PROCEDURE 1. Lets start by downloading the uTasker project/framwork (for Kinetis ) from µTasker Kinetis Developer's Page . Then extract and copy the folder to your CW workspace ,import the project to CodeWarrior IDE, It should look like this. (I am using version 14-9-2015)   2.Next Select "uTaskerSerialLoader_Flash" from the Five build configurations (refer http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF  ).uTaskerBM_Loader is described in http://www.utasker.com/docs/uTasker/uTasker_BM_Loader.pdf This is a very small loader alternative that works together with an initial application. uTaskerV1.4_BM_FLASH is the application to build so that it can be loaded to a loader (including the USB-MSD one). uTaskerV1.4 is a 'stand-alone' version of the application that doesn't work together with a loader (and doesn't need a loader).If you want to build application to load using the USB-MSD loader you need to use uTaskerV1.4_BM_FLASH. after that find the files config.h and ap_hw_kinetis.h.These files define the type of MCU you use. 3.In config.h Select your board or MCU type or the closest MCU resembling the architecture of your own MCU. My MCU  MK22DX256VLF5 was not there so with a little help from mjbcswitzerland  I chose TWR_K21D50M Board settings as TWR-K21D50M module is a development board for the Freescale Kinetis K11, K12, K21 and K22 MCUs. (Note : Be sure to remove or comment any other defined boards ) After Selecting the Board/MCU scroll down to find USB_INTERFACE and USB_MSD_LOADER and make sure that these two are defined (not commented ).This is necessary to enable USB enumeration as Mass storage device. Also comment the following if already defined : HID_LOADER KBOOT_HID_LOADER USB_MSD_HOST This is necessary as we are using our Bootloader in MSD Device Mode not in MSD Host Mode. Also we arent using HID_LOADER and KBOOT. Now open  ap_hw_kinetis.h and Find your selected MCU (in my case its TWR_K21D50M ) So, Find the String "TWR_K21D50M" (or whatever your MCU is ) and see if the follwing lines are defined. #define OSC_LOW_GAIN_MODE #define CRYSTAL_FREQUENCY    8000000  #define _EXTERNAL_CLOCK      CRYSTAL_FREQUENCY #define CLOCK_DIV            4                                      or    #if(..........)         #define CLOCK_MUL        48                                            #define SYSTEM_CLOCK_DIVIDE 2                                      #else         #define CLOCK_MUL        24 #endif     #define USB_CLOCK_GENERATED_INTERNALLY Here comes an integral part of USB MSD Bootloading/Programming.You must be wondering about CRYSTAL_FREQUENCY  8000000 and  CLOCK_DIV   4  .This is the frequency of an external crystal oscillator  (8mhz) connected between EXTAL0 and XTAL0 pins of the Target MCU.If your MCU has an internal oscillator then check whether the latter is defined. refer- https://cache.freescale.com/files/microcontrollers/doc/app_note/AN4905.pdf          http://www.utasker.com/kinetis/MCG.html There are two ways to be able to use USB: 1. Use a crystal between EXTAL0 and XTAL0 - usually 8MHz is used. (with or without load capacitor -both worked for me ) 2. Use a 48MHz oscillator on the USB-CLKIN pin. First one is easier and it worked for me.Since my MCU doesnt have an internal oscillator I have used and External 8Mhz crystal. If you want to use a 16Mhz crystal then just make the following changes : #define CRYSTAL_FREQUENCY    8000000 #define _EXTERNAL_CLOCK      CRYSTAL_FREQUENCY #define CLOCK_DIV            4                                 TO #define CRYSTAL_FREQUENCY    16000000 #define _EXTERNAL_CLOCK      CRYSTAL_FREQUENCY #define CLOCK_DIV            8 Note: The CLOCK_DIV should be such that it prescales the crystal frequency to range of 2-4MHz. Here is the clocking diagram of My MCU.The next diagram shows an oscillator crystal connected externally to my dev board. Next search for "PIN_COUNT" under your corresponding MCU/Board (mine is TWR_K21D50M).My MCU is 48 LQFP with 256kb flash and 32kb SRAM (you have to change them according to your MCU ).So I have changed the following lines                              from   #define PIN_COUNT           PIN_COUNT_121_PIN                         #define SIZE_OF_FLASH       (512 * 1024)                          #define SIZE_OF_RAM          (64 * 1024)                              to   #define PIN_COUNT           PIN_COUNT_48_PIN                      #define SIZE_OF_FLASH       (256 * 1024)                              #define SIZE_OF_RAM          (32 * 1024)  Next if you search for your MCU/Board (in this case TWR_K21D50M) ,you will find this line : #define UART2_ON_E This defines the alternative port for UART2,since many boards doesnt have PORTE ,it can be chaned to other ports. [its not important though] Note : When building the serial loader for a device with small RAM size reduce the define #define TX_BUFFER_SIZE (5512) to 512 bytes so the buffer can be allocated (the large size was used only for some debugging output on a larger device) [loader version :14.9.2015] Now search for the String "BLINK_LED" under your corresponding MCU/Board ( mine is TWR_K21D50M ) .The uTasker Bootloader has a special function ,whenever it is in MSD/LOADER mode it blinks a test LED on the board.This is not important but it can be used for debugging purposes.I have a test LED on my board at PORTB16 .You can also specify hardare pins to force bootloader mode and to stop watchdog timer if you pull SWITCH_3 and SWITCH_2 down to ground respectively.I am setting SWITCH_3 and SWITCH_2 as PORTD7 and PORTD6 respectively. Now on the toolbars go to Project > Properties > C/C++ Build > Settings > Tool Settings > Target Processor :Change it to your MCU type (mine is cortex-m4 ) .Next go to Linker >General and change the linker script file to match your MCU's flash,RAM,Type.I have set mine to K_256_32.ld (Kinetis K type processor with 256kb flash and 32 kb RAM) Apply your changes.Now you are ready to go. 4.  Build your project under SerialLoader_FLASH configuration .If there are no compilation errors then you have done it! (if there are then recheck everything with this guide ) Now Click the Flash programmer icon a and Select Flash File to Target. (if your not getting the icon switch to "DEBUG" perspective view ) Now you may choose your Programmer (or emulated programmer )[connection tab] ,select the correct Flash configuration file ,then browse for the binary file that has been generated under C:\Users\<computer user>\workspace\Kinetis_14-9-2015\Applications\uTaskerSerialBoot\KinetisCodeWarrior\uTaskerSerialBoot_FLASH\uTaskerSerialBoot.bin and Click on "Erase and Program". You may skip Step 5 and go to Step 6. 5.I am using the OpenSDA circuitry of my FRDM-KL25Z (J-11 trace cut ) as a programmer using J-link OpenSDA app. Download the app from SEGGER - The Embedded Experts for RTOS and Middleware, Debug Probes and Production Programmers - OpenSDA / OpenSDA V2 depending on your OpenSDA version (FRDM KL25Z has OpenSDAv1). Refer - Using the Freedom Board as SWD Programmer | MCU on Eclipse 5.1.First Enter bootloader mode and Flash the Jlink sda app into it.Connect the SWD wires from the board to your  Target MCU/Board ,also connect the target board        to the external oscillator.Also connect the FRDM's OpenSDA through USB. (A drive with the name JLINK Should come )                                          5.2. Go to Flash File to target and under connections tab click new. give any name and click new under Target Tab.Then select the target type (your target MCU ,mine is                      K22DX256M5).Then check Execute Reset under Initialization Tab. Click finish.    Now you'll get the option to select connection type ,then choose J-Link/J-Trace for ARM and change the Debug port interface to SWD .If you get the error :connection name is not        unique then just change the name (I have used jlink1).Click Finish.     Now I have set up my connections so I can flash the MCU with Jlink app on my OpenSDA circuitry. 6. Now to verify USB Enumeration of your Custom Board ,connect it to PC using USB and you should get a drive with the name UPLOAD_DISK.
View full article
On this page you will find additional notes to chassis assembly you may find useful. Examples of components used are obtained from the http://www.soselectronic.com/ distributor. Cables To connect battery you will need cable shown at the image top right. You can use the cable provided with the car and add an appropriate connector to its end. This usually requires special crimping tool, so it may be more appropriate to buy the "Tamyia charging cable" (shown on the bottom left side of the image above), cut the banana ends and attach the connector to the board. If you search for the appropriate type of the connector, it is called usually Tamiya charging connector, Tamiya jack 6,3 mm (SOS code 70479) or similar. Another cable you have to assemble is a power supply cable for the microprocessor board. You will need approx. 10-15 cm long cable with the barrel jack (SOS code 3834) or similar on one end and 2-pin 2.54mm connector (e.g. SOS code 4934 + 4937) on the other end. NOTE: Never power the microprocessor board and interface boards from different power supplies! In such case the grounds on both boards are not connected and you can damage the board. The grey flat ribbon cable that interconnects the boards is for signals only, there is no common GND connection! Battery You may find (as we did) the provided cable strips too weak to hold the battery on the place. Replace them with the classic electricians cable strips (e.g. SOS code 67504). Also do not forget that the batteries need to be charged fully the first time you charge them or they will not be able to fully charge in the future. If you jump the gun because you want to test your code as soon as you can you will hurt yourself later as we found our battery was absolutely shot in later stages of our build. Motor wires To attach the motor to the interface board you may find (as we did) the cables too short. Then remove 6 screws on the bottom (see image on the left), open the motor box and desolder the short wires. Replace with approx. 15 cm long silicon cables at least 1mm2. End of the cables should be connected to the 3-pin connectors with the 3,9mm pitch (e.g. SOS order code 5914 ) - see image on the right. Again, the contacts should be attached using a special crimp tool. Camera To attach the camera we found useful to prepare two metal L-shaped pieces made from aluminium. With the help of black plastic distance posts (already available in the kit) and these metal stands, you may freely change the position of the camera over the surface. You may use following files to cut the required shapes (drawing was made using the QCad program): Preview (.pdf) CAD file (.dxf)   Base board There was no motherboard in the kit, so you will need to provide your own. To make life easier, we offer you our CAD files created with QCad program. You may use it to produce your board. We use plexiglass for ours, but any other plastic material is appropriate. The large hole in the middle is for cables from the servo. We attach the board to the car using the plastic standoffs (you will need them 55 mm long, so in our case, we used the combination of 40 + 15 mm) - see an example (SOS code 10260). To attach both the processor and interface boards the simillar 5mm plastic standoffs were used. Preview (.pdf) CAD file (.dxf) Getting all together Please, notice the orientation of cables, especially the power supplies. You may find useful following connection diagram. Enlarged Schematic (.png) NOTE: Never power the microprocessor board and interface boards from different power supplies! In such case the grounds on both boards are not connected and you can damage the board. The grey flat ribbon cable that interconnects the boards is for signals only, there is no common GND connection! Servo Motor connectors The parts provided are extremely flimsy and if you snap them in and the wheels are not perfectly straight the wheels will align wrong when the servo first turns on. First off just concentrate on one wheel at a time and we found it useful to have one person hold the wheel straight while the arm was in the proper position and then we used needle nose pliers to quickly and precisely snap the pieces into the wheel. Don't be afraid to use some muscle we hesitated a few times at first because it didn't look good but it was fine.
View full article
  Overview: The NXP Cup is a global competition where student teams build, program, and race a model car around a track for speed. The fastest car to complete the track without derailing, wins. The creation of this autonomous car requires: Embedded software programming and basic circuit creation using NXP parts included in the entry kit Students to create motor control hardware and software to propel and steer their intelligent car Students must also interface to a camera to navigate the car through the race course by following the guide line. This competition lends itself well to use in senior design/capstone project courses.  The contest time frame can fit within the average 3-4 month semester.  Most development work can be done easily within that timeline. History: The NXP Cup Challenge is a collaborative, competitive, and hands-on way for students to learn about embedded systems and control. The NXP Cup, formerly known as the Smart Car Race began in 2003 in Korea at Hanyang University hosting 80 teams of students. Since that time the competition has spread to China, India, Malaysia, Latin America, North America, and most recently Europe in 2012, impacting more than 500 schools and 15,000 students a year. In 2010 it took the name of the Freescale Cup followed by NXP Cup after the most recent merger in December 2015.
View full article
Features General Tower card Form Factor Connections to allow use with a TRK-MPC5604B Board Camera Interfaces 1. 5-pin header to connect directly to Freescale Line Scan Camera 2. Header for 2nd linescan camera (optional) 3. RCA Camera Interface. Includes an LMH1981 Sync Extraction chip and connectors to MCU to allow for low resolution (32x32) decoding of signals Servo Outputs 3-pin Header to connector directly to steering Servo 1 Extra Servo header. Power Accepts direct Battery Power – Onboard Switching regulator 5-18v Tower Card will source power to other tower modules. All circuitry except for motor controller can be optionally powered over USB Connector Battery Input and motor Outputs will be a Tyco (TE Connectivity) TE Connectivity Screw Terminal http://search.digikey.com/us/en/products/1776275-2/A98036-ND/1826899 Motor Driver 2x MC33887APVW : Dual, Independent 5A Motor Driving Circuit Supports forward, reverse and braking. Current Feedback to MCU ADC to allow for closed loop torque control Programming Integrated Kinetis MK20DN512ZVLL10MCU with OSJTAG Can be used stand-alone or be used as a peripheral in the tower system. Additional I/O Extra signals from K40 routed to tower edge card connector. Signals for H-bridge, camera and servo can be routed to Tower Edge connector to be driven by another MCU card. Each can be disconnected via jumper. - We will need to crosscheck the signals to all other CPU modules. Would it be easier to just have a version that doesn't have the K40 populated and OSJTAG populated? Also, we may not need jumpers. Simply configure the Kinets I/O to inputs. Some basic I/O for debugging. 4-poistion DIP Switch + 4 LEDs. Inputs for Tach Signal/Speed Sensor Design Files Rev Alpha Schematics (Sent to MyRO on 4.4.2012) - Includes 3d view Assembly Prints (For Reference) PCB Fabrication Notes Bill of Materials Rev A Errata: Pins 4 & 5 for the camera (Gnd and +3.3v) got swapped on the PCB. You will need to swap the wires in the cable. You can pop the contacts out of the connector housing with tweezers. POT0 has a jumper wire to pin 26 (ADC1_SE18 . This was done to put all signals *except* the NTSC video onto ADC1 to simplify software. Future versions will have this change in the artwork Some components interfere with the tower connector. It can be mated to about 95%. Will work fine. Future versions will fix this issue Rev Beta Schematics, Assembly Prints, BOM, etc. - Includes 3d view Rev B Errata: None known! Google Code repository for the Example Code: https://code.google.com/p/tfc-twr/ This code works with Rev B of the board (and Rev A). 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 teh OSTAG interface, Labview demo applications and drivers for the USB Pictures Just verified the OSJTAG. Test Project to blink the battery LED's was downloaded into the K20 Videos Testing the Servo circuits….. Testing the pots, servos, H-bridges and K20 USB port Linescan Camera Bringup with Labview NTSC Camera Bringup with Labview 1.) This is a basic demo of an NTSC camera being brought in using the a Combo of the ADC, port interrupts and DMA transfers. 2.) I *ahem* overclock the ADC to 24MHz to get some extra resolution for a 64x64 pixel image (the first 6 columns are junk as they contain color burst data*) 3.) I decimate the images to a few frames per second to send over the WIFI (the booster pack card I made) to a Labview program. The Kinetis can bring the data in a the same frame rate of the camera, I just need to send much slower as there is some overhead in my communications scheme (ASCII text) and the WIFI is driven via a UART. 4.) In reality, I can get a 64 x 480 pixel image in memory as I pull in all the lines. I just decimate the rows to get a 64x64 result on the labview display. 5.) DMA does most of the work freeing up the CPU to do algorithms in the foreground.
View full article
The line scan camera module consists of a CMOS linear sensor array of 128 pixels and an adjustable lens. This camera has a 1x128 resolution. Line Scan Camera Board Details Schematics, BOM, and datasheets: Line Scan Camera featuring TAOS 1401 Mounting Options You will likely want to mount the camera on a mast or boom above the car to ensure the greatest field of view. Determining the angle of orientation about the pivot at the top of the boom will change the “look ahead” distance of the camera and enable more efficient steering algorithms DIY Camera Mounts Solution Overview One method of implementation is to take the entire readout of the camera and store it in the memory. Then a line detection algorithm can be used to locate the position of the black line. Due to varying lighting conditions, some level of pixel thresholding may be necessary as the intensity differences across the data may not always produce a clear indication of the line location. A good approach is to use an algorithm that looks for changes in the magnitude of voltage from one portion of the array to another, since the camera’s AO magnitude is directly related to the brightness the pixel array senses. If the microcontroller finds a significant decrease in magnitude followed by large increase in magnitude this would give us a good indication of the location of the line. For this a derivative function can be utilized. Once we have successfully determined the position of the black line, immediately adjust the wheels to adjust the direction of the car so that the black line will remain in the center of the camera’s view. Sample camera output (for illustrative purposes only) The camera outputs an analog signal from 0 to 5V depending on the grey-scale value of the image. to simplify our sample we will assume that we have set limits for the line and have transformed the data to digital bits using a threshold value. 0’s are high intensity (non-line locations), 1’s are low intensity (black or line locations) 10000000000000000000000000000000001111101000000000000000000010000000000000000 Since the camera provides a 128x1 bit picture, and the camera will be pointing down at the track which is a fixed width. A control algorithm should be developed to line up the 1’s in the center of the 128 bits. The center of the field of view will be require calibration and testing, but it is assumed that the camera will remain in a fixed location pointing down the center of the forward looking axis of rotation. Signals For normal operation of the camera, the following signals must be produced and processed: CK (clock) - latches SI and clocks pixels out (low to high) continuous signal SI (serial input to sensor) begins a scan / exposure discrete pulses, pulse must go low before rising edge of next clock pulse AO (analog output) - Analog pixel input from the sensor (0-Vdd) or or tri-stated The CK and SI signals are simple ON/OFF signals which can be produce using a GPIO Pin, setting the pin high and low corresponding to the desired exposure time of the camera. The only other requirement is to read the Analog Output of the camera which requires the initialization of the Analog Module and setting it to the proper pinout. Acutal camera output image: Yellow = SI, Green = Camera Signal, Purple = clock More camera waveforms and information (Power Point) available here This link shows a video of the camera connected to the oscilloscope http://www.youtube.com/watch?v=YOAd3ERnXiQ To obtain this signal, connect channel 1, 2 and 3 of an oscilloscope to the SI pulse (Trigger off this signal), CLK, and AO signals. Timing The timing for creation and read of the signals is crucial and is detailed in the diagram below. This information can also be found in the Line Scan Datasheet. Analog Read: The Analog Output (AO) signal from the camera needs to be processed and read by the microcontroller's Analog to Digital Converter (ADC). This ADC device converts a continuous signal into a discrete number which is proportional to the signal voltage. An 8 bit ADC has 256 discrete levels (2^8). If a analog signal between 0 and 5 volts is sampled, a digital discrete number of 0 would correspond to zero volts, and a digital discrete number of 255 would correspond to 5 volts. A number such as 145w would correspond to about 2.8 volts. The maximum signal sample rate is limited by the microcontroller. Proper configuration of the ADC peripheral and the multiplexer of the chip will configure a pin to read in an analog signal when calling the function. More details on analog to digital converters can be found on the wikipedia site here. Read/Write In write mode, the GPIO pin can be set, cleared, or toggled via software initiated register settings. Microcontroller Reference Manual: Analog to Digital Converter You will find high level information about GPIO usage in several different areas of a reference manual. See the reference-manual article for more general information. Relevant Chapters: (see GPIO chapters for clock and SI Creation) Introduction: System Modules: System Integration Modules (SIM) - provides system control and chip configuration registers Chip Configuration: Signal Multiplexing: Port control and interrupts Focusing the camera: Once the sensor is perfectly working the next step is to find the best position of the lens that will generate the clearest images. The best way to do it is using an oscilloscope: Connect the SI and AO signals to the oscilloscope Set the SI pulse so that it can be clearly seen and then trig the AO signal with the SI signal using the trig function Fix the camera looking at a sheet of paper with a black line in the center The image of the black line will appear on the oscilloscope screen Screw the camera until you find the position where the line seems the clearest Camera Circuit   5 wires must be connected ground power SI CLK AO Camera Limitations   According to the datasheet:   " The sensor consists of 128 photodiodes arranged in a linear array. Light energy impinging on a photodiode generates photocurrent, which is integrated by the active integration circuitry associated with that pixel. During the intergration period, a sampling capacitor connects to the output of the integrator through an analog swith. The amount of charge accumulated at each pixel is directly proportional to the light intensity and the integration time." Integration Time: T T = (1/fmax)*(n-18)pixels + 20us, where n is the number of pixels Minimum integration time: 33.75us Maximum integration time: capacitors will saturate if exceeding 100ms frequency range 5 Khz - 8 Mhz (8 Mhz is fmax in equation above) The integration time is the following: It occurs between the 19th CLK cycle and the next SI pulse. The CLK frequency itself has little to do with the integration time. One each rising edge, the clock outputs one of the previously sampled intensity values. This means that integration time should be set by varying the time between SI pulses, not changing the clock frequency. Make the CLK frequency high, and have as much time as needed between the two SI pulses to obtain the desired intensity value. Pro Tips: #1 - Avoid Light Noise Light can be transmitted through the pcb on the back of the camera. This unwanted extra light shining on the CMOS linear sensor can induce significant errors into your signals received. A shroud or housing for the camera unit can easily eliminate this problem. One of the easiest solutions is to place a piece of electrical tape across the back of the camera in the highlighted area indicated in the picture below. #2 - Know your Settings When testing the car on the track or transporting it, it is not uncommon for the focus on the camera to loosen or change. Therefore it is recommended that after adjusting your camera focus for maximum performance you make mark (ex. metallic sharpie) between the lens and its body so you can realign the camera lens to it's proper position easily if it does shift. #3 - Know your Zone When hooking up the linescan camera, regardless of position or focus there is a drop off at each end of the image data. This is easily viewed with an oscilloscope. This effect is undesirable, particularly when you are finding your line position utilizing a derivative approach. These fallouts cause erroneous derivative values, and hence a poor line position solution. Two solutions we found useful were: (1) Ignoring the first 10-15 pixels and last 10-15 pixels of the image data array, and then determining the line position; (2) Often when making decisions in the code as to where the line was at it was found useful to use a threshold value for the difference in the derivative position, and secondly a binary threshold on the camera data. Note that the falloff depends on camera focus, position, etc. Therefore, these threshold values and pixels in which to ignore are relative to a specific instance. The problem however is common to the camera. #4 - Buffer Data Since the camera can read the line very quickly while the servo can only update every 20ms, there are multiple camera reads before the servo can update, if you are reading the camera fast and then overriding without saving them in some form then those camera reads are being wasted and are better off not having occurred. What can help is to create some sort of filter by bringing new values into an array with previous values and preforming some sort of averaging. The following code will take the new line position value and place it in a 1xA array where A is defined by CAMERA_AVG. NO AVERAGING IS OCCURRING HERE all that is happening is the camera values are being saved in a simple array, what is done with them is up to you. The way this works is that it shifts the entire array so the oldest data point is discarded in order to make room for the new line position at the other end of the array. It will only adds the new value if there is one available if not it copies the previous first position value to the new first position value. CAMERA_AVG => an integer value for how long the averaging length will occur gfpLineAverage => global floating point array of camera center line values fpLinePos => returned from read camera this is the center line position ReadCamera() => is the read camera function call returns a floating point value of fpLinePos // this will shift the values up and throw away the oldest value // then add a new reading for (i=CAMERA_AVG;i>0;i—) { gfpLineAverage[i]=gfpLineAverage[i-1]; } // if no line was detected the previous camera value will be passed on if (fpLinePos=ReadCamera()) { gfpLineAverage[0]= fpLinePos; } For example an array of of center line position values ranging from 0-127 could look like. Initial values [51 50 52 54 58 55] New position of 45 read [45 51 50 52 54 58] New position of 44 read [44 45 51 50 52 58] No value read [44 44 45 51 50 52] No value read [44 44 44 45 51 50] New position of 50 read [50 44 44 44 45 51] Program Exercise Specifics of how to configure the K40 ADC, to create the delay code is covered in the K40: Line Scan Camera Tutorial. Additional 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 Additional Resources Freescale app note on interfacing with a linescan camera Freescale app note on interfacing with an RCA camera
View full article
Here is a simple example developed at Politecnico di Torino, to show how the NXP CUP car can be managed using Simulink-generated code. The Simulink model is intended to move the car forward and backward for 20 seconds, or until an obstacle is found. Any comment is welcome.
View full article
This tutorial covers the details of Blinking an LED on the Kinetis K40 using the TWR-K40X256-KIT evaluation board. It will introduce the evaluation board, and some basic CodeWarrior features. Overview 1. Hardware 2. Set up the Software Development Environment A. Download and Install Codewarrior B. Download and Install Drivers 3. Set up the Hardware: Twr K40x256 Hardware Setup 4. Import the LED Project 5. Build the Code 6. Download/Debug/Run 7. Learning Step: LED Code Description Read/Write Functions Variables Header File Definitions Initialize the GPIO Blink the LED: Other K40 Tutorials: K40 Related Pages Credits / References Overview   In this exercise students will explore a Freescale Cup Car application which targets a Freescale K40 board attached to the Tower System.   Students will: Configure the Software Development Environment Configure the evaluation board hardware Learn how to import example files into a CodeWarrior project Build a project Download and run the code on a Kinetis K40 Tower System board Learn how to utilize the GPIO Peripheral to blink a LED     To successfully complete this exercise, students will need the following board and development environment. The K40 Tower card, TWR-K40x256 CodeWarrior for Microcontrollers USB Cord 1. Hardware     Read the Blink LED overview article for general information on LED circuits, GPIO pins and reference manuals.   2. Set up the Software Development Environment   There are several steps necessary to prepare the evaluation board and PC for microcontroller programming and development. Interfacing the evaluation board with a PC requires downloading and Install the CodeWarrior IDE, as well as the device drivers for programming the microcontroller via USB. A. Download and Install Codewarrior   Before completing this example project, download-and-install-codewarrior-10-1 or the latest version compatible with the twr-k40x256-kit.   B. Download and Install Drivers   In addition to CodeWarrior, it may(needs verified) be necessary to install one or both of the following tools: RAppID initialization tool- RAppID comes on the DVD provided with your evaluation board. In the main directory of the DVD, click on the "TRK_MPC5604B.html" file to open the DVD interface which provides user manuals, software, schematics and documentation for the evaluation board. P&E Microcomputer Systems, Inc drivers- P&E is a a computer driver for the TRK-MPC5604B and Kinetis Tower system device, enabling evaluation board programming via USB through the CodeWarrior debug OSJTAG interface. This driver can be downloaded here in case this isn't found on the disk.   3. Set up the Hardware: Twr K40x256 Hardware Setup   There are several Twr K40x256 hardware configuration steps. Follow the twr-k40x256-hardware-setup instructions before importing the LED Project. 4. Import the LED Project   After the software is successfully downloaded and installed, the next step is to import an existing project into your Workspace. in this case, the LED_BLINK_96MHZ Project. Follow the instructions on the codewarrior-project-import page to import the LED_BLINK_96MHZ project into CodeWarrior. If errors are encountered, look in the Problems view and resolve them. Ignore any warnings. 5. Build the Code   If there is 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. By default, the application is set to link to RAM. If you want your program in FLASH, make sure that you have that build configuration enabled:     Make sure you do a "Clean" operation (under the project menu) after you make the configuration change. If you encounter errors, look in the problems view and resolve them. You can ignore any warnings. 6. Download/Debug/Run   If the project builds correctly, it is time to download to the board and watch it work. Ensure that the USB cable that came with the board connects the board to the host computer’s USB port. There are multiple ways to issue the Debug command. Right click the project in the projects view and choose Debug As->CodeWarrior Download. Alternatively, y go to the Run menu and choose Debug (F11). Click the Resume button and your should see the LED blinking! Click the Pause button to stop execution. Click the Terminate button to end debugging. 7. Learning Step: LED Code Description Read/Write   If the LED was on Port C, Bit 7 we might have code like: #define LED_E1_Location(1<<7)   For example, to toggle a pin the following code might be used: GPIOC_PSOR=LED_E1_LOC     "Sets" the LED located at "E1" high.   the syntax means the following GPIOC refers to Port C   "Set" is one of three commonly utilized commands for GPIO control. There are also commands for "Clear" and "Toggle."   Command: "GPIOC_PSOR" literally means PORT SET OUTPUT REGISTER which SETS a pin high Command: "GPIOC_PCOR" clears a pin, PORT CLEAR OUTPUT REGISTER which CLEARS a pin to the "low" state Command: "GPIOC_PTOR" toggles a pin opposite of the current state   the « is a "shift" command which is discussed in the c-programming-for-embedded-systems. You can alter the raw register as well using a MASK but the dedicated set/clear/toggle registers are more straightforward.   **NEEDS UPDATED ** Hardware Chip Port/Pin Comment SW3 PT cell-content SW4 cell-content cell-content Functions   The following functions can access the LED; //Where n is the LED number LED_En_TOGGLE;  //will toggle a LED to a different state LED_En_ON; // turns the LED ON LED_En_OFF // turns the LED OFF Variables   Locations of the LED's LED_E1_LOC LED_E2_LOC LED_E3_LOC LED_E4_LOC Header File Definitions   from k40_TOWER_BOARD_SUPPORT.h //The E1 LED is on Port C, Bit 7 #define LED_E1_LOC (1<<7) #define LED_E2_LOC (1<<8) #define LED_E3_LOC (1<<9) #define LED_E4_LOC (1<<11)    //There are dedicated set and clear registers.    //Write a one to PSOR Sets the Bits, Writing to PCOR clears bits.    //Toggling a bit can be done with the PTOR register    //You can access the raw register as well -> PDOR |= My Bit    //but the dedicated bit set/clear/toggle registers are easier!    //Also, The cathode of the LEDs are towards the port pin! This means    //you have to turn the port off to get the LED to turn the pin on. #define LED_E1_OFF   GPIOC_PSOR=LED_E1_LOC #define LED_E1_ON   GPIOC_PCOR=LED_E1_LOC #define LED_E1_TOGGLE   GPIOC_PTOR=LED_E1_LOC #define LED_E2_OFF   GPIOC_PSOR=LED_E2_LOC #define LED_E2_ON   GPIOC_PCOR=LED_E2_LOC #define LED_E2_TOGGLE   GPIOC_PTOR=LED_E2_LOC #define LED_E3_OFF   GPIOC_PSOR=LED_E3_LOC #define LED_E3_ON   GPIOC_PCOR=LED_E3_LOC #define LED_E3_TOGGLE   GPIOC_PTOR=LED_E3_LOC #define LED_E4_OFF   GPIOB_PSOR=LED_E4_LOC #define LED_E4_ON   GPIOB_PCOR=LED_E4_LOC #define LED_E4_TOGGLE   GPIOB_PTOR=LED_E4_LOC Initialize the GPIO   From K40_TOWER_BOARD_SUPPORT.c void InitK40GPIO() {    SIM_SCGC5 = SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK;    //To use a Port, its Clock must be enabled!!    //Lets just enable the clocks for ALL of the ports    //Important! Each IO pin has a dedicated 32-bit Register to set it up (Selection GPIO vs peripheral, IRQ, Etc.)    //Setup port C7,C8,C9 and B11 as GPIO and enable High Drive Strength    PORTC_PCR7 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;  //Enable GPIO on on the pin    PORTC_PCR8 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;  //Enable GPIO on on the pin    PORTC_PCR9 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;  //Enable GPIO on on the pin    PORTB_PCR11 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;  //Enable GPIO on on the pin    PORTC_PCR18 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;    PORTE_PCR28 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;    //Make Sure the GPIO is setup to be an output    GPIOC_PDDR |= LED_E1_LOC | LED_E2_LOC | LED_E3_LOC;    GPIOB_PDDR |= LED_E4_LOC;    LED_E1_OFF;    LED_E2_OFF;    LED_E3_OFF;    LED_E4_OFF; } Blink the LED:   Within Main.c or any other C file created, Blink the LED's using the following functions: LED_E1_TOGGLE; LED_E1_ON; LED_E2_OFF; Other K40 Tutorials:   K40 Related Pages   K40: Turning A Servo Tutorial   K40: Drive DC Motor Tutorial Kinetis K40 TWR-K40X256 K40: Blinking LED Credits / References   Some of the content from this tutorial originated from:   Shawn Moffit: Electrical Engineering, Penn State University for - K40 Code   Processor Expert Hands-On Lab Rev. 1.0, 05/2011 by Jim Trudeau, Freescale Semiconductor, Inc. for - some text descriptions of steps Original Attachment has been moved to: LED_BLINK_96MHZ.zip
View full article
For details on how to use the Motors, visit theDC Motor Tutorial Images Boards before 2013 Current Board Rev. 0 Rev. 1 Technical Details Revision 1 (Schematics, design files, sample code, instructional videos) Revision 0 (Schematics) H-Bridge Specifications Freescale MC33931 Datasheet Pro Tips: #1 - Electro-Magnetic Interfence (EMI) This has been mitigated in the rev. 1 board. In many cases the dc drive motors give off much EM interference causing poor data from the camera, and decreasing the servo motor performance substantially. In most cases around a PWM value of 20-25 duty cycle at the drive motors, caused detrimental problems. This problem was remedied in two ways, (1) connecting capacitors between the motor leads, the closer to the drive motor the better; (2) There is a way to connect the camera directly to the kwikstik and bypass the motor board. #2 - Rev. 0 Board workaround to Enable Braking This has been fixed in the rev. 1 board. In order to go forward AND backwards, you have to have control over IN1 and IN2 (see table below). If you look at the schematic, you can see that IN1 is directly connected to GND. In order to enable breaking you need to lift pin 43, solder a wire to it and control it properly. Tutorials General Tutorial on the DC Motor Control Qorivva: DC Motor Tutorial Kinetis Tower: DC Motor Tutorial Design evolution of motor board prior to 2010 - Freescale Cup Cars utilized the MC33932EVB 2010~2012 - Freescale Cup teams migrated to the current Interface/Motor board featuring Dual H-Bridges [Not manufactured] Tower and Trak Compatible Interface/Motor Control Board (Design files if you want to make one!) 2013+ - FRDM-KL25Z shield
View full article