Designed and developed by Victor
Lee of MicroTech Systems Limited ( www.mcu.hk
The term "MT System"
is the name given to a collection of 'pre-programmed' microcontrollers called
MT chips which are programmed using the TinyC programming language.
A suite of development software which includes a text editor, compiler, simulator
and downloader is provided free of charge for writing programs in TinyC. The MT
System and TinyC were designed and developed by Victor Lee of MicroTech Systems
Ltd in Hong Kong.
There is only ONE set of development software
for ALL types of MT chips. From the programmer's
point of view, it doesn't matter which MT chip the program is written for - the
same TinyC program will run on all types of MT chips. However, not all the TinyC
functions are supported by all types of MT chips - unsupported functions are simply
ignored by the MT chips if encountered. The various MT chips differ from each
other by the number of programs that can be stored in their flash memory, the
amount of run-time memory available, the number of I/O pins and the TinyC functions
The software development suite is wrapped together in an IDE
(Integrated Development Enviroment). The editor is the software
you use to write your TinyC programs. The compiler translates your written program
into object code that the MT chip can understand and execute. The downloader transfers
(via a serial cable) the object code into the flash memory of the MT chip. The
IDE also includes a simulator
and an RS232 test terminal.
The simulator can mimic a real MT chip by loading and executing the object code
produced by the compiler. The simulator provides a simple debugging tool for viewing
the results of a running TinyC program before downloading it to an MT chip. It
is a good way to test the logic flow (ie. execution steps) of the program.
The RS232 test terminal is a basic termianl program that can send and receive
data via the PC's serial port. It is useful for communicating with an MT chip
once it has been programmed and executing your code. It also includes a 'servo
controller console' which can control a number of servo motors using the MT Servo
Download the latest MT IDE
package, including sample programs
are based on the latest generation of 8051, Atmel AVR or ARM core flash microcontrollers.
These chips are pre-programmed with the MT system code. The MT system code is
a 16-bit run-time C interpreter that executes programs written in the TinyC
language. The MT system code has a built-in downloader that enables the chip to
be programmed directly via a serial connection to a PC, eliminating the need for
an separate IC programmer. This makes developing TinyC programs for MT chips simple
and easy. Note: MT chips use microcontrollers
that can be programmed up to 100,000 times so 'wearing out' the chip is not really
One of the major features of MT chips is that all the I/O pins can be used
for both input and output, generating pulses for speakers/devices, moving RC servos.
In addition any five I/O pins can be defined as external interrupt inputs.
MT chips also include onboard ADCs and/or DACs - these are all 10-bit resolution.
For further details of MT chips and how to use them please refer to the "MT
Chips Hardware Reference".
a C-like programming language used to develop programs for MT chips. Although
tiny in terms of data type and language constructs, and with just over a dozen
functions, it is still powerful enough for developing complex programs. It is
easy to learn and can be mastered in a short period of time, providing an easy
'stepping stone' to programming using a full blown C compiler. A TinyC program
can have a maximum size of 32K program words (64K bytes).
The syntax of TinyC follows the standard ANSI C language. It has fewer language
constructs but it does support up to five I/O pin interrupts, one timer interrupt
and recursion. The timer interrupt makes refreshing a 7-segment LED display possible
- something most other competing controllers are not capable of !
You can download the latest TinyC
If you want to see how easy
it is to program using TinyC then you can download a number of sample programs,
with demo videos, here.
between TinyC and standard ANSI C
not designed to be completely ANSI C compatible. It is a 'tailor made' version
aimed at developing programs for microcontrollers.. Users should be fully aware
of TinyC's limitations and added features before writing programs.
The following details the main differences between TinyC and standard ANSI C:
- No need for function
- Only one variable type
- int (integer).
No support for floating point numbers.
- Both global and local
variables are initialised to 0 at program startup.
- No need to specify function
return type (if used) - always assumed to be int.
- TinyC does not support
string type but does support literal strings and string constants.
- TinyC only supports
parameter passing by name (value), not by reference (address).
- Extra iteration construct
- loop - in addition to while, do..while and for
- In TinyC the <expression>
parts of looping statements cannot be empty.
- The <expression>
in the case part of a switch-case statement can
be any expression, not necessarily just a constant label expression.
code size (in 16-bit words)
number of characters in a single input line
number of characters in an identifier
number of characters in a file name
number of break statements within a looping statement
number of continue statements within a looping statement
number of functions in the whole program
number of function calls within a function
number of timer interrupts in the whole program
number of I/O pin interrupts in the whole program
number of string constants in the whole program
number of numeric constants in the whole program
number of global variable in the whole program
number of local variables within a function
of photos of various robots using MT chips can be seen here.