Jump to content

  • Log In with Google      Sign In   
  • Create Account

Photo

TMS0803/5 Emulating Calculator Build

TMS0803 TMS0805 Calculator Emulator

  • Please log in to reply
28 replies to this topic

#1 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 07 June 2014 - 05:07 PM

MSP430G2452 acting as a TMS0803 calculator chip.

Emulates TI Datamath 2500 and Sinclair Scientific.

 

There seems to be some interest in building this emulating calculator so I will start a build thread.

/EDIT add youtube video, different versions of PCBs, try to get everything in one place. 1st July. 2014

/EDIT add build tips down under, here 8th July, 2014

 

 

I got introduced to a web based calculator emulation via this thread.

 

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/1500? emulations 

 
Eventually I built the emulator on a standalone PCB design fitted w/ bubble leds from the '70 when the original calculators were made.
 
/EDIT add version 0, version 1 photos
 
This is the original failed build (w/ faulty 9 digit leds) and the 1st successful build. Next are the 1st two I built. They were given away a few weeks ago.
 
V1_01.jpg V1_03.jpg
 
Here is a close-up photo. Eventually I build 3 of these and they are all gone.
 
V1_04.jpg  
 
/EDIT add version 2 photos
I did a revised PCB to layout the buttons for better ergonomics, also adding a bypass cap and programming "loops" for in-circuit programming. I had proof-build one (from resurrected parts) and am waiting parts for a few more. There is another thread in this forum for a good build / buy.
 
v2_01.jpg v2_02.jpg v2_03.jpg v2_04.jpg

 

I am posting the bits that's needed for whoever interested to build it.

 

This is all that's there

calb01.jpg

 

1 MSP430G2452, from your Launchpad G2 (the "other" chip in the package)

2 bubble led, from sparkfun ($2.95 ea)

20 tactile buttons, 6 x 3 x 4.3mm, from DX ($4.76/100)

1 spdt dip size switch, from DX ($7.37/100)

1 CR2032 cell holder, from DX ($3.14/20)

1 miniature red led thru-hole, forgot where I got it (see picture)

1 47k pull-up resistor

 

* 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.

 

I am attaching the schematic here but it is not very readable, I started my pcb design by placing components 1st, make traces. And lastly I let Fritzing to auto route the schematic.

 

tms0800_4xs_schem.png

 

It is easier to understand the connections w/ the ascii art schematic, in my opinion

 

/EDIT corrected minus sign led, should be on P1.

               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|--/
            |     digit 5 P2.7|--/
            |     digit 6 P2.4|--/
            |     digit 7 P2.5|--/         segment a to g + dot........
            |                 |       /                                 ....\
            |                 |      /                                       \     (led for minus sign)
            |   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 github

 

 

 

There is also good amount of H/W information commented inside the code

 

If 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.

 

I will post the PCB separately. Also working on a better design and will post it also.


  • pine likes this
www.simpleavr.com :: breadboard good, use breadboard

#2 cubeberg

cubeberg

    Level 4

  • Members
  • 1,178 posts


Posted 07 June 2014 - 07:40 PM

Awesome project!

#3 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 10 June 2014 - 01:37 PM

I am attaching the original PCB image here, and a revised PCB that I am going to order.

 

The new PCB has less buttons, and I added a bypass capacitor. Plus it can fill another type of CR2032 cell holder (I want to use the lower profile ones).

 

tms0800_4xs_pcb.png tms0800_4xs20_pcb.png


  • bluehash and abecedarian like this
www.simpleavr.com :: breadboard good, use breadboard

#4 bluehash

bluehash

    Site Admin

  • Administrators
  • 5,465 posts

Posted 10 June 2014 - 02:03 PM

@simpleavr are the bubble leds available from elsewhere too?

Group buy open:

[Group Buy-19][O] TMS0803/5 Emulating Calculator With Bubble Display

 

Thanks for putting this together.


