Wiznet WIZ145SR-EVB Serial to Ethernet User manual

Add to My manuals
28 Pages

advertisement

Wiznet WIZ145SR-EVB Serial to Ethernet User manual | Manualzz

WIZ140SR / WIZ145SR User’s Manual

( Version 2.0.1 )

©2012 WIZnet Co., Ltd. All Rights Reserved.

☞ For more information, visit our website at http://www.wiznet.co.kr

WIZ140SR/WIZ145SR Datasheet

(WIZnet Co., Ltd.)

Document Revision History

Date Revision Changes

2012-06-15

2013-06-19 v2.0.0 v2.0.1

Modify the error sentence ( P3, P8, P10, P13, P16 )

Changed the document version notation and file name.

COPYRIGHT NOTICE

Copyright 2012 WIZnet Co., Ltd. All Rights Reserved.

Technical Support: [email protected]

Sales & Distribution: [email protected]

For more information, visit our website at http://www.wiznet.co.kr

WIZ140SR/WIZ145SR Datasheet

(WIZnet Co., Ltd.)

Contents

1. Introductions ................................................................................................................... 1

1.1

Main Features ........................................................................................................... 1

1.2 Specifications ............................................................................................................ 2

2. Getting Start ................................................................................................................... 3

2.1 Install Hardware ......................................................................................................... 3

2.2 Configuration Tool Installation ..................................................................................... 3

3 Important Functions ......................................................................................................... 4

3.1 Module Configuration thru TCP/IP .............................................................................. 4

3.2 Module Configuration thru Serial command ................................................................ 4

3.2.1 Serial command Format ................................................................................... 4

3.2.2 Command code(Direction: Serial device -> MODULE) ....................................... 5

3.2.3 Reply code(Direction: WIZ140SR/WIZ145SR -> Serial device) .......................... 7

3.2.4 Example .......................................................................................................... 8

3.2.4.1 Command for changing the IP address of the module to 192.168.1.2 ....... 8

3.2.4.2 Command for setting the Domain Name of Channel #1 ............................ 8

3.2.4.3 Command for reading the Local Port Number of Channel #3, when the value is 5000 ..................................................................................................... 8

3.3 IP Accuisition Mode (Static, DHCP, PPPoE) Setting Function ....................................... 8

3.3.1 Static ............................................................................................................... 8

3.3.2 DHCP .............................................................................................................. 9

3.3.3 PPPoE .......................................................................................................... 10

3.4 Connection Mode (Server, Client, UDP) Setting Function .......................................... 10

3.4.1 Server Mode .................................................................................................. 10

3.4.2 Client Mode ................................................................................................... 11

3.5 DNS Setting Function .............................................................................................. 11

3.6 Real-time Debug Function ........................................................................................ 12

3.7 Data Packetizing Function ........................................................................................ 13

3.7.1 Character....................................................................................................... 13

3.7.2 Size ............................................................................................................... 14

3.7.3 Time .............................................................................................................. 15

3.7.4 Compound Settings ........................................................................................ 15

3.8 Inactivity Time Function ............................................................................................ 16

3.9 Firmware uploading thru TCP/IP ............................................................................... 16

3.10 Log Data save and report function .......................................................................... 17

3.10.1 Log Data ...................................................................................................... 17

3.10.1.1 Log Data Frame ................................................................................. 17

3.10.1.2 Code & Parameter .............................................................................. 17

3.11 TCP Connection Status Function ............................................................................ 19

4 Demo............................................................................................................................ 20

4.1 Operate in Server mode ........................................................................................... 20

4.1.1 Composition ................................................................................................... 20

4.1.2 Operation Order ............................................................................................. 20

WIZ140SR/WIZ145SR Datasheet

(WIZnet Co., Ltd.)

Figures

I

MAGE

1 C

ONFIGURATION TOOL

................................................................................................................... 3

I

MAGE

2 S

ERIAL

C

OMMAND

F

RAME

F

ORMAT

.............................................................................................. 4

I

MAGE

3 S

ERIAL

C

OMMAND

E

XAMPLE

#1 .................................................................................................... 8

I

