KWIKSTIK K40 Getting Started

Showing results for 
Search instead for 
Did you mean: 

KWIKSTIK K40 Getting Started

No ratings

KWIKSTIK K40 Getting Started

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.

Board Tips

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: []

Useful Videos:


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


Example Programs:

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.

Labels (1)

Excellent set of tutorials.

I've run the flash version of the second project and I see it run in both the debugger and on the LCD however when I disconnect and reconnect the USB cable the LCD no longer works.  Also the upload time is painfully slow.

Is there any way to download  It looks like it was moved or deleted and I can no longer access it.  It takes me to a page that says that this site does not exist

I just updated the page but a moderator needs to approve.   email me at ehughes _at_ _dot_ net 

I will send them to you as an attachment

I am not able to download the LCD example. It says link not available. Please help.:smileyconfused:

I just uploaded it to the page.  Once the page change gets approved by a moderator it should be ready to download.

Is there anyway to reset the kwikstik to its factory settings?? (With default applications loaded)

I'm supposed to return a borrowed kwikstik from my frnd as the way it was.

And plz let me know if there is any possible way to get the source code/Project of the default demo applications (Sound Recorder, Remote Control and USB Joystick). These might help me a lot in developing my own application with max use of the features(As i'm not very aware of the high-end embedded programming)

Version history
Revision #:
1 of 1
Last update:
‎07-12-2012 12:17 PM
Updated by: