Author Topic: Pic Microcontroller Choosing for Calculator Project  (Read 10373 times)

0 Members and 1 Guest are viewing this topic.

Offline brueTopic starter

  • Contributor
  • Posts: 16
  • Country: ch
Pic Microcontroller Choosing for Calculator Project
« on: July 19, 2012, 10:26:28 am »
Hi there

I really like Daves uCalc, so i want to design my own one.
I would like to use a PIC micro with mtouch technology.

Its a big Problem for me to choose a ideal controller. I dont know how much RAM do i need, how much ROM do i need. Should i use a 16 Bit or better a 32 Bit controller?
Uses Dave a single mtouch Channel for every button, or any matrix? I think it would be better with a single button per channel design.

Thanks for every part suggestion or other ideas.

 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10224
  • Country: nz
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #1 on: July 19, 2012, 10:32:21 am »
If you mean his calculator watch then one of the critical design factors will be power consumption.
Since the battery space is small and a watch should last a while before needing a new battery.

You'd want the button system to be on hardware interrupts so buttons can wake up the micro automatically.

I don't know much about the mtouch technology but you should check it's power requirements. If it needs continuous power it may not be suitable.

EDIT: Ah, i see the one you mean, the credit card sized calculator. At least with that it doesn't need to display information 24/7 like a watch, so power consumption isn't quite as critical.
You still need a ultra low standby current though, unless you have a hard power switch.
« Last Edit: July 19, 2012, 10:40:04 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2682
  • Country: fr
    • kripton2035 schematics repository
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #2 on: July 19, 2012, 10:40:42 am »
I'm pretty sure that a 8 bits pic18 would be enought to make a small calculetor like the uCalc ...
dave uses a pic24, ok but it's too much in my mind.
so a 32 bits why not, but to calc simple orepations it's not needed.
first determine what type of calculations you want to implement, then you can choose the controller.
 

Offline brueTopic starter

  • Contributor
  • Posts: 16
  • Country: ch
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #3 on: July 19, 2012, 12:12:55 pm »
Ok i will give some more informations.

Its not like a watch, its in credit card format. I would like to build it with RPN/UPN functionality (Like a HP 15c etc) with the typical scientific functions like:

-Standard operations
-sin cos tan
-root, exp
-Log, Ln
-Numeral system convertions


Eventually later extended funkctions like pre programmed constants, support for complex numbers, Statistical operations, etc.


Thanks for your support
 

Offline olsenn

  • Frequent Contributor
  • **
  • Posts: 993
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #4 on: July 19, 2012, 01:25:42 pm »
Use whatever micro you'd like, but for the love of god, please program it in assembly language and don't use Li-Ion batteries (keep it to AA or AAA NON-RECHARGABLE batteries)
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #5 on: July 19, 2012, 02:01:03 pm »
please program it in assembly language
what?! you want to do sin and lon in assembly? i hope you will not unintentionally defaming god for giving such suggestion. :P
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1673
  • Country: pl
  • Troll Cave Electronics!
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #6 on: July 19, 2012, 02:01:18 pm »
use anything that proves to consume the least power. First shot would be something from MSP430 or NanoWatt PIC18 families. A calculator doesn't need any serious processing power so anything including 8051 is perfectly good as long as it draws very low current.
I love the smell of FR4 in the morning!
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: sg
    • T4P
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #7 on: July 19, 2012, 03:48:01 pm »
Don't forget the Geckos ... From energy micro
 

Offline olsenn

  • Frequent Contributor
  • **
  • Posts: 993
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #8 on: July 19, 2012, 05:47:53 pm »
Quote
what?! you want to do sin and lon in assembly? i hope you will not unintentionally defaming god for giving such suggestion.

Assembly is really not that difficult for things like that... sin for instance is just a Taylor series of finite resolution (you define the resolution) which is easy if you already have the low level bit operators to JMP to. Take a look at the free online book, Matters Computational; it is written more for C, but it provides great algorithms for doing some neat things at a very low level.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #9 on: July 20, 2012, 01:19:12 am »
thanks for the sin info olsen, never thought of the taylor series since i took that for granted in higher level language. but what specific i have in mind is... do you want to code all the floating point operations in assembly? perharps you already have the readymade library? fair, then are you willing to code 4 or 8 lines of assembly just to move one FP argument or pushing it to stack?
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1685
  • Country: nl
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #10 on: July 21, 2012, 11:14:27 pm »
Well, a PIC18 of PIC24.. do the power comparisons. Some PIC24 claim XLP (Xtreme Low Power) or something.
PIC32 is more power hungry.

