59
STONE HMI -professional solution provider of embedded touch control computer STeWin4300 REV:110714 User manual

Blue Ocean Microchip - STONE Technology

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Blue Ocean Microchip - STONE Technology

STONE HMI

-professional solution provider of embedded touch control computer

STeWin4300

REV:110714

User manual

Page 2: Blue Ocean Microchip - STONE Technology

Contests

Chapter 1 Comprehensive description of STeWin4300 . . . . . ... .. ... ... ... ... ... ... .. ... ... ... ... ... ... .. ... ... ... - 4 -

1.1 Characteristic of product - 4 -

1.2 Specifica tion and performa nce parameter... .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. . . - 7 -

1.3 Dimensions.. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. - 8 -

Chapter 2 System configura tion of ........... .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. .. STe W in4300 - 11 -

2.1 Appearance introduc tion ........... ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. . . - 11 -

2.2 interface introduction ................................................................................................... - 12 -

Chapter 3 Function and setting .......... ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. .. . .. .. .. .. ... - 14 -

3.1 Audio output ........... .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. . - 14 -

3.2 USB interface............................................................................................................... - 14 -

3.3 SD card........ ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. . . - 15 -

3.4 Backlight adjustme nt.. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. . . ... .. .. .. .. .. ... .. .. - 15 -

3.5 Screen rotate..... .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... . - 16 -

3.6 Serial port setting ........... .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. .. . - 16 -

3.7 Using of I/O port ............ ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. . . - 18 -

3.8 Using of touch screen...... .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... . - 18 -

3.9Application switching .................................................................................................. . - 19 -

3.10Time and dates setting................................................................................................ . - 19 -

3.11 Encryption program ................................................................................................... - 20 -

3.12 FRAM ................................................................................................ ........................ - 21 -

3.13 Watchdog ................................................................................................................... - 21 -

Chapter 4 ActiveS ync ........... ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. . . .. .. .. . - 22 -

4.1 Installing Microsoft ActiveS ync ........... .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. . - 22 -

4.2 building connection...................................................................................................... - 22 -

4.3 File management ............. .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. . . - 24 -

Page 3: Blue Ocean Microchip - STONE Technology

Chapter 5 Developme nt of application.. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. .. . - 27 -

5.1 Setting up EVC ............................................................................................................ - 27 -

5.2Installing sdk ................................................................................................................. - 33 -

5.3Creating and compiling application .............................................................................. - 38 -

5.3.1Crea ting a new project ........... .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. . . - 38 -

5.3.2A ssoc ia te d with SDK ........... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. . . - 42 -

5.3.3Connec tion setup:.. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. . . - 43 -

5.3.4 Compile and downloa d. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. . . - 45 -

Chapter 6 Developme nt with VS2005 ........... .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. . . - 47 -

6.1Setting up VS2005 ....................................... ................................................................ . - 47 -

6.2 Example of “Hello World”(VB) ................................................................................. . - 47 -

6.3 Example of “Hello World”(VC) ................................................................................. . - 51 -

Chapter 7 Update logo ............ .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... . - 53 -

Chapter 8 Update system ............ .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. . - 55 -

Chapter 9 How to run compiled application automatica lly. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. . - 56 -

Appendix API ........... .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. . . .. ... .. .. .. - 57 -

Postscript. .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. .. ... .. .. .. .. ... .. .. .. .. .. ... .. . . .. .. .. ... .. .. .. . - 59 -

- 3 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 4: Blue Ocean Microchip - STONE Technology

Chapter 1 Comprehensive description of STeWin4300

STeWin4300 is equipped with Microsoft Windows CE Embedded, a stable operating system

used in many industrial touch screen applications. The processor is 32-bit RISC(ARM920T

Core).We have been a member of Windows Embedded Partner Program.

So the products are all pre-installed genuine Windows CE system.

The STeWin4300 is possible to switch between different assignments. It combines a graphic

display and touch interface with a high efficiency industrial controller. Coordinating with MCU

perfectly through serial port, STeWin4300 is suitable to industrial control, medical device, test

monitoring, intelligent device, smart home, mobile or automotive systems, etc.

Configuration is usually used in man-machine interface, but this pattern is easy to operate and

restricted in application. Windows CE supports applications developed in Microsoft Visual Studio

2005 and EVC. The managed code can be generated in Visual BASIC, C#, VC++. Users can

design man-machine interface and transplant it to other ARM operating systems equipped with

Microsoft Windows CE Embedded.