MAGE

4 S

ERIAL

C

OMMAND

E

XAMPLE

#2 .................................................................................................... 8

I

MAGE

5 S

ERIAL

C

OMMAND

E

XAMPLE

#3 .................................................................................................... 8

I

MAGE

6 D

EBUGGING FROM

D

EBUG SERIAL PORT

..................................................................................... 13

I

MAGE

7 L

OG

D

ATA

F

RAME

........................................................................................................................ 17

I

MAGE

8 C

ONSOLE SCREEN DURING MODULE BOOTING PROCESS

........................................................... 22

I

MAGE

9 S

CREEN AFTER CONNECTING TO MODULE WITH

TCP/IP ............................................................ 23

I

MAGE

10 C

ONSOL SCREEN AFTER

TCP C

ONNECTION

............................................................................. 24

Tables

T

ABLE

1 S

PECIFICATIONS

............................................................................................................................. 2

T

ABLE

2 S

ERIAL

C

OMMAND

C

ODE

T

ABLE

.................................................................................................... 7

T

ABLE

3 S

ERIAL

C

OMMAND

R

EPLY

C

ODE

T

ABLE

........................................................................................ 7

T

ABLE

4 L

OG DATA CODE

&

PARAMETER

T

ABLE

......................................................................................... 18

WIZ140SR/WIZ145SR Datasheet

(WIZnet Co., Ltd.)

1. Introductions

1.1 Main Features

 Support 4 Serial port

 Connect with the Serial Device directly

 Adding network function simply and quickly

 Providing Firmware customization

 High system stability and reliability by using W5300

 Easy and powerful configuration tool program

 Support DHCP and DNS function

 Support static as well as dynamic IP setting

 10/100 Mbps Ethernet interface, Max 115,200bps serial interface

WIZ140SR/WIZ145SR Datasheet 1

1.2 Specifications

Architecture

MCU

WIZ140SR

ARM-based 32-bit MCU

TCP/IP W5300

PHY

WIZ145SR

Included in W5300

10/100Mbps Ethernet

Auto negotiation (Full-duplex and Half-duplex)

Auto MDI/MDIX

Serial

Data

Port

Serial RS-232C

Interface TTL

Signals TXD, RXD, RTS, CTS, GND

Parameters Parity : None, Odd, Even

Data bits : 7, 8 bit

Flow control : None, RTS / CTS, XON / XOFF

Speed Up to 115,200bps

Interface TTL Serial

Debug

Port

Parameters Parity : None

Data bits : 8 bit

Flow control : None

Speed 115,200bps

Dimensions

( Include connector size ) 16.2mm

Pin header Connector 2.54mm Pitch Pin-header, 14Pin (1x14)

2.54mm Pitch Pin-header, 28Pin (2x14)

None 1 RJ-45 Connector RJ-45 Connector

Input voltage

Power consumption

Temperature

Humidity

DC 3.3V

Under 200mA

0

C ~ 70C (Operation), -40C ~ 85C (Storage)

10 ~ 80%

Table 1 Specifications

WIZ140SR/WIZ145SR Datasheet 2

2. Getting Start

2.1 Install Hardware

You prepared WIZ140SR Module or WIZ145SR module with Test board.

STEP1: Drop the WIZ140SR/WIZ145 Module in WIZ140SR/WIZ145SR Test Board.

STEP2: Connect Ethernet cable to RJ-45 connector on the Test Board

STEP3: Connect PC and Test Board using Serial Cable.

STEP4: If you check Debugging message from debug serial port, you connect PC and Test

Board using Serial Cable.

STEP5: connect to the power

*1. Boot selection pin is open, when working normal mode.

*2. H/W Trigger switch is OFF.

2.2 Configuration Tool Installation

Start the Configuration Tool Installation program, which can be downloaded from the WIZnet home page. The captured screen of the Configuration tool is as shown below.

WIZ140SR/WIZ145SR Datasheet

Image 1 Configuration tool

3

3 Functions

3.1 Module Configuration thru TCP/IP

Basic Information for modules, WIZ140SR and WIZ145SR, can be set by using TCP/IP network.

