Skip to content

ckormanyos/ti84-ref_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ti84-ref_app

build Issues Unlicense

ckormanyos/ti84-ref_app creates a fully functioning reference application for the TI-84 Plus monochrome graphics calculator. It runs in the open Asm(prgm) interface provided in the calculator's CATALOG menu. It uses the TI-84's on-board Z80 processor.

The reference application implements parallel blinky and hello-world text sequences. It boots through a small startup code and subsequently initializes a skinny microcontroller abstraction layer (MCAL). Control is then passed to a minimalistic cooperative multitasking scheduler. The application task (managed by the scheduler) directs the presentations of its associated ASCII-text messages.

The text sequences ON/OFF and hello/world are presented in cyclic, alternating fashion(s) on the calculator screen. Text is used since there is no actual LED present on the calculator-target system. This is intended to simulate an LED-blinky by toggling between ON and OFF. To make the program a little more interesting, an independent hello-world-task is supported as well. The ON/OFF messages are printed every $1s$ and the hello/world messages every $3s$.

Implementation details

The cooperative multitasking timebase is derived from a $1s$ tick. The underlying $32$-bit timer resides on ports 0x45-0x48, where the lower byte at port 0x45 is used. This timer is only available on the TI-84, not the TI-83.

The blinky ON/OFF and hello/world text messages are printed at rows $2$ and $3$, respectively, and both at column $6$.

A skinny main() subroutine in the soruce file app_main.c controls the program flow. After starting the multitasking scheduler with os_schedule(), it services the two alternating tasks app_led_task() and app_hello_task() based on their cycle times.

The application is written in the C language using the C23 standard. There is minimal use of assembly for startup and to interface with TI-83 Plus System Routines.

Running on the Calculator

Programming the calculator:

  • After build, locate bin/refapp.8xp.
  • Drag refapp.8xp onto the calculator using the standard method with TI Connect version 4. Important: Use version 4 for the TI-84 Plus.
  • The on-calculator name of the program is REFAPP.

To start the program, use the usual Asm(prgm) option found in the CATALOG menu and select the REFAPP program. The explicit keystrokes are listed below.

Let's execute the program on the calculator using keystrokes:

  • Hit $2^{nd}$-CATALOG.
  • Use the arrows to navigate down to the Asm( entry.
  • Hit the ENTER-key.
  • Then hit the PRGM-key.
  • Select REFAPP and hit the ENTER-key.
  • The calculator screen should now show Asm(prgmREFAPP.
  • Hit the ENTER-key and the program should start to run.
  • To exit the blinky ON/OFF and hello/world show, press the ENTER-key.
  • Clear the screen (if desired) with the CLEAR-key.

The running programm in the display-state ON/hello is shown in the image below.

Pre-built Program

A fully-built ref_app can be found in the bin directory. This pre-built program can be used to trouble-shoot the environment.

Tools and Build

This application uses the free sdcc toolchain. C-runtime initialization (i.e., static initialization prior to the call of main()) is supported with the file crt0.s in the startup directory.

The build system:

  • The build system uses GNUmake with a straighforward Makefile.
  • The build system is supported on both Win* and *nix.
  • The Win*-build requires a small selection of ported *nix tools. These are included in the wbin directory.
  • The on-calculator image is packed by BinPac8x v1.2.
  • Build results including HEX-File and the on-calculator image refapp.8xp are placed in the bin-directory.

Build on Win*

Prerequisites:

  • Install sdcc version 4.4 or higher.
  • Install python.

Then build in the command shell with:

cd ti84-ref_app\build
make all

Build on *nix

Prerequisites:

  • Install sdcc version 4.4 or higher.

Then build in the bash shell with:

cd ti84-ref_app/build
make all

Testing and Continuous Integration

Testing has been performed on the target system, which is a fully-functioning TI-84 Plus calculator purchased years ago from a commercial retailer.

Continuous integration is performed on GHA using a ubuntu-latest and macos-latest runners. The workflow run builds the application and verifies the presence of bin/refapp.8xp.

Aditional Details

Origins (and Reservations)

  • This project has been inspired by and influenced by numerous previous works, including (but not limited to) the azertyfun/LibTI project.
  • The aforementioned project was ground-breaking and excellent.

Please do, however, use this project at your own discretion and observe also the license details. This project is not in any way affiliated with Texas Instruments Inc, or any of its subsidiaries, including the educational products division.

Some of this software has been reverse engineered from other projects or terse technical notes. In addition, the software actively writes to calculator ports, such as port 0x40 and port 0x41. Personally, I do not consider this to be a $100\%$ sound basis for project reliability and/or stability.

Empirical evidence does, nonetheless, show a working, and fully/properly initialized C-language, non-trivial application. It provides a basis that seems to adhere to the established, common rules of modern C. Larger projects could potentially be built upon or modelled from this one.

References

  • TI-83 Plus System Routines, Third Release (Jan. 25, 2002), located here
  • SDCC Compiler User Guide, SDCC 4.4.1, Revision 14549 (at the time of writing this doc, Jan. 29, 2024), located here

Licensing