STeWin4300 supports the .NET Compact Framework 2.0 which simplify development and

testing time.

1.1 Characteristic of product

Hardware Specification

Ultra-high integration, complete Embedded structure and user-friendly on-site fixed.

USB HOST、USB DVICE、100M LAN、SD card, etc.

32-bit RISC ARM chip, ARM920T core, frequency is 400MHz.

SDRAM : 64MB ,NAND FLASH: 128M.

4.3-inch digital TFT screen(16:9), 480 × 272 resolution, LED backlight.

Four-wire resistive touch screen. Two standard RS232 , one RS232/RS485 switchable , coordinating with PC ,MCU, PIC,

AVR, DSP, etc.

- 4 -

STeWin4300 Tel:+86-010-84351669

Page 5: Blue Ocean Microchip - STONE Technology

Internal mono spaker ,external stereo jack.

Eight input ports and eight output ports (driving voltage is 5V), serial port and all the other

interface have antistatic design by adding TVS.

Power :9V~28V.

Operating temperature: -20 ℃ ~ +70 ℃ ,Storage temperature: -30 ℃

~+85℃,Operating humidity: 45% ~80%RH.

The screens have been passed the certification of CE, FCC, ROHS and temperatures.

Software Specification

Genuine edition WINDOWS CE5.0 CORE operating system is pre-installed and the starting time is less than 12 seconds. After the system starts, the remaining capacity of SDRAM is up to 60M.

The memory space can be adjusted between program memory and storage memory.

Data would be not lost after power down.

EVC / VS2005 software and MFC.

ActiveSync software, code debugging through USB port.

Supporting for preservation of the registry, time and date under power-down situation.

Applications can run automatically when STeWin4300 turn on by modifying the registry.

SD card can be modified the power-on image and upgrade OS and etc. It can support up to

8GB.

SD card can store softwares, multimedia files and the data.

Supporting for API functions, such as backlight control, volume adjustment, screen rotation,

time control, etc.

Backlight and sound can be adjusted through parameter.

Users can switch between system and application by switch.

Offering fully functional SDK code and API functions.

Offer free source code for simple utility.

Watchdog can prevent system down (customization).

FRAM, stored data and frequent data read and write, read and write speed is equivalent to RAM.

- 5 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 6: Blue Ocean Microchip - STONE Technology

Nandflash format TFAT, to avoid accidents during the operation file corruption caused by

power failure

Offering method of encryption to make your program security.

Offer UI design and part of ICON components freely.

- 6 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 7: Blue Ocean Microchip - STONE Technology

1.2 Specification and performance parameter

Name STeWin4300

Size 4.3-inch(95.04×53.86)

Resolution 480X272

Brightness 300

Contrast 400:1

Backlight LED(adjustable) life:30000h

Touch screen four-wire resistive,1000000/point

Operating temperature -20℃~ +70℃(certified)

Passed certification CE,FCC,RO H S and temperature

System parameters

Operating system Genuine edition WINDOWS CE5.0Core Chinese/English

Basic frequency 400MHz

Processor SAMSU N G S3C2440-40

Internal memory 64MB SDRAM

Memory 128MB NAND Flash

Storage U-Disk ; SD card

Software compilation ARMV4I

method

Interface parameter

Serial RS232(2);RS485(1)

Serial frequency Setted up through software

SD card Up to 8GB (supporting for upgrading OS,boot logo,data storage)

USB HOST USB Host1.1 Connect to U-Disk, USB mice, keyboards

USB DVICE Connect to computer for USB1.1 device access over ActiveS ync

Network 100M, network debugging, data transmission

Audio Stereo headphone output, speaker

Power 9V~28V (12V 80~180m A )

Expansion function WIFI、GPS、GPRS、Bluetooth、Watchdog

Universa l digita l IO Input(8) ,output(8)

Dimensions

Mounting type Embedded installation shell

Safety performance of Waterproof, shakeproof

IP65

Size of front panel 136mm ×104 mm

Size of mounting hole 126mm ×95mm

- 7 - ST-eWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 8: Blue Ocean Microchip - STONE Technology

1.3 Dimensions

Installation size of STeWin4300 Unit: mm

- 8 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 9: Blue Ocean Microchip - STONE Technology

- 9 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 10: Blue Ocean Microchip - STONE Technology

Picture1-1

- 10 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 11: Blue Ocean Microchip - STONE Technology

Chapter 2 System configuration of STeWin4300

2.1 Appearance introduction

