Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
I have set myself the task of building my own scientific calculator using the ATMEGA328. I have drawn up a circuit (on paper, I'll try to make a computer version that is more usable) and I want to have a second set of eyes looking at it just to make sure that I'm not going to blow anything up. The 7 segment displays on the top are common cathode displays, not common anode. Other than that and the status led's underneath the 7 segment displays it should be pretty self-explanatory. I'll see if I can get a more readable version up here soon. Thanks in advance!

EDIT:: The SN74HC595 chips are serial to parallel output shift registers for those who don't know.

It's a good start. The first thing that I spot is that the display is not going to work the way you intend. If you're going for a persistence-of-vision display, you'd want something like a multiplexer, not a shift register, attached to the common cathode of the displays. As drawn, your displays will spend most of their time (1) blank or (2) showing the exact same digit. A better solution would be to have a shift register attached to each display, then a multiplexer multiplexing which shift register was receiving a clock pulse. You would then need 3 pins/bits to select 1-of-8 shift registers, a 4th pin to clock that shift register, and a 5th pin to choose the bit being clocked in. Maybe a 6th pin to clear all the shift registers. You could therefore select the first shift register, clock in all the bits for the first 7-segment display, select the second shift register and repeat, ... to the 8th register.
Yeah, I was going for a persistence of vision display and you are correct in that only one digit would be lit up at a time. I hear what you are saying about the multiplexer but I'm not entirely sure how much it would gain on this small of a scale. I'm actually going to try and wire this up today on a breadboard to see if it works (because I have the shift registers on hand.) If not, I'll explore a multiplexer per your suggestion but my knowledge on those is much more limited Wink
Sounds reasonable! I suspect you're going to end up with a display that's either incredibly dim or flickery, but I wholeheartedly support doing the experiments to see exactly what you get. I hope you'll show us the results.
Absolutely! I'll get a video up (of course cameras work differently than eyes...) and I'll also write my personal account about it and how it looks. I do absolutely expect some flicker but I don't know how much to expect. Anyway, I'm gonna get to wiring it up Smile
Sorry about the double post, but this is a very significant update.
I wired up the displays (due to a lack of jumper wire not all of the displays are hooked up) and made a small program to display the index of the display (from 0 to 7 going down columns)
At first, it didn't work. I got like hybrid numbers mixed and different led brightnesses. It was bad.
But then it occurred to me that transistors take time to fire. So I added a delay(2); in the program after the clock cycle had happened (I experimented with different delays and found that 2 worked the best.) There is minimal flicker, no more than other led displays. Here is a video:
Looks nice, Botboy! Keep up the good work!
here is that schematic corrected and put into Eagle.
I have tested buttons and display now on a breadboard. All seems to be working! Smile
(Those couple of 7-seg displays are pulled down cause they were connecting to things they shouldn't have been)
Protip: use one of these for your seven segment display: http://www.ebay.com/itm/MAX7219-serial-LED-7segment-display-8-digits-module-/131349253301
(Thats just an example you can probly find it for cheaper somewhere else, i bought 8 in bulk for like $1.5 each)
That would have been cheaper than what I already bought, but I don't really like how it breaks in the middle. Also, I already wrote my own routine to display using my current setup.

So it turns out that I only have the trial version of Eagle which means my board layout area is limited. So I had to find an old computer my dad used to use which has a licensed version of Eagle. There was only one problem and that was that It's Eagle 4.15 which means that none of my libraries were compatible and I pretty much had to start from scratch. But it's all laid out in the schematic editor and now I am putting together the board. It looks like it's going to be about 3.5" by 5" tall so easily fits in your pocket Smile

I am having trouble with code in that my double type variables are doing bad things. Instead of being, say, 13 it's actually 12.9999999blahblahblah which is a huge pain in the butt and I'm not entirely sure how to fix it. Suggestions?
Botboy3000 wrote:
So it turns out that I only have the trial version of Eagle which means my board layout area is limited. So I had to find an old computer...
Kicad erryday. (Eagle is fine- I learned on it- but those artificial limitations..)

Quote:
I am having trouble with code in that my double type variables are doing bad things. Instead of being, say, 13 it's actually 12.9999999blahblahblah which is a huge pain in the butt and I'm not entirely sure how to fix it. Suggestions?
Welcome to the land of binary floats. Your options are basically to either round results off to several digits less than you actually have internally or write your own (or use somebody else's, I guess) BCD float manipulation functions.

TI calculators do both- the internal representation is a BCD float and they store two more digits than they display.
Yeah, the screen can only display 8 digits so maybe I could do something like
(round(Number * 100000000)) / 100000000
You think that would work (sorry I can't test it at the moment, but will be able to later) or is there a better way to do it?
I could theoretically just switch to doing all integer math and just having a variable that stores where the decimal should be... idk I'll play around.
Botboy3000 wrote:
Yeah, the screen can only display 8 digits so maybe I could do something like
(round(Number * 100000000)) / 100000000
You think that would work (sorry I can't test it at the moment, but will be able to later) or is there a better way to do it?
It should work, but might be slow and lose precision. If you're using C floats, don't- there's not enough precision to get 8 decimal digits out with reasonable accuracy. doubles should be fine since you have basically twice as many mantissa bits. It may make more sense to use IEEE decimal floats if supported. For instance, this seems to work okay with my GCC:
Code:
    _Decimal64 foo = 0;
    _Decimal64 bar = 2;
    _Decimal64 baz = foo + bar;
Where apparently _Decimal64 is the built-in support for IEEE 754 decimal64.

Quote:
I could theoretically just switch to doing all integer math and just having a variable that stores where the decimal should be... idk I'll play around.
You've just described implementing a floating-point library. Wink
Thanks for the information, Tari!
I have kinda taken a break from programming for a while since I really can't test it effectively anymore without the full button matrix so I've switched focus for now on finally getting the boards designed and ordered.
Remember how I said I dug up this old Windows XP machine that had Eagle 4.15? Well, when my dad bought the license (back when Eagle was licensed) he did not buy the autorouter module which SUCKS because I have a crap ton of air wires that are going to be a real pain to try and route on this tiny board. Adding polygons for VCC and GND did help but there are still tons of signal lines as you can see in the above schematics. So far I pretty much have the whole button matrix and 7-seg displays routed but that, of course, is the easy part as opposed to the routing around the 4 rather large integrated circuits. Here's a screenie of what I have so far:
::EDIT I am still trying to come up with a cool name for this thing. Right now all I have come up with is "MegaCalc" because it runs off of an ATMega... any ideas about this would be greatly appreciated.
Update! I did end up finding a third-party autorouting program that worked stupendously. I got the board routed, did one last check of the schematic (it all looked good but I am fully expecting it to not work on the first go Razz ) and ordered the boards off of dirtypcbs. They should be here next week or early the week after that. I'll get all the parts soldered on and post again about how it works, or how it doesn't work. After that, I need to design a case for it and 3D print it somewhere but probably not before I work on programming. In the above schematic, there is no on/off switch but I added one shortly after posting that. Still looking for a name for this thing. Please post ideas about that if you have them. Thanks!!
Very exciting news! My boards finally came from China and I got one soldered up AND IT WORKED FIRST TIME!

... almost. I did end up having to add a pull down resistor and re-route the on/off switch but it DIDN'T EXPLODE Very Happy

Here are pictures of the soldered board (front and back)



It can currently add, subtract, multiply, divide both positive and negative integers and decimals.
I now need to work on the scientific, trig, hyperbolic functions and whatever else I can think of.
Fantastic work Botboy, I'm glad that it all worked!
There are projects around to convert HP 30B's or 20B's business calculators to the WP34s scientific calculator. Are there similiar projects for TI calculators?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement