Memory & Ranges
Memory area
- TOPWAY Smart LCD provide RAM area for variables VP_N16, VP_N32, VP_N64, VP_STR, …
- Be aware that data in RAM dissipates when Smart LCD power is cut.
- There are multiple storage areas within Smart LCD.
- Table below explains those areas and ways to access them.
| Int RAM | HW RAM area
|
||
|---|---|---|---|
| Int Flash | HW Flash area
|
Partition0
|
Partition2
|
| Ext U-Drv | Partition1
|
||
| Hardware | File System | ||
HW RAM area (on-board internal RAM)
- It is for VP variables (VP_N16, VP_N32, VP_N64, VP_STR, VP_G16,…)
- VP variables' default values are either 0s or “blank” at startup
- TRAM is volatile memory
- VP variables can be accessed by Project Elements, Lua Commands, Serial commands
HW Flash area (on-board internal flash)
- It can be directly accessed by serial command
- Serial command 0x94: provides backup or restore function
- Serial command 0x90: write a data to Hardware Flash area
- Serial command 0x91: read a from Hardware Flash area
- Lua access via “hmt.runcmd” that by execute the above commands
Partition 0 (on-board internal flash)
- Display Project files are stored in this partition
- Constant data is stored in usr.bin file at design-time. User can use serial command 0x95 to retrieve that.
- Lua io.open, io.read commands can be used to access the partition (named as “disk0”). For data safety, DON’T use Lua io.write command in Partition 0.
Partition1 (External U-Drv)
- External USB storage is defined as partition 1.
- This partition (named as “disk1”) can be accessed by Lua io.open, io.read commands
- In most of the case, it is for backing up the internal stored data (with Lua script)
Partition2 (on-board internal flash)
- This partition can be config in SGTools (project config)
- This partition (named as “disk2”) can be access by Lua io.open, io.read command

Note
We can assign a default value at run-time, by using "Page Function". The function will run before the host page is loaded.
PAGEs, Image-Resources and VP-Variables Ranges
Note:
*1. IMG_BKG must >1/2 of Full-Screen (SGTools auto resize to fit screen)
*2. IMG_ICON and IMG_ANI Size Limit
| Project resolution | Size Limit |
|---|---|
| 320x240 | 320x240 max. (Full-Screen) |
| 480x272 | 480x272 max. (Full-Screen) |
| 640x480 | 131072pixels (42% of Full Screen) |
| 800x480 | 131072pixels (34% of Full Screen) |
| 800x600 | 131072pixels (27% of Full Screen) |
| 1366X480 | 131072pixels (20% of Full Screen) |
*3. 1~128frame max.
*4. Memory Size may vary by model.
Elements in PAGE Limitation
Note:
*1. IMG_ICO for key-down display, IMG_BKG will be cropped to key size for key-down display
*2. Monitoring values
*3. Element display Size: 8x8 (MIN), except Bitmap Element
*4. The above limitation is to ensure the display performance, though it can be override by the “config.ini” in the SGTools installation folder. (Remember to backup the file before edit!)
System Registers
| Address | System Register | Descriptions | Note |
| 0xFFFF00
: 0xFFFF07 |
Timer_Ctrl0
: Timer_Ctrl7 |
D[0]=0 : stop the timer
D[0]=1 : start the timer D[1]=0 : count down, time down to 0x00000000 D[1]=1 : count up, time up to 0x7fffffff D[7:2]=000000 : reserved |
(*1) |
| 0xFFFF10 | RTC_Year | Value=0~99 | 0xffff10~0xffff16
should be written at the same time |
| 0xFFFF11 | RTC_Month | Value=1~12 | |
| 0xFFFF12 | RTC_Day | Value=1~31 | |
| 0xFFFF13 | RTC_Hour | Value=0~23 | |
| 0xFFFF14 | RTC_Minute | Value=0~59 | |
| 0xFFFF15 | RTC_Second | Value=0~59 | |
| 0xFFFF16 | RTC_Set | Value=1 : sync the time | |
| 0xFFFF20 | Buzzer | Value=0~63; buzzer beeping duration (*1) | See Project Setting for details |
| 0xFFFF21 | Backlight | Value=0~63; Real time backlight brightness setting (*1) | |
| 0xFFFF22 | ScreenSaverBacklight | Value=0~63; Screen Saver Backlight Brightness (*1) | see Screen Saver section for details |
| 0xFFFF23 | ScreenSaverPage_H | Value=0~999; Screen Saver display Page (*2) | |
| 0xFFFF24 | ScreenSaverPage_L | ||
| 0xFFFF25 | ScreenSaver Timer1_H | Value=0~65535; Screen saver delay time 1 (*2) | |
| 0xFFFF26 | ScreenSaver Timer1_L | ||
| 0xFFFF27 | ScreenSaver Timer2_H | Value=0~65535; Screen saver delay time 2 (*2) | |
| 0xFFFF28 | ScreenSaver Timer2_L | ||
| 0xFFFF30 | Font_CodePage | Font Code Page index value (*1) (*3) | |
| 0xFFFF31 | Font_Country | Font Country index value (*1) (*4) |
Note:
*1. Value can be update by command System_register_write (0xb3) to access the register
*2. Value should be written at the same time by command Sucesstive_write (0x82)
*3. Code Page index value
| index | Code Page | .......... | index | Code Page |
| 1 | 437(OEM United States) | 12 | 1252(ANSI Latin I) | |
| 2 | 737(OEM Greek437G) | 13 | 1253(ANSI Greek) | |
| 3 | 852(OEM Latin II) | 14 | 1254(ANSI Turkish) | |
| 4 | 860(OEM Portuguese) | 15 | 1255(ANSI Hebrew) | |
| 5 | 863(OEM Canadian French) | 16 | 1256(ANSI Arabic) | |
| 6 | 865(OEM Nordic) | 17 | 1257(ANSI Baltic) | |
| 7 | 866(OEM Russian) | 18 | 1258(ANSI/OEM Viet Nam) | |
| 8 | 874(ANSI/OEM Thai) | 19 | GB2312 (Simplified Chinese) | |
| 9 | 932(ANSI/OEM Japanese Shift JIS) | 20 | GBK (Simplified Chinese) | |
| 10 | 1250(ANSI Central Europe) | 21 | ECU-KR ( Korea ) | |
| 11 | 1251(ANSI Cyrillic) | 22 | BIG5 (Traditional Chinese) | |
| 0 | uni-code (with font config <3> TTF) |
*4. Country index value
| index | Code Page | .......... | index | Code Page |
| 1 | USA | 7 | DenmarkⅡ | |
| 2 | France | 8 | Sweden | |
| 3 | Germany | 9 | Italy | |
| 4 | UK | 10 | Spain | |
| 5 | DenmarkⅠ | 11 | Japan | |
| 6 | DenmarkⅡ |