Picture2-1

-11 -

Page 12: Blue Ocean Microchip - STONE Technology

2.2 interface introduction

1、Power: DC 9V~28V 2、LAN: connect to PC with crossover Ethernet cable 3、USB interface: U-Disk (up to 2G), USB mice, USB keyboards,USB-DEVICE for debugging

Picture2-2 4、SD card: up to 8G 5、SW This switch is an update LOGO,system or whether automatically

Picture2-3 6、Serial:RS232 and RS485

STeWin4300 can be a displayable terminal control device and connected to subordinate computer (mcu) through RS232.

- 12 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 13: Blue Ocean Microchip - STONE Technology

STeWin4300 Rs232

MCU

Data

sampling, I/O

control, Bus

control Other

control

operation

Picture2-4

STeWin4300

Serial Rs232

module GPS

module

etc

Picture 2-5

The advantage of separating display interface from control system is making the systems

independent and upgrading conveniently.

7、Audio output port: connect to Stereo headphone output or speaker

- 13 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 14: Blue Ocean Microchip - STONE Technology

Chapter 3 Function and setting

Connect the STeWin4300 to a power source (12V) and always check the polarity of the

terminals before connecting them to the power source.

After connecting the power and a short period of starting, Windows CE operating system will

run. Using the Windows CE is similar to using the regular Windows operating system. As is

shown in the picture:

Picture3-1

3.1 Audio output

STeWin4300 has a single-channel speaker ins ide. For stereo, headphone or outside speaker

can be connected to 3.5mm audio jack. Double clicking the icon which is volume and sound

control can change the volume.

3.2 USB interface

STeWin4300 has one USB Host port and one USB Device port. USB Host port can be used

to connect to USB mice, keyboards and Flash driver. Using more than one USB device at a time

will require the use of an external USB hub. The USB Device port is used to connect to a

computer for device access over ActiveSync. Please refer to the ActiveSync section.

- 14 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 15: Blue Ocean Microchip - STONE Technology

3.3 SD card

STeWin4300 SD memory slot supports cards up to 8G in capacity.

SD Flash memory can be used in the following ways:

1、 Images, sounds, log files storage;

2、 Convenient storage for large programs;

3、 Changing the logo conveniently;

4、 System renewal and upgrading.

3.4 Backlight adjustment

The display settings let you control the backlight. Backlight provides a screen saving function.

The backlight can be automatically turned off when the device is no longer used to lengthen the

device life. We offer two methods:

Method one: programs can use the API to adjust the backlight, API is referred to

in appendix1.Recommended only switch (100 / 0) two states. Eg:Test_All.exe

Picture3-2

The backlight can be changed through changing “Backlight Test” in the picture.

Method two: Please go to “My Device” - “Control Panel” -“Display”-“Backlight” ,To set the

time to automatically turn off, tick the check box “External power,and device is idle for more

than” and set the time to elapse by inputting a number in the edit box.

- 15 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 16: Blue Ocean Microchip - STONE Technology

as shown in the Figure below.

Picture3-3

3.5 Screen rotate

The screen can be rotated to different angles through clicking “Rotate screen”. Program

controlled by API, API is referred to in appendix1.

3.6 Serial port setting

1、STeWin4300 have three serial resource,com3 which is one of them can be used either as

RS232 or RS485 by setting the RS232/485 conversion switch properly through the”S2”.

Switch S2, S2-1, S2-2, ON state com3 for the RS485 status, S2-3, S2-4, ON state com3 for

the RS232 status.

Note: Please turn off the power, then switch the

“S2”. 2、the serial setting is as follows:

1 )“ COM1/COM2 ” has two serial ports which are com1 and com2.com1 use 2-pin,3-

pin,5-pin;com2 use 1-pin,6-pin,5-pin,as shown in the following table3-1.

- 16 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 17: Blue Ocean Microchip - STONE Technology

3-1:The following is the definition for the ST-eWin4300

Serial number Function Pin number S2 state

com1 RS232 COM1/COM2—2(Transmitted)

COM1/COM2—3(Received) ——

COM1/COM2—5(GND)

com2 RS232 COM1/COM2—1(Transmitted)

COM1/COM2—6(Received) ——

COM1/COM2—5(GND)

com3 RS232 COM3—2(Transmitted) 1,2 OFF

3,4 ON

COM3—3(Received)

COM3—5(GND)

RS485 COM3—1(485A) 1,2 ON

3,4 OFF

COM3—6(485B)

