UM0401
User manual
User manual for eight bit port expander
STMPE801 demonstration board
Introduction
This document explains the functioning of the demo board for the port expander Chip
STMPE801 with a PC GUI for reading and writing to the eight GPIOs and controlling the I
2
C
interface.
The objective of this demonstration board is to display the capabilities of the 8-bit port
expander (STMPE801) developed by STMicroelectronics using a Windows-based software
application. The software application provides a user-friendly environment to test the port
expander and verify its functionality.
The board is controlled by the GUI through the parallel port in the PC. The power to the
board should come from an external 5 V constant DC power supply.
The PC based GUI acts as the I
2
C host and controls the STMPE801 slave on the board.
The eight GPIOs in the STMPE801 are accessible through headers and can be easily pulled
high or low using jumpers. The GPIOs can be configured as outputs by writing to the
appropriate registers using the GUI. All these interfaces are controlled by using I
2
C
communication between Host and Slave devices.
In addition, the hardware has a provision for controlling the STMPE801 through an external
I
2
C master.
June 2007
Rev 1
1/17
www.st.com
Contents
UM0401
Contents
1
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1
1.2
1.3
1.4
System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Package contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Software installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Hardware installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.1
1.4.2
Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Jumper settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2
Running the STMPE801 port expander GUI . . . . . . . . . . . . . . . . . . . . . . 8
2.1
2.2
2.3
2.4
Running internal registers of STMPE801 . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Programming GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Configuring interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3
4
5
Using the external I
2
C master . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Demo board footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2/17
UM0401
List of figures
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Figure 10.
Figure 11.
Figure 12.
Figure 13.
Figure 14.
Figure 15.
Figure 16.
Figure 17.
Figure 18.
Figure 19.
GUI start up screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Port expander board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Voltage regulation from +5 V supply (VIN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
JP10_1 for Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
JP55_2 and JP56_2 for I
2
C_CLK and I
2
C_SDATA selection. . . . . . . . . . . . . . . . . . . . . . . . 7
JP2_3 setting for STMPE801 INT pull-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
JP3_3 and JP5_3 setting for STMPE801 SCLK and SDAT . . . . . . . . . . . . . . . . . . . . . . . . . 7
JP4_3 setting for STMPE801 I
2
C Slave address selection . . . . . . . . . . . . . . . . . . . . . . . . . 8
JP6_3 and JP7_3 setting for STMPE801 V
CC
and VIO connections . . . . . . . . . . . . . . . . . . 8
Screen shot of STMPE801 GUI startup screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Screen shot of write/read tab in STMPE801 GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Error screen when the incorrect I
2
C slave address is chosen . . . . . . . . . . . . . . . . . . . . . . 10
GPIO Input state screen shot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
GPIO Output state screen shot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Entering in hibernate mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Interrupt setting tab screen shot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Interrupt enabled with indication of current interrupt status in the ISR - screen shot . . . . . 14
External I
2
C connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Demo board footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3/17
Getting started
UM0401
1
1.1
Getting started
System requirements
In order to use the port expander demonstration board with the Windows operating system,
a recent version of Windows, such as Windows XP or Windows 2000 must be installed on
the PC. The user must have administrative rights to install the executable and launch it.
The version of the Windows OS installed on your PC may be determined by clicking on the
"System" icon in the Control Panel.
1.2
Package contents
The port expander demo board includes the following items:
●
Hardware content:
–
–
One demonstration board
One parallel port cable
PC executable software (STMPE801_GUI) to be used along with demo board
A DLL file to support the executable (io.dll) to be installed in the same directory as
the executable file.
Source code (written in Borland Delphi)
User manual
Schematic of the hardware
●
Software content:
–
–
–
●
Documentation:
–
–
1.3
Software installation
The GUI is a simple executable that can be run even from a USB flash drive. The only
requirement is that the user must have administrative rights on the system in order to open
the accompanying DLL file. The GUI can be started by double-clicking on the file
STMPE801_GUI.exe. When the exe file is opened, the GUI resembles
Figure 1
below:
4/17
UM0401
Figure 1.
GUI start up screen
Getting started
1.4
Hardware installation
Figure 2
below shows the snapshot of the demonstration board.
Figure 2.
Port expander board
5/17