Stellarisiti - Join the new Tiva-C/Stellaris ARM Forums discussing Tiva-C(Stellaris) Microcontrollers.

C2kCentral - C2000 News, Projects and Forums
43oh - MSP430 Discussion, News, Projects and Hacks
MachineGrid - Robots, Hacks and Technology!


#5 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 10 June 2014 - 04:02 PM

@simpleavr are the bubble leds available from elsewhere too?

Group buy open:

[Group Buy-19][O] TMS0803/5 Emulating Calculator With Bubble Display

 

Thanks for putting this together.

 

I got them from Sparkfun and I think they are reasonably priced. I also saw it on tindie (can't find it now).

 

I don't know if you want to work your the pcb or use one of my versions. I am going to get 10 of the new design from Elecrow and build a couple more.

 

Let me know what you need. May be I can kit them up for Canadian members who may be interested.

 

I can upload the Fritzing files when you need them. Only thing is that it would only work on older versions (0.8.3). The buttons are 6.5 mm pin spaced and I have to do it w/ a custom part, which I had trouble moving the whole thing to 0.8.7b.


www.simpleavr.com :: breadboard good, use breadboard

#6 bluehash

bluehash

    Site Admin

  • Administrators
  • 5,465 posts

Posted 10 June 2014 - 04:26 PM

I got them from Sparkfun and I think they are reasonably priced. I also saw it on tindie (can't find it now).

 

I don't know if you want to work your the pcb or use one of my versions. I am going to get 10 of the new design from Elecrow and build a couple more.

 

Let me know what you need. May be I can kit them up for Canadian members who may be interested.

 

I can upload the Fritzing files when you need them. Only thing is that it would only work on older versions (0.8.3). The buttons are 6.5 mm pin spaced and I have to do it w/ a custom part, which I had trouble moving the whole thing to 0.8.7b.

Thanks.

I'll wait for the GB to grow to 10 and then see about placing the order. I'll let you know if there are any Canadians in the order.


Stellarisiti - Join the new Tiva-C/Stellaris ARM Forums discussing Tiva-C(Stellaris) Microcontrollers.

C2kCentral - C2000 News, Projects and Forums
43oh - MSP430 Discussion, News, Projects and Hacks
MachineGrid - Robots, Hacks and Technology!


#7 jensma

jensma

    Noob Class

  • Members
  • 2 posts
  • LocationGermany

Posted 02 July 2014 - 08:20 PM

Hey there!

 

I just registered because of this awesome calculator! Any chance for a kit? :)

 

Cheers!



#8 abecedarian

abecedarian

    Level 4

  • Members
  • 1,049 posts
  • LocationDundrinkingin Anlimentonic Encastle


Posted 02 July 2014 - 11:55 PM

@jensma - http://forum.43oh.co...ge-2#entry49067
Over here, doing "over here" things.

#9 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 03 July 2014 - 12:30 AM

@abecedarian

 

Happy cakeday


www.simpleavr.com :: breadboard good, use breadboard

#10 abecedarian

abecedarian

    Level 4

  • Members
  • 1,049 posts
  • LocationDundrinkingin Anlimentonic Encastle


Posted 03 July 2014 - 02:05 AM

:blush:

Thanks @simpleavr


Over here, doing "over here" things.

#11 GeekDoc

GeekDoc

    Level 4

  • Administrators
  • 1,394 posts
  • LocationO'Fallon, Illinois (St. Louis Metro area)
  • Sparkfun Wishlist


Posted 03 July 2014 - 01:03 PM

You made Hackaday!

Congratulations!

 

EDIT: Okay, I see I am a day late with news, as usual...


Public Service Announcement: I am a microcontroller / electronics noob! I should usually be quietly ignored or patiently instructed.
http://blog.DocsTech.net

#12 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 09 July 2014 - 03:04 AM

/EDIT Sep-24-2014 include feedback for builders.

 

Adding some assembly tips here.

 

General

 

  • Make sure you got the orientation of the msp430 mcu and led modules right. Square pads on the PCB means pin 1, other pins have round pads. Dots printed on ICs and display modules means pin 1. Match them up.
  • The top-most two tactile button positions are not to be populated, the firmware does not use it. I just put it there because it may be useful to have the extra buttons if you "roll-your-own" firmware and need them.
  • You should use a temperature controlled iron w/ clean (as clean as u can clean them) tips. * this tip in fact applies to all projects, also heat the component, not the solder. You will get clean joints that lasts.
  • I don't think it matters too much, but I would place, solder components based on their difficulty. So if there is a certain part that you find challenging (say negotiating the part, your iron, etc), do that one 1st. You should try to fit all components w/o attempt to solder and gauge which ones should go 1st. My order is battery holder, tactile buttons, leds misc and mcu last.
  • Some components are loose on their holes, you may want to use tape and or blu-tack to temporary secure them for soldering.
  • If you don't think you need to re-program the firmware, you can skip the 0 ohm bridge and the Gnd, Vcc loop bridge. They are for hooking up to the programmer.

 

v2_14.jpg

 

Bubble LEDs

 

The two led modules are a very tight fit against each other. And when you force them down into positions one or both may have a tendency to get loose and rise from the PCB. After doing 2 boards, I start to file down the contacting sides of the modules.

 

This helps them fit better w/o grinding into each other. As a side note, I also noticed that by removing the black paint on the adjacent edges allow lights to pass through, thus when the display is on you won't see too much of a "blocking" line between the 4 digits.

 

You can see the two displays on the right have been filed down on one of their edges. Also the black paints were removed.

 

v2_15.jpg

 

* Also make sure you position your LED modules correctly. Pin 1 should be at SW corner, the pad is a square pad on the PCB and there is a black dot on the LED modules (underside) to indicate Pin 1.

 

Battery Holder

 

The PCB can accept both thru-hole and certain kind of smd battery holders. For the smd type that fits (pin to pin at 20mm), you should use solder paste to make one side of the join. If you do not have, I would tin both the PCB pad and the contact 1st, then turn up my iron and heat thru from the top of the smd contact to make the join.

 

v2_16.jpg

 

Tactile Buttons

 

If you are using smd tactile buttons, you need to use long nose pliers to clamp the contacts into short pins.

 

v2_12.jpg

 

For both smd and thru-hole buttons, it is easier to solder on the top,  one pin at a time, lay out a full column of buttons at a time, then solder one side of pins. Continue w/ the other 3 columns. With all buttons have one pin soldered, check for alignment and use iron + tweezer to adjust. Finally solder down the other side of pins for all buttons.

 

When soldering, if needed you can use finger / tweezer to help secure position. The fit between the buttons and the holes are mostly ok. Unless your iron is not clean and you need to push around too much.

 

v2_13.jpg


  • bluehash likes this
www.simpleavr.com :: breadboard good, use breadboard

#13 Mac

Mac

    Level 2

  • Members
  • 245 posts
  • LocationMichigan, USA

Posted 10 July 2014 - 02:27 AM

Hi Chris (simpleavr),

 

Bravo!  The project looks great!  Unfortunately, I still can't figure out your ASCII art schematic so I'm trying to come up with something based off your printed circuit board.

 

If you get a chance could you take a look and tell me if I have the correct polarity on the "negative" LED, please?  Or, any other errors, for that matter?  I know I still have a few components to add (battery, power switch, and bypass cap).

 

Thanks.  Cheerful regards, Mike

Attached Thumbnails

  • Calculator Schematic (small).png


#14 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 10 July 2014 - 03:25 AM

@Mac

 

Thanks for trying to decode my badly organized schematic.

 

Comparing yours w/ what I had put out review wrongs on my side. I had mistaken the "negative" led be P2.2 and P2.3, It should be as what you noted (I assume you had observed it from the Fritzing generated schematic, but couldn't figure out the polarity as I just used a two pin header to represent the LED). I will correct all the ASCII schematics as soon as I can.

 

Checking w/ the code reviewed that for my PCB they should be P1.2 anode, P1.3 cathode, to match how I am driving it in the code.

 

        if (g_state&ST_MINUS) {
            P1OUT = BIT3;
            P1REN = 0x00;
            P1DIR = BIT2|BIT3;
            stays = 0x1c;
        }//if

Of course it will also do no harm if you have it reversed, we could just change the code.

 

As I mentioned, I do the layout based on routing convenience and the source code has been organized so that it will work by changing #defines. So you should not worry too much.

 

I had not check the row / column / scan line connections but as long as you observe

 

  • P1 for segments
  • P2 for digits
  • Segments (P1) also used for scanning.

 

You can just adjust these #defines to fit your PCB layout

 

#define SEG_A_P1    (1<<2)
#define SEG_B_P1    (1<<3)
#define SEG_C_P1    (1<<7)
#define SEG_D_P1    (1<<1)
#define SEG_E_P1    (1<<5)
#define SEG_F_P1    (1<<4)
#define SEG_G_P1    (1<<0)
#define SEG_d_P1    (1<<6)
,,,
#define DIGIT_0_P2  (1<<0)
#define DIGIT_1_P2  (1<<6)
#define DIGIT_2_P2  (1<<1)
#define DIGIT_3_P2  (1<<2)
#define DIGIT_4_P2  (1<<5)
#define DIGIT_5_P2  (1<<7)
#define DIGIT_6_P2  (1<<4)
#define DIGIT_7_P2  (1<<3)

For the 2 versions of PCBs I did, they are slightly different and I only need to change one of the #defines.

 

With different driving PINs used, the "raw" key scan-codes can be different. They have to be re-mapped in this hwkey_map matrix

 

Below I show the example of the mapping of digit 0

 

You can see the raw scan-code at the commented '0' location be 0x63, this matched my V2 PCB design where the zero button is connected between P1.3 and P1.6, thus 0x36 or 0x63 from our scanning function. We scan from MSB to LSB so all the raw scan-codes start w/ the higher value pin 1st, thus result in 0x63.

 

You can see the mapping array maps a value of 0x29, which is the raw scan-code of the TMS080x mcu. The TMS chip has an extra 4 scan-lines and the value it reads into it's register is in the range of 0x11 to 0x19 and 0x21 to 0x29. We have to map to these values so that the micro-code emulator can see the keys as like in the old calculators.

 

So if you have a different layout on buttons, you can just rework the mapping array and change this part of the code. You just need to make sure you are multiplexing on P1 pins only.

 

static const char hwkey_map[] = {       // converts to tms080x scan code
 
#ifdef V2
/*   [60]  [73]
   ^E[20]Cx[62] /[74]
    7[10] 8[61] 9[21]xC[43]
    4[40] 5[64] 6[42]/-[41]
    1[70] 2[76] 3[72]++[71]
   V0[30] 0[63]E.[32]-=[31]
*/
//     0     1     2     3     4     5     6     7
    0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 1
    0x27, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 2
    0x29, 0x22, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, // 3
    0x14, 0x24, 0x16, 0x21, 0x00, 0x00, 0x00, 0x00, // 4
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 5
    0x00, 0x18, 0x25, 0x29, 0x15, 0x00, 0x00, 0x00, // 6
    0x11, 0x23, 0x13, 0x00, 0x26, 0x00, 0x12, 0x00, // 7
    /*
        KN 1 2 3 4 5 6 7 8 9    // 11...19
        KO C = + - x / E . 0    // 21...29
        KO C v + - / x ^ E 0    // 21...29  (sinclair scientific)
    */
 
 

 

What kind of software did you use to generate the schematic? It looks simple and very clear and I would like to try it.

 

Let me know if you have more questions, they will help to debug the documentation and the design.

 

 

 

 


  • Mac likes this
www.simpleavr.com :: breadboard good, use breadboard

#15 Mac

Mac

    Level 2

  • Members
  • 245 posts
  • LocationMichigan, USA

Posted 11 July 2014 - 02:42 AM

Thank you for checking, Chris, but doesn't that code snippet suggest that P1.3 is high and P1.2 is low (P1.3 = anode and P1.2 = cathode)?

 

The wiring diagram was made using the drawing tools in Microsoft Excel.

 

I love those bubble displays but they're much too expensive for my budget so I thought maybe I'd try to build this project on a prototype board with standard displays.

 

I will add the missing battery, bypass cap, and power switch to my diagram and I would be happy to post it, if anyone is interested.

 

Again, very nice project!  Thank you for sharing.

 

Cheerful regards, Mike



#16 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 11 July 2014 - 11:31 AM

Thank you for checking, Chris, but doesn't that code snippet suggest that P1.3 is high and P1.2 is low (P1.3 = anode and P1.2 = cathode)?

 

The wiring diagram was made using the drawing tools in Microsoft Excel.

 

I love those bubble displays but they're much too expensive for my budget so I thought maybe I'd try to build this project on a prototype board with standard displays.

 

I will add the missing battery, bypass cap, and power switch to my diagram and I would be happy to post it, if anyone is interested.

 

Again, very nice project!  Thank you for sharing.

 

Cheerful regards, Mike

 

@Mac

 

Yes you are right P1.3 is high and should be anode, I always confuse about anode and cathode, they are better described IMO in Chinese as being yin and yang (like everything else), where yang goes to V+.

 

If it's Excel that you had used for the schematic, I will skip. But they do look nice.

 

In the github source code, there is also the original tms0800.c which uses a different layout saved 4 pins. The extra pins were used for serial UART and that version of code can connect to a terminal and the emulation runs as a single stepping disassembler where you can read the instructions, etc. Like Ken Shirriff's web based emulation.

 

I would be interested in seeing the final product, may be a couple of photos after it's done.


www.simpleavr.com :: breadboard good, use breadboard

#17 Mac

Mac

    Level 2

  • Members
  • 245 posts
  • LocationMichigan, USA

Posted 12 July 2014 - 05:09 AM

I hope this updated wiring diagram for v2 board may be useful.

 

Cheerful regards, Mike, K8LH

 

 

Attached Thumbnails

  • v2 schema (small).png

  • simpleavr likes this

#18 Mac

Mac

    Level 2

  • Members
  • 245 posts
  • LocationMichigan, USA

Posted 17 July 2014 - 04:44 AM

Hi Chris (simpleavr),

 

May I ask where is software for v2 board and which compiler, please?  I'm hoping it's CCS ???

 

Thanks...

 

Cheerful regards, Mike

 

<added>

 

Found it and I see you're using GCC...



#19 simpleavr

simpleavr

    Level 3

  • Members
  • 721 posts
  • Locationtoronto


Posted 17 July 2014 - 12:43 PM

Found it and I see you're using GCC...

 

Should compile w/ CCS though, I haven't really take the time to try it. But the template / skeleton used to be compiled on both. And there are tons of left-over space, so should be fine.

 

Also be careful when prototyping, there are no limiting resistors for the LEDs. If they looks "very bright", it's time to disconnect power. I know it's wrong, but I don't want led drivers and extra parts as I want this to be easy to solder and minimal PCB estate.


www.simpleavr.com :: breadboard good, use breadboard

#20 Mac

Mac

    Level 2

  • Members
  • 245 posts
  • LocationMichigan, USA

Posted 24 July 2014 - 04:13 PM

Chris (simpleavr),

 

Can you point me in the right direction to Ken Sherriff's TMS0803 Java Simulator code, please?  I apologize.  I've been searching but I just can't seem to find it.

 

TIA.  Cheerful regards, Mike






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users