A converter port should be prepared if using com2.The sequence is as following:

table3-2

com pin Converter

1 2

6 3

5 5

2)The interface of equipment is marked with “COM3” provides com3 and 485. com3 use 2-

pin,3-pin,5-pin. 485 connects to 1 and 6 pin of COM3.1-A; 6-B

3) RS485 achieved the transceiver by the hardware itself, as long as the program does not

simultaneous ly send and receive operation, which is to ensure the half-duplex transmission of

data,

Corresponding views is as follows:

- 17 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 18: Blue Ocean Microchip - STONE Technology

Picture3-4

3.7 Using of I/O port

The I/O port at back of the board,as show above picture I/O port has eight output ports and

eight input ports. Pin Definition and API ,please refer to Appendix 1. 17PIN,18PIN is GND,

9PIN,20PIN is 5V

3.8 Using of touch screen

The using of touch screen is similar to operating on a PC with mouse.Clicking on icon is

equivalent to click the left button of mouse. If you want to determine the action the user right-

clicks, you can SHRecognizeGesture function to complete.A long press on icon is equivalent to

click the right button of mouse. Long pressing on icon will appear a pop-down menu, which can

copy, delete, rename and view attribute.As shown below:

- 18 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 19: Blue Ocean Microchip - STONE Technology

Picture3-5

Touchscreen Calibration ,You can calibrate the touchscreen through”My Device-Control

Panel-Stylus-Calibration-Recalibration”,Carefully press briefly hold stylus on the target .Repeats

as the target moves five times around the screen. Click anywhere on the screen back to the system

interface.

3.9Application switching

If not less than two applications are running at the same time and you want to switching

quickly between them, you can use “queue of running program” icon at the button of right side. As

shown below:

Picture3-6

3.10Time and dates setting

It is recommended that the time and dates be intercalated before you use it. The method is

shown below:

1、 Double-clicking the icon “time and date” at bottom of the right side,or entering “control

panel”→ “date/time”;

2、 In the dialog “data/time”, the current date and time can be intercalated accurately.

3、 After intercalating the date and time,users should click “apply” button and the time and - 19 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 20: Blue Ocean Microchip - STONE Technology

date at the bottom of right side are changed,then click “OK”.As shown below:

Picture3-7

3.11 Encryption program

We provide an encryption method for the program, and each device has unique IMEI,

randomly generated, can not be changed, make the product more secure. Eg:Test_All.exe。

Program starts at the beginning, through a function to read the machine IMEI, and compare the

serial number, If not the same, indicating that the unauthorized use of your program, you can stop

the running programs. API is referred to in appendix1.

Picture3-8

- 20 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 21: Blue Ocean Microchip - STONE Technology

3.12 FRAM

eWin4300 device provides a FRAM,64Kbit. Frequent reading and writing data stored by

FRAM, in order to reduce the frequency of nandflash operation, thereby reducing the risk of

system failure. API is referred to in appendix1.

3.13 Watchdog

You can create a software watchdog to monitor the operation, when the program is

not running properly, the watchdog will automatically restart the system. At system startup,

the watchdog is disabled by default, enable the watchdog program flow is as follows:

1. Set the Watchdog Timer timeout , the time is equal to 10s,20s, maximum is 40s

2. Enable the watchdog

3. Feed the watchdog , within the time set out in the need to feed the dog, otherwise it will

restart the system

If the watchdog is enabled, you can also disable the watchdog, API is referred to in

appendix1.

- 21 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 22: Blue Ocean Microchip - STONE Technology

Chapter 4 ActiveSync

Microsoft ActiveSync is a synchronization software that enables data exchange between a

device that runs on Microsoft’s Windows CE and a PC. It is convenient to transfer files or develop

and debug application. It is a basic software for a PC to communicate with mobile devices.

4.1 Installing Microsoft ActiveSync

Double-click the Microsoft ActiveSync installation file in CD, click “Next” and follow the

prompts.

Note: Do not connect USB DEVICE to the board before install ActiveSync.

4.2 building connection

1、Connect the device port to USB port on PC with ActiveSync installed.When the connection is

established, ActiveSync will ask to set up a partnership. As is shown in the picture:

Pictur4-1

- 22 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 23: Blue Ocean Microchip - STONE Technology

2、ActiveSync should connect to the ST-eWin4300 and display the following window:

Picture4-2

3、 If the connection is established, the taskbar of PC will display the following icon .

The color is green: the connection is successfully made. The color is gray: disconnected.

