DGUS Development Guide - V3.1.0
DGUS Development Guide - V3.1.0
November, 2012
Contents
INTRODUCTION ....................................................................................................................................2
1 Hardware .............................................................................................................................................4
1.1 SD Card Slot ....................................................................................................................................................... 4
1.2 CONFIG.TXT ....................................................................................................................................................... 5
INTRODUCTION
DGUS is a brand-new GUI software platform based on DWIN K600+ kernel which developed and
authorized by DWIN Technology with own proprietary. Under DWIN system, GUI designs and
developments for communicating with user’s host could be achieved by DGUS_SDK, DWIN Toolbox that
specialized in visual interface and easy-use operation, it saves engineers from complicated programming
and takes less time for whole products developments.
Differing from traditional LCMs which manage the display by commands or timing sequence, GUI in DGUS
module is accomplished by real-time variables. All the feature of operation and display are defined in
preinstalled programmable Config. files. Software flow charts of different development methods for
temperature controller are shown as below.
As above information illustrated the DGUS’s easy-usage and quick convenience as compared with
traditional development, let alone animations, icons, and other factors on screen are considered.
In some medium and small projects of automation, DGUS module can act as host of other modules in a
RS485 network. DGUS module can even work as a microcontroller by DWIN OS running which is a DWIN’s
own programming system.
The whole development procedure is accomplished with DGUS_SDK_V3.4, configuration software for PC
for creating Config.files for DGUS module.
1 Hardware
File Format
Create a <DWIN_SET> folder in root directory of SD card.
Copy all the pictures, fonts and config files into <DWIN_SET> folder, as shown below.
Plug SD card into slot on module to download files.
Variables
22*.BIN 22_Initialization.BIN
Initialization
Hardware
CONFIG.TXT CONFIG.TXT
settings
1.2 CONFIG.TXT
CONFIG.TXT adopts a kind of method like scripting language to describe parameter register. Each
parameter will be stated line by line while no need to write unused parameters, as shown below.
Name of Parameter
Register
Range Description
R0 Module driver mode, unnecessary for modification.
Baud rate setting, 0x00-0x10 matchup with 1200bps -921600bps.
R1 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08
R1 0x00-0x11 Baud rate 1.2K 2.4K 4.8K 9.6K 19.2K 38.4K 57.6K 115.2K 28.8K
R1 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11
Baud rate 76.8K 62.5K 125K 250K 230.4K 345.6K 691.2K 921.6K Defined
Image Space
A 224MB flash memory (256MB K600+), extendable to 2016MB (2GB K600+), is designed for images.
Screen Resolution 256MB K600+ 2GB K600+
320×240 869 7807
480×272 869 7807
640×480 290 2602
800×480 290 2602
800×600 217 1952
1024×600 174 1561
1024×768 145 1301
Variable
56KB variable SRAM, which can be used as extended RAM, is designed to save data for variables. Variable
SRAM is divided into 28672 addresses from 0x0000 to 0x6FFF. Data in variable SRAM can be written by
command 0x82 and read by command 0x83, one address once at least.
Procedures of Upgrade:
A. Power off DGUS module and connect module with PC via serial port.
B. Open the SSCOM3.2 and click "Open File" to select a DGUS bin file, such as DGUS_V3.5.BIN.
C. Write "DWIN_M600_BOOT!" in data input column and set send-eve interval to 10ms/Time.
D. Select "Send New" and "Send eve", then power DWIN module again.
E. The serial port will receive "Erase ......”. If no response, please check the connection.
F. It will receive "Please Tx File!" after one second, then hook off "Send New" and click "Send File".
G. Wait another 3 to 10 seconds. If the serial port receives "***************END***************", it means the
download is finished.
H. Restart the module. Upgrade finished.
Upgrade your DGUS firmware by SD card is STRONGLY RECOMMENDED for V2.0 and higher version.
Method 1: Send password to module via serial port to activate SD card once.
We take 0xA55A as frame header, send command: A5 5A 0B 82 60 00 31 32 33 34 35 36 37 38.
Method 2: Using <Text Input> to type password can activate SD card once.
Step 1: open RUN function in Windows and run DOS using “command”.
Step 2: type command to format: “format/q g:/fs:fat32/a:4096”, and click <enter> to finish formatting.
Backstage user program is supported by DGUS module with DWIN OS function. User program, including
maximum 32764 commands, is saved in address #23 in font flash memory. Specific codes in CONFIG.TXT
can be used to disable/enable user program.
Executing cycle of user program is the same with refresh cycle of variables (200ms or 250ms). Please refer
to <DWIN OS Development Guide> to get detailed information.
2 Serial Port
Serial mode of DGUS module is asynchronous, full duplex serial port (UART). Each byte occupies 10 bits: 1
stars bit, 8 data bit, and 1 stop bit.
Baud rate can be defined by SD card. All data transfer is in hexadecimal format with MSB priority. E.g.:
transferring 0x1234, 0x12 will be transferred first, then 0x34 after.
Volume of serial FIFO buffer is 4KB, minimum capacity of data transfer in DGUS circle (200ms or 250ms).
Maximum capacity depends on the complexity of GUI.
DWIN recommends sending no more than 4KB data to DGUS module in a DGUS circle.
CRC checksum is only available for command and data, rather than data length and frame header, with
ANSI CRC-16(X16+X15+X2+1) format.
3 Data Format
To make it easier for calculation of MCUs, all the data in DGUS module is in integer, unsigned integer or
long integer format.
16-bit color system is adopted by DGUS module refers to chart below view definition of color palette.
65K-color Definition
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R4 R3 R2 R1 R0 G5 G4 G3 G2 G1 G0 B4 B3 B2 B1 B0
Define
Red 0xF800 Green 0x07E0 Blue 0x001F
Call keypad from designated page (KB_Source = 0x01): keypad is activated after click.
Call keypad from designated page (KB_Source = 0x01): page with keypad.
Key code (0x0000 – 0x00FE) of “Start” and “End” button will be written in VP address. Designate 0x00FF
key code for “Esc” button.
Values can also be indicated by <Data Variable> function to have exact current value (refer to Chapter
5.2.1).
Function keys
Key Definition Description
0x00F0 Cancel Cancel the operation, no affect to variable data.
0x00F1 Return Save the input text to the designated address and return.
0x00F2 Backspace Backspace, delete one character.
0x00F3 Delete Delete.
0x00F4 CapsLock Caps lock. Must assign the button effect to enable it.
0x00F7 Left Cursor forwards for one character.
0x00F8 Right Cursor backwards for one character.
Setup Mode
Mode Data Pack Notes for Data Pack Function
Transmit data from register to variable SRAM 0x6F00-0x6FFF (low
0x00 No No
bytes).
Transmit data from variable SRAM (low bytes) to register and reset
0x01 No No
module parameters of R1-R3, R5-RA.
Coordinates of top-left Convert designated area to monochrome bitmap (vertical mode) and
Tran_Area
and bottom-right of area. save the data to designated VP address.
VP address for restoring A. Width should be even.
*VP
bitmap data. B. Height should be multiple of 8.
C. VP data format shown as below:
VP: status indicator, refreshed to 0x5555 after operation.
0x02
VP+1: horizontal length, by word.
VP+2: numbers of data segment.
VP+3: bitmap data, with MSB priority.
If the key code automatically upload is enabled (R2.3=1), module will
upload message (value in VP address upload to 0x5555) to serial port.
The command is mainly for printing of current screen.
*VP Variable pointer. Upload data in designated VP address to serial port.
0x03
Tx_LEN Length of data to be sent. Range of Tx_LEN: 0x0001-0xFFFF.
0x04 Save function with 0x03, uploading data to COM2 (reserved port).
Coordinates of top-left Convert designated area to monochrome bitmap (horizontal mode) and
Tran_Area
and bottom-right of area. save the data to designated VP address.
A. Width should be multiple of 16.
B. VP data format as shown below:
VP: status indicator, refreshed to 0x5555 after operation.
0x05 VP+1: horizontal length, by word.
VP address for restoring
*VP VP+2: numbers of data segment.
bitmap data.
VP+3: bitmap data, with MSB priority.
If the key code automatically upload is enabled (R2.3=1), module will
upload message (value in VP address upload to 0x5555) to serial port.
The command is mainly for printing of current screen.
Frame_He Send the current touched position to COM2 (serial port for reserving the
Frame header (2 bytes)
ad system), the format is:
0x06 Frame_Head + X + Y + Check (The cumulative Sum for 1 byte of X, Y)
Frame_En
Frame end (2 bytes) + Frame_end.
d
Scale and position of curve can be modified by buttons on screen if variable description is saved in SP
address.
To scale the trend curve automatically with Incremental Adjustment (0xFE02), without user’s program.
To move the trend curve up and down with using Slider adjustment (0xFE03) to revise the value of
Y_Central, without user’s program.
E.g.: a 12-bit A/D data acquisition, Vmax= 4095, Vmin= 0, to display trend curve fully-scale between Ys =
50 and Ye = 430, MUL_Y= (430-50)*256/ (4095-0)= 23.7, rounded down to get 23.
0x0002 Line
0x0003 Rectangle
String format.
Address Definition Description
VP CMD Command.
VP+1 Data_Pack_Num_Max Data Pack Number.
VP+2 DATA_Pack
6 Development Steps
Step 1: Planning of Variables
Basic principles of planning:
VP should be arranged in continuous addresses for convenience to write and read.
Overlap of VP and SP addresses should be avoided.
①Variable input and display: 0xFE00 Variable Data Input (popup keypad which is not on the current
page), 0x5A10 Variable Data Display.
② Variable adjustment (“++”, “--”) and display: 0xFE02 Adjustment of Variable data, 0x5A10 Variable
Data Display.
③Variable adjustment (drag with following slider): 0xFE03 Slider Adjustment, 0x5A02 Slider Scale
Indicator.
④ Time set and display: 0xFE04 RTC Set (similar to 0xFE00 Variable Data Input), 0x5A12 RTC Display
(Two mode of time display: digital and analog).
⑤ Scale bar, status bar: 0x5A00 Variable Icon Display (Display different icons corresponding to the
different variable values), 0x5A01 Animation Icon Display (When the variable is a specified value, display
multiple icons circulation animation in proper order).
⑥Dashboard: 0x5A05 Icon Rotation Instructions.
⑦Text input and display: 0xFE06 Text In-put, 0x5A11 Text display.
⑩ Display and adjust the trend curve: 0x5A20 Trend curve Display (Support up to eight channels
simultaneously receive data and show the real-time trend curve), 0xFE03 Slider Adjustment, 0x5A02 Slider
scale indicator, 0xFE02 Incremental Adjustment. Adjustment of the trend curve scaling and central axis
position can be achieved without code interference.