But as always, you don't need to run the controller at full speed. PIC24 allows very flexible clocking, I dunno how good the PIC18's are in that respect (haven't played much with them).

Oh btw.. assembler? AVOID
Open source projects are cool. Have you ever seen 'open source' embedded projects that are completely written in assembler and are noticeable? I haven't.
It's probably because open source benefits from developers joining. I don't feel encouraged to digg around some assembler code to understand it and expand it.
Don't get me wrong. I do some inline assembler for things like context switching in RTOS, or some x86 assembly on some game (Race simulators) data mining, but I'm glad a compiler knows it's tricks.

Assembler sounds stupid. Implementing an algorithm for sin may take yourself an afternoon. I can just type sin() and it works.
Maybe I want a boot loader too so I can update the program via an UART.
Or an RTOS so I can multitask things (altho for a calculator.. hmm ;) )

Anyway..
I believe Dave uses a matrix. Don't know for sure. His video's about the project are quite explanatory. :)
I don't think you need 32-bit power. 16-bit sounds good enough. 8-bit may be a bit low if you want to multiple 32-bit integers or floats, because it has to do a ton of instructions to calculate that.
RAM and ROM? Well, I don't think a calculator needs a lot of RAM. But I see most PIC24 series are in the 4k+. Should be plenty.
ROM: well, I know for matter of fact that you can port programs between PIC24F very easily.
If you get yourself a PIC24F DIP version, breadbord it up with an LCD and some buttons (Do the touch on a PCB later), and experiment. You'll soon figure if need 8K or 64K for the project.
Honestly I don't know. I only used PIC24F with USB before, which eats a ton of ROM.
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12370
  • Country: us
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #11 on: July 22, 2012, 01:44:48 am »
Hi there

I really like Daves uCalc, so i want to design my own one.
I would like to use a PIC micro with mtouch technology.

Its a big Problem for me to choose a ideal controller. I dont know how much RAM do i need, how much ROM do i need. Should i use a 16 Bit or better a 32 Bit controller?
Uses Dave a single mtouch Channel for every button, or any matrix? I think it would be better with a single button per channel design.

Thanks for every part suggestion or other ideas.

You are approaching this the wrong way.

The golden rule of engineering is that the first one you build will be the prototype that you discard.

So if you have not built anything yet, what you are going to build is your prototype. And for a prototype it doesn't much matter how much RAM or ROM you need, or what the exact design turns out to be.

Just get a big micro with plenty of memory and interfaces and breadboard your design. Use that design to figure out what you really need to build the real one, then go ahead and build that. Nobody can answer your questions except yourself, and the only way you can find the answers to the questions is to build a prototype and see what you discover.
 

Offline Zad

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: gb
    • Digital Wizardry, Analogue Alchemy, Software Sorcery
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #12 on: July 22, 2012, 04:29:45 am »
Any specific reason you are going with the PIC? The new ARM cored micros have a lot better power efficiency and overall speed (should it ever be needed).

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8404
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #13 on: July 22, 2012, 10:20:51 am »
Ok i will give some more informations.

Its not like a watch, its in credit card format. I would like to build it with RPN/UPN functionality (Like a HP 15c etc) with the typical scientific functions like:

-Standard operations
-sin cos tan
-root, exp
-Log, Ln
-Numeral system convertions


Eventually later extended funkctions like pre programmed constants, support for complex numbers, Statistical operations, etc.


Thanks for your support
To give you an idea of the hardware requirements, a real HP 15c used an ASIC at 220kHz and consumes around 1.2mA active and <100nA standby; they recently produced a reissue of it using a standard Atmel ARM chip and the power consumption went up to 19mA active and 4uA standby.

Also, good (accurate) calculators don't use standard binary floating-point, but BCD-based custom numerical formats.
 

Offline slateraptor

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: us
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #14 on: July 26, 2012, 07:50:00 am »
Take a look at the free online book, Matters Computational; it is written more for C, but it provides great algorithms for doing some neat things at a very low level.