If one runs ActiveSync for the first time, after installation, it is displaying the disconnected

states. If ActiveSync does not automatically connect, click“connection settings” from “file”. It will

display the following dialog:

Picture4-3

- 23 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 24: Blue Ocean Microchip - STONE Technology

Recommended setting: Delete the hook-like mark in front of “allow connections to one of the

following:”, then click “OK” and finish the installation.

Picture4-4

Now connect USB DEVICE port of ST-eWin4300 to USB port of PC with installed

ActiveSync. If the connection is the first time, PC will identify it as a new hardware, Just by

installing the wizard, ActiveSync installation directory to find X: \ Program Files \ Microsoft

ActiveSync \ Drivers automatically generated driver can be installed, or CD-ROM with the

provided usb drive, find, can be installed..

4.3 File management

When the connection is successfully made, users can copy and transfer files between ST-

eWin4300 and PC through ActiveSync. 1、 Click the “Explore” button.

- 24 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 25: Blue Ocean Microchip - STONE Technology

Picture4-5

2、 When you press “Explore” button, you will see ST-eWin4300’s file folders as shown below:

Picture4-6

The users can operate the files through drag-dropping icon with mice.

- 25 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 26: Blue Ocean Microchip - STONE Technology

Eg:in this way, users can transfer the MP3 files on PC to the memory and storage card of

STeWin4300. 3、 Double-clicking the icon, you can only see the attribute of files ,but can not open and operate the program.

- 26 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 27: Blue Ocean Microchip - STONE Technology

Chapter 5 Development of application

Development of application has two steps, the first step is developing and compiling

application on development environment of PC; the second step is downloading it to

STeWin4300.Users can run and debug the program before the connection between STeWin4300 and

PC made successfully.

ST-eWin4300 can execute Windows CE5.0 applications developed with EVC and Visual

Studio 2005.This chapter is a guide to develop application with EVC.

5.1 Setting up EVC

Step1:Enter installation catalog of EVC, and double-click “setup.exe”. The installation will start.

Picture5-1

- 27 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 28: Blue Ocean Microchip - STONE Technology

Picture5-2 Step2:Click “Next”

Picture5-3 Step3:Accept installation agreement, then click “Next”

- 28 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 29: Blue Ocean Microchip - STONE Technology

Picture5-4 Step4:Enter the ID number and click “Next”

Picture5-5 Step5:Select the list of files to be installed and the fault is “select all”, and then click “Next”

- 29 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 30: Blue Ocean Microchip - STONE Technology

Picture5-6

Step6:Create an installation directory, defaults, and then click “Next”

Picture5-7 Step7:Display the prompting message and click “Yes”

- 30 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 31: Blue Ocean Microchip - STONE Technology

Picture5-8 Step8:Prepare to install and go to next step automatically after a short time

Picture5-9

Step9:Set up Windows CE platform manager automatically and then go to next step automatically

Picture5-10 Step10:Set up successfully, click “OK” and go to next step

Picture5-11

Step11:Prepare to set up EVC, and then go to next step automatically

- 31 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 32: Blue Ocean Microchip - STONE Technology

Picture5-12

Step12:Click “continue”

Picture5-13

Step13:Confirm ID number, click “OK” and then go to the next step automatically

Picture5-15 Step14:Select the content to be setted up, default is select all, then click “Continue” and go to the next step automatically

- 32 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 33: Blue Ocean Microchip - STONE Technology

Picture5-16 Step15:Installation

would be completed automatically, confirm dialog will display, and then click “OK”

Picture5-18

5.2Installing sdk

SDK lies in CD\development software\sdk 1、 Double-click and run ce50_2440a_SDK. A dialog displays as following:

- 33 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 34: Blue Ocean Microchip - STONE Technology

Picture5-19

Picture5-20

2、 Click “accept” and “Next”

- 34 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 35: Blue Ocean Microchip - STONE Technology

Picture5-21

3、 Enter your customer information and click “Next”

Picture5-22

4、 Click “Complete” from dialog “Choose Setup type”

- 35 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 36: Blue Ocean Microchip - STONE Technology

Picture5-

23 5、 Select catalog to be installed and click “Next”

Picture5-24 6、 Click “Install”

- 36 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 37: Blue Ocean Microchip - STONE Technology

Picture5-

25 7、 Installing ce50_2440a_SDK,as shown below:

Picture5-

26 8、 Click “finish” and complete the installation