① Connect the module and PC, that has ConfigTool.exe installed, to the network of same subnet and turn on power.

button from the Tool program, then, all modules that are connected to the local network will display.

③ Use the Configuration Tool to modify the settings of each module.

Specific modification steps are explained after 3.3 of this document

3.2 Module Configuration thru Serial command

This function is used to modify the settings of the module by using Serial port.

Connect the cable to the module’s Channel #1 serial port and switch the HW Trigger SW’s pin to ‘ON.” Then, Serial command mode is accessed.

Caution! Once Serial command mode is activated, the connected TCP socket is

disconnected, therefore, data exchange through the data channel is not possible.

3.2.1 Serial command Format

1 Byte

STX

1

4 Bytes (0 ~ 32 Bytes)

Image 2 Serial Command Frame Format

1Byte

ETX

2

1

STX : ‘<’ (Hex code: 0x3C)

2

ETX : ‘>’ (Hex code: 0x3E)

WIZ140SR/WIZ145SR Datasheet 4

3.2.2 Command code(Direction: Serial device -> MODULE)

Code Parameter

General Info

R_PC None

Comments

Get Product Code

R_IP None

W_IP xxx.xxx.xxx.xxx

Get Local IP Address

Set Local IP Address

R_SN None

W_SN xxx.xxx.xxx.xxx

R_GW None

W_GW xxx.xxx.xxx.xxx

R_FW None

R_DB None

Get Subnet Mask

Set Subnet Mask

Get Gateway Address

Set Gateway Address

Get Firmware Version

Get Debug mode value

Set Debug mode value

1 : Enable

R_MD None Get IP setting mode value

Set IP setting mode value

1: DHCP

2 : PPPoE

R_CM None

W_CM 0: H/W trigger

1: S/W trigger

R_SC None

W_SC xxxxxx

R_DS None

W_DS xxx.xxx.xxx.xxx

W_XX None

Channel Info

RnSM None

WnSM 0: Server

1: TCP Client

2: Mixed

RnCS None

RnDM None

Get Serial command mode type

Set Serial command mode type

Get Serial command mode character

Set Serial command mode character

Get DNS Server IP Address

Set DNS Server IP Address

Get Socket operation mode

n : channel number( 0 ~ 3)

Set Socket operation mode

n : channel number( 0 ~ 3)

Get Socket connection state

n : channel number( 0 ~ 3)

Get DNS mode value

n : channel number( 0 ~ 3)

WIZ140SR/WIZ145SR Datasheet 5

1: Enable

RnUM None

Set DNS mode value

n : channel number( 0 ~ 3)

Get UDP mode value

n : channel number( 0 ~ 3)

1: Enable

RnSI None

Set UDP mode value

n : channel number( 0 ~ 3)

Get Remote Peer’s IP Address

n : channel number( 0 ~ 3)

WnSI xxx.xxx.xxx.xxx

RnLP None

WnLP 0 ~ 65535

RnSP None

Set Local port number

n : channel number( 0 ~ 3)

Get Remote Peer’s port number

n : channel number( 0 ~ 3)

WnSP 0 ~ 65535

RnSD None

Set Remote Peer’s port number

n : channel number( 0 ~ 3)

Get Remote Peer’s Domain name

n : channel number( 0 ~ 3)

WnSD xxxxxxxxxxxxxxx(Variable) Set Remote Peer’s Domain name

n : channel number( 0 ~ 3)

RnBU None Get Serial configuration value(Baud rate, data bit, parity and flow control)

n : channel number( 0 ~ 3)

WnBU xxxx

[Baud]

0

115200

1 57600

2 38400 4 19200

4 9600 5 4800

6 2400 7 1200

[Data]

0 7bit 1 8bit

WIZ140SR/WIZ145SR Datasheet

[Parity]

0 1 2

None Odd Even

Set Remote Peer’s IP Address

n : channel number( 0 ~ 3)

Get Local port number

n : channel number( 0 ~ 3)

Set Serial configuration value(Baud rate, data bit, parity and flow control)

n : channel number( 0 ~ 3)

4Bytes : [Baud][Data][Parity][Flow]

