The Kwikstik board is a great board for use in a Freescale Cup car! This page has some videos and example code to get you
up and running quickly. For novice embedded developers it is recommended you use the FRDM-KL25Z for your Freescale Cup car.
The General Purpose TWRPI socket on the Kwikstik K40 board 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 Kwikstik User's Manual, but the user manual does not describe how to order a connector.
Soldering and directly connecting to the pins on the socket itself is very risky and not recommended. When browsing for connectors that interface with the TWRPI sockets you have two main options.
1. The first is a surface mount chip, that is a female connector to connect with the male pins on the board. There are surface mount lead on the top of the chip which will be easier to solder to. The part number is: SFC-110-T2-L-D-A
2. The second option is a female connector which mates with the male connection on the board and is then terminated with a wire for each pin. This option can greatly simplify your wiring challenges on your car as any additional lengths or wires can easily be trimmed off. The part number is: SFSD-10-28-G-12.00-S
Image of the SFSD-10-28-G-12.00-S with corresponding Kwikstik TWRPI socket.
Connectors can be ordered from Samtec as samples at this website: [http://www.samtec.com/suddenservice/samples/samples.aspx]
Creating a new baremetal project for a Freescale KwikStik
Debugging a bare metal project on the Freescale Kwikstik.
Importing projects and merging code.
A discussion of the header files (and how to use them!) for Kinetis Devices in Codewarrior V10. This is the first of 2 videos. I had to split them up
as I cannot upload videos greater than 15 minutes in length.
Second part of the Kinetis Header file discussion
Discussion on getting the Clock setup on the Kwikstik
How to setup GPIO on the Kinetis. Includes discussion on enabled clocks to peripherals and setting up the pin control registers.
How to use the SysTick peripheral in the Cortex core with interrupts
Discussion of how to setup interrupts on the NVIC. The Flex timer is used as an example
All of the programs are bare metal examples for CodeWarrior 10.1 that can be used on the Kwikstik board. Make sure to read all of the comments in the C files!
How to Load Programs In CodeWarrior:
Copy only the source files and header files into a new folder. Import that new folder into CodeWarrior to avoid debug problems.
ClockSetup - Systick
This example will demonstrates how to enable the 4MHz Crystal on the Kwikstik. Early versions of the Kinetis silicon had bug in which the device could crash if the clock dividers are changed while executing from FLASH (errata e2448). This code places clock initialization code in RAM. The clock code is based upon routines from Kinetis Peripheral Module Quick Reference (Freescale document KQRUG.pdf). It also shows how to enable the SysTick module in the Cortex Core. The SysTick is used to provide a delay Function.
This code shows how to use the NVIC in the Cortex Core. The Flex Timer module is used to generate a periodic interrupt (similar to the SysTick example).
This code will turn on segments on the LCD on the Kwikstik. The LCD driver code is derived from the MQX based example on the Kwikstik page.
This code shows how to setup the flex timers to generate different styles of PWM. Note: One of the examples sets up the flex timer for pseudo-complementary PWM. It DOES NOT use the hardware based complementary mode. It writes 2 individual registers in a software routine. One should use this a starting point to enable full hardware based complementary mode.
This example is a basic example on how to interface to the Freescale Linescan Camera. It will display a rough approximation of the output on the LCD.
Note: The code does not run with the camera by default. This is because the AOUT is set to the pin with the pull up resistor (J15 pin 4). Once changed it will work smoothly.