- 37 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 38: Blue Ocean Microchip - STONE Technology

Picture5-27

5.3Creating and compiling application

5.3.1Creating a new project 1、Run Embedded Visual C++4.0 and create a new project. Click “New” from “File”, as shown

below:

Picture5-28

2、Click “Project” from “New” and select “WCE MFC AppWizard(exe)”,then fill in project name

- 38 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 39: Blue Ocean Microchip - STONE Technology

and location. Select “Win32(WCE ARMV4I)” and click “OK”

Picture5-29

3、 Select “English” in language setting, default other settings. Click “Next”.

Picture5-30

4、 Maintain the default value and click “Next”

- 39 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 40: Blue Ocean Microchip - STONE Technology

Picture5-

31 5、 Maintain the default value and click “Next”

Picture5-

32 6、 Maintain the default value and click “Finish”

- 40 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 41: Blue Ocean Microchip - STONE Technology

Picture5-33 The result is shown below:

- 41 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 42: Blue Ocean Microchip - STONE Technology

Picture5-34

Picture5-35

5.3.2Associated with SDK

Select ce50_2440a_test as platform

Picture5-36

- 42 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 43: Blue Ocean Microchip - STONE Technology

5.3.3Connection setup:

Picture5-37

Single-click

Picture5-38

- 43 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 44: Blue Ocean Microchip - STONE Technology

Picture5-39 Click “Test” and test the connection

Picture5-40 A successful connection will produce a dialog as below. Click “OK”

- 44 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 45: Blue Ocean Microchip - STONE Technology

Picture5-41

5.3.4 Compile and download

1、Select “Rebuild All” from “Build”, as shown below:

Picture5-42

Now the system will compile your project. 2、If compiling is successfully made, it will have a automatically process to download. USB line

should be connected and the connection to PC is

successfully made through Microsoft ActiveSyne before downloading. If

the process is successful, a dialog will display as below:

- 45 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 46: Blue Ocean Microchip - STONE Technology

Picture5-43

3 、 “Finished downloading” illustrates that now application has been downloaded to STeWin4300.Open “My device” from WinCE. The application named “test” has been in it.

- 46 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 47: Blue Ocean Microchip - STONE Technology

Chapter 6 Development with VS2005 Developing application with VS2005, users can download and run application on STeWin4300.

6.1Setting up VS2005

The full name of “VS2005” is Microsoft Visual Studio 2005, users can read details on Microsoft

website.

6.2 Example of “Hello World”(VB)

1、Run “Microsoft Visual Studio 2005”

Picture6-1

2、Choose “New Project” from the file menu.

Picture6-2

3 、 Select “Windows CE5.0” and “Windows Application”. Type the name of

project(“TestProgram1” in this example) and click “OK”.

- 47 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 48: Blue Ocean Microchip - STONE Technology

4、A new blank project is created as shown below.

Picture6-3

5、Drag a button control from the toolbox to the middle of Form1.

Picture6-4 6、Select the new button. Change the text attribution from ―Button1‖ to ―Hello‖.

- 48 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 49: Blue Ocean Microchip - STONE Technology

Picture6-5 7、 Double-click the ―Hello‖ button. Visual Studio will open a window to edit the

code that handles ―Hello‖ button click events. Type ―MsgBox(―Hello!!!‖)‖

Picture6-6 8、Set the target device

In the Solution Explorer, select the top-level item. Select ―Target Device‖ and a list of

possible devices will be displayed. Choose WindowsCE5.0.

- 49 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 50: Blue Ocean Microchip - STONE Technology

Picture6-7 9、 Click the Start Debugging icon as indicated below. This will build and publish the program in debugging mode.

Picture6-8 10、 After a short delay, the program is transferred to ST-eWin4300 and executed(assuming a working ActiveSync connection).

- 50 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 51: Blue Ocean Microchip - STONE Technology

If the program has not error, dialog will display at the bottom. After a short delay,

application interface will display on the screen of STeWin4300.

Picture6-9

6.3 Example of “Hello World”(VC)

1、Click File-New Project on the menu bar. 2、Choose ―Smart Device‖ in the ―Project types‖ box. Then choose ―MFC Smart Device

Application‖ from the ―Templates‖ box. Type the desired name in the ―Name‖ box.

Picture6-10

- 51 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 52: Blue Ocean Microchip - STONE Technology

3、Click ―OK‖. The Application Wizard will be displayed as below.

Picture6-11