How would you rate the book? I'm always on the lookout for exceptional reference literature to add to my personal library.
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1673
  • Country: pl
  • Troll Cave Electronics!
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #15 on: July 26, 2012, 10:51:57 pm »
I know that there are two trends in low-power programming which can be called 'lowest frequency' and 'burst'. First one achieves low power consumption by lowering the clock speeds to minimum, the second one relies on executing given task as fast as possible and then going to deep sleep mode (or whatever it is called). Both can be mixed with each other and both can benefit from using specialized cells like FPU, hardware trygonometric function tables, hardware polynominal calculation etc.
I love the smell of FR4 in the morning!
 

Offline baljemmett

  • Supporter
  • ****
  • Posts: 665
  • Country: gb
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #16 on: July 26, 2012, 11:11:18 pm »
I know that there are two trends in low-power programming which can be called 'lowest frequency' and 'burst'. First one achieves low power consumption by lowering the clock speeds to minimum, the second one relies on executing given task as fast as possible and then going to deep sleep mode (or whatever it is called). Both can be mixed with each other and both can benefit from using specialized cells like FPU, hardware trygonometric function tables, hardware polynominal calculation etc.

Dave discussed some of the implications of this in one of his (very!) early videos: EEVblog #4 – Low Power Calculator Design and FPGAs.

(Strange-looking envelopes in Dave's old lab ;))
 

Offline Bloch

  • Supporter
  • ****
  • Posts: 456
  • Country: dk
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #17 on: July 27, 2012, 07:21:40 pm »
I know that there are two trends in low-power programming which can be called 'lowest frequency' and 'burst'.


Yes lower the frequency the lower will the Power use be. ( example PIC12F675 ) 
Standby Current:
- 1 nA @ 2.0V, typical
• Operating Current:
- 8.5 uA @ 32 kHz, 2.0V, typical
- 100 uA @ 1 MHz, 2.0V, typical
 

Offline SteveyG

  • Supporter
  • ****
  • Posts: 993
  • Country: gb
  • Soldering Equipment Guru
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #18 on: July 30, 2012, 07:25:27 am »
Microcontroller choice shouldn't be too critical so long as it has enough I/O for your needs. Most calculators are based on 4 bit processors anyway!
YouTube Channel: https://www.youtube.com/user/sdgelectronics/
Use code: “SDG5” to get 5% off JBC Equipment at Kaisertech
 

Offline FenderBender

  • Super Contributor
  • ***
  • Posts: 1115
  • Country: us
    • The Solid State Workshop
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #19 on: July 31, 2012, 09:57:20 pm »
Microcontroller choice shouldn't be too critical so long as it has enough I/O for your needs. Most calculators are based on 4 bit processors anyway!

Yea most calculators are running on 4-bit or 8-bit MCUs or CPUs. 8052 is a popular one. Still used today. It's nothing extraordinary.
 

Offline rbk17c

  • Newbie
  • Posts: 7
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #20 on: July 31, 2012, 11:12:05 pm »
Being a self-confessed PIC fan-boy, I would go with some XLP pic18. It might get a bit hard to get it to do trigonometry, but at least you have a 8X8 HW multiplier. :-)

- Do as IanB suggests: Start with a big chip, and reduce when you have your (almost) finished code. (Only the pricetag differs) Take a look at something like pic18f26K22 in I/SP (=DIP). Try to design it, so that you can have the programmer connected all the time you program. - if you can, don't use the IPCS pins for anything else.

Use the internal oscillator.

The touch thiggy "CTMU" uses VERY little power - something in the order of 1/2 uA. (I think it is actually designed with batteries in mind).

Hans: are you trying to start a religious war:-) I love coding in assembler, - I don't like the waste of space poor c-compilers produce.
But I relinquish. Hans is right. Use the right tool for the right job! Some hi-speed display updates: ASM; calculating square-root of (2*Pi)? use C (And a VERY good math library.).
/holger
 

Offline brueTopic starter

  • Contributor
  • Posts: 16
  • Country: ch
Re: Pic Microcontroller Choosing for Calculator Project
« Reply #21 on: August 03, 2012, 08:25:36 pm »
Thanks a lot for all your "inputs", i definitly dont programm it in assembler. This is because i havent got any expirience with assembler. Im working currently with the 24FJ128GB106 on the cap evaluation board. Later i would do some tests with the 24F32KA304, a controller with xlp nano watt technology.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf