Bolymin BEGA220A User Manual
Advertisement
Advertisement
BEGA220A
USER MANUAL
Features:
ARM 9 CPU
7” 800X480 TFT with Touch Panel @18bit color
Wi-Fi
10/100Mbps Ethernet LAN
RS-232/485/422
Audio
Host USB1.1 x 1
Device USB2.0 x 1
SD/MMC card
Support WINCE 5.0 OS
Support .Net Compact Framework 3.5
BOLYMIN, INC.
5F, 38 Keya Rd., Daya Dist., Taichung City 42881, Taiwan, R.O.C.
WEB SITE: http://www.bolymin.com.tw
TEL: +886-4-2565-8689 FAX: +886-4-2565-8689
Declaration of Conformity
CE Class A
This product has passed the CE test for environmental specifications. Test conditions for passing included the equipment being operated within an industrial enclosure. In order to protect the product from being damaged by ESD (Electrostatic Discharge) and EMI leakage, we strongly recommend the use of CE-compliant industrial enclosure products.
FCC Class A Federal Communication Commission Interference Statement
Note: This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference when the equipment is operated in a commercial environment. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instruction manual, may cause harmful interference to radio communications. Operation of this equipment in a residential area is likely to cause harmful interference in which case the user will be required to correct the interference at his own expense.
FCC Caution:
Any changes or modifications not expressly approved by the party responsible for compliance could void the user’s authority to operate this equipment.
Note:
This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions:
(1) this device may not cause harmful interference, and
(2) this device must accept any interference received, including interference that may cause
undesired operation.
BEGA220A USER MANUAL - 2 -
IMPORTANT NOTE:
FCC Radiation Exposure Statement:
This equipment complies with FCC radiation exposure limits set forth for an uncontrolled environment. This equipment should be installed and operated with minimum distance 20cm between the radiator & your body.
This device and its antenna(s) must not be co-located or operation in conjunction with any other antenna or transmitter.
For product available in the USA/Canada market, only channel 1~11 can be operated. Selection of other channels is not possible.
Caution:
To comply with FCC part 15 rules in the United States, the system must be professionally installed to ensure compliance with the Part 15 certification. It is the responsibility of the operator and professional installer to ensure that only certified systems are deployed in the United States.
The use of the system in any other combination (such as co-located antennas transmitting the same information) is expressly forbidden.
This BEGA220A must be installed and used in strict accordance with the manufacturer's instructions as described in the user documentation that comes with the product. Any other installation or use will violate FCC Part 15 regulations. Modifications not expressly approved by manufacture could void your authority to operate the equipment.
BEGA220A USER MANUAL - 3 -
History of Version
Version
01 NEW VERSION
Contents
02 pp.47-Add evc4sp4 , pp43-driver download URL, pp33-0.9v,etc. remove SRAM
02a Add “Troubleshooting Chapter”
Date
2010/05/17
Note
Spec.
2010/10/20 Rev.
2010/11/3 Add
02b Remove SPI, update SDK download URL. Update address 2010/12/10 Rev.
03 Reformat – bookmark support
BEGA220A USER MANUAL - 4 -
2011/1/14 Rev.
TABLE OF CONTENTS
1 GENERAL INFORMATION.......................................................6
1.1
I NTRODUCTION ........................................................................................................................................ 7
1.1.1
Packing Content ......................................................................................................................................... 7
1.1.2
Module Layout ............................................................................................................................................ 8
1.2
S
PECIFICATIONS
.................................................................................................................................... 10
1.2.1
System Functional Blocks .......................................................................................................................10
1.2.2
Module Specifications .............................................................................................................................. 11
1.3
M ECHANICAL S PECIFICATIONS ................................................................................................................ 12
1.3.1
Module Specifications ..............................................................................................................................12
2 BEGA220A INSTALLATION & TESTING
..............................13
2.1
C ONNECT P OWER ................................................................................................................................. 14
2.2
C
ONNECT A
SD/MMC C
ARD
.................................................................................................................. 15
2.3
C ONNECT H OST USB ............................................................................................................................ 16
2.4
C ONNECT TO LAN ................................................................................................................................ 17
2.5
C
ONNECT
W
I
-F
I
.................................................................................................................................... 20
2.6
C ONNECT C OMMUNICATION B US ............................................................................................................ 24
2.6.1
Pin Assignment of Communication Bus ...............................................................................................24
2.6.2
Serial Port Test ..........................................................................................................................................25
2.6.2.1
Connect Serial Port ..........................................................................................................................................25
2.6.2.2
Serial Port test procedure ...............................................................................................................................29
2.6.3
Device USB installation ...........................................................................................................................34
2.6.4
Speaker installation ..................................................................................................................................35
2.7
ADC_GPIO B
US
.................................................................................................................................. 36
2.7.1
Pin Assignments of ADC_GPIO Bus ......................................................................................................36
2.7.2
GPIO Test ....................................................................................................................................................37
2.7.3
ADC test ......................................................................................................................................................40
2.7.3.1
ADC test set-up .................................................................................................................................................40
2.7.3.2
ADC test procedure ..........................................................................................................................................41
3 BEGA220A PROGRAMMING GUIDE
....................................43
3.1
T RANSFER F ILE B ETWEEN BEGA220A AND PC ...................................................................................... 44
3.1.1
Connect PC and BEGA220A ...................................................................................................................44
3.1.2
Transfer Files .............................................................................................................................................48
3.2
P ROGRAMMING FOR BEGA220A ........................................................................................................... 49
3.2.1
Setup Development environment ...........................................................................................................49
3.2.2
Create New Project ...................................................................................................................................50
3.3
S
ERIAL
P
ORT
F
UNCTION
........................................................................................................................ 53
3.3.1
Overview .....................................................................................................................................................53
3.3.2
Serial Port Control-CSerialPort class ....................................................................................................54
3.3.2.1
Basic concept of class CSerialPort ...............................................................................................................54
3.3.2.2
Member function of class CSerialPort ..........................................................................................................55
3.3.2.3
How to catch the receive message ................................................................................................................56
3.3.3
Example Code ............................................................................................................................................57
3.4
GPIO C
ONTROL
................................................................................................................................... 61
3.4.1
How to Control GPIO for BEGA220A .....................................................................................................61
3.4.2
GPIO Control Function for BEGA220A ..................................................................................................62
3.4.3
Definition of GPIO Index ..........................................................................................................................63
3.5
ADC C
ONVERTER AND
B
ACKLIGHT
A
DJUSTMENT
.................................................................................... 64
3.5.1
Overview .....................................................................................................................................................64
3.5.2
Control Function of A/D Converter ........................................................................................................65
3.5.3
Function about Backlight Adjustment ...................................................................................................66
4. TROUBLESHOOTING ..............................................................67
BEGA220A USER MANUAL - 5 -
1 General Information
This chapter provides basic information about Bolymin’s BEGA220A module and it consists of :
1.1 Introduction
1.2 Specifications
1.3 Mechanical Specifications
BEGA220A USER MANUAL - 6 -
1.1 Introduction
BEGA220A module is a general purpose embedded system and is suitable for versatile applications such as medical probing devices, in-car automation, human machine interface
(HMI), etc. And here is the order information for the BEGA220A family :
Order Information
Part No. RS-485 RS-422 WLAN 20 PIN EXT BUS(
IOX12,ADCX6
)
BEGA220A
BEGA220A1
BEGA220A2
BEGA220A3
BEGA220A4
BEGA220A5
BEGA220A6
BEGA220A7
1.1.1 Packing Content
A complete package should contain all of the following:
BEGA220A module
Female USB to mini USB cable with 20cm length (CB04P201LC01$)
220 communication cable with 3M 40 pin connector and length100cm(CB40P1000LC01$ )( only on sample stage)
CD for user manual and utility software
BEGA220A USER MANUAL - 7 -
1.1.2 Module Layout
No.
1
Name Description
Touch screen To support touch screen operation on BEGA220A
No. Name
2 Power socket
Description
Use 12V/3A power with a spec. of DC Plug_in 2.5 socket
3 ADC_GPIO Bus GPIOx12, ADCx6
4
Communication
Bus
5 Host-USB 1.1
Device USB 2.0
RS-232x3 RS485/422x1(Optional)
Connect to USB 1.1 peripheral (keyboard, mouse,etc)
6 RJ-45 Connect to Ethernet network
BEGA220A USER MANUAL - 8 -
No.
7
8
Name
Wi-Fi Antenna socket
Connect Wi-Fi antenna
Description
SD Card socket Connect SD and MMC Card (4GB max.)
BEGA220A USER MANUAL - 9 -
1.2 Specifications
1.2.1 System Functional Blocks
Wi-Fi
EXT
BUS
20
PIN
I/O x 12
(KEYx12)
ADC x 6
10/100 Ethernet
CPU (ARM/400MHz)
DC/DC
Audio codec
AMP
Dual
CH
Device
USB 2.0
SPI
RS232 x3
RS485/
422
Touch
IF x4
800*480
TFT-LCD
Host
USB 1.1
COMMUNICATION BUS 40 PIN
NAND FLASH
DDR II
SRAM
EEPROM
SD/MMC Card
BEGA220A USER MANUAL - 10 -
1.2.2 Module Specifications
Parameter
CPU
System Memory
Specification
Samsung S3C2416X 400MHz
32 bit RISC architecture ARM926EJ CPU core
16-bit 64MB/133MHz DDR2 memory
Storage Device
Series Port
USB
GPIO
ADC
LAN
Audio
Wi-Fi
OS
LCD Size
LCD Resolution
LCD Brightness
Power Supply
Operating Temperature
2GB NAND Flash
2 wire RS-232 x 3
Isolated RS485/422 x1(Option)
1x USB device (USB2.0) for Active Sync only
1XUSB host (USB1.1)
Support programmable 12 x IO sharing with Key board interface
Support 6 x channel 12 bit high speed A/D converter
High performance 16-bit 10/100 Ethernet controller
Dual channels 2 watts speaker output
IEEE 802.11b/g,Wi-Fi compliant
WinCE 5.0(default), preloaded with .Net CF3.5
7” TFT LCD
800x480
400 cd/m ²
DC9V~DC28V
-20 ~ +70
BEGA220A USER MANUAL - 11 -
1.3 Mechanical Specifications
1.3.1 Module Specifications
BEGA220A USER MANUAL - 12 -
2 BEGA220A Installation & Testing
This chapter provides installation information for BEGA220A module and it consists of :
2.1 Connect power
2.2 Connect SD/MMC Card
2.3 Connect Host USB
2.4 Connect LAN
2.5 Connect Wi-Fi
2.6 Connect Communication Bus
2.7 Connect ADC_GPIO Bus
BEGA220A USER MANUAL - 13 -
2.1 Connect Power
User may prepare a power adaptor with an output of DC12V/3A and a 2.5
as illustrated.
DC Plug_in 2.5
BEGA220A USER MANUAL - 14 -
2.2 Connect a SD/MMC Card
Insert SD/MMC card as illustrated and eject card only when it’s not at reading mode. Note that there is write-protection toggle switch on the card and make sure it’s not write-protected so data can be written into the card.
WinCE will then detect the SD/MMC Card and appears a storage card icon as follows:
BEGA220A USER MANUAL - 15 -
2.3 Connect Host USB
Users may connect host USB to any USB1.1 device, for example mouse, keyboard, USB storage, through a mini-USB cable as illustrated.
BEGA220A USER MANUAL - 16 -
2.4 Connect to LAN
STEP1: Connect to LAN port as illustrated.
STEP2: Click on “Start-Setting-Networking and Dial-up connections” to set up a network
STEP3: Select ”DM9ISA1” to set up a LAN parameters.
BEGA220A USER MANUAL - 17 -
STEP4: Select static IP or DHCP IP as appropriate.
STEP5: Select Internet Explorer.
STEP6: Enter URL at the Address box
BEGA220A USER MANUAL - 18 -
STEP7: Enter URL at the Address box
BEGA220A USER MANUAL - 19 -
2.5 Connect Wi-Fi
STEP1: Screw up the Antenna on BEGA220A as illustrated.
STEP2: Click on the network icon as highlighted to enter the wireless setup.
BEGA220A USER MANUAL - 20 -
STEP3: Click on ”Wireless Information” tab to set up wireless parameters
STEP4: Click on ”Add New…” to add a new wireless connection
STEP5: Set up SSID, WEP, IEEE802.1X Authentications parameters as appropriate on
BEGA220A, then click OK.
BEGA220A USER MANUAL - 21 -
STEP6: Select the wireless access point, or SSID as appropriate, then click ”Connect” to enable wireless connection of BEGA220A. The connection status is shown right beneath the SSID selection box.
STEP7: Select ”IP Information” tab and click on “renew” to refresh IP address.
STEP8: Select “Internet Explorer” on desktop.
BEGA220A USER MANUAL - 22 -
STEP9: Enter URL address in the ”Address” box
STEP10: then the browser will surf to the URL as specified.
BEGA220A USER MANUAL - 23 -
2.6 Connect Communication Bus
2.6.1 Pin Assignment of Communication Bus
1 NC Yellow/Red 21 GND
2 NC
3 DSPC1
4 DSPC3
Yellow/Blue 22
Black
Brown
23
GND
DSPC2
Green/White
Blue/White
White/Red
24 DSPC4 Brown/Black
5 NC Brown/White 25 NC
6 USBDP
7 NC
Red 26
Brown/Green 27
USBDN
GND
Orange/Green
Red/Black
Orange/White
8 TXD1T
RTS1T 9
10 VBUS
11 TXD2T
12 NC
Orange 28 RXD1T Orange/Black
Yellow 29 CTS1T Yellow/Black
Green
Blue
X
Purple
Grey
30 GND Green/Black
31
32
RXD2T
GND
Blue/Black
Red/White
Red/Green
33 RXD3T Purple/Black
34 GND2 Orange/Blue
13 TXD3T
14 VDD2
15 A-422R+
16
A-422T+
A-485D+
17
White
Pink
35
36
A-422R-
A-422T-
A-485D-
VDD2 Grey/Black 37 GND2
White/Black
Pink/Black
18
19
NC
SS
X
Light green
38
39
GND
SPIMOSI
Red/Blue
Purple/White
Purple/Red
Light green/Black
20 SPIMISO Light blue 40 SPICLK Light
BEGA220A USER MANUAL - 24 -
2.6.2 Serial Port Test
BEGA220A provides 3 sets of RS-232 for serial connection. There is also optional RS-485 or RS-422 interface available as options.
2.6.2.1 Connect Serial Port
1 st
set of RS-232 (Debug Port)(for update only)
Connect 1 st
set of RS-232 on BEGA220A to DB9-female on PC’s COM port. This RS-232 port is used as debug port ONLY with a signal level of +/-12v.
Pin Assignment of RS-232
RS-232 DB9 Female BEGA220A
Pin No Pin Name Pin No Pin Name
1 DCD — —
2
3
4
TD
RD
DTR
8
28
—
TXD1T
RXD1T
—
5
6
7
8
9
GND
DSR
CTS
RTS
RI
27
—
29
9
—
GND
—
CTS1T
RTS1T
—
BEGA220A USER MANUAL - 25 -
2 nd
set of RS-232 (COM3)
Connect 2 nd
set of RS-232 to PC’s COM port. BEGA220A reserves COM3 port for the 2 nd set of RS-232 and its signal level is at +/-12 v.
Pin Assignment of RS-232
RS-232 DB9 Female BEGA220A
Pin No Pin Name Pin No Pin Name
1 DCD — —
2
3
4
5
6
7
8
TD
RD
DTR
GND
DSR
CTS
RTS
13
33
—
32
—
—
—
TXD3T
RXD3T
—
GND
—
—
—
9 RI — —
BEGA220A USER MANUAL - 26 -
3 rd
set of RS-232(COM4)
Connect 3 rd
set of RS-232, which is defaulted to COM4 on BEGA220A, to DB-9 COM port of PC. The signal level runs at +/-12v.
Pin assignment of RS-232
RS-232 DB9 Female BEGA220A
Pin No Pin Name Pin No Pin Name
1 DCD — —
2
3
4
5
6
7
8
9
TD
RD
DTR
GND
DSR
CTS
RTS
RI
11
31
—
30
—
—
—
—
TXD2T
RXD2T
—
GND
—
—
—
—
BEGA220A USER MANUAL - 27 -
RS-422 (Option)(COM1)
BEGA220A supports 1 set of RS-422 serial interface and defaulted to COM1 port. It is supported to use a RS-232 to RS-422/485 converter board to connect to PC’s COM port for connectivity test.
Pin Assignment of RS-422
Pin No
35
Pin Name
A-422R-
15
16
36
A-422R+
A-422T+
A-422T-
34 GND2
*
Note that either RS-422 or RS-485 can be used at a time.
*
If no isolation is required, please connect Pin14 to Pin 12 and Pin 34 to Pin 32; otherwise, connect Pin 14 and 34 to a voltage of 5 +/- 10% voltage (4.75-5.25v).
RS-485 (Option)(COM1)
BEGA220A support one set of RS-485 serial interface and defaulted to COM1 port. During connectivity test, it is applicable to use a RS-232 to RS-422/485 converter board to connect to
PC’s COM port.
Pin assignment of RS-485
Pin No
37
Pin Name
GND2
16
36
A-485D+
A-485D-
*
Note that either RS-422 or RS-485 can be used at a time.
*
If no isolation is required, please connect Pin14 to Pin 12 and Pin 34 to Pin 32; otherwise, connect Pin 14 to a voltage of 5 +/- 10% voltage (4.75-5.25v), and pin 34 to ground.
BEGA220A USER MANUAL - 28 -
2.6.2.2 Serial Port test procedure
To test serial connectivity , first connect the RS-232 cable as appropriate, and run the hyper-terminal program to test if receiving and sending function normally. Here is the step guide:
PC set up
:
STEP1 : Run “hyper-terminal” program under start-program-accessories-communication”, then enter a name for this session and click ok.
STEP2: Select PC’s COM port in ”Connect using” box to connect to serial port on
BEGA220A. Then click OK.
BEGA220A USER MANUAL - 29 -
STEP3: Pull down ”Bits per second” to set up communication speed (usu. Ranges from
9600 to 115200). Make sure the baud rate value is identical to that on BEGA220A.
Select None for ”Flow control”, then click “”Apply”, and click ”OK”.
Bits per second
Flow control
BEGA220A USER MANUAL - 30 -
BEGA220A set up procedure:
STEP1: Select ”My Device” on BEGA220A
STEP2: Select “ Windows” folder
STEP3: Run ”SerialPortTest”
BEGA220A USER MANUAL - 31 -
STEP4: ” Here is the initial screen of SerialPortTest”
STEP5: Select COM port as appropriate. Pull down at Baud Rate ranged between 9600 to
115200 and use the same value at both BEGA220A and PC end. Then click on
“Open port” to activate a serial connection.
Serial port select
BaudRate select
Open port
STEP6: If everything goes right, you will see the pop-up window as follows. Click on OK to proceed.
BEGA220A USER MANUAL - 32 -
STEP7: Enter “text” at Tx” window and click on”Send Tx” button.
STEP8: At PC end, you will see the same text entered echoed back.
STEP9: Enter some text at PC end and note an echo of the text will appear at RX window at
BEGA220A end.
BEGA220A USER MANUAL - 33 -
2.6.3 Device USB installation
BEGA220A supports one set of Device USB to communicate with a PC through ActiveSync software for data sync. Here illustrates the connection of Device USB. Please refer to chapter
3.1.1 for ActiveSync operation.
Pin assignment of Device USB
USB BEGA220A
Pin No Pin Name Pin No Pin Name
1 VBUS 10 VBUS
2
3
4
D-
D+
GND
26
6
30
USBDN
USBDP
GND
BEGA220A USER MANUAL - 34 -
2.6.4 Speaker installation
BEGA220A offers 2 sets of speaker circuits to connect to 8 /2W speaker. Connect speakers as illustrated to support audio playback.
1 st
set of Speaker
Pin Assignment of Speaker
Speaker BEGA220A
Pin No Pin Name Pin No Pin Name
1
2
+
-
3
23
DSPC1
DSPC2
2 nd
set of peaker
Pin Assignment of Speaker
Speaker BEGA220A
Pin No Pin Name Pin No Pin Name
1 + 4 DSPC3
- 24 DSPC4 2
BEGA220A USER MANUAL - 35 -
2.7 ADC_GPIO Bus
2.7.1 Pin Assignments of ADC_GPIO Bus
1 ADCT0 Brown
2 ADCT1
11 ADCT3 Blue
Orange 12 ADCT4 Blue/Black
3
4
5
ADCT2 Brown/Black 13 ADCT5
GND
KEY1
Orange/Blac k
Red
14
15
GND
Purple
White
KEY6 Purple/Black
6
7
KEY2
KEY3
Yellow 16 KEY7 White/Black
Red/Black 17 KEY8 Grey
8 KEY4 Yellow/Black 18 KEY9 Light Blue
9
10
KEY5 Green 19 KEY10 Grey/Black
KEY11 Green/Block 20 KEY12
Light blue/Black
BEGA220A USER MANUAL - 36 -
2.7.2 GPIO Test
BEGA220A offers 12 general purpose programmable I/O ports (GPIO). Please refer to sample code at chapter 4.4.The typical signal length is around 10 to 15 cm and the rated voltage is as follows
Item Symbol Min Typ Max Unit
High Level Input Voltage VIH 2.3 — 3.6 V
Low Level Input Voltage VIL -0.3
High Level Output Voltage VOH 3.1
Low Level Output Voltage VOL —
Test Procedure:
—
—
—
0.9 V
3.3 V
0.2 V
STEP1: Select”My Device” on BEGA220A
STEP2: Select “Windows” folder.
BEGA220A USER MANUAL - 37 -
STEP3: Run ”GpioTest_220A”
STEP4: Here is the initial screen of ”GpioTest_220A” and defaulted to test all KEYs as inputs.
STEP5: A green light at KEY stands for a high input signal
BEGA220A USER MANUAL - 38 -
STEP6: To test output, pull down the Input and change the KEY to output.
STEP7: While KEY is defined as OUTPUT as step6, check on red circle to the left of KEY to generate a high output voltage.
BEGA220A USER MANUAL - 39 -
2.7.3 ADC test
2.7.3.1 ADC test set-up
Prior to ADC port testing, connect ADCT0 port as illustrated. Use a Vdd of 3.3 volt and voltage divider to limit maximum ADCT0 to be 1.6 volt (ADC readout as 4095 , 12-bit unsigned). Then run the ADC test by using test program as BEGA220A provided. Note that the maximum voltage of ADCTO should not exceed 1.6 volt.
BEGA220A USER MANUAL - 40 -
2.7.3.2 ADC test procedure
STEP1: Select”My Device”on BEGA220A
STEP2: select “Windows” folder
STEP3: Run “ADCTest” program by double-clicking the icon.
BEGA220A USER MANUAL - 41 -
STEP4: ”ADCTest” initial screen is as follows:
STEP5: Click ”Start” button to start testing ADC.
STEP6: Adjust variable resistor (VR) and observe the changes in read-out of ADC Port value. Click on “Stop” to finish the ADC test.
BEGA220A USER MANUAL - 42 -
3 BEGA220A Programming Guide
This chapter demonstrates connection from BEGA20A to PC and how to use software to control serial port, GPIO , ADC, and Backlight. This chapter consists of the following:
3.1 Transfer File Between BEGA220A and PC
3.2 Programming for BEGA220A
3.3 Serial Port Function
3.4 GPIO Control
3.5 A/D Converter and Backlight Adjustment
BEGA220A USER MANUAL - 43 -
3.1 Transfer File Between BEGA220A and PC
3.1.1 Connect PC and BEGA220A
User may setup the connection between desktop PC and BEGA220A by following steps:
STEP 1.
Install Microsoft ActiveSync 4.5 on desktop PC. You may download ActiveSync from: http://www.microsoft.com/downloads/details.aspx?familyid=9e641c34-6f7f-404d-a04b-dc09f814
1141&displaylang=en&tm
After installation, you need to restart PC.
STEP 2. Connect desktop PC and BEGA220A by USB cable. Below picture shows the hardware connection between desktop PC and BEGA220A for file transfer.
Host USB used for USB 1.0 device, such as mouse, keyboard or USB storage device.
BEGA220A
40 pin external bus
USB cable
Please note that the USB cable should plug into the connector of device USB wiring from the 40 pin communication bus . Below table shows the pin assignment of device USB on the
40 pin external bus.
USB connector
Pin No Pin Name
40 pin communication bus of
BEGA220A
Pin No Pin Name
1 VBUS 10 VBUS
2
3
4
D-
D+
GND
26
6
30
USBDN
USBDP
GND
BEGA220A USER MANUAL - 44 -
STEP 3. Power on BEGA220A and connect BEGA220A and PC by USB cable. For the first connection, windows system on PC will request the USB device driver of BEGA220A. Please install USB driver by following procedures.
(1). Select the advance item on below dialog and click “Next” button.
(2). Click “Browse” button and then select the directory which includes USB device driver file of
BEGA220A. Click “Next” button.
Directory which includes USB device driver file of BEGA220A
*The following download URL contain all needed driver for 220A Active Sync/Samgsung drivers: http://www.bolymin.com.tw/manual/dnw.rar
BEGA220A USER MANUAL - 45 -
(3). Click “Continue” button
(4). Click “Finish” button. Now BEGA220A may connect to PC by ActiveSync.
BEGA220A USER MANUAL - 46 -
(5). Select “No” and click “Next” button to cancel the synchronization.
BEGA220A USER MANUAL - 47 -
3.1.2 Transfer Files
After connecting PC and BEGA220A, below screen will display. The green cycle means the connection between PC and BEGA220A has been built.
Execute ”Explore” program and move into the folder of BEGA220A, you can transfer files between PC and BEGA220A.
Folder of BEGA220A
BEGA220A USER MANUAL - 48 -
3.2 Programming for BEGA220A
3.2.1 Setup Development environment
By following steps, we can setup the development environment for WinCE 5.0:
1. Install Microsoft eMbedded Visuall C++ 4.0(eVC 4.0) into desktop PC : eVC 4.0 can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyID=1DACDB3D-50D1-41B2-A107-
FA75AE960856&displayLang=en.
Use free serial number : TRT7H-KD36T-FRH8D-6QH8P-VFJHQ
2. Install service pack 4 for eVC 4.0 and here is the download URL: http://download.microsoft.com/download/a/7/3/a735c7fb-dcbd-429f-9090-d09b3b15d3fa/e vc4sp4.exe
After the patch, the eVC sp4 version is 4.00.1610.0.
3. Connect BEGA220A and Desktop PC by procedures in section 3.1.2
4. Install SDK of BEGA220A provided by Bolymin. The installation file may be found in the product CD. Here is the download URL: http://www.bolymin.com.tw/manual/BEGA220A_INX_SDK_101109_v094.msi
5. The platform setting of embedded Visual C++:
The following picture shows the required setting of eVC 4.0 sp4::
Select SMDK2416 or
BEGA220A platform
Debug or release version
SMDK2416 device or
BEGA220A device
BEGA220A USER MANUAL - 49 -
3.2.2 Create New Project
In this section, we will describe how to create a new project in eVC 4.0 sp4. An experienced programmer may jump to next section directly. You may create a new project for your application by following steps:
STEP 1: Execute eVC 4.0 sp4.
STEP 2: Select “File”-“New…: function
STEP 3: Select your application type, setup the location and name of your project and. Please select “WCE MFC AppWizard(exe)” as application type.
Project name
Project location
Application type
Only select “ARMV4I” as CPU type
BEGA220A USER MANUAL - 50 -
STEP 4: Select “Dialog based” and “language” setting. Click “Next” button.
STEP 5: Click “Next” button.
BEGA220A USER MANUAL - 51 -
STEP 6: Click “Next” button.
STEP 7: Click “Finish” button.
STEP 8: Now you can add your codes into this new project.
You can get more development information from below MSDN website. http://msdn.microsoft.com/en-us/library/bb847963.aspx
BEGA220A USER MANUAL - 52 -
3.3 Serial Port Function
3.3.1 Overview
There are 4 serial ports in BEGA220A. The following table lists the function of each serial port:
Name Function Comment
COM1:
COM3:
COM4:
RS-422 or RS485 port
Debug port Internal used.
Option
Used by application program. 2 wire RS-232
Used by application program. 2 wire RS-232
May not open by application program.
BEGA220A USER MANUAL - 53 -
3.3.2 Serial Port Control-CSerialPort class
Bolymin provided a class, CSerialPort, which implements basic control logic for serial port.
Application may use this class by adding “CSerialPort.cpp” and “CSerialPort .h” into project.
Customer may modify the source code of class CSerialPort to expand the serial port functions.
3.3.2.1 Basic concept of class CSerialPort
The object of class CSerialPort will handle all data transfer and receive of opened serial port.
Once there is any data is received by the opened serial port, CSerialPort object will send a user defined message to user defined window which should be main window of application program.
Below picture shows the flow:
Window of user application
User application should catch this message to get received data
Call Send() function to send data by serial port
Send user defined message to user window
CSerialPort object Received data
Serial port
BEGA220A USER MANUAL - 54 -
3.3.2.2 Member function of class CSerialPort
CSerialPort Function: Constructor function of calss CSerialPort.
Syntax CSerialPort();
Parameters None
Return value None
Open Function: Open a serial port.
Syntax BOOL Open(
LPCTSTR port, int baud_rate, int data_bit int stop_bit int parity
);
Parameters port Name of serial port listed in the table of section 3.3.1. baud_rate Baud rate, ex: 9600. data_bit Data_bit, 7 ~ 8 stop_bit Stop bit , ONESTOPBIT, ONE5STOPBITS or TWOSTOPBITS.
parity Parity , NOPARITY, ODDPARITY, EVENPARITY.
Return value TRUE: Open serial port successfully
FALSE: .Open serial port fail.
Send Function: Send specified data by this serial port.
Syntax BOOL Send(
LPCVOID buf_ptr,
DWORD data_len
);
Parameters buf_ptr Memory pointer of data will be sent. data_len Length of data will be sent. (UNIT: byte)
Return value TRUE: Send data successful.
FALSE: Send data fail.
SetCommMsg Function: CSerialPort object will send a receive message to specified window.
User need to call this function to set the receive message value and the window that will receive message.
Syntax void SetCommMsg(
HWND win_handle,
UINT receive_msg
);
Parameters win_handle Handle of the window that will receive message. receive_msg User defined message value.
Return value None
Close Function: Close current serial port.
Syntax BOOL Close (
);
Parameters None
Return value TRUE: Close serial port successfully.
FALSE: Cloas serial port fail.
BEGA220A USER MANUAL - 55 -
3.3.2.3 How to catch the receive message
Please apply following steps to catch the receive message.
STEP 1: Define a receive message in your code as below: const UINT WM_CMD_OK = WM_USER+1;
STEP 2: Declare a message processing function in the window that will process receive message.
STEP 3: Create message mapping.
STEP 4: Implement the receive message processing function.
BEGA220A USER MANUAL - 56 -
3.3.3 Example Code
Bolymin provide a test application and its source code for example. Below picture is the screen shot of the serial port test program:
Select serial port and setup its parameter values.
Open/Close selected serial port.
Data will be sent by selected serial port Received data
Clear received data
Send data Clear sent data.
Below are the major source codes of the test program:
File: SerialPortDlg.cpp
/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg dialog
///////////////////////////////////////////////////////////////////////////// const UINT WM_CMD_OK = WM_USER+1;
BEGIN_MESSAGE_MAP(CSerialPortDlg, CDialog)
//{{AFX_MSG_MAP(CSerialPortDlg)
ON_BN_CLICKED(IDC_OPEN_COM, OnOpenCom)
ON_BN_CLICKED(IDC_CLOSE_COM, OnCloseCom)
Define a receive message
ON_BN_CLICKED(IDC_SEND, OnSend)
ON_BN_CLICKED(IDC_CLEAR_SEND, OnClearSend)
ON_BN_CLICKED(IDC_CLEAR_REC, OnClearRec)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_CMD_OK, OnCommRecv)
Map the receive message processing function to user defined message.
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg message handlers
/////////////////////////////////////////////////////////////////////////////
BEGA220A USER MANUAL - 57 -
BOOL CSerialPortDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
// Set big icon
// Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen m_ComboBaud.SetCurSel(5); /* Define BaudRate: 115200 */ m_ComboData.SetCurSel(1); m_ComboParity.SetCurSel(0);
/* Define data bit: 8 bit */
/* Define parity: none */ m_ComboPort.SetCurSel(0); m_ComboStop.SetCurSel(0);
/* Define searial port: COM1 */
/* Define stop bit: 1bit */ m_ButClose.EnableWindow(FALSE); m_strRecDisp = _T(""); m_cSendBuffer = new char[60];
UpdateData(FALSE); m_pSerialPort = new CSerialPort();
/* "Close"Button is disable*/
Create a CSerialPort object and set current window as the window which will process received data. m_pSerialPort->SetCommMsg(m_hWnd, WM_CMD_OK);
} return TRUE;
/*******************************************************************************************
Implement function used to process receive data from serial port
{
********************************************************************************************/
LRESULT CSerialPortDlg::OnCommRecv(WPARAM wParam, LPARAM lParam)
CString tmp; char *buf;
DWORD buflen; buf = (char *)wParam; buflen = (DWORD)lParam;
// memory pointer of received data
// received data length
CEdit *pRecvStrEdit = (CEdit*)GetDlgItem(IDC_REC_DISP);
{ for (int i = 0; i < buflen; i++, buf++) tmp.Format(_T("%c"), *buf);
BEGA220A USER MANUAL - 58 -
}
} m_strRecDisp += tmp; pRecvStrEdit->SetWindowText(m_strRecDisp); /* Show */ return 0;
}
// Initial user interface const CString PorTbl[4] = {_T("COM1:"),_T("COM3:"),_T("COM4:"),_T("COM6:")}; const DWORD BaudTbl[6] = {4800, 9600, 19200, 38400, 57600,115200}; const DWORD DataBitTbl[2] = {7, 8}; const BYTE StopBitTbl[3] = {ONESTOPBIT, ONE5STOPBITS, TWOSTOPBITS}; const BYTE ParityTbl[4] = {NOPARITY, ODDPARITY, EVENPARITY, MARKPARITY};
/*******************************************************************************************
Function for “OPEN” button used to open selected serial port.
{
********************************************************************************************/ void CSerialPortDlg::OnOpenCom()
UpdateData(TRUE);
CString strPort = PorTbl[m_ComboPort.GetCurSel()];
DWORD baud = BaudTbl[m_ComboBaud.GetCurSel()];
DWORD databit = DataBitTbl[m_ComboData.GetCurSel()];
BYTE stopbit = StopBitTbl[m_ComboStop.GetCurSel()];
BYTE parity = ParityTbl[m_ComboParity.GetCurSel()];
Open selected serial port by specified parameter values.
BOOL ret = m_pSerialPort->Open(strPort, baud, databit, stopbit, parity); if (ret == FALSE)
{
}
MessageBox(_T("Open ") + strPort + _T(" Fail!")); return; m_ButOpen.EnableWindow(FALSE); m_ButClose.EnableWindow(TRUE);
/* Disable "open" button */
/* Enable "close" button */
MessageBox(_T("Open ") + strPort + _T(" is OK!"));
BEGA220A USER MANUAL - 59 -
/*******************************************************************************************
Function for “CLOSE” button used to close current serial port.
********************************************************************************************/ void CSerialPortDlg::OnCloseCom()
{ m_pSerialPort->Close(); Close current serial port. m_ButOpen.EnableWindow(TRUE); m_ButClose.EnableWindow(FALSE);
/* Enable "Open" button */
/* Disable "close" button */
}
/*******************************************************************************************
}
Function for “SEND” button used to send data by serial port.
********************************************************************************************/ void CSerialPortDlg::OnSend()
{
UpdateData(TRUE); int len = m_strSendEdit.GetLength(); for(int i = 0; i < len;i++) m_cSendBuffer[i] = (char)m_strSendEdit.GetAt(i);;
Send data by current serial port.
BOOL status = m_pSerialPort->Send(m_cSendBuffer, len); if (!status)
MessageBox(_T("Can't write string to COM"),_T("Error"),MB_OK);
}
{
/*******************************************************************************************
Destory function of serial port test dialog
********************************************************************************************/ void CSerialPortDlg::OnDestroy()
CDialog::OnDestroy(); m_pSerialPort->Close(); delete m_pSerialPort; delete m_cSendBuffer;
Close current serial port and delete
CSerialPort object.
BEGA220A USER MANUAL - 60 -
3.4 GPIO Control
3.4.1 How to Control GPIO for BEGA220A
Bolymin provides a DLL file “ pGPIO_220A.dll
”,which is already included in your WinCE OS as a hidden file, to control the General Purpose Input and Ouput(GPIO) signal. In BEGA220A, there are 12 user defined GPIO. User may read current value of all GPIO of BEGA220A, change values of GP output signal and set the attribute of GPIO by functions in “ pGPIO_220A.dll
”.
User may use GPIO control functions by following procedures:
STEP 1.
Add “pGPIO_220A.h” into project.
STEP 2.
Load “ pGPIO_220A.dll
” by “ Loadlibrary ()” function.
STEP 3.
Get the address of control functions by “ GetProcAddress ()” function.
STEP 4.
Execute GPIO control functions by the address got at STEP3.
Below is a simple example code to use the GPIO control functions:
// variable declaration
HINSTANCE m_hModule;
BOOL (*m_pGetGPInput)(int); void (*m_pSetGPOutput)(int, BOOL);
BOOL (*m_pIsOutput)(int); void (*m_pSetIOAttribute)(int, BOOL);
Load “ pGPIO_220A.dll
” and get the address of
GPIO control functions. m_hModule=::LoadLibrary(_T(" pGPIO_220A.dll
")); m_pGetGPInput = (BOOL (*)(int))::GetProcAddress(m_hModule,_T("GetGPInput")); m_pSetGPOutput = (void (*)(int, BOOL))::GetProcAddress(m_hModule,_T("SetGPOutput")); m_pIsOutput = (BOOL (*)(int))::GetProcAddress(m_hModule,_T("IsOutput")); m_pSetIOAttribute = (void (*)(int, BOOL))::GetProcAddress(m_hModule,_T("SetIOAttribute")); m_pSetIOAttribute(GIO_KEY1, GA_INPUT);
Execute GPIO control functions. m_bPOUT1 = m_pGetGPInput(GIO_KEY1); m_pSetIOAttribute(GIO_KEY1, GA_OUTPUT); if (m_pIsOutput(GIO_KEY1)) m_pSetGPOutput(GIO_KEY1, TRUE);
BEGA220A USER MANUAL - 61 -
3.4.2 GPIO Control Function for BEGA220A
GetGPInput Function: Get current status of specified GPIO.
Syntax BOOL GetGPInput (
int gpio_index
);
Parameters gpio_index The index of specified GPIO. Refer to section 3.4.3 for the value definition.
Return value TRUE: Current status of specified GPIO is HIGH.
FALSE: Current status of specified GPIO is LOW.
SetGPOutput Function: Set value of specified GP Output.
Syntax void SetGPOutput (
int gpio_index,
BOOL value
);
Parameters gpio_index The index of specified GP output. Refer to section 3.4.3 for the value definition. value New value of specified GP output.
TRUE: Set specified GP output to HIGH.
FALSE: Set specified GP output to LOW.
Return value None
IsOutput Function: Check if the specified GPIO is output or not..
Syntax BOOL IsOutput (
int gpio_index
);
Parameters gpio_index The index of specified GPIO. Refer to section 3.4.3 for the value definition.
Return value TRUE: The specified GPIO is output.
FALSE: The specified GPIO is input.
SetIOAttribute Function: Set the attribute of the specified GPIO.
Syntax void SetIOAttribute (
int gpio_index,
BOOL value
);
Parameters gpio_index The index of specified GPIO. GIO_KEY1~GIO_KEY12 . value New attribute of the specified GPIO.
GA_OUTPUT: Set the specified GPIO as output.
GA_INPUT: Set the specified GPIO as input.
Return value None
BEGA220A USER MANUAL - 62 -
3.4.3 Definition of GPIO Index
Class CGPIO_220A support following index values:
GPIO index Description
GIO_KEY1 User defined general purpose input/output. (KEY1)
GIO_KEY2
GIO_KEY3
GIO_KEY4
GIO_KEY5
GIO_KEY6
GIO_KEY7
GIO_KEY8
GIO_KEY9
User defined general purpose input/output. (KEY2)
User defined general purpose input/output. (KEY3)
User defined general purpose input/output. (KEY4)
User defined general purpose input/output. (KEY5)
User defined general purpose input/output. (KEY6)
User defined general purpose input/output. (KEY7)
User defined general purpose input/output. (KEY8)
User defined general purpose input/output. (KEY9)
GIO_KEY10
GIO_KEY11
User defined general purpose input/output. (KEY10)
User defined general purpose input/output. (KEY11)
GIO_KEY12
GO_BLIGHT_ENABLE
User defined general purpose input/output. (KEY12)
Backlight control. Default value : HIGH .
GO_LCD_POWER_ENABLE LCD power control. Default value : LOW .
GO_AMP_SWITCH Amplifier switch. Default vale: LOW .
GO_EN485 Reserved for internal use.
BEGA220A USER MANUAL - 63 -
3.5 ADC Converter and Backlight Adjustment
3.5.1 Overview
Bolymin provides a dynamic link library “ CtrlFunc_220A.dll
” which includes all control functions of A/D converter and backlight adjustment.
For A/D converter, there are 6-ch A/D converters with 12-bit resolution in BEGA220A. User may read the value from selected A/D converter channel by functions provided by Bolymin.
Suggested hardware wiring about A/D converter may be found in user manual. Detail description of control functions of A/D converter may be found in section 3.5.2.
For backlight adjustment, user may get current brightness value or change the brightness of backlight by control functions. The description of control functions of backlight adjustment may be found in section 3.5.3.
User may use control functions about A/D converter and backlight adjustment by following procedures:
STEP 1.
Add “CtrlFunc_220A.h” into project.
STEP 2.
Load “ CtrlFunc_220A.dll
” by “ Loadlibrary ()” function.
STEP 3.
Get the address of control functions by “ GetProcAddress ()” function.
STEP 4.
Execute control functions about A/D converter by the address got at STEP3.
STEP 5 . Call “FreeLibrary()” function to free the reference of “ CtrlFunc_220A.dll
” while ending the application program.
Below is a simple example code to use the control functions about A/D converter and backlight adjustment:
// variable declaration
HINSTANCE m_hModule;
BOOL (*m_pInitADC)(void); int (*m_pReadADC)(int);
Load “ CtrlFunc_220A.dll
” and get the address of control functions. m_hModule=::LoadLibrary(_T(" CtrlFunc_220A.dll
")); m_pInitADC = (BOOL (*)(void))::GetProcAddress(m_hModule,_T("InitADC")); m_pReadADC = (int (*)(int))::GetProcAddress(m_hModule,_T("ReadADC")); m_pInitBacklightCtrl = (BOOL (*)(void))::GetProcAddress(m_hModule,_T("InitBacklightCtrl")); m_pGetBrightness = (int (*)(void))::GetProcAddress(m_hModule,_T("GetBrightness")); m_pSetBrightness = (int (*)(int))::GetProcAddress(m_hModule,_T("SetBrightness")); m_pInitADC(); value = m_pReadADC(ADC_CHANNEL0); m_pInitBacklightCtrl();
Execute control functions of A/D converter. brightness = m_pGetBrightness(); m_pSetBrightness(brightness+5); // Increase the brightness by 5
Execute control functions of backlight adjustment. m_pSetBrightness(0); // OFF the backlight
FreeLibrary(m_hModule); // free the instance of “CtrlFunc_220A.dll”
BEGA220A USER MANUAL - 64 -
3.5.2 Control Function of A/D Converter
initADC Function: A/D converter initialization. User need to call this function before using A/D converter.
Syntax BOOL initADC ();
Parameters None
Return value TRUE: Initial A/D converter successfully.
FALSE: Fail to initial A/D converter.
ReadADC Function: Read A/D converted data from specified A/D converter channel.
Syntax Int ReadADC(
int adc_channel
);
Parameters adc_channel The index of specified A/D converter channel.
ADC_CHANNEL0~ADC_CHANNEL5
Return value A/D converted data from specified A/D converter channel.
BEGA220A USER MANUAL - 65 -
3.5.3 Function about Backlight Adjustment
InitBacklightCtrl Function: Initial backlight controller. User need to call this function before adjusting backlight brightness.
Syntax BOOL InitBacklightCtrl ();
Parameters None
Return value TRUE: Initial backlight controller successfully.
FALSE: Fail to initial backlight controller.
GetBrightness Function: Get current brightness value of backlight.
Syntax int GetBrightness ();
Parameters None
Return value Current brightness value of backlight. (0~100)
SetBrightness Function: Set brightness value of backlight.
Syntax Int SetBrightness(
int new_value
);
Parameters new_value New brightness value of backlight. (0~100)
0: Turn OFF the backlight
Return value Original brightness value of backlight.
BEGA220A USER MANUAL - 66 -
4. Troubleshooting
Q1. When 220A is connected to a PC via USB for Active Sync (AS- a communication link for file transfer between 220A and PC), 220A does not boot. How to fix the problem?
A1. Solution : Before booting up 220A, make sure the USB connection for AS is disconnected.
Reason: It is due to the boot loader program mistakenly identify AS device and cause the hang.
The boot-up sequence was incomplete and never got to WinCE boot up sequence.
Q2. Why the program disappears as OS reboot?
A2. There are two folders available as non-volatile memory, which is partitioned from flash memory. Note that on embedded system, the whole OS is running on 64MB DDR2 SDRAM- meaning most directories seen such as \temp, \windows, \my documents, etc., are all volatile(will be gone after reboot). Only \PocketMory and \PocketMory1 are good for permanent data storage. Click on My Device icon on desktop to bring up the follow screen, select PocketMory , click on File-Property to view folder details. Repeat above steps for PocketMory1.
Click Start-Control-Storage Manager to view partition info.
Cross reference storage and property to know PocketMory and PocketMory1 allocation/free/used space on 2GB flash memory.
BEGA220A USER MANUAL - 67 -
<End of BEGA220A User Manual >
BEGA220A USER MANUAL - 68 -
Copyright
Copyright © 2010 BOLYMIN, INC. All rights reserved. No part of the materials may be reproduced in any form or by any means without prior written consent of BOLYMIN, INC.
Disclaimer
THE CONTENTS OF THIS DOCUMENT ARE SUBJECT TO CHANGE WITHOUT
NOTICE. BOLYMIN, INC. RESERVES THE RIGHT TO MAKE CHANGES WITHOUT
FURTHER NOTICE TO ANY PRODUCTS HERIN TO IMPROVE RELIABILITY,
FUNCTION OR DESIGN. BOLYMIN, INC. DOES NOT ASSUME ANY LIABILITY ARISING
OUT OF THE APPLICATION OR USE OF ANY PRODUCT OR CIRCUIT DESCRIBED
HERIN; NEITHER DOSE IT CONVEY ANY LICENSE UNDER ITS PATENT RIGHTS,
NOR THE RIGHTS OF OTHERS.
CUSTOMERS ARE ADVISED TO CONSULT WITH BOLYMIN, INC. OR ITS COMMERCIAL
DISTRIBUTORS BEFORE ORDERING.
BOLYMIN, INC.
5F, 38 Keya Road, Daya Dist., 42881 Taichung City, Taiwan, R.O.C.
WEB SITE: http://www.bolymin.com.tw
TEL: +886-4-2565-8689
FAX: +886-4-2565-8698
BEGA220A USER MANUAL - 69 -

Public link updated
The public link to your chat has been updated.
Advertisement