Close

I didn't choose the MCU ... it chose me!

A project log for TI-57 Programmable Calculator Hardware Retrofit

A modern MCU-based hardware replacement for the venerable TMC1501 used in the Texas Instruments TI-57 LED calculator.

tomcircuittomcircuit 02/28/2024 at 22:510 Comments

I like the STM32 ARM cortex MCU family. They are well documented, readily available, and cheap 'breakout boards' for them abound. The MCU retrofit must fit nicely in the space of a 28-pin 0.6" pitch DIP, so package size is key.  The STM32F103 is an ARM Cortex M3 MCU that can run at up to 64MHz from its internal 8MHz oscillator. It's available in a 5x5mm QFN36 package. It's also the same part (well, from the same family) as the MCU on the ubiquitous "Blue Pill" boards. So, there's a cheap evaluation platform available.

There are not so many other choices in small-yet-still-hobby-solderable-package MCU, so I really wanted to make the QFN36 device work. 

Of course, with 36 pins, that makes GPIO a bit scarce. I need 8 segment anode driver enables, 12 digit cathode sink pins, and 5 keyboard sense lines. That's about 3 too many. Also, making space for the 12 digit cathode ballast resistors (to achieve 5mA segment current) was clearly going to be tough. LED digit drivers with serial interfaces abound, and nice ones provide constant current sink outputs, eliminating the dozen ballast resistors. Well, ok, the driver has one resistor to set the current for the outputs, but that's a great convenience! I found a number of 16-output LED driver chips that use a simple serial interface. I opted for speed over pincount, and favored the simple serial "shift register like" interface over I2C. That means that the 12 digit cathode sinks can be controlled by just 3 GPIO pins - a net savings of 9 GPIO.

The other approach would be to use a 3-to-8 decoder, such as an 74HC138. This would allow the 8 segment lines to be controlled by only 3 GPIO. But, that doesn't eliminate the ballast resistors and only yields a net savings of 5 GPIO.

The STM32F103TBU6 has 128KB of onchip FLASH, which turns out to be far more than required. It also has SPI and UART and timers and all sort of other goodies that I probably won't need. 

So, we have a winner based upon package size, availability, and onchip goodies.

Discussions