simpleavr 399 Posted June 7, 2014 Share Posted June 7, 2014 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 Sinclair Scientific emulation 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. Here is a close-up photo. Eventually I build 3 of these and they are all gone. /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. I am posting the bits that's needed for whoever interested to build it. This is all that's there 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. 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 1 Quote Link to post Share on other sites
cubeberg 540 Posted June 7, 2014 Share Posted June 7, 2014 Awesome project! Quote Link to post Share on other sites
simpleavr 399 Posted June 10, 2014 Author Share Posted June 10, 2014 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). bluehash and abecedarian 2 Quote Link to post Share on other sites
bluehash 1,581 Posted June 10, 2014 Share Posted June 10, 2014 @@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. Quote Link to post Share on other sites
simpleavr 399 Posted June 10, 2014 Author Share Posted June 10, 2014 @@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. Quote Link to post Share on other sites
bluehash 1,581 Posted June 10, 2014 Share Posted June 10, 2014 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. Quote Link to post Share on other sites
jensma 0 Posted July 2, 2014 Share Posted July 2, 2014 Hey there! I just registered because of this awesome calculator! Any chance for a kit? Cheers! Quote Link to post Share on other sites
abecedarian 330 Posted July 2, 2014 Share Posted July 2, 2014 @@jensma - http://forum.43oh.com/topic/5537-group-buy-19o-tms08035-emulating-calculator-with-bubble-display/page-2#entry49067 Quote Link to post Share on other sites
simpleavr 399 Posted July 3, 2014 Author Share Posted July 3, 2014 @@abecedarian Happy cakeday Quote Link to post Share on other sites
abecedarian 330 Posted July 3, 2014 Share Posted July 3, 2014 Thanks @@simpleavr Quote Link to post Share on other sites
GeekDoc 226 Posted July 3, 2014 Share Posted July 3, 2014 You made Hackaday! Congratulations! EDIT: Okay, I see I am a day late with news, as usual... Quote Link to post Share on other sites
simpleavr 399 Posted July 9, 2014 Author Share Posted July 9, 2014 /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. 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. * 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. Tactile Buttons If you are using smd tactile buttons, you need to use long nose pliers to clamp the contacts into short pins. 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. bluehash 1 Quote Link to post Share on other sites
Mac 67 Posted July 10, 2014 Share Posted July 10, 2014 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 Quote Link to post Share on other sites
simpleavr 399 Posted July 10, 2014 Author Share Posted July 10, 2014 @@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 1 Quote Link to post Share on other sites
Mac 67 Posted July 11, 2014 Share Posted July 11, 2014 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.