Professional Documents
Culture Documents
Product No TU480x272C-XXX
Issue Date 1/4/2011
Document Ref 42779
General - 1
480X272 pixels
16 Million Colours
100 Page Display RAM
128M Byte Flash
4G+ Micro SDHC Slot
LED Backlight Control
5V Supply 3.3V Logic
ASCII + MultiFonts
Full RS232 Port
SPI - I2C Interfaces
Sync Serial Controller
USB 2.0 Interface
Resistive Touch Screen
Up to 12 x 12 Key Control
Up to 24 User Digital I/O
2 Analogue Inputs
2 PWM Outputs
Real Time Clock + Date
Run Animations
Auto Menu Control
Screen Rotation - 90, 180
Graphic User Interface
Integrated Debugger
Downloads
Full Specification (pdf)
Full Specification (compiled)
2D Mechanical
EMC Data
Module Part Number Price** RS232 RS485 Touch USB CN8 Battery Holder CANBUS Adaptor Note
TU480X272C-K612A1 Yes - - - - - -
-K612A1T €88 Yes - Yes - - - Standard
-K612A1TU* €89 Yes - Yes Yes - - Can use as Dev Kit
-K612A1TUB €90 Yes - Yes Yes Yes - Battery not included
-K612A1TUBC €104 Yes - Yes Yes Yes Yes Battery not included
TU480X272C-K611A1 Yes Yes - - - - -
-K611A1T €94 Yes Yes Yes - - - -
-K611A1TU €95 Yes Yes Yes Yes - - -
-K611A1TUB €96 Yes Yes Yes Yes Yes - Battery not included
-K611A1TUBC €110 Yes Yes Yes Yes Yes Yes Battery not included
* Main distributor stock item, other versions supplied to order. Pre-fitted connector options are available.
** Unit price excludes freight and VAT. Option to pay in GBP £
This product has been designed to simplify the implementation of TFT technology into your product. The high level text based object oriented
command structure, entity library and 100 page screen memory allow most of the processing to be undertaken by the TFT module leaving the host
CPU to concentrate on the core application processes. This allows proven firmware running on small 8 bit microcontrollers to be modified to drive this
TFT module with a minimum of work and risk.
Electrical Parameters
Parameter Sym Min Typ Max Unit Condition Note
Supply Voltage VCC 4.5 5 5.5 VDC VSS=0V Absolute Max 6.0VDC
Logic Supply Output VDD 3.2 3.3 3.4 VDC VCC=5V Max50mA
"H" VIH -0.5 - 3.4 (1) VDC VCC=5V /RES, K0-K24, SCK, /SS, HB, SIN,
Logic Input Voltage
"L" VIL VSS - VSS+0.5 VDC VSS=0V SCL,SDA
IOH=2mA
"H" VOH 3.0 - 3.4 VDC
VCC=5v
Logic Output Voltage K0-K24, SDA, SCL, SOUT, MB
IOL=-2mA
"L" VOL 0 - 0.7 VDC
VCC=5V
"H" Level Logic Input Current IIH - - 1.0 uADC VCC=5.5V /RES, K0-K24, SCK, /SS, SIN, SCL,
"L" Level Logic Input Current IIL - - 1.0 uADC VCC=5.5V SDA
CON Function 1/2 3/4 5/6 7/8 9/10 11/12 13/14 15/16 17/18 19/20 Note
CN5 USB/ SD Card Extension DA2 CDA CK DA0 0V 0V DM CNX - - SD Card Pins 1-10
DA3 3V3 0V DA1 CD 5V DP 0V - - USB Pins 11-16
CN6 Debug / Async Serial 3V3 DRXD DBG
0V DTXD 3V3 output max 50mA
CN7 8x8 Keyboard Matrix and 5V 3V3 K0 K2 K4 K6 K8 K10 K12 K14 3V3 output max 50mA
user I/O Ports 0V 0V K1 K3 K5 K7 K9 K11 K13 K15
CN8 USB Connector 5V power is provided from the PC. Standard Mini B connector can be omitted on user request.
CN9 SD Card Slot Micro SD Card holder allows permanent installation for large storage or upload to internal flash.
5V pins are common un-fused input /outputs. 3V3 pins are outputs only with a total 50mA capacity. Do not connect pins '-' or NC
Pin Assignments, Module Dimensions and Function Syntax Copyright 2010 Noritake Co Limited
Accessories - 2
Accessories
Noritake- Itron offers a range of accessories to get you up and running quickly.
Overview - 3
iSMART TFT Module Overview
Product Overview
This product has been designed to simplify the implementation of TFT technology into your product.
The high level text based object oriented command structure, entity library and multi page screen memory allow most of the processing to be
undertaken by the TFT module leaving the host CPU to concentrate on the core application processes. This allows proven firmware running on
small 8 bit microcontrollers to be modified to drive this TFT with a minimum of work and risk.
*option
Software Overview
Several customers have asked why we developed our own object oriented programming language rather than provide a product with Linux or an
operating system supporting compiled 'C'. If we look back at the original requirements we can see some of the reasons.
Prime: A combined operating and communication software offering unique capabilities for slave / host applications.
1/ The customer’s end user or distributor could write code and insert images to add in their own functionality with a text editor.
2/ The program code could be updated or expanded by the host system using ASCII text over a serial link.
3/ The product should be license free and use simple development tools.
4/ The customer can create his own large images and control them like fonts.
5/ The SD card should be able to stream video and audio with the minimum of user programming.
6/ Existing host software need only have limited changes to upgrade a display from 4X20 LCD to a full colour TFT.
7/ The module has the intelligence to operate as a host and the compact command language to act as a high speed slave.
8/ The number of commands should be minimized by using 'overloading' and provide a higher level of functionality than C functions.
9/ The parameters for interfaces and screen entities should be held in styles similar to HTML.
10/ The application development time should take days or weeks rather than months.
11/ If the software engineer leaves the company, it is relatively easy for the engineering manager to amend the program.
These reasons may not be key to your application, but we believe it does offer new product opportunities.
the CALC command. Buffers or variables can be created for interfaces, on-board memory, the SD Card, timers, counters and text. Hex code can
be included in text variables when prefixed by \\.
When creating your page structures and functions in a file, // prefixes user comments.
If an SD Card is used, the module will look for a file called ‘TU480A.MNU’ which will reference all other menu or image files. This may be your
only menu file with all functions included. It would have a header similar to the example below to copy other files on the SD card to the internal
flash memory. See the 'example projects' section
RESET(LIBRARY); FPROG;
LIB(BACKIMAGE,”SDHC/backmain.bmp”); //load background picture into the onboard flash library
LIB(STARTIMAGE,”SDHC/startbut.bmp”); //load start button into the onboard flash library
…….. FEND;
From Q1,2011, entities can be changed via the user interfaces by direct reference to there name or style
Examples:
homepage.back=“BLUE”; change the background colour of the page called homepage to blue
rs2.set=“96e”; change the rs232 baud rate to 9600 baud with even parity
StatusText=“Visual Error”;; change the text area called StausText to show Visual Error
GenText.font=“40X56Kata” change font size of all text using style GenText
We hope you find the 'getting started' and online examples suitable for understanding the functional techniques and rapid implementation in your
application. Please do not hesitate to contact our tech team by email for assistance. tech@noritake-itron.com
spi interface set up spi , tsync, rsync Receive OK, Transmit 26th Nov SPI
set = "MR100"; quick set up combination OK for receive
active= M or S or N; set as Master, Slave or None Slave Only
edge= R or F; uses Rising or Falling clock edge OK
speed = 100; set transmit speed in master mode
rxi= Y or C or N; set receive buffer interface as active OK
proc=“;” or \\0D or other process on receive string terminator OK
procDel = Y or N delete or keep termination character. OK
encode = s , w, m; s= single byte ASCII, w=2 byte UNI, m= UTF8 OK
rxb= num; set size of receive buffer in bytes OK
rxo= M or L; set receive data order OK
rxf = N , H; use none or hardware MB
rxs = N , Y; use select input \RSS. OK
txi= Y or E or N; set transmit buffer interface as active
end= "nn" byte returned when no data left in buffer
txb= num; set size of transmit buffer in bytes.
txo= M or L; set transmit data order
txf = N , H; none or hardware HB in Master mode
txs = N , Y; use select output \TSS in master mode
key i/o interfaces K23 is the highest order bit and K0 the lowest KEY
active ihigh is active “\\000000” >“\\FFFFFF” OK
inp high is input, low output“\\000000” >“\\FFFFFF” OK
trig high is trigger interrupt OK
edge high is rising edge, low is falling edge OK
keyb high is scanned keyboard connection OK
analogue converters adc1, adc2 are processed at 1000 samples per second OK ADC
active=N,1,2,12; set none, ADC1, ADC2 or both
calib1=function name; set user function to use for calibrate/scale ADC1
calib2=function name; set user function to use for calibrate/scale ADC2
avg1= 1-16; number of samples taken and averaged for ADC1
avg2= 1-16; number of samples taken and averaged for ADC2
System Set up the system. These parameters can be set at initialisation or at any time during operation by specifying the
parameter to be changed. Example: setup( system ){ bled=50; }. To change a setting
use a dot operator as follows: LOAD(system.bled,50);
startup=all; Displaying messages and progress bar at start up is configurable using startup=all or none or bar.
bled = 100; set backlight to OFF=0 or ON=100 (1-99 brightness levels available v4 PCB, v32 firmware)
wdog = 1000; set the watchdog time out period in milliseconds.
rotate = 0; set the rotation of the screen with respect to PCB. This is stored in EEPROM for use with boot messages.
test=hide/showTouchAreas; hide or show touch areas during product development
encode = s, w, m; menu text strings can contain single byte ASCII (s), 2 bytes for UNIcode (w) or multibyte for UTF8 (m)
calibrate = n; initialise the internal touch screen calibration screen. This automatically returns to the previous page on completion.
If it is necessary to abort then send setup( system ) {calibrate=n};
touchsamples = 20; Define th number of touch samples per interrupt. Defaults:4.3" = 12; 5.7" = 12; 7" = 22;
touchdebounce = 10; Define the time period between each sampling period. Defaults: 4.3" = 25; 5.7" = 30; 7" = 25;
touchaccuracy = 20; Define the 0.25 pixel accuracy of the samples. Defaults: 4.3" = 50; 5.7" = 14; 7" = 12;
system version The software and hardware versions can now be read to a serial port or text variable.
LOAD( RS2, VERS_IBOOT ) returns NAND bootloader version
LOAD( RS2, VERS_ILOADER ) returns main loader version
LOAD( RS2, VERS_IAPP ) returns main application version
LOAD( RS2, VERS_IMODULE ) returns module name and version
operational
Real Time Clock RTC The real time clock requires a battery to be fitted to the rear of the module or a 3VDC supply applied via a connector
fitted to the rear of the PCB. The default format is 14 Sep 2010 09:50:06 which can be modified to suit the
application which is achieved by loading the RTC into a variable having the required format. Another method is to
use predefined variables of individual RTC values.
SET RTC
The RTC is set using 24 hour time with LOAD( RTC, "YYYY:MM:DD:hh:mm:ss" );
with fixed format where:
- YYYY is year 1900-2099
- MM is month 01-12
- DD is day of month 01-31
- hh is hours 00-23
- mm is minutes 00-59
- ss is seconds 00-59
User changes the vars via buttons then a SAVE button would load the RTC
LOAD(RTC,years,":",months,":",days,":",hours,":",mins,":00");
READ RTC
You can LOAD the RTC into a variable where the format is specified in a style as follows:
STYLE( myRtcStyle, Data )
{
type = text; // Setup a text variable
length = 64; // with max length of 64 chars
format = "jS F Y g:ia"; // RTC format string
}
The RTC date/time can be displayed as a formatted string using special characters
> Day:
d Day of month with leading zeros 01-31
j Day of month without leading zeros 1-31
S Ordinal suffix for day of month st, nd, rd, th
> Month:
F Full textual representation of month January-December
m Numeric representation of month with leading zeros 01-12
M Short textual representation of month, three letters Jan-Dec
n Numeric representation of month without leading zeros 1-12
> Year:
> Time:
a Lowercase Ante meridiem and Post meridiem am, pm
A Uppercase Ante meridiem and Post meridiem AM, PM
g 12-hour format of hour without leading zeros 1-12
G 24-hour format of hour without leading zeros 0-23
h 12-hour format of hour with leading zeros 01-12
H 24-hour format of hour with leading zeros 00-23
i Minutes with leading zeros 00-59
s Seconds with leading zeros 00-59
> other characters not in list will be shown as is
Format examples:
"d M Y H:i:s" will display as: 14 Sep 2010 09:50:06 (default format)
"d/m/y" will display as: 14/09/10
"jS F Y g:ia" will display as: 14th September 2010 9:50am
Runtime Counter The RUNTIME counter uses pre-define variables which can be set and tested for values
The command Reset(RUNTIME) sets all vales to zero and starts the timer.
This runtime counter is independent of the real time clock and runs continually so no setup is required.
Example Usage IF(CNTMINS>30,FuncHalfHour); //if greater than 30 minutes run function called FuncHalfHour
TEXT(MinsText,CNTMINS);; //update counter value on page and refresh screen
operational
I/O Counters The 24 I/O counters use pre-define variables which can be reset and tested for value.
The counter uses an unsigned 32bit register (U32) with names CNTKxx where xx=00 to 23.
They require the I/O to be set as an interrupt but do not require an associated INT() command.
Counter increment depends on the rising or falling edge of the interrupt.
The command RESET(CNTK00) resets to zero the I/O counter on K00.
The maximum counter speed is 0-10kHz+ and is dependent on other interrupt and entity usage.
Example Usage IF(CNTK00>300,Func300); //if greater than 300 run function called Func300
TEXT(K00Text,CNTK00);; //update counter value on page and refresh screen
operational v40
RS232 Interface - 6
RS232 Interface - RS2
The asynchronous communication speed and parity can be set with the setup
command. The hardware lines RTS-CTS and DTR-DSR enable communication
between host and module and are selected by jumpers on the back of the
module. Only one pair can be selected at any one time. (RTS-CTS or DTR-
DSR).
setup(RS2)
{ //user must test the application to establish the maximum viable baud rate.
baud=38450; //num = 110 to 6,250,000. Any value can be set to allow trimming for deviating clocks i.e. 38450
data=6; //num = 5, 6, 7, 8
stop=15; //num = 1, 15, 2 - note 15 is 1.5 bits
parity=N; //first letter of Odd, Even, None, Mark, Space
rxi=Y; //set receive interface as active (Y), a command processing source (C) or disable (N). Default = N
proc=“;”; //process on receive termination character. See below
procDel=Y; //remove or keep the termination character(s) before processing
rxb=8246; //set size of receive buffer in bytes. Default = 8192 bytes maximum = 256K bytes.
txi=Y; //set transmit interface as active (Y), to echo command processing (E) or disable (N)
txb=8350; //set size of transmit buffer in bytes. Default = 8192 bytes
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
flow=N; //none (N), hardware RTS/CTS or DTR/DSR (H), software XON XOFF (S).
}
When sending commands (rxi=C) to the module, processing only occurs when \\0D or 0D hex is received.
Example: TEXT(MyText,"Hello World");;\\0D
Example usage
setup(RS2)
{
set="96NC" //quick set up combination "48, 96, 192, 384, 768, 1150 with parity N, O, E and Command option".
}
FUNC( SerRxEvent )
{
LOAD( Var, RS2 ); // Must read RS2 to clear interrupt
TEXT ( RecvTxt, Var);; //show received ASCII data on screen and refresh. To update, no style is specified.
}
RS485 Interface - 7
RS485 Interface - RS4
setup(RS4)
{
set="96NC"; //quick set up combination "48, 96, 192, 384, 768, 1150 with parity N, O, E and Command option".
}
setup(RS4)
{ //user must test the application to establish the maximum viable baud rate.
baud=38450; //num = 110 to 6,250,000. Any value can be set to allow trimming for deviating clocks i.e. 38450
data=6; //num = 5, 6, 7, 8
stop=15; //num = 1, 15, 2 - note 15 is 1.5 bits
parity=N; //first letter of Odd, Even, None, Mark, Space
rxi=Y; //set receive interface as active (Y), a command processing source (C) or disable (N). Default = N
proc=“;”; //process on receive termination character(s). See below
procDel=Y; //remove or keep the termination character(s) before processing
rxb=8196; //set size of receive buffer in bytes. Default = 8192 bytes, maximum 256K bytes.
txi=Y; //set transmit interface as active (Y), to echo command processing (E) or disable (N)
txb=8196; //set size of transmit buffer in bytes. Default = 8192 bytes
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
flow=N; //none (N), software XON XOFF (S).
duplex=F; //set Full Duplex (F) or Half Duplex (H). TBA
}
When sending commands (rxi=C) to the module, processing only occurs when \\0D or 0D hex is received.
Example: TEXT(MyText,"Hello World");;\\0D
Example usage
setup(RS4)
{
set="96NC" //quick set up combination "48, 96, 192, 384, 768, 1150 with parity N, O, E and Command option".
}
PAGE( PageName, PageStyle)
{
POSN(100,100); TEXT ( RecvTxt, "Example", stRecvTxt);; //show received ASCII data on screen
....
....
INT( SerRxInt, RS4RXC, SerRxEvent ); //Used when rxi=Y
}
FUNC( SerRxEvent )
{
LOAD( Var, RS4 ); // Must read RS4 to clear interrupt
TEXT ( RecvTxt, Var);; //show received ASCII data on screen and refresh. To update, no style is specified.
}
The asynchronous communication speed and parity can be set with the
setup commands. The host busy line (HB) stops the module from sending
data to the host. The use of the HB and MB busy lines are optional, and
can be connected together if not required.
When sending commands (rxi=C) to the module, processing only occurs when \\0D or 0D hex is received.
Example: TEXT(MyText,"Hello World");;\\0D
Example
FUNC( SerRxEvent )
{
LOAD( Var, AS1 ); // Must read AS1 to clear interrupt
TEXT ( RecvTxt, Var);; //show received ASCII data on screen and refresh. To update, no style is specified.
}
CANBUS Adaptor
When attaching a CANBUS adaptor type EMCBK33 to CN3 using a 10 way IDC cable, the connector is fitted to the backside of the module and the following
set up is required to match the default settings in the adaptor.
setup(AS1)
{
baud=38400; //num = 110 to 115200. Any value can be set to allow trimming for deviating clocks i.e. 38450
data=8; //num = 5, 6, 7, 8
stop=1; //num = 1, 15, 2 - note 15 is 1.5 bits
parity=N; //first letter of Odd, Even, None, Mark, Space
rxi=C; //set receive buffer interface as active (Y), a command processing source (C) or disable (N). Default = N
encode=sr; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
flow=H; //none, hardware RTS/CTS or DTR/DSR, software XON XOFF
}
The default receive address for the adaptor is ID=155h with 11bit or 29bitID
packets accepted (2.0a or 2.0b spec)
All bytes are received on AS1 with 1 to 8 bytes of data.
The transmit ID is also 155H. with data sent via AS1 with data length of 1.
Active
SPI Interface - 9
SPI Interface
setup(spi)
{
set="MR100"; //quick set up as Master/Slave, edge R/F, Command and speed 20-1000
}
setup(spi)
{
active=M; //set as Master, Slave or None for both transmit and receive. Default = N
edge=R; //uses Rising or Falling clock edge. Default = R
speed=100; //set transmit speed value in kilobits/sec from 20 to 1000 for master mode. Default = 100
rxi=Y; //set receive buffer interface as active (Y), a command processing source (C) or disable (N). Default = N
proc=“;”; //process on receive termination character(s). See below.
procDel=Y; //remove or keep the termination character(s) before processing
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
rxb= 8264; //set size of receive buffer in bytes. Default = 8192 bytes
rxo=M; //set receive data order as most significant bit (M) or least significant bit (L). Default = M
rxf= N; //use none or hardware MB to signify receive buffer full. Default = N
rxs=N; //use select input \RSS. Default = N
txi=Y; //set transmit buffer interface as active (Y), to echo command processing (E) or disable (N)
end="nn" //byte returned when no data left in display's spi transmit buffer and as a dummy byte to send if required.
txb=8244; //set size of transmit buffer in bytes. Default = 8192 bytes
txo=M; //set transmit data order as most significant bit (M) or least significant bit (L). Default = M
txf=N; //none or hardware HB used to signify halt transmit in master mode. Default = N
txs=N; //use select output \TSS in master mode. Default = N
}
When sending commands (rxi=C) to the module, processing only occurs when \\0D or 0D hex is received.
Example: TEXT(MyText,"Hello World");;\\0D
SPI receive active v32. Master and transmit plan 6th Feb
I2C Interface - 10
I2C Interface
The user must fit 10K pull up resistors to SDA and SCL somewhere on their I2C
bus.
setup(i2c)
{
set = "C7E"; //quick set up of I2C - Slave with Command and Address
}
setup(i2c)
{
addr="3E"; //address pair where nn for write and nn+1 for read with range 02 to FE.
end="\\00"; //byte returned when no data left in display's i2c transmit buffer
active=S; //set as Master (M) or Slave (S) or disabled (N). Default = N
speed=100; //set transmit speed value in kilobits/sec from 20 to 400 for master mode. Default = 100
rxi=Y; //set receive buffer interface as active (Y), a command processing source (C) or disable (N). Default = N
proc=“;”; //process on receive termination character(s)
procDel=Y; //remove or keep the termination character(s) before processing
encode=s; //s= ASCII single byte, w=UNICODE 2 byte, m=UTF8 multibyte
rxb=8192; //set size of receive buffer in bytes. Default = 8192 bytes
txi=Y; //set transmit buffer interface as active (Y), to echo command processing (E) or disable (N)
txb=8186; //set size of transmit buffer in bytes. Default = 8192 bytes
}
When sending commands (rxi=C) to the module, processing only occurs when \\0D or 0D hex is received.
Example: TEXT(MyText,"Hello World");;\\0D
Please view the I2C Master Mode example project from which this section is taken.
VAR(null,0,U8);
// measure temperature using I2C sensor which has 40ms processing time
// the 2nd byte of the load command defines the device base address. The iSMART adjusts this depending on read or write instruction.
// the 3rd byte defines the number of bytes to read after commands (4th+ bytes) are sent.
LOOP{readTempLoop,forever) {
LOAD(I2C,addr_temp,null,0); //addr_temp variable has \\72 for temperature sensor I2C address. Command 0 is sent with no bytes read.
WAIT(40);
LOAD(I2C,addr_temp,2); // read 2 bytes of data into I2C buffer
WAIT(2);
LOAD(temp_high, I2C); // each byte is read one at a time since raw data (encode=sr;) is defined in setup.
LOAD(temp_low, I2C);
IF(tuvar=1?convertt); //the function convertt is used to combine the 2 bytes and show degrees C or F according to user setting
TEXT(tempval, temp_high);; //update textbox and refresh screen
}
Operational
Keyboard Control
24 I/O lines (K0-K23) can be configured to scan a key matrix with up to 144 keys
configured using the setup commands for I/O control. When a key is pressed, a
function can be initiated using a key command.
No diodes are required in the key matrix for dual key operation making it ideal for low
cost membrane keyboards.
I/O Control
The module contains simple Input and Output functions for the 24 I/O lines (K0-
K23).All inputs include an optional pull-up resistor ~50K-120K in value. The outputs
can source ~1mA and sink ~3mA.
Certain I/O have expanded functions for customization.
NOTE: The ports K0 to K15 connect directly to the CPU without ESD protection. K16
to K23 have series 100R resistors and 10pF capacitors to GND.
setup(keyio)
{
active=\\0000FF; //high is active “\\000000” >“\\FFFFFF”, default is inactive
inp=\\00000C; //high is input, low is output “\\000000” >“\\FFFFFF”
trig=\\000001; //high is trigger interrupt “\\000000” >“\\FFFFFF” as defined by edge
edge=\\000000; //high is rising edge, low is falling edge “\\000000” >“\\FFFFFF”
keyb=\\000FF0; //high is scanned keyboard connection “\\000000”>"\\FFFFFF”
}
Single bit variables can be set and tested K00, K01, K02...K23 once enabled
8 bit variables can be set and tested KA, KB, KC, KD, KE once enabled
KA = K07,K06,K05,K04,K03,K02,K01,K00
KB = K15,K14,K13,K12,K11,K10,K09,K08
KC = K14,K12,K10,K08,K06,K04,K02,K00
KD = K15,K13,K11,K09,K07,K05,K03,K01
KE = K23,K22,K21,K20,K19,K18,K17,K16
SETUP(keyio)
{
active=\\000001; // set K00 to be active
inp=\\000001; // set K00 as input
trig=\\000001; // enable trigger interrupt on K00
edge=\\000000; // set to trigger in falling edge
}
PAGE(mypage,pagestyle)
{
//set up entities or keys on page
INT(myInt,K00,myEvent); // setup interrupt to call ‘myEvent’ on every K00 event
//rest of page
}
FUNC(myEvent) // This function is called each time a falling edge is detected on K00
{
// some actions
}
I/O counters CNTK00-CNTK23 The 24 I/O counters use pre-define variables which can be reset and tested for value.
The counter uses an unsigned 32bit register (U32) with names CNTKxx where xx=00 to 23.
They require the I/O to be set as an interrupt but do not require an associated INT() command.
Counter increment depends on the rising or falling edge of the interrupt.
The command RESET(CNTK00) resets to zero the I/O counter on K00.
The maximum counter speed is 0-10kHz+ but is dependent on other interrupt and entity usage.
Example Usage IF(CNTK00>300,Func300); //if greater than 300 run function called Func300
TEXT(K00Text,CNTK00);; //update counter value on page and refresh screen
operational v40
setup(pwm)
{
active=12; //use 12 to synchronize PWM 1 and 2. N=none
pol1=H; //polarity = High or Low on first phase of PWM1
pol2=H; //polarity = High or Low on first phase of PWM2
cycle1=“200”; //cycle time in microseconds of PWM1. Range 160Hz to 1MHz
cycle2 = “300”; //cycle time in microseconds of PWM2. Range 160Hz to 1MHz
duty1= “44”; //value of first phase as a percentage for PWM1 = 1-99
duty2= “56”; //value of first phase as a percentage for PWM2 = 1-99
delay= “50”; //delay between first phase of PWM1 and first phase of PWM2 in microseconds
}
The input voltage range is 0V to 3VDC max. Ref voltage is filtered from 3.3VDC.
ADC1 and ADC2 are sampled each 1ms using 10bit successive approximation.
If the result is copied to an 8 bit variable, the high order bits are used.
setup( adc )
{
active=12; //set none, ADC1, ADC2 or both
calib1=0.4; //set value to use for calibration/scaling of ADC1
calib2=0.2; //set value to use for calibration/scaling of ADC2
avg1=16; //number of samples read and then averaged for ADC1
avg2=16 //number of samples read and then averaged for ADC2
}
example usage
//TU480A.MNU Menu file for TU480X272C with single red pen.
STYLE(BlackPg, Page) { Back=\\00FF66;} //green background
STYLE(stGraphRed,DRAW){type=graph; col=red; width=4; maxX=490; maxY=300; curRel=CC; } //red pen for graph
SETUP( adc ){active=1; calib1=0.2; avg1=8; }
VAR(varADC1,0,U16);
VAR(PixXVal,1,U16);
Page(GraphPage,BlackPg)
{
POSN(240,136);
DRAW(MyGraphRed,480,272,stGraphRed);
LOOP(GraphLoop,FOREVER)
{
LOAD(varADC1,ADC1);
DRAW(MyGraphRed,PixXVal,varADC1);;
IF(PixXVal>478?[LOAD(PixXVal,1);RESET(MyGraphRed);]:[CALC(PixXVal,PixXVal,4,"+");]); //Move to next X Pixel
}
}
SHOW(GraphPage);
piezo - BUZZ
CN2 is a pin connector where the centre pin (2) is connected to a 30V FET switching
to 0V with maximum 200mA.
Users can attach a piezo sounder with integrated oscillator or similar low ripple
device to provide an audible output or drive an LED indicator.
The negative terminal of the device should be connected to the TFT and the positive
to a supply from 5V to 24VDC.
Command Overview - 12
Command Overview and Development Status
This page identifies the current and expected operating status of commands and styles
Click command view column for detailed description and check release dates which are subject to revision.
The commands have a YELLOW background and the styles a PURPLE background.
Run Time Counter Predefined variables which can be set and tested. OK RUN
The runtime counter is continually counting.
It is independent of the real time clock.
Reset(RUNTIME); resets counter to zero
LOAD(CNTSECS,23); set value of seconds
CNTMILLI increments every millisecond 0-999
CNTSECS increments every second 0-59
CNTMINS increments every minute 0-59
CNTHOURS increments every hour 0-23
CNTDAYS increments every day 0-n
To update a variable from a port using the equate sign e.g. VOLTS=34.5; will be available from end Jan 2011
Until then, please use LOAD(VOLTS,34.5);
System Commands - 13
System Commands
Command Description and Status
FPROG FPROG and FEND are used to program subsequent commands into internal flash memory. Use the RESET
……….. (LIBRARY) command before FPROG if the existing structure is to be replaced, otherwise the commands are
FEND appended to the existing structure.
Plan.
LIB(Name,Source) Store image, font, user font or user code file in the library.
Examples LIB(myimage,“rs2/myimg.bmp?back=\\FFFFFF&rotate=180&scale=75");
LIB(myimage,“rs4/mypic.bmp?back=\\FFFFFF”);
LIB(myfont,“spi/fnt?start=\\0000”);
The system does not yet recognize directory structures in the SDHC card.
Please put all active files in the root. All file names are 8 characters maximum length.
INC(Source) Include another menu, style or setup file in the current file. 7 levels of include are possible.
This command can be used to reference a file containing styles and commands on the
SDHC card so that it’s contents are included at that point in the command process.
This enables modular design of the menu system.
The system does not recognize directory structures in the SDHC card.
Please put all active files in the root. All file names are 8 characters maximum length.
RESET(Name) Clear the contents of the RunTime Counter, Delete List, Library Files or do a System reset.
Reset the System so that it re-boots as at power ON using RESET(SYSTEM)
Clear the runtime counter with RESET(RUNTIME);
Clear the EEPROM and reload defined variables RESET(EEPROM);
Clear the deleted entity list with RESET(DELETED);
Clear the library with RESET(LIBRARY); //Allows new program to load. Interface setup unchanged.
; Command separator used in menu files and data sent or received via serial interfaces. Example: RUN(HELP);
WAIT(“1000”);
Operational
;; Refresh the current page. Can be used for refreshing a page after a series of entity updates
without knowing which page is showing.
LOAD(VOLTS,"34");LOAD(AMPS,"100");;
Operational
[ cmd(..); cmd(...);.......cmd(..); ] The commands which require a function as a parameter ie IF, RUN, INT and KEY can have the function code
embedded inside the commands by enclosing the required code in square brackets.
This allows you to reduce the number of lines of code for simple functions and where the function is unlikely to
be used elsewhere.
Without inline:
KEY(keyFlr15,floor15fnc,104,84,TOUCH); //calls function floor15fnc
FUNC(floor15fnc)
{
LOAD(vReqd,15); TEXT(txtCurFlr,"15"); RUN(fncGo);
}
With inline:
KEY(keyFlr15, [ LOAD(vReqd,15); TEXT(txtCurFlr,"15"); RUN(fncGo); ],104,84,TOUCH);
Operational
Example:
In the Aircon example, the main page image has buttons which need a touch area located over each of them.
Position the cursor then draw a touch key area.
PAGE(MainPage,MainPgStyle)
{
POSN( 400, 208 ); KEY( StopKey, StopEvent, 95, 95, TOUCH ); //call function StopEvent
POSN( 76, 252 ); KEY( SaveKey, SaveEvent, 62, 24, TOUCH ); //call function SaveEvent
POSN( +80, +0 ); KEY( CalibKey, CalibEvent, 62, 24, TOUCH ); /call function CalibEvent
POSN( +80, +0 ); KEY( ClockKey, [Show(Clock);], 62, 24, TOUCH ); //inline code to show clock
}
Page Styles
The style defines the page size, position and background.
STYLE(stPage,Page) //create a style name and define as type Page
{
sizeX=480; //specify width of page 1 to 3* LCD width
sizeY=272; //specify height of page 1 to 3* LCD height
posX=0; //specify the absolute X position of page on screen. -4 * LCD width to 4 * LCD width
posY=0; //specify the absolute Y position of page on screen. -4 * LCD height to 4 * LCD height
back=black; //specify background colour of page as hex \\000000 to \\FFFFFF or colour name
image=pageimg; //specify background image of page as SDHC path or entity name using LIB.
}
Combine Variables, Buffers and Text and copy the result to a Variable or Buffer. This allows absolute text and
variables to be joined together and sent to an interface.
Example:
LOAD(num,2); //load variable num with value 2
LOAD(EditText,EditText,"D"); //Concatonate contents of EditText with D
LOAD(RS2,”DATE=”, DTIME , “; TEMP=“,ACTVAL, ”; \\0D\\0A”); //send concatenated data to RS232
LOAD(NumImg,"Image",num,".bmp"); //Create a name like Image2.bmp
LOAD(BasePage,BaseBack,BaseEnglish); //Create page from template pages
Text to Integer/Float
LOAD(MyInt,MyText); //The text string is parsed until a non-valid numeric value.
LOAD(MyInt,"1","2","3"); //MyInt = 123
If the string does not start with a number or +/- then the result is 0. v0.36
Example Pointers
To set/change which entity the entity pointer is pointing to you use '>' instead of ','.
LOAD( EntPtr1>"Var1" ); // Set EntPtr1 to point to Var1
LOAD( EntPtr1>"Var1",num,"3" ); // Set EntPtr1 to point to Var123 (very power full not found in C)
To put data or an entity name into the entity pointed to by the entity pointer use quotes.
LOAD( EntPtr1, "ABC" ); // Load the Entity pointed to by EntPtr1 with "ABC"
Operational
SHOW(Name) Show a Page on the Display or reveal a hidden Group or Entity
This puts the selected page on the top layer of the screen. If the HIDE() command has previously been used
for an entity, it will now appear on a page when the page is shown on the display.
Show(Page) can also used to refresh a page if entities have changed.
Reserved names provide relative navigation when the name of a page may not be known..
Show(PREV_PAGE); Show the page which launched the current page.
Show(THIS_PAGE); Refresh the current page
Show(Entity1, Entity2, Entity3...);; multiple show entities then refresh current page
Operational
HIDE(Name) Hide a Page, Group or Entity.
If the page on which a small sized page, group or entity is placed is showing on the screen and the page
refreshed, the named page, group or entity will disappear from view. Touch, external keys are disabled.
Hide(Entity1, Entity2, Entity3...);; multiple hide entities then refresh current page
Operational
DEL(Name) Delete a Page, Group, Entity, Variable or Buffer from SDRAM.
If visible on the display, it will remain until the page is refreshed. If the name refers to an image, font or file
stored in the flash library then this is set for memory to be freed using RESET(DELETED);
The command DEL(“LIBRARY”) is used prior to renewing all the application files.
Re-position a previously placed entity by specifying the new coo-ordinates and it's name.
This can be useful for indicator bars, simple movement animations and moving text.
Examples:
POSN(+25,+0); moves the cursor 25 pixels to the right.
POSN(236,48); absolute position of x=236, y=48.
POSN(24,56,CalcPage); position cursor on calc page at x=24, y=56.
POSN(VarX,Vary); use variables with absolute values to control position of cursor
POSN(VarX,Vary,VertBar); use variables to move an entity - vertical bar
POSN(TOUCHX,TOUCHY,MyRectCursor); move a cursor to the contact point on the screen.
Operational
TEXT(Name,Text,Style) Create or update Text. Use Carriage Return and Line Feed for multi line entry \\0A\\0D The font and colour are
defined in the style. If the cursor relative position is ’CC’ (Centre Centre) it is easy to locate text in the centre of
images like buttons. Text areas can overlap other text areas when for example a 'drop shadow' is required. Text
can include embedded hex codes to access Unicode fonts and a cursor.
Examples:
TEXT(EditBox,"Hello World",st8Red12); //creates Edit Box with user defined style st8Red12
TEXT(EditBox,"Hello People"); //modifies content of EditBox
TEXT(EditBox,TextVar); //modifies content of EditBox with content of variable
TEXT(EditBox,"Hello\\w0020World"); // example of unicode embedded character (see fonts page)
TEXT Styles
Fonts are available using single byte, 2 byte and UTF8 multi-byte coding.
Built in ASCII fonts have the reserved names Ascii8, Ascii16, Ascii32 (case sensitive).
Other library fonts are uploaded using the LIB command and have file type .FNT
These are available for download from the character fonts web page at www.itrontft.com.
Unique Font Overlay
It is possible to overlay one font over another to enable single byte operation with ASCII from 20H to 7FH and
Cyrillic, Greek, Hebrew, Bengali, Tamil, Thai or Katakana from 80H to FFH. The LIB command is used to load the
extended font at 0080H instead of it's normal UNICODE location. The style for a text can then specify
font="MyASCII,MyThai"; causing the Thai to overlap the ASCII from 80H to FFH.
Operational
DRAW(Name,X,Y,Style) Draw or update a Line, Box, Circle or Graph of size X,Y. The entities can be an outline or filled.
The colour can be enhanced using alpha blending within the draw style.
Graphs of a different colour can be superimposed on top of each other.
Example Draw
DRAW(MyCircle, 32, 32, DrawCircle);
DRAW(MyCircle, 64, 64); //modified circle is double diameter.
DRAW(MyBox,VarX,VarY); //modified box using variables. Should not exceed MaxX,maxY.
Graph
DRAW(MyGraph,100,100,GraphStyle); //draws a graph window of 100x100 pixels.
DRAW(MyGraph,20,30); //draws a pixel on the graph at 20,30 relative to the origin.
DRAW(MyGraph,varX,varY); //use variables to plot a pixel on the graph.
RESET(MyGraph); //clears the graph
Please refer to the ADC analogue input section for an application example.
Draw Styles
It is possible to specify transparency values with colours if the colour is entered as a 32-bit hex number the top 8
STYLE(stCircleRed,DRAW)
{
type=B; //Specify the type of shape to draw. type = B or Box , C or Circle, L or Line, G or Graph
col=red; //Specify the border colour of the shape. Use hex, colour name + alpha
width=1; //Specify the border width of the shape default = 1
back=\\00FF66; //Specify the fill colour of the shape. Use hex, colour name + alpha
maxX=160; // Declare the maximum width allowing for rotation
maxY=40; // Declare the maximum height allowing for rotation
rotate=0; // Specify the rotation of the shape with respect to the screen. 0,90,180,270
curRel=CC; //specify placement relative to cursor. CC Centre Centre , TC Top Centre,
} //BC Bottom Centre, LC Left Centre, RC Right Centre, TL Top Left,
// BL Bottom Left, TR Top Right, BR Bottom Right
Operational
IMG(Name,Source,Style) Draw or update an Image of size X,Y. Source has several techniques.
If an image is pre-stored in the library, it’s entity name is used for Source.
If it is to be directly loaded from the SDHC card the path is the Source.
Scaling and rotation can also be specified in the LIB command.
The system does not recognize directory structures in the SDHC card.
Please put all active files in the root. All file names are 8 characters maximum length.
Old version IMG(name,source,x,y,style); supported although x,y not used.
Example:
IMG(MyPic,TopBtnMyImage); //previously stored as TopBtn using LIB command
IMG(MyPic,"sdhc/TopBtn.bmp",90,60,MyImage); //stored on SDHC card
Image Styles
The image may be larger than the size specified so it is necessary to define how it will be scaled.
STYLE(MyImage,Image)
{
scale=100; // The image is scaled down or up by a percentage.
//Supports 5% steps below 100 and 100% steps above 100.
maxX=160; // Declare the maximum width allowing for rotation
maxY=40; // Declare the maximum height allowing for rotation
rotate=0; // Specify the rotation of the shape with respect to the screen. 0,90,180,270
curRel=CC; // specify placement relative to cursor. CC Centre Centre , TC Top Centre,
} // BC Bottom Centre, LC Left Centre, RC Right Centre, TL Top Left,
// BL Bottom Left, TR Top Right, BR Bottom Right
The touch area can have a One Touch function by using the built in style TOUCH or TOUCHR (repeat)
An external key can use the default style KEYIO.
Both thse built in styles process when the key is depressed.
For processing at press and release, create 2 keys at the same location with different styles, one with
action=DOWN; and the other with action=UP;.
When specifying an external key action, the values for X and Y indicate the contact points on the key board matrix
where K0 is \\00 through to K23 which is \\17 .
This method allows dual key press capability as in SHIFT key operation.
Key scan uses ports K0-K23 which can be configured as shown in the I/O section.
Switches connected to 0V should use the I/O interrupt command INT(...);
The last touch co-ordinates are stored in predefined variables TOUCHX and TOUCHY
The touch screen can be calibrated using the command setup( system ) { calibrate=y; }
The position of touch keys can be temporarily viewed as a grey area using
setup( system ) { test=showTouchAreas; } and hidden again using test=hideTouchAreas.
The built in style TOUCHR provides auto repeat after 1sec with 200ms repetition.
See the SYSTEM command for global touch screen debounce, sampling and accuracy parameters.
Examples KEY
Key(TopKey,TopFnc,90,50,MyTouch); a touch area 90x50 pixels. Create your own style MyTouch
Key(ExtKey,ExFunc,\\07,\\10,KEYIO); This external key operates when K7 and K16 connect.
Key(TKey,[Hide(SPage);Show(TPage);],50,50,TOUCH); Inline commands instead of function
Plan: Key(ExtKey,ExFunc,K07,K16,PushKey); This external key operates when K7 and K16 connect.
KEY Styles
Specify the source of key data. Touch debounce and sampling is setup globally in SYSTEM
If you require a dual action, specify 2 keys at the same location, one with action D and one with U.
STYLE(myTouch,key)
{
type=touch; //specify 'touch' screen or external 'keyio'
debounce=250; //Specify the time delay to allow external key press to stabilise in milliseconds.
delay=1000; //Specify the time delay before key auto repeat occurs in milliseconds. 0=off.
repeat=500; //Specify the repeat period if the key is held down in milliseconds
action = D; //Specify D or Down and U or Up. Specify the up or down action point for the key.
curRel=CC; //specify touch key placement relative to cursor. CC Centre Centre , TC Top Centre,
} //BC Bottom Centre, LC Left Centre, RC Right Centre, TL Top Left,
// BL Bottom Left, TR Top Right, BR Bottom Right
Operational.
Function Commands - 16
Function Commands
Command Description
RUN(Name) Run previously defined user code or functions.
User code is supplied in C and compiled by our firmware department subject to order.
Functions can be run as macros for compact menu design.
RUN(Func1); or RUN(Func1,Func23,Func3...FuncN); or a pointer to a function RUN(func-ptr);
Operational except User code TBD.
WAIT(Time) Wait for a period of milliseconds before processing menu commands.
Interrupts and key presses will still occur and can be processed.
Wait timer accuracy increased, now running off system tick timer (max error 200ns).
Wait is operational.
FUNC(Name) {…} Create a function called by commands which returns to the next command on completion. Functions can call
other functions and themselves. No storing or passing of variables occurs as these are all global even if created
in a function. Max 12 nested loops or functions.
Operational
VAR(Name,Value,Style) Create a variable having a certain style and a default value.
+ pointer usage A variable contains text or numbers which can be amended and be referred to as a single name in an equation
+ non volatile parameter storage or to show information on the display. Variable names must start with a letter or _.
Variables can be pointers to other variables and entities and use the '>' operator.
Non volatile parameter storage is also handled by VAR which initially loads the default value, then at
subsequent power ON reloads the last stored value which was saved using LOAD(varname,newval);
Example Numbers
VAR(lowval,32.4,FLT1); define lowval as a single decimal float and default value 32.4
VAR(lowval,22.4,FLT1E); define lowval as a single decimal float and default value 22.7
or load EEPROM value if already exists.
Use RESET(EEPROM); to clear and reload only current values.
Example Pointers
Create a pointer which is defaulted to null using the '>' symbol.
VAR(EntPtr1>"",PTR);
To set/change which entity the entity pointer is pointing to you use '>' instead of ','.
LOAD( EntPtr1>"Var1"); // Set EntPtr1 to point to Var1
To put data into the entity pointed to by the entity pointer, enclose data / source entity in quotes.
LOAD( EntPtr1, "ABC" ); // Load the Entity pointed to by EntPtr1 with ABC
The following commands now support entity pointers where ( | means 'or this')
> LOAD(name | ptr | "ptr", | > num | "txt" | var | ptr,...);
> CALC(var | ptr, var | ptr, num | var | ptr,"op");
> TEXT(name | ptr, "txt" | var | ptr,...);
> IF(var | ptr op num | "txt" | var | ptr ? func | func_ptr : func | func_ptr);
> KEY(name, func | func_ptr,...);
> INT(name, buf, func | func_ptr,...);
> SHOW(name | ptr,...);
> HIDE(name | ptr,...);
> RUN(name | func_ptr,...);
> IMG(name | img_ptr, lib | img_ptr,...);
STYLE(stVar, Data)
{
type = U8; // U8, U16, U32 - unsigned 8, 16 and 32 bit integer
// S8, S16, S32 - signed 8, 16, 32 bit integer
// TEXT for text strings
// FLOAT for higher resolution calculation
// POINTER for use with images
length=64; // For text, specify the length from 1 to 8192, default =32
decimal=3; // Specify the number of decimal places when type is float. Range 0 to 7, default=2
format="dd mm YY"; //Specify RTC format. see RTC page for format character types
location=SDRAM; //Specify the data location as SDRAM (default) or EEPROM
}
Operational
IF(Var~Var?Function1:Function2) Compare variables, buffers or text for value or length.
If true, do function1, if false do function2 (optional).
The ~ operator types can compare text length with another text or a numeric length.
The operators allowed for numeric values are: The operators allowed for text strings are:
=, == equal to =, == equal to
<>, != not equal to > greater than
< less than < less than
> greater than >= greater than or equal to
<= less than or equal to <= less than or equal to
>= greater than or equal to <>, != not equal
+ sum not equal to zero ~= same text length
- difference not equal to zero ~< text length shorter than
* multiplication not equal to zero ~> text length longer than
/ division not equal to zero ~! not same text length
% modulus not equal to zero
& logical AND
| logical OR
^ logical exclusive-OR
=- equal to the negative of
&& Boolean AND
|| Boolean OR
Examples:
IF(K0=“L”?HELPFNC); //single condition
IF(HIGHVAL < ACTVAL ? HIGHFUNC : LOWFUNC);
IF(STRVAR~>0? SHOWFUNC); //if STRVAR length > 0 show data
IF(STARVAL >= -STARTMP?SHOWSTAR);
IF(STARVAL > 0? [ LOAD(vReqd,15); TEXT(txtCurFlr,"15"); RUN(fncGo); ] ); //uses in line code [..]
Operational v18
LOOP(Name,Var1){...........} Repeats the specified actions a number of times in a PAGE then continue. Max 12 nested loops or functions.The
value for Var1 can be a number from 1-65000 or the text FOREVER. You can terminate a LOOP using the
command DEL(Name);
Examples:
LOOP(MyLoop,12){Show(Page1);wait(100);show(page2);wait(100);} //repeat 12 times
LOOP(MyLoop,FOREVER) {Show(Page1);wait(100);show(page2);wait(100);}
Operational v17 for use in PAGE. Use in FUNC expected 4th Feb.
INT(Name,Buffer,Function) If an interrupt occurs for the specified buffer, do function.
An interrupt will occur when a buffer’s style parameters allow activity within the buffer and the appropriate
type of interrupt is set.
Serial interfaces can trigger on a byte received, a byte transmitted and a
semi-colon (command separator) received. I/O can trigger on input change.
Use HIDE(Name); to disable an interrupt.
This is currently set to interrupt on each character received for the 'Buffer':
> RS2RXC = RS232 Receive Character
> RS4RXC = RS485 Receive Character
> AS1RXC = Async1 Receive Character
> AS2RXC = Async2 Receive Character
> DBGRXC = Debug Receive Character
> I2CRXC = I2C Receive Character
NOTE: The Buffer must be read to clear the interrupt otherwise the Function will keep getting called!
Example:
PAGE( PageName, PageStyle)
{
INT( SerRxInt, RS2RXC, SerRxEvent );
}
FUNC( SerRxEvent )
{
LOAD( Var, RS2 ); // Must read RS2 to clear interrupt
LOAD( RS4, Var); //send out of RS485 interface.
TEXT ( RecvTxt, Var);; //show received ASCII data on screen
// and refresh
}
Operational except for counters
CALC(Result,VarA,VarB,Method)
Numeric Handling
This provides a fast simple calculation placed in the Result variable according to the type
of method using + , - , / , *, %(modulus) or logical functions | (OR) & (AND) ^ (EXOR) for non float.
Trig functions are planned.
the length of 'src' then the cursor is placed after the last character.
'dst' and 'src' can be the same text variable.
'src' is unmodified unless same text variable as 'dst'.
Supported data types:
'dst' => text variable | pointer to text variable
'src' => text variable | pointer to text variable | "string"
'pos' => integer variable | pointer to integer variable | integer
Operational v37 except Trig functions Sin, Cos, Tan, CoTan TBA.
Reserved Words - 17
iSMART TFT Reserved Words
Words Description
; Terminate command
;; Refresh current page
ac97 audio buffer. adaptor connects to CN4
action Specify action point as Down or Up. Used in Key settings
I2C -- used Master (M), Slave (S) or None (N)
Key I/O -- high is active "\\000000" > "\\FFFFFF"
active
PWM / ADC -- None (N), 1 (1), 2 (2), both (12)
RTC -- enable (Y) or disable (N)
adc1 analogue to digital converter 1 processes at 1000 samples per second
adc2 analogue to digital converter 2 processes at 1000 samples per second
addr address pair where =nn write, =nn+1 read. Used with i2c interfaces
as1 async1 interface
as2 async2 interface
AS1RXC Async1 Receive Character
AS2RXC Async2 Receive Character
avg1 number of samples taken and averaged for ADC1 (1-16)
avg2 number of samples taken and averaged for ADC2 (1-16)
back Specify the back colour of the object
baud = 110 to 115200. Used for asynchronous interfaces
bled LED Backlight 0=OFF 100=FULL or use 1-99
buzz buzzer output
CALC Quick calculation and text manipulation eg. CALC(Result, Var1, Var2, Act)
calib1 set user function to use for calibrate/scale ADC1
calib2 set user function to use for calibrate/scale ADC2
calibrate used in setup(system) to calibrate touch screen
CAN CANBUS adaptor - 1Mhz - adaptor connects to CN3
CNTDAYS increments every day (0-n) Used with Runtime counter
CNTHOURS increments every hour (0-23) Used with Runtime counter
CNTMILLI increments every millisecond (0-999) Used with Runtime counter
CNTMINS increments every minute (0-59) Used with Runtime counter
CNTSECS increments every second (0-59) Used with Runtime counter
CNTK00-CNTK23 I/O counters which can be set up using interrupt and trig parameters
col Specify the text or border color
curRel Specify the relative placement of an object
cycle1 cycle1 value in microseconds
cycle2 cycle2 value in microseconds
data = 5, 6, 7, 8 Used for asynchronous interfaces
dbg debugger interface
DBGRXC Debug Receive Character
debounce Specify the time delay to allow a key
DEL Delete a page, entity eg DEL(Name)
delay Specify the time delay for auto repeat
delay delay in microseconds between pwm1 and pwm2
DELETED list of deleted entities
DRAW Create box, circle, line, pixel, shape eg DRAW(Name,X,Y,Style)
duty1 value as a percentage of High period
duty2 value as a percentage of High period
edge uses Rising(R) or Falling(F) clock edge
EEPROM internal EEPROM -- parameter storage using extended variables VarE
encode single byte of ASCII (s), 2 byte UNI (w), UTF8 (m) Used in system settings
end byte returned when no data left in buffer. Used with spi and i2c interfaces
FLOAT High resolution calculation data type
flow flow control - none (N), hardware (H), software (S) XON XOFF Used with asynchronous interfaces
font The ASCII based + extended fonts
format various characters specify the date and time format Used the real time clock and date settings
FPROG.....FEND Store SDHC menu and image files in onboard flash
FUNC Declare a set of commands eg FUNC(Name) {...}
HIDE Hide a page, entity eg HIDE(Name)
i2c i2c interface
I2CRXC I2C Receive Character
IF Evaluate condition and do func1 if true, func2 if false eg IF(Var~Var?Func1:Func2)
image Specify a background image for the page
IMG Image placement and manipulation eg IMG(Name,Source,Style)
INC Include the contents of another menu, style or setup file eg INC(FileName)
inp high is input, low output“\\000000” >“\\FFFFFF” Used with Key I/O interfaces
INT If interrupt triggered do function eg INT(Name,Buffer, Function)
KEY Designation of touch or key matrix
keyb high is scanned keyboard connection
keyio K23 is the highest order bit and K0 the lowest
LIB Load picture or font into library eg LIB(Name,Source)
LIBARY list of all items stored in the libary
LOAD Multi function copy page, variable N2--N.. to Name. eg LOAD(Name,N2,N3,N..)
LOOP Loop for a specified number of times eg LOOP(Name,Var){...}
maxLen Specify the maximum number per row (Max 512)
maxRows Specify the maximum number of rows (Max 32)
NAND NAND Flash supports a Proprietary structure
PAGE Specify contents of page eg PAGE(Name,Style) {...)
parity = Odd, Even, None, Mark, Space Used with asynchronous interfaces
POINTER Images data type
poll1 poll1 is High (H) or Low (L) on first phase
poll2 poll2 is High (H) or Low (L) on first phase
Styles List - 18
Styles
Styles enable you to maintain a common theme throughout your application and reduce the number of parameters required to be passed in the
Page, text, draw, image and key commands. A style is only used during the creation of an entity. When updating a text or an image, the style is
omitted from the command.
Plan: Style parameters can be updated using the dot operator except sizes and watchdog values.
LOAD(Txt32ASC.font,"ASCII8"); LOAD(Txt32ASC.rotate,varRotate); where varRotate holds 0,90,180 or 270.
Command Description
VAR(Name,Value,Style) VAR Data Styles
Specify your own style for integer, float, pointer or text or use a built in style name
STYLE(stVar, Data)
{
type = U8; // U8, U16, U32 - unsigned 8, 16 and 32 bit integer
// S8, S16, S32 - signed 8, 16, 32 bit integer
// TEXT for text strings
// FLOAT for higher resolution calculation
// POINTER for use with images
length=64; // For text, specify the length from 1 to 8192, default =32
decimal=3; // Specify the number of decimal places when type is float. Range 0 to 7, default=2
format="dd mm YY"; //Specify RTC format. see RTC page for format character types
location=SDRAM; //Specify the data location as SDRAM (default) or EEPROM
}
Operational
PAGE(Name,Style) {…….} Page Styles
The style defines the page size, position and background.
STYLE(stPage,Page) //create a style name and define as type Page
{
sizeX=480; //specify width of page 1 to 3* LCD width
sizeY=272; //specify height of page 1 to 3* LCD height
posX=0; //specify the absolute X position of page on screen. -4 * LCD width to 4 * LCD width
posY=0; //specify the absolute Y position of page on screen. -4 * LCD height to 4 * LCD height
back=black; //specify background colour of page as hex \\000000 to \\FFFFFF or colour name
image=pageimg; //specify background image of page as SDHC path or entity name using LIB.
}
Operational
DRAW(Name,X,Y,Style) Draw or update a Line, Box or Circle of size X,Y or Pixel at X,Y. The entities can be an outline or filled.
Draw Styles
It is possible to specify transparency values with colours if the colour is entered as a 32-bit hex number the top
8 bits specify the alpha blending level.
col = \\aarrggbb; back = \\aarrggbb; where aa = alpha level.
For example, col = \\80FFFF00; gives 50% transparent yellow.
STYLE(stCircleRed,DRAW)
{
type=B; //Specify the type of shape to draw. type = B or Box , C or Circle, L or Line, P or Pixel
col=red; //Specify the border colour of the shape. Use hex, colour name + alpha
width=1; //Specify the border width of the shape default = 1
back=\\00FF66; //Specify the fill colour of the shape. Use hex, colour name + alpha
maxX=160; // Declare the maximum width allowing for rotation
maxY=40; // Declare the maximum height allowing for rotation
rotate=0; // Specify the rotation of the shape with respect to the screen. 0,90,180,270
curRel=CC; //specify placement relative to cursor. CC Centre Centre , TC Top Centre,
} //BC Bottom Centre, LC Left Centre, RC Right Centre, TL Top Left,
// BL Bottom Left, TR Top Right, BR Bottom Right
Operational
IMG(Name,Source,X,Y,Style) Image Styles
The image may be larger than the size specified so it is necessary to define how it will be scaled.
STYLE(MyImage,Image)
{
scale=100; // The image is scaled down or up by a percentage.
//Supports 5% steps below 100 and 100% steps above 100.
STYLE(myTouch,key)
{
type=touch; //specify 'touch' screen or external 'keyio'
debounce=250; //Specify the time delay to allow a key press to stabilise. Value in milliseconds.
delay=1000; //Specify the time delay before auto repeat occurs. Value in milliseconds. 0=off.
repeat=500; //Specify the repeat period if the key is held down. Value in milliseconds
action = D; // Specify D or Down and U or Up. Specify the up or down action point for the key.
curRel=CC; //specify touch key placement relative to cursor. CC Centre Centre , TC Top Centre,
} //BC Bottom Centre, LC Left Centre, RC Right Centre, TL Top Left,
// BL Bottom Left, TR Top Right, BR Bottom Right
Operational for stylus. Touch with finger requires large key plus sampling parameter to be added.
Setup List - 19
Setup
Setups for the interfaces are shown below with an explanation of the parameters.
Interface Setup
System setup(system)
{
bled=100; //set backlight to OFF=0 or ON=100, 1-99 brightness levels available v4 PCB, v32
// firmware
wdog=100; //set the watchdog time out period in milliseconds.
rotate=0; //set the rotation of the screen with respect to PCB
test=showTouchAreas; //hide or show touch areas during product development
calibrate=n; //initialise the internal touch screen calibration screen. This automatically returns to
// the previous page on completion. If it is necessary to abort then send
//setup( system ) {calibrate=n};
encode=s; //ASCII handling with extended unicode/utf8 in occasional strings
}
Setup
setup(RS2)
{
baud=38450; //num = 110 to 115200. Any value can be set to allow trimming for deviating clocks i.e. 38450
data=6; //num = 5, 6, 7, 8
stop=15; //num = 1, 15, 2 - note 15 is 1.5 bits
parity=N; //first letter of Odd, Even, None, Mark, Space
rxi=Y; //set receive interface as active (Y), a command processing source (C) or disable (N). Default = N
proc=“;”; //process on receive termination character. See below
procDel=Y; //remove or keep the termination character(s) before processing
rxb=8246; //set size of receive buffer in bytes. Default = 8192 bytes
txi=Y; //set transmit interface as active (Y), to echo command processing (E) or disable (N)
txb=8350; //set size of transmit buffer in bytes. Default = 8192 bytes
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
flow=N; //none, hardware RTS/CTS or DTR/DSR, software XON XOFF
}
Setup
setup(RS4)
{
baud=38450; //num = 110 to 115200. Any value can be set to allow trimming for deviating clocks i.e. 38450
data=6; //num = 5, 6, 7, 8
stop=15; //num = 1, 15, 2 - note 15 is 1.5 bits
parity=N; //first letter of Odd, Even, None, Mark, Space
rxi=Y; //set receive interface as active (Y), a command processing source (C) or disable (N). Default = N
proc=“;”; //process on receive termination character(s). See below
procDel=Y; //remove or keep the termination character(s) before processing
rxb=8196; //set size of receive buffer in bytes. Default = 8192 bytes
txi=Y; //set transmit interface as active (Y), to echo command processing (E) or disable (N)
txb=8196; //set size of transmit buffer in bytes. Default = 8192 bytes
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
flow=n; //set n=none, s=software XON,XOFF
}
Setup
setup(AS1) //can setup AS1, AS2 or DBG
{
baud=38450; //num = 110 to 115200. Any value can be set to allow trimming for deviating clocks i.e. 38450
data=7; //num = 5, 6, 7, 8
stop=2; //num = 1, 15, 2 - note 15 is 1.5 bits
parity=N; //first letter of Odd, Even, None, Mark, Space
rxi=Y; //set receive buffer interface as active (Y), a command processing source (C) or disable (N).
//Default = N
proc=“;”; //process on receive termination character(s). See below
procDel=Y; //remove or keep the termination character(s) before processing
rxb=8246; //set size of receive buffer in bytes. Default = 8192 bytes
txi=Y; //set transmit buffer interface as active (Y), to echo command processing (E) or disable (N)
txb=8246; //set size of transmit buffer in bytes. Default = 8192 bytes
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
flow=N; //none, hardware RTS/CTS or DTR/DSR, software XON XOFF
}
Setup
setup(spi)
{
active=M; //set as Master, Slave or None for both transmit and receive. Default = N
edge=R; //uses Rising or Falling clock edge. Default = R
speed=100; //set transmit speed value in kilobits/sec from 20 to 1000 for master mode. Default = 100
rxi=Y; //set receive buffer interface as active (Y), a command processing source (C) or disable (N).
//Default = N
proc=“;”; //process on receive termination character(s). See below.
procDel=Y; //remove or keep the termination character(s) before processing
encode=s; //set s=ASCII, w=UNICODE, m=UTF8 or use sr, wr and mr specifying raw data bytes.
rxb= 8264; //set size of receive buffer in bytes. Default = 8192 bytes
rxo=M; //set receive data order as most significant bit (M) or least significant bit (L). Default = M
rxf= N; //use none or hardware MB to signify receive buffer full. Default = N
rxs=N; //use select input \RSS. Default = N
txi=Y; //set transmit buffer interface as active (Y), to echo command processing (E) or disable (N)
end="nn" //byte returned when no data left in display's spi transmit buffer and as a dummy byte to
//send if required.
txb=8244; //set size of transmit buffer in bytes. Default = 8192 bytes
txo=M; //set transmit data order as most significant bit (M) or least significant bit (L). Default = M
txf=N; //none or hardware HB used to signify halt transmit in master mode. Default = N
txs=N; //use select output \TSS in master mode. Default = N
}
Setup
setup(i2c)
{
addr="3E"; //address pair where nn for write and nn+1 for read with range 02 to FE.
end="\\00"; //byte returned when no data left in display's i2c transmit buffer
active=S; //set as Master (M) or Slave (S) or disabled (N). Default = N
speed=100; //set transmit speed value in kilobits/sec from 20 to 400 for master mode. Default = 100
rxi=Y; //set receive buffer interface as active (Y), a command processing source (C) or disable (N).
//Default = N
proc=“;”; //process on receive termination character(s)
procDel=Y; //remove or keep the termination character(s) before processing
encode=s; //s= ASCII single byte, w=UNICODE 2 byte, m=UTF8 multibyte
rxb=8192; //set size of receive buffer in bytes. Default = 8192 bytes
txi=Y; //set transmit buffer interface as active (Y), to echo command processing (E) or disable (N)
txb=8186; //set size of transmit buffer in bytes. Default = 8192 bytes
}
Character Fonts - 20
Character Fonts
Compact Narrow Fonts Wide Rounded Fonts
ASCII Base Page ASCII + European
PC437 (USA - European Standard) Cyrillic
PC850 (Multilingual) Greek
PC852 (Latin 2) Arabic
PC858 (Multilingual) Hebrew
PC860 (Portuguese) Bengali
PC863 (Canadian French) Tamil
PC865 (Nordic) Thai
PC866 (Cyrillic) Chinese/Japanese/Korean TBA
WPC1252 Hangul TBA
Katakana Katakana
You can include the character fonts required for an application by downloading the attached files and use the LIB command to store them
in memory. You can setup your system to process text as single byte, 2 byte UNICODE or multibyte UTF8. See the LIB command for installing
fonts. System fonts ASCII8,ASCII16 and ASCII32 are built in. The wide rounded fonts are preferred for higher quality designs.
It is possible to overlay one font over another to enable single byte operation with ASCII from 20H to 7FH and Cyrillic, Greek, Hebrew, Bengali,
Tamil, Thai or Katakana from 80H to FFH. The LIB command is used to load the extended font at 0080H instead of it's normal UNICODE location.
The style for a text can then specify font="MyASCII,MyThai"; causing the Thai to overlap the ASCII from 80H to FFH
Example
LIB( ascii24,”sdhc/asc_24.fnt”); //upload ascii 24 pixel wide font
LIB( cur24,”sdhc/cur_24.fnt?start=\\0080”); //upload currency font to 80H
In text style…
font=”ascii24,cur24”; //cur24 overlays ascii24 at 80H-8FH
COMPACT NARROW FONTS (Single Byte Range 20H to FFH or UNICODE Range 0020H to 00FFH)
The ASCII base page is included automatically at 20H-7FH and the other fonts are automatically loaded to 80H to FFH.
This gives a single byte range of 20H to FFH.
WIDE ROUNDED Fonts (Single Byte Range 20H to FFH or UNICODE Range 0020H to FFFFH)
When loading these fonts into library, it is necessary to specify the offset address for the first character of each
font table if a variation from UNICODE is required. The supplementary characters above FFFF are not supported in UTF8.
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
40px (8mm)
48px (9.6mm)
60px (12mm)
72px (14.4mm)
Unicode Range
0020 - 0217
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
0401 - 04F9
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
0374 - 03F3
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
060C - 06F9
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
0591 - 05F4
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
0981 - 09FA
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
0B82 - 0BF2
16px (3.2mm)
24px (4.8mm)
32px (6.4mm)
Unicode Range
0E01 - 0E5B
16x16 (3.2mm)
24x24 (4.8mm)
32x32 (6.4mm)
Unicode Range
3300 - 9FA5
16x16 (3.2mm)
24x24 (4.8mm)
32x32 (6.4mm)
Unicode Range
AC00 - D7A3
16x16 (3.2mm)
24x24 (4.8mm)
32x32 (6.4mm)
Unicode Range
30A1 - 30FE
Colour Chart - 21
Colour Chart
The colour chart below shows the built in colours of the TFT module. To clarify the reference name of a colour, hover over the hex code.
#4682B4 #041690 #6495ED #B0C4DE #7B68EE #6A5ACD #483D8B #191970 #000080 #00008B
steelblue royalblue cornflowerblue lightsteelblue mediumslateblue slateblue darkslateblue midnightblue navy darkblue
#0000CD #0000FF #1E90FF #00BFFF #87CEFA #87CEEB #ADD8E6 #B0E0E6 #F0FFFF #E0FFFF
mediumblue blue dodgerblue deepskyblue lightskyblue skyblue lightblue powderblue azure lightcyan
#AFEEEE #48D1CC #20B2AA #008B8B #008080 #5F9EA0 #00CED1 #00FFFF #00FFFF #40E0D0
paleturquoise mediumturquoise lightseagreen darkcyan teal cadetblue darkturquoise aqua cyan turquoise
#7FFFD4 #66CDAA #8FBC8F #3CB371 #2E8B57 #006400 #008000 #228B22 #32CD32 #00FF00
aquamarine mediumaquamarine darkseagreen mediumseagreen seagreen darkgreen green forestgreen limegreen lime
#7FFF00 #7CFC00 #ADFF2F #9ACD32 #98FB98 #90EE90 #00FF7F #00FA9A #556B2F #6B8E23
chartreuse lawngreen greenyellow yellowgreen palegreen lightgreen springgreen mediumspringgreen darkolivegreen olivedrab
#808000 #BDB76B #B8860B #DAA520 #FFD700 #FFFF00 #F0E68C #EEE8AA #FFEBCD #FFE4B5
olive darkkhaki darkgoldenrod goldenrod gold yellow khaki palegoldenrod blanchedalmond moccasin
#F5DEB3 #FFDEAD #DEB887 #D2B48C #BC8F8F #A0522D #8B4513 #D2691E #CD853F #F4A460
wheat navajowhite burlywood tan rosybrown sienna saddlebrown chocolate peru sandybrown
#8B0000 #800000 #A52A2A #B22222 #CD5C5C #F08080 #FA8072 #E9967A #FFA07A #FF7F50
darkred maroon brown firebrick indianred lightcoral salmon darksalmon lightsalmon coral
#FF6347 #FF8C00 #FFA500 #FF4500 #DC143C #FF0000 #FF1493 #FF00FF #FF00FF #FF69B4
tomato darkorange orange orangered crimson red deeppink fuchsia magenta hotpink
#FFB6C1 #FFC0CB #DB7093 #C71585 #800080 #8B008B #9370DB #8A2BE2 #4B0082 #9400D3
lightpink pink palevioletred mediumvioletred purple darkmagenta mediumpurple blueviolet indigo darkviolet
#9932CC #BA55D3 #DA70D6 #EE82EE #DDA0DD #D8BFD8 #E6E6FA #F8F8FF #F0F8FF #F5FFFA
darkorchid mediumorchid orchid violet plum thistle lavender ghostwhite aliceblue mintcream
#F0FFF0 #FAFAD2 #FFFACD #FFF8DC #FFFFE0 #FFFFF0 #FFFAF0 #FAF0E6 #FDF5E6 #FAEBD7
honeydew lightgoldenrodyellow lemonchiffon cornsilk lightyellow ivory floralwhite linen oldlace antiquewhite
#FFE4C4 #FFDAB9 #FFEFD5 #F5F5DC #FFF5EE #FFF0F5 #FFE4E1 #FFFAFA #FFFFFF #F5F5F5
bisque peachpuff papayawhip beige seashell lavenderblush mistyrose snow white whitesmoke
#DCDCDC #D3D3D3 #C0C0C0 #A9A9A9 #808080 #778899 #708090 #696969 #2F4F4F #000000
gainsboro lightgrey silver darkgray gray lightslategray slategray dimgray darkslategray black
Getting Started - 22
Getting Stared with iSMART TFTs
If you received a development kit with USB cable and SD card inserted into a xxx-K612A1TU module, just plug in the USB cable between a PC and
the display module. The boot code and operational software will load and then run the file TU480A.mnu from the SD card.
The supplied demonstration sequences through 4 screens. The elevator and aircon screens are working applications so you can press the touch
keyboard to operate. After 20 seconds of inaction, the demonstration moves on to the next screen.
After experimenting with the demonstration, review the basic applications below. Do not hesitate to send us an email for further explanation. Key
issues to understand..
1/ The system uses text commands rather than difficult to remember hex codes.
2/ All objects and functions are given a name for easy future referencing.
Interfaces are given pre-defined names like RS2 for RS232 and RS4 for RS485.
3/ Commonly used parameters are stored in 'styles' like in HTML web pages.
This reduces the number of commands from 250 in a conventional TFT module
to just 25 in iSMART TFTs with equal or better functionality.
A typical menu file's commands will be constructed and ordered as follows (detail removed for clarity):
LIB... //load in images and fonts from memory into library
LIB...
INC.. //include another menu file which may have global styles and setup.
STYLE... //define styles for pages, text, images used in this file
STYLE...
VAR... //create variables used for calculation, temporary storage and pointing
VAR...
PAGE(MAIN,styleMain) { //create a main page with text, images and associated keys
POSN... TEXT //place text at a specified position on screen
POSN... IMG //place icon / image at a specified position on screen
POSN... KEY //place a touch key area on screen and define function to call
}
INT... // Initialise interrupts for slave timers and inputs...not host interface - use setup with v39 software
SHOW(MAIN); // After pre-loading all style parameters, pages and functions, start the application with first page.
After this point, functionality follows page key presses and functions or incoming command data from host or interfaces.
When creating an entity for the first time, include the style parameter. To update the entity omit the style parameter.
If you specify the style again, you will create a copy.
Entities are layered on the screen from back to front in the order they are listed in the menu with the screen background defined in the page style.
If you want a button image to change colour, include one colour button in your background and the other colour button as a separate image over
the top. To change colour, just HIDE and SHOW the top button. This technique is used in the air conditioner project.
The examples below can be cut and pasted from their box into a text editor (NotePad).
Save the file as TU480A.mnu and copy onto the SD card.
Plug it into the iSMART TFT module, apply power and view the result.
Hello World from Internal Menu
// Menu file TU480A.MNU for Demo using TU480X272C and v32 firmware update
// Simple demo to display text
SHOW( MainPg );
//end
Hello World via RS232 IN with touch key to send RS232 OUT
/ / Menu file TU480A.MNU for Demo using TU480X272C
// 07-Oct-2010
// This example is identical to example 1 except RS232 is defined
// using setup for command mode at19200 baud, no parity
SETUP( RS2 )
{
set = "192NC"; // 19200 bps, no parity, command mode
}
SHOW( MainPg );
// Send text command to the display via RS232 : LOAD( mytxtVar, "Hello World" );;\\0D
// Note :-
// Sending 2 semicolons is equivalent to SHOW (currentpage);
// All command lines must be followed by CR (\\0D)
//If your system can send binary \\0D can be sent as 0DH
Example Projects - 23
Air Conditioning Control System
The Start button is stored separately and placed over the top of the stop button.
The commands HIDE and SHOW are used to control visibility.
The text areas are the ’21’ , the ’29’ , the ‘24.5’ , the ’monitoring…’
The touch areas cover the buttons (+ - + - SAVE CAL TIME STOP).
The changed HEAT and COOL parameters are stored in EEPROM
Download Images <zip>
// ------------------------------------------------------------------------------
// Air Conditioner Page
// ------------------------------------------------------------------------------
LIB( libImgAcBg, "SDHC/AirConBg.bmp" ); // Load background picture
LIB( libImgAcStart, "SDHC/AirConSt.bmp?back=\\76bbfe" ); // Load start button + transparency
LIB( fntAscii32, "SDHC/asc_32.fnt" ); // Load Ascii Font 32
LIB( fntAscii16, "SDHC/asc_16b.fnt" ); // Load Ascii Font 16
VAR( varRunDemo, 0, U8 );
VAR( varSecCnt, 0, U8 );
VAR( varCnt2, 1, U8 );
VAR( varDemoNum, 0, U8 );
POSN( -130, +117 ); TEXT( txtAcMsg, "Set Limits or press START", stTxt8Wht64 ); // Draw text for prompts
POSN( 238, 182 ); TEXT( txtAcAct, varAcAct, stTxt32Yel06 ); // Draw text for actual value
POSN( 400, 208 ); KEY( keyAcStop, fncAcStop, 95, 95, TOUCH ); // Stop
// Load green start button over top of red stop button and start touch area
IMG( imgAcStart, libImgAcStart, 95, 95, stGenImg );
KEY( keyAcStart, fncAcStart, 95, 95, TOUCH ); // Start
FUNC( fncAcHeatDn)
{
RUN(fncDemoPause);CALC(varAcHeat,varAcHeat,1,"-");TEXT(txtAcHeat,varAcHeat);IF(varAcCool=varAcHeat?fncAcCoolDn);;
}
FUNC( fncAcCoolUp )
{
RUN(fncDemoPause);CALC(varAcCool,varAcCool,1,"+");TEXT(txtAcCool,varAcCool);IF(varAcHeat=varAcCool?fncAcHeatUp);;
}
FUNC( fncAcUpd )
{
LOAD(varAcCnt,CNTSECS);
CALC(varAcAct,varAcAct,varAcDif,"+");
IF(txtAcMsg!="Set Limits or press START"?fncAcOn:fncAcOff);
TEXT(txtAcAct,varAcAct);;
}
FUNC( fncAcOff )
{
CALC(varAcTmp,varAcHeat,10,"+");
IF(varAcAct>varAcTmp?fncAcActHi);
CALC(varAcTmp,varAcCool,10,"-");
IF(varAcAct<varAcTmp?fncAcActLo);
}
The user can select a floor and travel from any floor to another floor.
The arrow is selected according to direction.
Warning signs for doors opening and closing are used.
Variables are used to store the current floor and destination floor.
An RS232 interface could be added to communicate with other floor indicators.
Download Image Files <zip>
// Create styles
STYLE(stLiftPg,Page){back=\\0000CD;}
STYLE(stLiftMainPg,Page){back=\\0000CD;image=libImgSelFlr;}
STYLE(stGenImg,Image) {curRel=CC;}
// Create vars
VAR(vS8,0,S8);
VAR(ptrLiftArr>"libImgUTri",PTR);
VAR(ptrLiftTens>"libImgGChar",PTR);
VAR(ptrLiftOnes>"libImgNum1",PTR);
VAR(vReqd,0,S8);
VAR(vThis,0,S8);
VAR(vMove,0,U8);
VAR( varRunDemo, 0, U8 );
VAR( varSecCnt, 0, U8 );
VAR( varCnt2, 1, U8 );
VAR( varDemoNum, 0, U8 );
POSN(160,249);TEXT(txtCurFlrLbl,"CURRENT FLOOR",stTxt32Wht64);
POSN(330,+0); TEXT(txtCurFlr,"G",stTxt32Wht64);
LOOP(lpLiftMain,FOREVER) {RUN(fncDemoUpdate);}
}
// Lift is moving
FUNC(fncMove)
{
IF(vThis>vReqd?[LOAD(ptrLiftArr>"libImgDTri");IMG(imgTri,ptrLiftArr);SHOW(imgTri);RUN(fncShowFlr);CALC(vThis,vThis,1,"-");]);
IF(vThis<vReqd?[LOAD(ptrLiftArr>"libImgUTri");IMG(imgTri,ptrLiftArr);SHOW(imgTri);RUN(fncShowFlr);CALC(vThis,vThis,1,"+");]);
IF(vThis=vReqd?[LOAD(vMove,0);HIDE(imgTri);RUN(fncShowFlr);RUN(fncDoorOpen);SHOW(pgLiftMain);]);
}
FAQ's - 24
Frequently Asked Questions
Please send your questions to tech@noritake-itron.com
We will try to respond within 24 hours (Monday to Thursday)
START PROGRAMMING
- What is needed to start a development with this TFT? Need SW-Development, HW Development-Kit ?
Hardware: TFT module plus SDCard plus SD Card Reader
Software: PC wit text editor (notepad) and image editor (paint or paint-shop) or download free iDevTFT software.
The main objective of this product was to avoid expensive development tools for the customer.
At this time the TU480A.mnu file on the SDCard must be edited externally using the supplied adaptor via a reader.
The USB cable is used only for easy supply of power.
When the SDCard is removed, the PC may ask for a USB driver. Press CANCEL to this request.
Once USB has been developed, this will allow the user to edit files and send via the USB.
1GB SD and SDHC 4G, 8G, 16G or 32G card can be used for im480c1.bin or other files.
2G SD not supported.
--------------------
- Can we program directly via the usb port into the flash ?
At the moment it is necessary to program and insert the SD card or send commands by async port.
The plan for USB is behind schedule but estimated from end Jan 2011
Production programming will then be possible via SDcard, serial port or USB.
The FPROG command will then transfer to onboard NAND flash for future power on initialisation without SD card.
-------------------
- Is the TFT interpreting a text based program language without the user compiling the software?
This is correct, although the TFT module internally converts the data to achieve the necessary speed.
The uploaded text menu files are discarded for security.
--------------------
-Is it possible to do screen captures for manuals or to run the interface on a PC as a simulator?
We supply iDevTFT for editing, local debugging and eventually PC simulation.
-----------------------
- The specification says that user code is generated at Noritake – will this be changed in the future?
The menu and function code is generated by the customer.
If the customer wants special functionality, we can produce a custom user software or (user code).
Some requests have been included as features in the main software.
--------------------
SD Card is the preferred method since customer can replace the card easily.
Customised firmware for writing to onboard 128M flash will be available.
--------------------
-GUI systems usually require dynamic memory (malloc and free), which has to be handled very carefully
in real-time systems. Are you using dynamic memory and if so, what system are you using?
The freeing of memory is a key issue.
We do have an equivalent to malloc and free.
Entities are created in the library and data area assigned.
When a DEL command (free) is used, the entry is marked
for deletion however the actual clean up is under user control
using the RESET(DELETED) command.
INTERFACING
-How many RS232 serial ports can this support?
There are 4 async ports as standard
A CMOS level 4 line ON CN3 and 2 line on CN6 and CN12 where present.
RS232 4 line on CN1 (includes DTR/DSR or CTS/RTS selection)
The K611A version modules include an additional full duplex RS485 port on CN1 which is common with CN12.
-----------------------
OTHER
- What is the response time of a keystroke?
The touch screen has 2 modes of operation.
1/ Calculate key on press or release allowing for defined debounce.
2/ Auto repeat after a defined period (delay) and resent until released (repeat).
It is possible to define a function to run on key down or/and key up.
This can be sent to a host interface or used internally for data entry or navigation.
------------------
-How is language support handled - is it possible to switch sets of strings for different languages?
Strings can be declared as variables and pointed to any text object.
Text data is internally processed and stored in UNICODE even though just ASCII may be used.
-On the current product we use a hybrid character set that is mostly western European but includes
some central European characters, so we can use the same fonts for Polish.
How would different character sets be handled?
Unicode fonts are available for 90% of the world's languages.
You can request selected additions for Eu50.
The user can create their own image fonts on a paint software and reference them to UNICODE values
-The application slows down as each minute passes and after ~16mins the system crashes.
A STYLE is only used during the first creation of a TEXT, DRAW or IMAGE command.
When updating in a LOOP, omit the style other wise a new entity is created.
Every entity remembers it’s position and parameters
//Incorrect --- constantly creates new text entities //Correct --- creates text entities once then updates