CP2400AB Silicon Laboratories Inc, CP2400AB Datasheet - Page 11

BOARD EVAL SPI LCD DRIVER CP2400

CP2400AB

Manufacturer Part Number
CP2400AB
Description
BOARD EVAL SPI LCD DRIVER CP2400
Manufacturer
Silicon Laboratories Inc
Datasheets

Specifications of CP2400AB

Main Purpose
LCD Development
Embedded
No
Utilized Ic / Part
CP2400
Primary Attributes
I²C, SMBus Interfaces
Secondary Attributes
Up to 128 segments
Product
Microcontroller Accessories
Core Processor
CP2400
Clock Speed
20 MHz
Interface Type
SPI
Timers
2
Operating Supply Voltage
1.8 V to 3.6 V
Cpu Core
CP2400
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
336-1857
CP2400/1-DK
6. Example Source Code
Example source code and register definition files are provided in the “SiLabs\MCU\Examples\C8051F93x_92x\”
default directory during IDE installation. These files may be used as a template for code development. Example
applications include a blinking LED example which configures the green LED on the target board to blink at a fixed
rate.
6.1. Register Definition Files
Register definition files C8051F930.inc and C8051F930_defs.h define all SFR registers and bit-addressable
control/status bits. A macro definition header file compiler_defs.h is also included, and is required to be able to use
the
C8051F930_defs.h
header
file
with
various
tool
chains.
These
files
are
installed
into
the
“Silabs\MCU\Examples\C8051F93x_92x\Header_Files\” directory during IDE installation by default. The register
and bit names are identical to those used in the C8051F93x-C8051F92x data sheet. These register definition files
are also installed in the default search path used by the Keil Software 8051 tools. Therefore, when using the Keil
8051 tools included with the development kit (A51, C51), it is not necessary to copy a register definition file to each
project’s file directory.
6.2. Blinking LED Example
The
example
source
files
F93x_Blinky.asm
and
F93x_Blinky.c
installed
in
the
default
directory
“Silabs\MCU\Examples\C8051F93x_92x\Blinky” show examples of several basic C8051F930 functions. These
include disabling the watchdog timer (WDT), configuring the Port I/O crossbar, configuring a timer for an interrupt
routine, initializing the system clock, and configuring a GPIO port pin. When compiled/assembled and linked this
program flashes the green LED on the C8051F930 Target Board about five times a second using the interrupt
handler with a C8051F930 timer.
6.3. Touch Sensitive Switch Example
The example source file F93x_CapTouchSense_Switch.c demonstrates the configuration and usage of the touch
sensitive (contactless) switches located on P2.0 and P2.1. Refer to the source file for step-by-step instructions to
build and test this example. This is installed in the following directory by default:
Silabs\MCU\Examples\C8051F93x_92x\ CapTouchSense_Switch
6.4. LCD Examples
The example source files in the project CP240x_LCD_Example show how to initialize the C8051F9xx as well as
the CP2400/1. The project uses the LCD library to configure the CP2400/1 through the SPI interface (CP2400) or
SMBus interface (CP2401). This project contains many examples that can be selected and customized through
modifications to header files. This is installed in the following directory by default:
Silabs\MCU\Examples\CP240x\CP240x_LCD_Example\Source
6.4.1. Target Board Selection
The target board that is connected to the CP2400/1 LCD Development Board must be specified in the file
lcd_lib_portdefs.h. The section labeled “Development Board Definition” has a global definition that specifies which
target board is connected to the CP2400/1 LCD development board. It is important to note that the target board
specified in this section must match the target board that is connected to the CP2400/1 LCD development board.
The following line of code would configure the code to use the C8051F930 target board:
#define DEV_BOARD
F930DK
6.4.2. Control Interface Selection
The control interface that is used to configure the CP2400/1 can be selected by modifying the file,
lcd_lib_portdefs.h. In this file, there is a section called “Interface Definition” where either the SPI interface
(CP2400) or the SMBus interface (CP2401) can be selected. It is important to note that the correct control interface
must be selected in this particular header file before compiling the project or the CP2400/1 will not function
correctly. The CP2400 uses the SPI interface, and the CP2401 uses the SMBus interface. The following line of
code would configure the code to use the SMBus interface to configure a CP2401:
#define BUS_INTERFACE
SMBUS
Rev. 0.1
11

Related parts for CP2400AB