![]() |
Kinetis SDK v.1.2 Demo Applications User's Guide
Rev. 0
Freescale Semiconductor, Inc.
|
This demo application demonstrates the I2C demo on different RTOS.
This I2C application demonstrates the SDK Peripheral drivers working on different RTOS. The application acts as both the I2C master and the slave device on different I2C buses, such as the I2C Master on the I2C0 bus and the I2C Slave on the I2C1 bus. It can run on a single board or on two different boards. When connecting the two I2C buses on one board, the master sends the command using the I2C0 bus to the slave using the I2C1 bus. When connecting the I2C0 bus to the I2C1 bus on the other board, the application running on the first board is a master and sends a command to the other board which acts as a slave. This means that the first board can send a command and get a response from the other board by using the I2C bus.
The basic purpose of this demo is:
The application creates three different tasks to handle events concurrently:
These Freescale Freedom development platforms and Tower System modules are supported by the KSDK I2C demo with RTOS.
The Bare Metal (no RTOS) demo Supported Platforms:
The FreeRTOS, µC/OS-II, µC/OS-III demo Supported Platforms:
The MQX demo Supported Platforms:
The I2C RTOS application is designed to work on one single board or two different boards. Note that the bare-metal version only supports two boards.
Before running this application, build it with the RTOS you want to use. The projects for different RTOSes are differentiated by the workspace file name in the format of i2c_rtos_<rtos>.eww. For example, in IAR, the i2c_rtos_ucosii.eww workspace file is the µC/OS-II version of this application. After opening the appropriate workspace, build the ksdk_<rtos>_lib project and build the application project. A binary named i2c_rtos_<rtos>.out is generated.
Make the connections between the listed signals by using the external wires.
FRDM-K22F Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J24 - Pin 12 | -> | I2C1_SCL | J1 - Pin 13 |
I2C0_SDA | J24 - Pin 10 | -> | I2C1_SDA | J2 - Pin 7 |
FRDM-K22F Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J24 - Pin 12 | -> | I2C1_SCL | J1 - Pin 13 |
I2C0_SDA | J24 - Pin 10 | -> | I2C1_SDA | J2 - Pin 7 |
GND | TP21 | -> | GND | TP21 |
FRDM-K64F Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J2 - Pin 20 | -> | I2C1_SCL | J4 - Pin 12 |
I2C0_SDA | J2 - Pin 18 | -> | I2C1_SDA | J4 - Pin 10 |
FRDM-K64F Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J2 - Pin 20 | -> | I2C1_SCL | J4 - Pin 12 |
I2C0_SDA | J2 - Pin 18 | -> | I2C1_SDA | J4 - Pin 10 |
GND | J2 - Pin 14 | -> | GND | J2 - Pin 14 |
FRDM-KL02Z Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J7 Pin 10 | -> | I2C0_SCL | J7 Pin 10 |
I2C0_SDA | J7 Pin 9 | -> | I2C0_SDA | J7 Pin 9 |
GND | J7 Pin 7 | -> | GND | J7 Pin 7 |
FRDM-KL25Z Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J10 - Pin 6 | -> | I2C1_SCL | J10 - Pin 12 |
I2C0_SDA | J10 - Pin 8 | -> | I2C1_SDA | J10 - Pin 10 |
FRDM-KL25Z Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J10 Pin 6 | -> | I2C1_SCL | J10 Pin 12 |
I2C0_SDA | J10 Pin 8 | -> | I2C1_SDA | J10 Pin 10 |
GND | J9 Pin 14 | -> | GND | J9 Pin 14 |
FRDM-KL26Z Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 - Pin 6 | -> | I2C1_SCL | J2 - Pin 20 |
I2C0_SDA | J4 - Pin 8 | -> | I2C1_SDA | J2 - Pin 18 |
FRDM-KL26Z Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 - Pin 6 | -> | I2C1_SCL | J2 - Pin 20 |
I2C0_SDA | J4 - Pin 8 | -> | I2C1_SDA | J2 - Pin 18 |
GND | J2 - Pin 14 | -> | GND | J2 - Pin 14 |
FRDM-KL27Z Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 Pin 20 | -> | I2C1_SCL | J4 Pin 12 |
I2C0_SDA | J4 Pin 18 | -> | I2C1_SDA | J4 Pin 10 |
FRDM-KL27Z Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 Pin 20 | -> | I2C1_SCL | J4 Pin 12 |
I2C0_SDA | J4 Pin 18 | -> | I2C1_SDA | J4 Pin 10 |
GND | J2 Pin 14 | -> | GND | J2 Pin 14 |
FRDM-KL43Z Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 Pin 2 | -> | I2C1_SCL | J2 Pin 20 |
I2C0_SDA | J4 Pin 4 | -> | I2C1_SDA | J2 Pin 18 |
FRDM-KL43Z Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 Pin 2 | -> | I2C1_SCL | J2 Pin 20 |
I2C0_SDA | J4 Pin 4 | -> | I2C1_SDA | J2 Pin 18 |
GND | J2 Pin 14 | -> | GND | J2 Pin 14 |
FRDM-KL46Z Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 Pin 6 | -> | I2C1_SCL | J2 Pin 20 |
I2C0_SDA | J4 Pin 8 | -> | I2C1_SDA | J2 Pin 18 |
FRDM-KL46Z Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J4 Pin 6 | -> | I2C1_SCL | J2 Pin 20 |
I2C0_SDA | J4 Pin 8 | -> | I2C1_SDA | J2 Pin 18 |
GND | J2 Pin 14 | -> | GND | J2 Pin 14 |
MRB board doesn't include user controllable LEDs, so the only available commands are: 4 (Read Temperature) and 5 (Read Id).
MRB-KW01 Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J15 - Pin 12 | -> | I2C1_SCL | J14 - Pin 14 |
I2C0_SDA | J14 - Pin 8 | -> | I2C1_SDA | J14 - Pin 12 |
MRB-KW01 Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | J15 - Pin 12 | -> | I2C1_SCL | J14 - Pin 14 |
I2C0_SDA | J14 - Pin 8 | -> | I2C1_SDA | J14 - Pin 12 |
GND | J14 - Pin 18 | -> | GND | J14 - Pin 18 |
TWR-K21D50M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
PTC10/I2C0_SCL | Primary Elevator - Pin A7 | -> | PTD2/I2C1_SCL | Primary Elevator - Pin B45 |
PTC11/I2C0_SDA | Primary Elevator - Pin A8 | -> | PTD3/I2C1_SDA | Primary Elevator - Pin B44 |
TWR-K21D50M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
PTC10/I2C0_SCL | Primary Elevator - Pin A7 | -> | PTD2/I2C1_SCL | Primary Elevator - Pin B45 |
PTC11/I2C0_SDA | Primary Elevator - Pin A8 | -> | PTD3/I2C1_SDA | Primary Elevator - Pin B44 |
GND | Primary Elevator - Pin A65 | -> | GND | Primary Elevator - Pin A65 |
TWR-K21F120M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
PTD2/I2C0_SCL | Primary Elevator B45 | -> | PTC10/I2C1_SCL | Primary Elevator B50 |
PTD3/I2C0_SDA | Primary Elevator B44 | -> | PTC11/I2C1_SDA | Primary Elevator B51 |
TWR-K21F120M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
PTD2/I2C0_SCL | Primary Elevator B45 | -> | PTC10/I2C1_SCL | Primary Elevator B50 |
PTD3/I2C0_SDA | Primary Elevator B44 | -> | PTC11/I2C1_SDA | Primary Elevator B51 |
GND | Primary Elevator - Pin A65 | -> | GND | Primary Elevator - Pin A65 |
TWR-K22F120M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator - Pin A7 | -> | I2C1_SCL | Primary Elevator - Pin B50 |
I2C0_SDA | Primary Elevator - Pin A8 | -> | I2C1_SDA | Primary Elevator - Pin B51 |
TWR-K22F120M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator - Pin A7 | -> | I2C1_SCL | Primary Elevator - Pin B50 |
I2C0_SDA | Primary Elevator - Pin A8 | -> | I2C1_SDA | Primary Elevator - Pin B51 |
GND | Primary Elevator - Pin A65 | -> | GND | Primary Elevator - Pin A65 |
TWR-K24F120M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator A7 | -> | I2C1_SCL | Primary Elevator B50 |
I2C0_SDA | Primary Elevator A8 | -> | I2C1_SDA | Primary Elevator B51 |
TWR-K24F120M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator A7 | -> | I2C1_SCL | Primary Elevator B50 |
I2C0_SDA | Primary Elevator A8 | -> | I2C1_SDA | Primary Elevator B51 |
GND | Primary Elevator A6 | -> | GND | Primary Elevator A6 |
TWR-K60D100M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator A7 | -> | I2C1_SCL | Primary Elevator A75 |
I2C0_SDA | Primary Elevator A8 | -> | I2C1_SDA | Primary Elevator B71 |
TWR-K60D100M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator A7 | -> | I2C1_SCL | Primary Elevator A75 |
I2C0_SDA | Primary Elevator A8 | -> | I2C1_SDA | Primary Elevator B71 |
GND | Primary Elevator A6 | -> | GND | Primary Elevator A6 |
TWR-K64F120M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator - Pin A7 | -> | I2C1_SCL | Primary Elevator - Pin A75 |
I2C0_SDA | Primary Elevator - Pin A8 | -> | I2C1_SDA | Primary Elevator - Pin B71 |
TWR-K64F120M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator - Pin A7 | -> | I2C1_SCL | Primary Elevator - Pin A75 |
I2C0_SDA | Primary Elevator - Pin A8 | -> | I2C1_SDA | Primary Elevator - Pin B71 |
GND | Primary Elevator - Pin A65 | -> | GND | Primary Elevator - Pin A65 |
TWR-K65F180M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator - Pin A7 | -> | I2C1_SCL | Primary Elevator - Pin B11 |
I2C0_SDA | Primary Elevator - Pin A8 | -> | I2C1_SDA | Primary Elevator - Pin B22 |
TWR-K65F180M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator - Pin A7 | -> | I2C1_SCL | Primary Elevator - Pin B11 |
I2C0_SDA | Primary Elevator - Pin A8 | -> | I2C1_SDA | Primary Elevator - Pin B22 |
GND | Primary Elevator - Pin A65 | -> | GND | Primary Elevator - Pin A65 |
TWR-KL43Z48M Single Board | ||||
Master | Connects To | Slave | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator A40 | -> | I2C1_SCL | Primary Elevator A7 |
I2C0_SDA | Primary Elevator A39 | -> | I2C1_SDA | Primary Elevator A8 |
TWR-KL43Z48M Two Boards | ||||
Master (Board #1) | Connects To | Slave (Board #2) | ||
Pin Name | Board Location | Pin Name | Board Location | |
I2C0_SCL | Primary Elevator A40 | -> | I2C1_SCL | Primary Elevator A7 |
I2C0_SDA | Primary Elevator A39 | -> | I2C1_SDA | Primary Elevator A8 |
GND | Primary Elevator A6 | -> | GND | Primary Elevator A6 |
For more detailed instructions, see a Kinetis SDK User's Guide for your board.
This menu displays on the terminal window:
Enter your choice (1 - 5):
You can select to toggle the RGB LED, read the temperature of the client board, and read the client unique ID.
Note that a different colored LED may turn on if the selected color is not available on that board.