After the Application Wizard completes, a framework application will be created for MFC application development. Note: When you use VC + +, you must select the sdk we provide--smdk2440a_SDK.msi.

- 52 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 53: Blue Ocean Microchip - STONE Technology

Chapter 7 Update logo

The boot time STeWin4300s is 12s.During this time users can set up a boot logo. A progress

bar shows the booting process.

Ⅰ)Design demand of boot logo

The bit resolution of boot logo is 24.The extension name of the renewal picture should be

modified to BMP. The resolution of the picture is 480X272.The position of progress bar is

fixed(we can offer individual customization in special condition. For the aesthetic the boot logo

must reserve the position of progress bar. Ⅱ)Position of progress bar

Centered point(X=136 Y=199) as origin ,the position of progress bar is from (136,199) to

(344,209).The length is 208 and the height is 10.As shown below:

Picture7-1

- 53 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 54: Blue Ocean Microchip - STONE Technology

Picture7-2 Ⅲ) Steps of modifying boot logo 1、 Saving the picture as boot logo to root directory of SD card( not more than 2G )and renaming

picture to ―logo.bmp‖.

2、Connecting the two pins below USB HOST with jumper cap 3、 Insert the card to STeWin4300, then power on and start. After the new root logo display and

then power off. Remove the SD card after prompt.

4、 Remove the jumper cap. 5、 Power on again and then the new boot logo will display. The renewal has been completed.

- 54 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 55: Blue Ocean Microchip - STONE Technology

Chapter 8 Update system 1、 Put xip.bin in the root directory of SD card(not more than 2G). 2、

Connecting the two pins below USB HOST with jumper cap

3、 Insert the card to STeWin4300 and then power on. A reminder ―Read xip.bin from sd card…‖ ,

―Format nand flashand…‖ ―Write xip.bin to nand flash…‖ will display at the upper-left of LCD.

After one minute WinCE system will start and the renewal has been completed. 4、 Remove the jumper cap and SD card. Power on again and enter WinCE desktop or user’s

application.

Note: After renew the WinCE system, resident Flash of previous system has been formatted.

Starting system for the first time needs two minutes. After that, the time of starting system only

needs less than 12 seconds.

- 55 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 56: Blue Ocean Microchip - STONE Technology

Chapter 9 How to run compiled application automatically Ⅰ) How to run compiled application

automatically Method 1:

1、 Copy users’ application to GUI file in resident Flash root directory.Rename users’

application to ―GUIsample.exe‖.( Resident Flash/ GUI/ GUIsample.exe)

2、 The system will enter users’ application interface instead of WinCE desktop when power

on.

Note: Make sure the two pins below USB HOST be not connected.

Method2:

1、 Copy users’ application to GUI file in SD card root directory and rename application to

GUIsample.exe.

2、 Run program ―Install.exe‖. The function of ―Install.exe‖ is copying GUI file(all the files) in

SD card root directory to Resident Flash.

3、 The system will enter users’ application interface instead of WinCE desktop when power on. Ⅱ) Exit to system in application

After setting auto start the application ,it will enter users’ application interface instead of

WinCE desktop when power on. If you want to exit to system ,you have to add ―Exit‖ in your

application with the function

―Create Process‖(L‖explorer.exe‖,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL);‖

If you want to enter system desktop without adding the ―Exit‖ button, there are two situations: a) Entering system desktop when the application is running;

b) Entering WinCE desktop instead of users’ application interface when power on.

Solution:

Situation 1:After application is running when power on, Connect the two pins JTAG19,20

Situation 2: Firstly connect the two pins below USB HOST and then power on.

- 56 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 57: Blue Ocean Microchip - STONE Technology

Appendix API

type Device PIN name Function name Description

I/O-17 GND

I/O-18

I/O-19 5V

I/O-20

I/O-15 Digital output 1 bool set_level:

set_digital_output(int set_level,int PORT_NO=0) 0—low,1---high

I/O-13 Digital output 2 bool set_level:

set_digital_output(int set_level,int PORT_NO=1) 0—low,1---high

I/O-11 Digital output 3 bool set_level:

set_digital_output(int set_level,int PORT_NO=2) 0—low,1---high

I/O-9 Digital output 4 bool set_level:

I/O

set_digital_output(int set_level,int PORT_NO=3) 0—low,1---high

I/O-7 Digital output 5 bool set_level:

contr set_digital_output(int set_level,int PORT_NO=4) 0—low,1---high

ol

I/O-5 Digital output 6 bool set_level:

