TI-89 Titanium Calculator and C Programming
Not so long ago there was an article on Habré about the graphical calculator TI-83, and since I am the owner of the TI-89 Titanium - the next generation calculator from Texas Instruments, under the cut I decided to talk about it and show how you can create your own for this calculator own programs in C.
Unlike the TI-83, which is based on an 8-bit z80 microprocessor, the TI-89 Titanium is created using the 32-bit Motorola 68000:
In addition, the TI-89 Titanium has a number of other improvements. Here I will give his brief characteristics:
Processor - 12 MHz MC68000, screen - monochrome, 160x100 pixels, 256K RAM (188K available to the user), 4M Flash ROM (approximately 2.7M available to the user), Standard I / O (never used), USB Mini Port (used for exchange information with a regular computer):
It is powered by four AAA batteries (I must say that it consumes quite a lot, so with intensive use of the battery you have to change it quite often). There is also an additional battery that saves the settings when replacing the main batteries:
There are many resources on the Internet devoted to TI calculators and, in particular, TI-89 Titanium. An example is www.ticalc.org. On this resource you can find a huge number of different descriptions, programs and source codes for this and other TI calculators, for example, toys.
In fact, this calculator is intended for mathematical calculations, and contains CAS (computer algebra system), which allows you to perform not only numerical calculations, but also calculations in symbolic form:
But we are interested in how to create our own programs in C. For this, there is a tigcc compiler (http://tigcc.ticalc.org) created based on gcc. Unfortunately, this project has not been updated for a long time, but, nevertheless, the compiler is working. Download it and install it on your workstation under Linux. After that, we compile with it some simple console application like “Hello world!” and we get the file with the extension 89z. This is our executable file.
The next step is to upload our program to the calculator. To do this, install the tilp application by executing "sudo apt install tilp2", connect the USB cable and run tilp. Next, select the files that you want to upload (for example, our program) and start the upload process. As soon as one or several files are uploaded to the calculator, you can see their list by pressing 2nd + VAR-LINK. In order to run the downloaded program, you need to go to the calculator in HOME, where the usual calculations are done and type the name of the program, and put parentheses behind it, that is, simply call the program as a function without arguments.
Regular console programs are not so interesting, so there are functions for rendering various primitives on the screen, reading input from keys, etc. As one of the interactive applications, I adapted my program for playing reverse. It looks like this:
Sources for this program can be downloaded from my site here .
It should be noted that, unfortunately, tigcc is not able to optimize the code well, so the programs are not the fastest. This can be corrected if you write in assembler, and at the same time understand how Motorola 68000 has a better command system than x86. Many sample assembler programs can be downloaded from ticalc.org.
And last but not least. If you don’t have such a calculator, you can still play with it. To do this, you must install the emulator "sudo apt install tiemu", which looks and works exactly like its iron brother:
Unlike the TI-83, which is based on an 8-bit z80 microprocessor, the TI-89 Titanium is created using the 32-bit Motorola 68000:
In addition, the TI-89 Titanium has a number of other improvements. Here I will give his brief characteristics:
Processor - 12 MHz MC68000, screen - monochrome, 160x100 pixels, 256K RAM (188K available to the user), 4M Flash ROM (approximately 2.7M available to the user), Standard I / O (never used), USB Mini Port (used for exchange information with a regular computer):
It is powered by four AAA batteries (I must say that it consumes quite a lot, so with intensive use of the battery you have to change it quite often). There is also an additional battery that saves the settings when replacing the main batteries:
There are many resources on the Internet devoted to TI calculators and, in particular, TI-89 Titanium. An example is www.ticalc.org. On this resource you can find a huge number of different descriptions, programs and source codes for this and other TI calculators, for example, toys.
In fact, this calculator is intended for mathematical calculations, and contains CAS (computer algebra system), which allows you to perform not only numerical calculations, but also calculations in symbolic form:
But we are interested in how to create our own programs in C. For this, there is a tigcc compiler (http://tigcc.ticalc.org) created based on gcc. Unfortunately, this project has not been updated for a long time, but, nevertheless, the compiler is working. Download it and install it on your workstation under Linux. After that, we compile with it some simple console application like “Hello world!” and we get the file with the extension 89z. This is our executable file.
The next step is to upload our program to the calculator. To do this, install the tilp application by executing "sudo apt install tilp2", connect the USB cable and run tilp. Next, select the files that you want to upload (for example, our program) and start the upload process. As soon as one or several files are uploaded to the calculator, you can see their list by pressing 2nd + VAR-LINK. In order to run the downloaded program, you need to go to the calculator in HOME, where the usual calculations are done and type the name of the program, and put parentheses behind it, that is, simply call the program as a function without arguments.
Regular console programs are not so interesting, so there are functions for rendering various primitives on the screen, reading input from keys, etc. As one of the interactive applications, I adapted my program for playing reverse. It looks like this:
Sources for this program can be downloaded from my site here .
It should be noted that, unfortunately, tigcc is not able to optimize the code well, so the programs are not the fastest. This can be corrected if you write in assembler, and at the same time understand how Motorola 68000 has a better command system than x86. Many sample assembler programs can be downloaded from ticalc.org.
And last but not least. If you don’t have such a calculator, you can still play with it. To do this, you must install the emulator "sudo apt install tiemu", which looks and works exactly like its iron brother: