MT System and TinyC
Designed and developed by Victor Lee of MicroTech Systems Limited ( )

MT System
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 they support.

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 Controllers.

Download the latest MT IDE package, including sample programs

MT Chips
MT chips 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 a problem!

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.
Some 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".

TinyC is 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 Programming Reference

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.

Differences between TinyC and standard ANSI C
TinyC was 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:

TinyC Language Limits

Maximum code size (in 16-bit words) 32760
Maximum number of characters in a single input line 300
Maximum number of characters in an identifier 30
Maximum number of characters in a file name 100
Maximum number of break statements within a looping statement 100
Maximum number of continue statements within a looping statement 100
Maximum number of functions in the whole program 100
Maximum number of function calls within a function 100
Maximum number of timer interrupts in the whole program 1
Maximum number of I/O pin interrupts in the whole program 5
Maximum number of string constants in the whole program 200
Maximum number of numeric constants in the whole program 200
Maximum number of global variable in the whole program 200
Maximum number of local variables within a function 200

Photo Gallery
A number of photos of various robots using MT chips can be seen here.