Close
0%
0%

TI-86 replica

TI-86 calculator replica based on STM32F407

Similar projects worth following
I started this project as way to learn about STM32F407 MCU. My goal was to make practically usable device for everyday use.
I am interested in calculator quite long time and when I was looking for appropriate calculator for my job, TI-86 was one of the best. Unfortunately, it was discontinued long ago. STM32F4xx was equipped enough to make one-chip-only TI-86 replica.

First of all, I wrote simple win32 application to make sure that I have enough information to start with this project. After seeing the calculator screen working I started preparing hardware.

I took 128x64 pixels LCD, STM32F407, breadboard, lot of buttons, some more parts for link connection and hardware was quickly prepared. Hardware signals (keyboard and link) are connected in the same signal order as on original hardware so no signal remapping is needed. The only modification to input or output data is shift.

This project uses Z80 simulator source originally written by Ian Collier. I saw this source as a part of Palm ZX Spectrum simulator for the first time. I used it for CP/M simulator and made some changes to be more accurate regarding flags processing. This is the core of calculator simulation.

Another part is LCD translation from TI-86 layout. LCD uses another layout so the display area is checked with every system tick and lines which have been modified are translated and sent to LCD. This part is written in ARM assembly to be more efficient. Translated data are sent using DMA.

Quite big challenge was power consumption. STM32F4xx can run up to 168MHz, but such fast memory has bad standby current (about 140uA for this device). Final solution now is: RAM is written to flash memory and MCU goes to deep sleep with RAM off. This backup is done some time (about 1 hour) after powering off so the flash is not re-written much. This solution has atvantage of RAM being backed-up for case of battery replacement.

Calculator replica has built-in gray link adapter. This is connected to USB CDC driver. This feature took quite a lot of time. Unfortunately not for code itself - after quite long time debugging I have found that TI connect doesn't support gray link on higher port numbers. After changing COM port number below 8 it started working.

CPU runs from internal 16MHz HSI oscillator (idle mode). If more power is needed, it runs from 64MHz PLL (USB or calculation mode). 16MHz and 64MHz is choosen to keep peripheral clock with the same frequency (16MHz) when switching between various modes.

To better understand TI-86 function, I had to write my own disassembler. This tool supports TI-86 ROM banking and allows to keep track of call names through long call ROM functions. This helped me to find one never seen feature of TI-86 hardware: battery monitoring. TI-86 replica emulates this hardware feature and reports low battery regarding measured battery voltage.

I also learned new features of ARM tools but unfortunately it led me to fighting with bug (objcopy and bug 1147). ROM contents is converted using objcopy directly to object file. If this bug is still there, manual editing is needed for object file (see comment in makefile). ROM file is not part of source files and has to be downloaded directly from your calculator.

I have to say that this replica is really usable tool and it has some advantages over original hardware (USB connection, LCD backlight). It would be nice to re-use some non-fuctional TI-86 as source for machanical parts, although I am not sure about real space for replica components.

  • 1 × STM32F407VGT6 Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × 64128L LCD 128x64 with ST7565R driver (serial bus)
  • 1 × 2xAAA battery holder
  • 50 × button tact switch

  • Tiva TM4C1294 port finished

    hynek01/27/2015 at 18:23 0 comments

    Finally I have finished port for TI's MCU Tiva TM4C1294. It took some time to learn how to program all necessary hardware. Photos of this prototype and all source files needed to run it are available on the project's web page.

    In contrast with STM32 version, Tiva version contains support for UART gray-link only. I was too lazy to port USB to this MCU just for fun :-) All other parts are working the same way as on STM32 version.

  • Ported on MCU from TI: TM4C1294 version

    hynek12/04/2014 at 11:51 0 comments

    I have prepared another hardware with TI's MCU: TM4C1294. If it is replica of TI's calculator, it should run on TI's MCU :-)

    So far it runs well. I still have to finish LowPower mode and some minor modifications needed for this MCU.

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates