See page 10 for quick start Ethernet Converter Device FMod-TCP BOX User Manual Version 1.2...
Page 2
Windows® is a registered trademark of Microsoft Corporation. Ethernet® is a registered trademark of Xerox Corporation. Java® is a registered trademark of Sun Microsystem. Philips® is a registered trademark of Koninklijke Philips Electronics N.V. Borland® is a registered trademark of Borland Software Corporation. Warning This device is not intended to be used in medical, life-support or space products.
SOS button ...9 3 Quick start ...10 Changing IP address ...10 4 Controlling the FMod-TCP BOX by TCP or UDP...12 General Information...12 RS232 (TCP # 8000)...12 Device parameters and I/O, A/D and I2C features (TCP # 8010 or UDP # 7010) .13 Easy IP address config (UDP # 7010)...19...
Page 4
Revision history Revision Date Author 05.05.06 09.06.06 14.08.06 Note - First version - Update specifications - Text corrections - I2C speed correction. - Warning register bits correction. 4 / 58 Firmware Applet Win32 app version version version Since 1.0 Since 1.0 Since 3.0 Since 1.0 Since 1.0...
Package and operating conditions Starter Kit contents The FMod-TCP BOX “Starter kit” should contain: FMod-TCP BOX device RS232 DSub cable DIN 41651 40 lines cable CD-Rom with dedicated software and Java applet sample This manual Absolute maximum rating Damage may occur if the device is operated using values beyond those mentioned below;...
Overview Applications The FMod-TCP BOX is a TCP/IP server that allows system integrators to connect different devices such as home appliances, industrial sensors and industrial control systems directly to the Ethernet network, (10BaseT) and to remotely monitor and control those using standard protocols.
7 / 58 "Question & Answer" oriented. The PC should send a Question, wait for the Answer and so on. To configure the device's parameters and to access I/O and A/D features, the protocol uses an Internal Registers Access routine (see chapter 4 and 7). The code samples available on the FiveCo's web site can help programmers...
Red-Green The device found another one with the same IP address blinking on the network. Disable the oth FMod-TCP BOX. Left side Power connector Inputs, Outputs, I2C, Supply voltage, 5V and GND 12 – 32 VDC...
The I2C pins are provided through a Philips PCA9512 driver chip. 10kΩ pull -ups are connected to ht side Standard RS232 DSub 9 connector (male like on a computer) The RS232 connector is the same as the ones found on any computer.
6. If you have more than one network adapter on your PC, the software will ask you to select the one which is connected to the same network as the FMod-TCP BOX. 7. The software will suggest a new IP address with the last byte left open.
Page 11
You can now connect the device with the Win32 software or open its web page by typing its new IP address into a web browser. Notes: The IP address won't be changed if a TCP connection exists with the device. The protocol used to change the IP address is described later in this manual.
TCP allows the acknowledgement of several packets at one time. Unfortunately, the FMod-TCP BOX device needs this acknowledgement to remove the data from its internal RS232 receive buffer (if no acknowledge is received from the PC, the module will resend those data).
So, with speeds greater than 9600bds, the buffer may be filled faster than data can be sent by TCP and part of those will be lost if no RS232 hardware flow control is used between the FMod-TCP BOX and the RS232 device (CTS and RTS lines).
Page 14
The maximum number of registers that can be read at one time is almost 30. The answer sequence should not be greater than 180 bytes. If the number of registers is too big, the FMod-TCP BOX will answer only with the value of some of them.
Page 15
EEPROMs, general-purpose I/O, A/D and D/A converters, CODECs, and microprocessors of all kinds. You can find the I2C’s specifications on the Philips web site at the following link: http://www.semiconductors.philips.com/ The I2C protocol can access a device by three different manners: Write (Start, AddW, Byte1, Byte2, …, Stop)
Page 16
To be able to do all of these 3 sequences, use this command: Byte# 0x00 I2CRWwithAck (0x0007) 0x02 TransactionID 0x04 LengthOfParameters (X + 3) 0x06 7 bits Address (bit 7 = 0) 0x07 X (number of bytes to write) 8 bits 0x08 xBytes ….
Page 17
Valid addresses list Checksum Note: If there is no address in the I2C Scan command, the FMod-TCP BOX will scan all addresses between 1 and 127! I2C speed change (advanced features) The I2C bus speed can be changed at any time by changing the content of the I2CSPD parameter.
Page 18
3. The I2C controller does not match all I2C specifications at speed higher than 100kHz. This feature will therefore not work with all I2C slaves. The value of the I2CSPD parameter must be computed with the following formula: CSPD CSpeed wanted The I2C speed cannot be saved in EEPROM.
IP address and subnet mask. Procedure: Send a UDP broadcast message (using a local or direct broadcast IP address) to your network (inside which the FMod-TCP BOX is connected) with the following command: Byte# 0x00...
Checksum calculation This checksum is the same as the IP checksum. Definition: sum of 1’s complement of all 16 bits words of whole message (FiveCo packet) except checksum bytes. Note: all values are unsigned! Sequence: 1. Clear accumulator Loop x. Only if last word is not made of two bytes, the data byte is the upper byte (big endian) 2.
Page 21
Here is an example of a checksum calculation function in C: int RetCheckSum(Byte* ByteTab, int Size) // This function returns the calculated checksum unsigned int Sum=0; bool AddHighByte=true; unsigned int ChecksumCalculated; for(int i=0;i<Size;i++) if(AddHighByte) Sum+=((ByteTab[i])<<8)^0xFF00; AddHighByte=false; else Sum+=(ByteTab[i])^0x00FF; AddHighByte=true; if (AddHighByte==false) Sum+= 0xFF;...
22 / 58 Java A pplet A specific Java Applet is provided with the module to control any of its ports without having to write any specific code. Overview To connect to the http server on the device, simply open your web browser and type the IP address of the module.
23 / 58 Main Config The Main panel shows the general information related to the device. • The first part allows the user to change the main settings of the device. Don't forget to use the "Save user parameters" button to make changes permanent! •...
24 / 58 Test A/D and I/Os This page can be used to access Inputs state and voltage and change Outputs state. The Inputs state and voltage are regularly updated automatically (20 kHz). You can change the low to high threshold of the inputs between 0 and 24V. This page display also the device supply voltage and warnings (Too low/high supply voltage, Outputs driver over current or temperature).
25 / 58 Test RS232 This page can be used to access RS232 bus. If you click on the "Connect to RS232 TCP Port" you can send ASCII data to RS232 bus and receive data from it (only ASCII is visible in this application). You can check "Add LF", "Add CR"...
Test I2C This page can be used to access I2C bus. The panel is divided in two parts: The part on the right allows scanning the I2C bus to find available slave devices. The part on the left allows sending a read or a write command to a device on the I2C bus.
Page 27
27 / 58 checked the "Read" box, the FMod-TCP BOX will use the read after write I2C feature). After writing the I2C address (7bits hexa) and the number of bytes to read (if applicable), click on the "Send" button. The answer is displayed in hex in the "Data received"...
Win32 A pplication A specific application is provided with the module to control any of its ports without having to write a specific code. Overview IP address of the module TCP port number Connection status To open a TCP port on the module, the user has to set the correct IP address of the module, to choose the correct TCP port in the list and to click on the "Open"...
Page 29
29 / 58 This application uses the IP address of your computer and its subnet mask to find the scan broadcast address. When you click on scan, a broadcast message will be sent to all devices in your subnet and answers will be listed. : it only works with devices in your subnet! WARNING How does it work?
RS232 interface chain to send The RS232 interface is easy to use. Just write the ASCII, HEX or decimal string in the dedicated text box and click corresponding "Send" button. The received bytes are displayed into the "Data received" boxes (same data but different representation).
“Load web files” interface List of files to load This option allows users to load their personal web files (html, java, jpeg, gif, txt …) into the flash memory. A maximum of 44kB is available for that application. An example of pages and Default Java Applet code is available on the Starter Kit CDRom or on the FiveCo's web page.
Main port interface Change RS232 baud rate and flow control Change disconnection timeout Change IP address of the module Change subnet mask of the module Module MAC address Change module name The configuration interface allows the user to change the device’s settings. RS232 baud rate: The user can change the RS232 baud rate and enable or TCP timeout: IP address:...
Page 33
33 / 58 The I2C interface is an easy way to test the I2C connection between the module and the user's electronic. The user has to choose between an I2C Read or Write operation. In Write mode, the bytes (in hexadecimal like 41 42 45 separated by spaces!) must be written in the dedicated line and the I2C address in the dedicated Address space (in hexadecimal or in decimal).
Registers management Memory Organization The user must know that a new register value sent through the communication port is loaded to the running parameters in RAM and used for the current process. All these parameters are lost upon power-down. It is required to save them to “User Parameters”...
Full Register Description List of registers Address General Information 0x00 (00) 0x01 (01) 0x02 (02) 0x03 (03) 0x04 (04) 0x05 (05) 0x06 (06) 0x07 (07) 0x08 (08) Communication 0x10 (16) 0x11 (17) 0x12 (18) 0x13 (19) 0x14 (20) 0x15 (21) 0x16 (22) 0x18 (24) 0x1A (26)
Page 36
Product identifier composed with a Type and Model number. It defines which kind of peripheral it is. Normally different modules TYPE are not software compatible. Example: TYPE = 0x00080000 means Type=8 (FMod-TCP BOX), Model = 0 Function Read/Write Control Product ID...
Page 37
VERSION Register Address Register Name 0x01 VERSION Register Size Register structure 4 Bytes Unsigned Int 16bits (HH-HL) Version Description: Firmware identifier composed with a Version and Revision number. Same Version with different Revision is backward compatible. Example: Firmware 0x0001000A = Version 1, Revision 10 is compatible with all earlier revisions of the same version (ver 1.0 to 1.9).
Page 38
RESET CPU Function Address Function Name 0x02 RESETCPU Register Size Register structure 0 Byte none Description: Reboots the device. The communication will be lost. Function Read/Write Control Restart processor Write only Unit none FMod-TCP User Manual v.2.8 38 / 58...
Page 39
SAVE USER PARAMETERS Function Address Function Name 0x03 SAVEUSERPARAMETERS Register Size Register structure 0 Byte none Description: Saves the following parameters to user EEPROM space: 0x12 IPADDRESS 0x13 SUBNETMASK 0x14 TCPTIMEOUT 0x15 MODULENAME 0x16 RS232CONFIG 39 / 58 Read/Write Function Control Saves all in EEPROM Write only...
Page 40
RESTORE USER PARAMETERS Function Address Function Name 0x04 RESTOREUSERPARAMETERS Register Size Register structure 0 Byte none Description: Restores the following parameters from user EEPROM space: 0x12 IPADDRESS 0x13 SUBNETMASK 0x14 TCPTIMEOUT 0x15 MODULENAME 0x16 RS232CONFIG 40 / 58 Function Read/Write Control Restores saved Write only values...
Page 41
RESTORE FACTORY PARAMETERS Function Function Name Address 0x05 RESTOREFACTORYPARAMETERS Register Size Register structure 0 Byte none Description: Restores the following parameters from factory EEPROM space: 0x12 IPADDRESS 0x13 SUBNETMASK 0x14 TCPTIMEOUT 0x15 MODULENAME 0x16 RS232CONFIG Note: SAVEUSERPARAMETERS should be performed after this function in order to save restored parameters as user parameters.
Page 42
SAVE FACTORY PARAMETERS Function Address Function Name 0x06 SAVEFACTORYPARAMETERS Register Size Register structure 0 Byte none Description: Saves the following parameters to factory EEPROM space: 0x12 IPADDRESS 0x13 SUBNETMASK 0x14 TCPTIMEOUT 0x15 MODULENAME 0x16 RS232CONFIG Note: This feature should only be used by a system integrator that would change the initial factory default settings.
Page 43
VOLTAGE Register Address Register Name 0x07 VOLTAGE Register Size Register structure 4 Bytes Signed (2’s cplt) Int 16 (HH-HL) +16 bits fixed point (LH-LL) Description: Input Voltage Limits: 0x7FFFFFFxx = 32’767.996 0x000000xx = 0.0 Step 0x000001xx = 0.004 Example: When read 0x00234567 = 2311527 , Voltage = 35.27 (2311527/655636) Information: Over 32 V (0x00200000) the overvoltage warning bit is set and the overvoltage protection diode should increase power current.
Page 44
WARNING Register Address Register Name 0x08 WARNING Register Size Register structure 4 Byte Unsigned Int 32 bits , each bit independent Description: Each information/warning/error is contained in 2 bits: the first one (from LSB to MSB) shows the actual state, the next one shows if this state appeared previously.
COM OPTIONS Register Address Register Name 0x10 COMOPTIONS Register Size Register structure 4 Bytes 32 individual bits Description: This register is reserved for future use. 45 / 58 Function Read/Write Control Communication Read/Write options FMod-TCP User Manual v.2.8 Unit none...
ETHERNET MAC Register Address Register Name 0x11 ETHERNETMAC Register Size Register structure 6 Bytes 6 x Unsigned Bytes Description: A standard hardware unique identifier (worldwide) for each device on an Ethernet network. Note: If the user writes into this register, the MAC address will not be modified. This register is available only for informational purposes.
Page 47
IP ADDRESS Register Address Register Name 0x12 IPADDRESS Register Size Register structure 4 Bytes 4 x Unsigned Bytes Description: Network identifier used for TCP/IP and UDP/IP. The values 255 (0xFF) and 0 (0x00) are reserved for broadcast and network addresses and should not be used in this register. Notes: The module will change for a new IP address only when all of its communications ports are closed.
SUBNET MASK Register Address Register Name 0x13 SUBNETMASK Register Size Register structure 4 Bytes 4 x Unsigned Bytes Description: Network IP subnet mask used for TCP/IP and UDP/IP. Notes: The module will change for a new subnet mask only when all of its communications ports are closed.
Page 49
TCP TIMEOUT Register Address Register Name 0x14 TCPTIMEOUT Register Size Register structure 1 Byte Unsigned Int 8 bits Description: The TCP timeout is a value (in seconds) after which the user will be disconnected if the device has not been accessed in the meantime. If the value is 0, the TCP timeout is deactivated.
MODULE NAME Register Address Register Name 0x15 MODULENAME Register Size Register structure 16 Bytes 16 (only) x Unsigned Bytes (CHAR) Description: Name and/or description of the module. Example: For the name “Hello Module”; extend to 16 byte the name: “Hello Module”+5x space=16 Byte.
Page 52
I2C SPeeD Register Address Register Name 0x18 I2CSPD Register Size Register structure 1 Byte Unsigned Int 8 bits Description: I2C speed setting between ~39kHz and 400kHz. The value of this parameter must be computed with the following formula based on the wanted speed: CSPD CSpeed wanted...
Page 53
TCP CONNECTIONS OPENED Register Address Register Name 0x1A TCPCONNECTIONSOPENED Register Size Register structure 1 Byte Unsigned Int 8 bits Description: Number of users connected to the device using TCP. Value can be 0 to 4. 53 / 58 Function Read/Write Control Number of TCP connections that Read only...
Page 54
ANALOG INPUTS THRESHOLD Register Address Register Name 0x20 ANALOGINPUTSTHRESHOLD Register Size Register structure 4 Bytes Signed (2’s cplt) Int 16 (HH-HL) +16 bits fixed point (LH-LL) Description: Defines the threshold used by the AD converter on inputs pins to define input state as low or high (0 or 1).
Page 55
INPUTS Register Address Register Name 0x21 INPUTS Register Size Register structure 2 Bytes Unsigned Int 16 bits, each bit independent Description: Show digital state of each inputs pin. The state is defined by comparing actual input voltage with the ANALOG INPUTS THRESHOLD. Bit 0 INPUT #1 Bit 1...
Page 56
OUTPUTS Register Address Register Name 0x23 OUTPUTS Register Size Register structure 2 Bytes Unsigned Int 16 bits, each bit independent Description: Controls the state of each of the output pins. Bit 0 OUTPUT#1 (Relay A) Bit 1 OUTPUT#2 (Relay B) Bit 2 OUTPUT#3 Bit 3...
Page 57
INPUT VOLTAGE x VALUE Registers Register Name Addresses 0x30 to 0x3F INPUTVOLTAGExVALUE Register Size Register structure 4 Bytes Signed (2’s cplt) Int 16 (HH-HL) +16 bits fixed point (LH-LL) Description: Voltage value of the 16 inputs pins between -12V and 12V. This value saturates at ~ -15.5V and 24V.
Need help?
Do you have a question about the FMod-TCP BOX and is the answer not in the manual?
Questions and answers