Description
I got introduced to a web based calculator emulation via this thread in 43oh.com forum.I got interested and start playing w/ the idea of implementing the emulation on an msp430, my code is based on Mr Ken Shirriff's work from the following pages. TI DataMath 2500II emulationsSinclair Scientific emulation
There is also a feature in HaD regarding Ken Shirriff's Sinclair Scientific work here.
Calculator Functions and Features
As this project emulates the original TI DataMath and Sinclair Scientific calculators, it operates exactly the same as the original ones. The keyboard layouts are similar in both calculators. On the PCB, the dominant key legends (on top of each key) are for TI DataMath, while the smaller legends (top and slightly left of each key) are for Sinclair Scientific emulating. I had select the MCU clock speed to be 8 Mhz, which appears to more or less matches the speed of the original calculators. I only observe the speed of the original calculators on youtube videos. The emulating calculator starts / defaults as TI DataMath. If you want to start the calculator as a Sinclair Scientific, hold down key "7" while turning on power. Holding down "4" while turning on power will place the emulator in a "slow CPU" mode, and it runs 8 times slower than usual as a TI DataMath. This will show how the display (as a register) changes during calculation cycles. Holding down "CE" while turning on power will briefly show a pre-entered message (8 letters). I added this feature to include personal message as I build these calculators as gifts. To enter a personal message, one can hold down "X" while turning on power. Pressing the keys 0, 1, 2 to 9 allows to select numerics and letters like a old cellphone keyboard, advance letter positions by pressing "+" key. The personal message will be saved in flash memory after the 8th letter has been entered. * note that the above key sequence is for Version 2 boards only. Version 1 boards uses different keys. ** there are changes to key sequence, please refer to my github (code section) repository for the latest.
Parts / Bill of Material
- 1 MSP430G2452, from your the Launchpad G2 (the "other" chip in the package), G2402, G2412 or G2432 will also work.
- 2 bubble led, from sparkfun ($2.95 ea)
- 20 tactile buttons, 6 x 3.5 x 2mm smd (ebay)
- 1 spdt dip size switch, no longer needed on V2 boards (NO NEED ANYMORE)
- 1 CR2032 cell holder, from DX ($3.14/20)
- 1 miniature 1.8mm red led thru-hole, forgot where I got it (see picture)
- 1 47k pull-up resistor
- 1 0.1uF by-pass capacitor
* most component can be found on ebay if you do not already process them. * different heights of the 6 x 3.5mm tactile buttons will work, I found the thinnest ones works best. Using smd switches will ensure the bottom is flat and won't poke your fingers. The miniature red led is to show the "negative" sign. The original calculators have 9 digit displays, since we have only 8 digit, I used a led to show the negative sign when needed. You can try different CR2032 cell holders, or even paper-clip diys, the pcb make provisions to mount different cell holders.
Schematic, Source Code and Build Hints
It is easier to understand the connections w/ the ascii art schematic, in my opinion. The ascii schematic is also included as part of the project source code.
MSP430G2452
-----------------
/|\| |
| | |
--|RST |
| | 2 x 4 digit bubble led
| digit 0 P2.0|----- +---------+ +---------+
| digit 1 P2.6|----- | % % % % | | % % % % |
| digit 2 P2.1|----- +---------+ +---------+
| digit 3 P2.2|--/-------+
| digit 4 P2.3|--/---|>--+ led (minus sign)
| digit 5 P2.7|--/-
| digit 6 P2.4|--/-
| digit 7 P2.5|--/- segment a to g + dot........
| | / ....\
| | / \
| segment A P1.2|-----+-----+-----+-----+-----+-----+-----+-----+
| | _=_ | _=_ | _=_ | _=_ | _=_ | _=_ | _=_ | _=_ |
| segment B P1.3|-o o-+-o o-+-o o-+-o o-+-o o-+-o o-+-o o-+-o o-+
| | _=_ | _=_ | _=_ | _=_ | _=_ | _=_ | _=_ |
| segment c P1.7|-o o-+-o o-+-o o-+-o o-+-o o-+-o o-+-o o-+
| | _=_ | _=_ | _=_ | _=_ | _=_ | _=_ |
| segment D P1.1|-o o-+-o o-+-o o-+-o o-+-o o-+-o o-+
| | _=_ | _=_ | _=_ | _=_ | _=_ |
| segment E P1.5|-o o-+-o o-+-o o-+-o o-+-o o-+
| | _=_ | _=_ | _=_ | _=_ |
| segment F P1.4|-o o-+-o o-+-o o-+-o o-+
| | _=_ | _=_ | _=_ |
| segment G P1.0|-o o-+-o o-+-o o-+
| | _=_ |
| segment H P1.6|-o o-+ (not all buttons populated)
| |
-----------------
The source code is in githubThere is also good amount of H/W information commented inside the codeIf you plan to design your own PCB, the basic principle in relationship w/ the code is
P1 for LED segments P2 for LED digits P1 also for key button scanning
You can move things around as long as you observe the above. I.e. If it fits better on your PCB, you could swap digit 1 w/ digit 3, segment A w/ segment E, etc, etc. All you need is to change #define in a header file and compile.
Comments
Please log in or sign up to comment.