6

[Flow Control]

0 1 2

None Xon/Xoff RTS/CTS

RnOC None

WnOC xx

Get Data Packing Condition ‘Char’

n : channel number( 0 ~ 3)

Set Data Packing Condition Char

n : channel number( 0 ~ 3) ex) if value is 0x0D, then ‘0’’D’

Get Data Packing Condition ‘Size’ RnOS None

WnOS 0 ~ 255

RnOT None

Set Data Packing Condition ‘Size’

n : channel number( 0 ~ 3)

Get Data Packing Condition ‘Time’

n : channel number( 0 ~ 3)

WnOT

WnOI

0 ~ 65535

RnOI None

Set Data Packing Condition ‘Time’

n : channel number( 0 ~ 3)

Get Inactivity Time value

n : channel number( 0 ~ 3)

0 ~ 65535

Set Inactivity Time value

n : channel number( 0 ~ 3)

Table 2 Serial Command Code Table

3.2.3 Reply code(Direction: WIZ140SR/WIZ145SR -> Serial device)

Reply Meaning

E

S

Serial command mode Start

Command Success

F

1

Command Fail

Invalid command

2

Invalid parameter

Table 3 Serial Command Reply Code Table

WIZ140SR/WIZ145SR Datasheet 7

3.2.4 Example

3.2.4.1 Command for changing the IP address of the module

Users’ Serial Device

<W_IP192.168.1.2>

<S>

<W_XX>

3

Image 3 Serial Command Example #1

WIZ140SR/WIZ145SR

3.2.4.2 Command for setting the Domain Name of Channel #1

Users’ Serial Device

< W1SDwww. wiznetexam.com >

<S>

<W_XX>

Image 4 Serial Command Example #2

WIZ140SR/WIZ145SR

3.2.4.3 Command for reading the Local Port Number of Channel #3

Users’ Serial Device

<R3LP>

<S5000>

Image 5 Serial Command Example #3

WIZ140SR/WIZ145SR

3.3 IP Acquisition Mode (Static, DHCP, PPPoE) Setting Function

This function is for setting how the module’s IP address is going to be acquired.

3.3.1 Static

The Static IP address mode is used when assigning static IP address.

When Permanent IP address is assigned by the network manager,

First, click the button to find module that is connected to the network.

3

In case of Set command, command W_XX must be sent at the end in order for the module to be configured.

WIZ140SR/WIZ145SR Datasheet 8

Select the module that the value will be assigned from the ListBox, which is shown at the left of the screen.

Select Static for the IP address mode,

Enter the assigned values for IP address, Subnet mask, and Gateway address,

⑤ Click

.

3.3.2 DHCP

The DHCP IP address mode is used when equipment that assign dynamic IP, like routers are connected.

First, click the button and find the module that is connected to the network.

② Select the module that the value will be assigned from the ListBox, which is shown at the left of the screen.

Select DHCP for the IP address mode,

④ Click

.

When there is not a DCHP server, the DHCP process fails. When the DHCP process

fails, booting completes with the existing network information after a period of time..

WIZ140SR/WIZ145SR Datasheet 9

3.3.3 PPPoE

The PPPoE IP address mode is used for setting the environment which communicate based on PPPoE, like ADSL modem.

First, click the button and find the module that is connected to the network.

Select the module that the value will be assigned from the ListBox, which is shown at the left of the screen,

Select PPPoE for the IP address mode,

Enter values of the ID and PW for PPPoE access.

⑤ Lastly,

.

3.4 Connection Mode (Server, Client, UDP) Setting Function

3.4.1 Server Mode

First, click the button and find the module that is connected to the network

Select the module that the value will be assigned from the ListBox, which is shown at the left of the screen

Select Server for Connection mode,

“Enter the Local Port value for Listen in the “Internet Connectivity Information box.”

WIZ140SR/WIZ145SR Datasheet 10

.

When Server mode is used, Remote IP address and Remote Port has no use.

3.4.2 Client Mode

First, click the button and find the module that is connected to the network

② Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen

Select Client for Connection mode

Enter the IP and Port number from the “Internet Connectivity Information box” into the

