IBD185
ST STM32F103VBT6
GPIO MiniPCIe Daughter Card
USER GUIDE
Version 1.0
Table of Contents
IBD185 Connectors Pin Definition ................................. 3
IBD185 Mechanical Drawing ........................................... 4
IBD185 Driver Installation ............................................... 5
IBD185 MCU Protocol Specification .............................. 7
1 Software Requirements ......................................... 7
1.1 Description ................................................... 7
1.1.1 GPIO configuration ................................... 7
1.1.2 GPIO status .............................................. 7
1.1.3 I2C Bus interface ...................................... 7
1.2 Protocol ........................................................ 7
1.2.1 Signal transmission format ........................ 7
1.2.2 Packet Format ........................................... 8
1.2.3 CRC .......................................................... 8
1.2.4 Communications flow ................................ 8
1.3 Command and Reply Codes ........................ 9
1.3.1 Summary ................................................... 9
1.3.2 Get Mcu Firmware Version ....................... 9
1.3.3 Get GPIO Configuration .......................... 10
1.3.4 Set GPIO Configuration .......................... 11
1.3.5 Get GPIO Status ..................................... 12
1.3.6 Set GPIO Status ..................................... 13
1.3.7 I2C Bus Interface Sub Command Set ..... 14
I2C Bus Initialize ............................................ 15
I2C Bus Enable .............................................. 16
I2C Device Status .......................................... 17
I2C Device Read/Write ................................... 18
I2C Device Read ............................................ 19
I2C Device Write ............................................ 21
I2C Bus Reset ................................................ 23
APPENDIX ...................................................................... 24
2 IBD185 User Guide
IBD185
ST STM32F103VBT6
GPIO MiniPCIe Daughter Card
IBD185 Connectors Pin Definition
J1, J2 for I2C
Pin # Signal Name
1
2
3
J3 Supports 16-in GPIO
Signal Name Pin # Pin # Signal Name
3.3V 2 1 3.3V
DIN8 4 3 DIN0
DIN9 6 5 DIN1
DIN10 8 7 DIN2
DIN11 10 9 DIN3
DIN12 12 11 DIN4
DIN13 14 13 DIN5
DIN14 16 15 DIN6
DIN15 18 17 DIN7
Ground 20 19 Ground
J4 Supports 16-out GPIO
Signal Name Pin # Pin # Signal Name
3.3V 2 1 3.3V
OUTPUT24 4 3 OUTPUT16
OUTPUT25 6 5 OUTPUT17
OUTPUT26 8 7 OUTPUT18
OUTPUT27 10 9 OUTPUT19
OUTPUT28 12 11 OUTPUT20
OUTPUT29 14 13 OUTPUT21
OUTPUT30 16 15 OUTPUT22
OUTPUT31 18 17 OUTPUT23
Ground 20 19 Ground
SCL
SDA
GND
IBD185 User Guide 3
IBD185 Mechanical Drawing
4 IBD185 User Guide
IBD185 Driver Installation
1. In the Windows OS, go to the Computer Management screen. In the
‘Other devices’ as shown, right click the “STM32 Virtual COM Port”
Properties.
2. In the STM32 Virtual COM Port Properties screen, click Update
Driver.
3. In the Hardware Update Wizard screen, select “No, not this time” and
click Next to continue.
4. Select “Install from a list or specific location (Advanced), and click
Next to continue.
5. To choose the “search” and “installation” options, click the checkbox
of “Include this location in the search”, and click Browse to find the
driver’s path in the CD provided or enter the path directly -
\SCSI\IBD185\iBASE_CDC.inf
IBD185 User Guide 5
6. Click Continue Anyway.
7. Click Finish to close the wizard.
8. There are a total of two serial ports. Therefore, the Hardware Update
Wizard procedure has to be repeated for the rest of the serial ports
6 IBD185 User Guide
IBD185 MCU Protocol Specification
1 Software Requirements
1.1 Description
MCU provides the following functionality:
1.1.1 GPIO configuration
Software can configure the functionality of GPIO pins on MCU.
MCU provides commands to configure the pin function as digital input
or digital output.
1.1.2 GPIO status
Software can control the output pin and get the status of input pin on
MCU.
MCU provides commands to control the output of pin which is
configured as an output pin or to read back the status of pin which is
configured as input pin.
1.1.3 I2C Bus interface
Software can perform I2C bus operation on MCU.
MCU provides command interface to control the I2C bus master on it.
1.2 Protocol
1.2.1 Signal transmission format
Bandwidth
Baud rate: 115200 bps.
Data Format
Parity: No Parity
1 start bit
8 data bits
1 stop bit
IBD185 User Guide 7
1.2.2 Packet Format
Header Size Command Data CRC
2 bytes 1 byte 1 byte 0 – 64 bytes 2 bytes
Header
bytes indicate start of the packet.
Size
specifies number of bytes for data field.
CRC
verifies data integrity for header, size, command and data bytes.
Command
identifies action, which is required to be performed on the data.
1.2.3 CRC
Protocol uses 16-bit CCITT CRC to verify data integrity.
P(x) = X16+X12+X5+1.
unsigned calc_crc(unsigned char *data, unsigned n, unsigned start)
{
unsigned I, k, q, c, crcval;
crcval=start;
for (I=0; I<n; I++)
{
c=data(I) & 0xFF;
q=(crcval^c) & 0x0F;
crcval=(crcval>>4)^(q*0x1081);
q=(crcval^(c>>4)) & 0x0F;
crcval=(crcval>>4)^(q*0x1081);
}
return crcval;
}
1.2.4 Communications flow
Communication between PC and MCU utilizes Master-Slave
model, where PC is a master, and MCU is a slave.
Master sends requests to the slave, and slave has to reply to
them. Slave acts like a passive device and cannot send any
requests to the master.
8 IBD185 User Guide