set_digital_output(int set_level,int PORT_NO=5) 0—low,1---high

I/O-3 Digital output 7 bool set_level:

set_digital_output(int set_level,int PORT_NO=6) 0—low,1---high

I/O-1 Digital output 8 bool set_level:

set_digital_output(int set_level,int PORT_NO=7) 0—low,1---high

I/O-16 Digital input 1 bool set_level:

read_digital_input(int * port_level,int port_NO=0) 0—low,1---high

I/O-14 Digital input 2 bool *port_level:

read_digital_input(int * port_level,int port_NO=1) 0—low,1---high

I/O-12 Digital input 3 bool *port_level:

read_digital_input(int * port_level,int port_NO=2) 0—low,1---high

I/O-10 Digital input 4 bool *port_level:

read_digital_input(int * port_level,int port_NO=3) 0—low,1---high

I/O-8 Digital input 5 bool *port_level:

read_digital_input(int * port_level,int port_NO=4) 0—low,1---high

I/O-6 Digital input 6 bool *port_level:

read_digital_input(int * port_level,int port_NO=5) 0—low,1---high

I/O-4 Digital input 7 bool *port_level:

read_digital_input(int * port_level,int port_NO=6) 0—low,1---high

I/O-2 Digital input 8 bool *port_level:

read_digital_input(int * port_level,int port_NO=7) 0—low,1---high

setup no rotate bool mode:

rotate_screen(int mode) 0-normal,1-90°,2-180°,3-270°

- 57 -

STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 58: Blue Ocean Microchip - STONE Technology

bool percent_value:0~100

no Backlight brightness set_brightness (int percent_value) Note:effective value is

0,10,20,30…100,0 is turn off

backlight

FRA bool SalAddr –Slave address(0xA0)

M no FRAM Read ReadFRAM(UINT8 SalAddr,UINT16 Addr -- FRAM address

Addr,UINT8 *pBuf) pBuf -- buffer

bool SalAddr –Slave address(0xA0)

no FRAM Write WriteFRAM(UINT8 SalAddr,UINT16 Addr -- FRAM address

Addr,UINT8 *pBuf) pBuf -- buffer

WDT Enable watchdog EnableWdt(void) Note:first set the time,then enable

Software Disable watchdog DisableWdt(void)

Watchdog Set the Watchdog SetWdtTimeOut(UINT8 Sec) Sec -- seconds, Maximum of 40

Timer timeout seconds

Feed the watchdog FeedWdt(void)

IMEI Encryption Read IMEI ReadIMEI(UINT8 *pBuf) pBuf – the length is 16 bytes

Software

Reserved Buzzer alarm Beep(DWORD dwDelay) dwDelay -- millisecond

PWM Reserved Set PWM divide SetPWMDiv(UINT8 Div) Div -- the number is 2,4,8,16

Note: You can only choose one,

the system defaults to 2

Start PWM StartPWM(UINT32 Cntb,UINT32 Cmpb) The PWMFrequency=

PWM_CLK/Div/Cntb (Hz)

Duty cycle = (Cmpb / Cntb) *

100%

Note: to the PWM's PWM_CLK

= 200000Hz, Div for the

SetPWMDiv (UINT8 Div) values

in the Div

Stop PWM BOOL StopPWM(void)

Get the current PWM DWORD GetPWMFrequency(void)

operating frequency

ADC Reserved Read the ADC UINT16 ReadADC(UINT8 ch) Ch -- Channel number

conversion value of ,the number is 0,1,2,3

the specified channel

Get the current ADC DWORD GetADCFrequency(void)

operating frequency

*Note: The orange writing to preserve function, not yet provide the hardware interface and

instructions

Header file: HDI_AP.h

Library file: HDI_API.lib

If dynamic library would be used, users need to build GUI sub-directory in resident Flash and

copy your files to residentflash\GUI

- 58 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com

Page 59: Blue Ocean Microchip - STONE Technology

Postscript

If you have special requirements, we can partially customize the system according to

your requirements, For details .please contact with [email protected]

For more details refer to www.stone-hmi.com Disclaimer

STONE HMI may at any time to make changes to specifications and product descriptions,

therefore may cause the product to be different from published specifications without notice.

Before ordering products, please contact with STONE HMI, to obtain the latest specifications.

Data and diagram in the manual are for reference only, accurate data with the real product.

STONE HMI 2011-07-14

- 59 - STeWin4300 Tel:+86-010-84351669 www.stone-hmi.com