“Remote IP address” and “Remote Port.” Enter the Module’s communication Port number into Local Port

⑤ Lastly,

.

※ When Client mode is being used, the module continuously attempts connection to

Remote IP address and Remote Port after booting.

3.5 DNS Setting Function

This function is used when Domain name is used due to server’s frequent change and non-fixed server IP. If the server address is the Domain name instead of the IP address, this function must be used.

① First,

button, and find the module that is connected to the network

WIZ140SR/WIZ145SR Datasheet 11

.

Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen,

Enter IP into DNS Server IP.

Check the box for “DNS mode,” and enter the Server Domain Name.

Enter the Port numbers for server and module.

⑥ Lastly,

.

3.6 Real-time Debug Function

.

This function is used to check on the motion of the module when the module is attached to the system during the system development process. The Console port is used to read the debug code of the module in real time.

WIZ140SR/WIZ145SR Datasheet 12

Image 6 Debugging from Debug serial port

3.7 Data Packet Function

This function is used to determine whether the data read from the serial port is going to be sent to the remote server or client in some kind of Ethernet packet unit.

3.7.1 Character

The data is buffered in the internal memory of the module until the specific characters are received. Once the specific characters are received, the buffered data are made into one

Ethernet packet and are sent to the remote system.

WIZ140SR/WIZ145SR Datasheet 13

This function is appropriate when the end of data frame that the serial port sends to the module ends with specific characters.

① First,

button, and find the module that is connected to the network.

Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen,

Enter the ASCII value of the character in the form of HEX code in the “Character” section of the “Data Packing Condition” box. (Enter 0x00 for Disable)

③ Lastly,

.

3.7.2 Size

This function is used when data is buffered in the serial port until the received data amounts to a specific byte size, and when the received data amounts up to the specific byte size, the buffered data are made into one Ethernet packet and sent to the remote system.

This function is appropriate when size of the data, which is sent from the serial port to the module, is fixed.

① First,

button, and find the module that is connected to the network.

Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen

Enter the wanted size in the “Size” section of the “Data Packing Condition” box.

(Enter 0 for Disable)

WIZ140SR/WIZ145SR Datasheet 14

3.7.3 Time

If there is not any new data during designated time, all data in the serial buffer is converted to Ethernet packet. If new data is received, the time is re-calculated and the received data is saved in the serial buffer. Time condition can be utilized when the serial data size is variable and has no ending character, but needs to be delivered in frame unit. (If the value is ‘0’, option is not used)

① First,

button, and find the module that is connected to the network.

Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen,

② Enter the wanted time information in the “Time” section of the “Data Packing Condition” box. (Enter 0 for Disable)

3.7.4 Compound Settings

Among the three functions explained above, two or more can be mixed for use.

WIZ140SR/WIZ145SR Datasheet 15

3.8 Inactivity Time Function

This function is used to forcibly disconnect the communication connection (TCP socket) when there are no data exchange with the remote system for a certain period of time.

① First,

button, and find the module that is connected to the network. select the module that the value will be assigned from the ListBox, which is shown on the left of the screen,

② Enter the wanted time information in the “Inactivity Time” section of the “Disconnect

Condition” box. (Enter 0 for Disable)

③ Lastly

.

3.9 Firmware uploading thru TCP/IP

This function is used for updating the module’s Firmware

① First,

button, and find the module that is connected to the network.

Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen,

③ Click to select the binary file for update.

④ Lastly,

.

In order to use the Firmware upload function, an IP address for communication with the module must be set. Make sure to ping test to check the module is able to communicate.

WIZ140SR/WIZ145SR Datasheet 16

3.10 Log Data save and report function

The module saves it operation and results in its memory; this function can load and read when the user wishes to. This function can be used to check on the problems when the communication with the remote system is not good. For example, things like, whether the serial device sent the data, or whether the module was down, or whether there was a problem with the communication circuit (ISP communication circuit), can be checked.

3.10.1 Log Data

3.10.1.1 Log Data Frame

Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6

Time Information[0:3]

Byte 7 Byte 8

CODE PARM1 PARM2 PARM3

Log time Log value

Image 7 Log Data Frame

3.10.1.2 Code & Parameter

Code Value(4Byte) Meaning Remarks

CODE PARM1 PARM2 PARM3

0x13 0x00 0x00 0x00 PPPoE init start

0x20

n

WIZ140SR/WIZ145SR Datasheet

n: Socket #

17

0x21

0x22

0x23

0x24

0x25

n

n

n

n

n

Size_H

4

Size_L

5

Socketn lbytes data sent

Size_H Size_L Socketn lbytes data receved

Config Writing

Config Reading

Table 4 Log data code & parameter Table

4

Sent from Ethernet or higher byte among data size

5

Lower byte among data size

WIZ140SR/WIZ145SR Datasheet 18

3.11 TCP Connection Status Function

This function is used to check the connection status for each channel of the module.

This can be checked through the H/W pin. If the value of the Pin is Low, the status is

“Connected”. If the value of the Pin is HIGH, the status is “Disconnected”.

※ In case of Serial command mode, all communication channels are forcibly cleared; and the

Connection status can’t be checked through the serial.

WIZ140SR/WIZ145SR Datasheet 19

4 Test

4.1 Operate in Server mode

4.1.1 Composition

Module

IP address(Static)

Ch# 1 Port number

Ch#1 Socket mode

Ch#1 Packing cond.

Ch#2 Port number

Ch#2 Socket mode

Ch#2 Packing cond.

Ch#3 Port number

Ch#3 Socket mode

Ch#3 Packing cond.

Ch#4 Port number

Ch#4 Socket mode

Ch#4 Packing cond.

192.168.123.193

IP address

5000

Port number

Server

Socket mode

Time 10ms

5001

Server

Time 10ms

5002

Server

Disable

5003

Server

Size 10

Port number

Socket mode

Port number

Socket mode

Port number

Socket mode

PC

4.1.2 Operation Order

① First,

button, and find the module that is connected to the network.

Select the module that the value will be assigned from the ListBox, which is shown on the left of the screen, auto

Client auto

Client

192.168.123.101

auto

Client auto

Client

WIZ140SR/WIZ145SR Datasheet 20

WIZ140SR/WIZ145SR Datasheet 21

⑦ Click

Apply the new values of the module and reboot.

Image 8 Console screen during module booting process

Run the Socket communication program, and attempt connection.

WIZ140SR/WIZ145SR Datasheet 22

Image 9 Screen after connecting to module with TCP/IP

Connection with module can be checked by using the Debug terminal.

WIZ140SR/WIZ145SR Datasheet 23

Image 10 Consol screen after TCP Connection

Repeat these steps with other channels to access, and data communication is enable.

WIZ140SR/WIZ145SR Datasheet 24

advertisement

Related manuals

Frequently Answers and Questions

What is the main function of the Wiznet WIZ140SR device?
The Wiznet WIZ140SR device is designed to provide network connectivity to serial devices, allowing them to communicate over an Ethernet network.
What are the key features of the Wiznet WIZ140SR device?
The key features of the Wiznet WIZ140SR device include support for four serial ports, 10/100 Mbps Ethernet connectivity, DHCP and DNS support, and a user-friendly configuration tool.
How is the Wiznet WIZ140SR device powered?
The Wiznet WIZ140SR device is powered by a 3.3V DC power supply.
What is the maximum serial data rate supported by the Wiznet WIZ140SR device?
The Wiznet WIZ140SR device supports a maximum serial data rate of 115,200 bps.
What is the maximum number of TCP connections that the Wiznet WIZ140SR device can handle?
The Wiznet WIZ140SR device can handle up to four simultaneous TCP connections.
What is the default IP address of the Wiznet WIZ140SR device?
The default IP address of the Wiznet WIZ140SR device is 192.168.1.100.
How can I configure the Wiznet WIZ140SR device?
The Wiznet WIZ140SR device can be configured using a web-based configuration tool or through serial commands.
What is the purpose of the debug serial port on the Wiznet WIZ140SR device?
The debug serial port on the Wiznet WIZ140SR device is used for debugging and troubleshooting purposes.