Post Reply 
low cost 32S on ESP32-S3
12-25-2023, 06:15 PM
Post: #1
low cost 32S on ESP32-S3
To expand on capabilities of the 10LC (using the M5Stack Cardputer), I have a beta version of the 32LC.

It has the 26 registers of the 32S, but program steps are expanded. Some complex number operations, secant method solver and Simpson's integration method are included. There are a number of omissions of features in this beta version (I thought I would release this sooner rather than later, in case anyone wants to use or test it), so if there is a feature you would desperately like implemented, let me know.

Binary files, firmware burning instructions and .pdf overlay are on GitHub under 32LC


Beta version 0.9 notes

Advantage of C implementation is speed, but not using calc. ROM means some aspects of the calculator may seem different than original.

Features:

- 26 registers and 1,400 program steps
- 2 selectable display fonts
- 3 selectable display colors
- audible keyboard beep
- fast - approx. 77,000 loop iterations in 10 seconds
- internally has number range from approx. 1e-317 to 9.9e307
- solver using secant method
- integration using Simpson’s method
- complex number functions

Known issues / differences from 32S:

- EEX implemented slightly differently - single digit exponent processed immediately
- Eng notation and All display mode not implemented yet
- XEQ currently works like GTO
- INPUT, SHOW, VIEW and MEM not implemented yet
- COMPLEX and statistics functions are not programmable
- Indirect register addressing and GTO not implemented yet
- SF, CF and FS? not implemented yet
- BASE menu not implemented yet
- for Solver and integration, known variables must be manually entered beforehand
- in programming mode, each number digit requires a single step
- programming mode does not insert lines - currently does overwrite
- error messages need updating

Program memory organization

The 1,400 program steps are organized as follows:

0-99 general
100-149 LBL A
150-199 LBL B
200-249 LBL C …
1350-1399 LBL Z

If LBL A is over 50 steps, it can overlap over B, and so on.

Solver example - Pythagorean formula:

Since a^2 + b^2 = c^2, then a^2 + b^2 - c^2=0

A00 LBL A
A01 RCL A
A02 x^2
A03 RCL B
A04 x^2
A05 +
A06 RCL C
A07 x^2
A08 -
A09 R/S

Exit programming mode.

Solve for C:

3 STO A 4 STO B

Enter 8 and 0 on the stack as initial guesses.

Set FN to (LBL) A Solve for C

Result is 5

Solve for A:

4 STO B 5 STO C

0 STO A

Enter 8 and 0 on the stack as initial guesses.

Set FN to (LBL) A Solve for A

Result is 3

Solve for B:

3 STO A 5 STO C

0 STO B

Enter 8 and 0 on the stack as initial guesses.

Set FN to (LBL) A Solve for B

Result is 4

Integration:

B00 LBL B
B01 RCL X
B02 x^2
B03 R/S

Set Fix 4 Set FN to (LBL) B Put lower limit 0 and upper limit 10 on the stack. Integrate X.

Result is 333.3333

Monte Carlo program to calculate PI:

C00 LBL C
C01 RANDOM
C02 x^2
C03 RANDOM
C04 x^2
C05 +
C06 SQRT
C07 1
C08 x>y
C09 GTO D
C10 1
C11 STO+ A
C12 GTO C

To enter program D, use GTO . D or LBL D

D00 LBL D
D01 1
D02 STO+ A
D03 1
D04 STO+ B
D05 GTO C

Do XEQ C and let it run for about 10 seconds. A stores the number of loop cycles and B stores the number of times a random point falls within quadrant 1 of a circle.

Do Rcl B, then Rcl A, / (divide) and 4 x (times) to get an approximation of pi.

   
Find all posts by this user
Quote this message in a reply
12-26-2023, 06:53 PM
Post: #2
RE: low cost 32S on ESP32-S3
Super fan of programmable calculator clones I get excited when I read your post.
But apart from an "M5Stack Cardputer" and your 32LC "bin" files (+ "Windows ESP32 flash download tool") what more do I need?
I can only find an "M5Stack Cardputer" on shop.m5stack.com for $29.90 but with $23 shipping is $52.90
Can we find it elsewhere? (unknown on Amazon)
Finally, is there a website regarding your 10LC and 32LC projects?

(and do you give me permission to share it on my site clones.phweb.me?)

In any case, congratulations!

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-26-2023, 08:38 PM
Post: #3
RE: low cost 32S on ESP32-S3
The M5Stack Cardputer can also be found on Digikey (they seem to have a .com, .sk, .be and .de website). The part number is the M5Stack K132. Shipping to the U.S. seems to be $6.99 and there's a $2.99 tariff.

You would need a micro SD card (I use a SanDisk Ultra 16GB SDHC) to retain registers and program steps.

You can download (from Github), print, cut and glue an overlay to put over the standard key labels. You can use 8.5x11 inch vinyl sticker paper for a self-adhesive option.

I do not have a website, but on GitHub, the Readme.md file has useful notes.

You are quite welcome to share about these 10LC and 32LC projects on your website.
Find all posts by this user
Quote this message in a reply
12-26-2023, 10:05 PM
Post: #4
RE: low cost 32S on ESP32-S3
Thank you for the information.
I found digikey.fr even though my Google searches only gave me sites outside France...
Another question: if I want to alternatively test 10LC or 32LC without updating each time, do I have to buy an additional m5stamp? (one to load 10LC and one to load 32LC???)
Sorry but there I could have many more questions!

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-27-2023, 02:50 AM
Post: #5
RE: low cost 32S on ESP32-S3
The M5Stamp that is plugged into the M5Cardputer appears to be a specialized version with a display connector, which looks fragile if it were frequently disconnected and reconnected. Therefore, if you wanted to be able to use both the 10LC and 32LC, you're best choice would be to have 2 M5Cardputers.

I am working on a version of the 11C based on a touchscreen M5Stack Paper (and a 32sii that could be loaded into memory and selected upon startup). Unfortunately, it uses a limited Micropython version that has about 6 digits of floating point precision and exponents limited to 10^35. So that would severely limit its practicality as a useable calculator. If anyone has a library of Python code that can do floating point functions with 10 digits of precision using 32 bit integer numbers (to work with), that would significantly help this side project.

   

   
Find all posts by this user
Quote this message in a reply
12-27-2023, 09:24 AM
Post: #6
RE: low cost 32S on ESP32-S3
(12-27-2023 02:50 AM)arhtur Wrote:  The M5Stamp that is plugged into the M5Cardputer appears to be a specialized version with a display connector, which looks fragile if it were frequently disconnected and reconnected. Therefore, if you wanted to be able to use both the 10LC and 32LC, you're best choice would be to have 2 M5Cardputers.
Two M5Cardputter ordered on Digikey.fr (shipping from USA but free FedEx fees).
So I'll still have some work to do to test and implement my "clones" site...

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-27-2023, 10:08 AM
Post: #7
RE: low cost 32S on ESP32-S3
(12-27-2023 02:50 AM)arhtur Wrote:  I am working on a version of the 11C based on a touchscreen M5Stack Paper (and a 32sii that could be loaded into memory and selected upon startup). Unfortunately, it uses a limited Micropython version that has about 6 digits of floating point precision and exponents limited to 10^35. So that would severely limit its practicality as a useable calculator. If anyone has a library of Python code that can do floating point functions with 10 digits of precision using 32 bit integer numbers (to work with), that would significantly help this side project.
Certainly these two projects seem equally interesting but I'm a little less of a fan.
The absence of a keyboard and especially the "tablet" format makes us think of emulators for smartphones or tablets. (already more than 30 emulators on my smartphone...)
In addition, the cost of the M5Stack Paper is not comparable to the cost of the M5Cardputter for a poor result for a scientific calculator ("about 6 digits of floating point precision and exponents limited to 10^35").
A format like the M5 K005 with keyboard would have appealed to me more because it looks more like a calculator than a smartphone.

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-28-2023, 04:18 PM
Post: #8
RE: low cost 32S on ESP32-S3
The M5 K005 would be a great platform to build a RPN calculator on, however, it does not seem to be available or manufactured any more.

I am looking into the feasibility of a 42LC using the M5Stack Cardputer, which would be a longer term project, but considering there's already a Free42, Plus42 and DM42, I'm not sure how popular it would be.
Find all posts by this user
Quote this message in a reply
12-28-2023, 05:32 PM
Post: #9
RE: low cost 32S on ESP32-S3
(12-28-2023 04:18 PM)arhtur Wrote:  The M5 K005 would be a great platform to build a RPN calculator on, however, it does not seem to be available or manufactured any more.
I am looking into the feasibility of a 42LC using the M5Stack Cardputer, which would be a longer term project, but considering there's already a Free42, Plus42 and DM42, I'm not sure how popular it would be.

For the K005 it is actually mentioned "Obsolete, This product is no longer manufactured" at Digikey. It’s regrettable!
It was the correct format for a calculator.

For the 42LC I don't know if the interest is based on competition from products such as DM42 but...
a 42S for the price of the M5Stack Cardputer is attractive! especially if the exchange of RAW files can be done with a PC. (see the post "dm42decode - a command-line decoder tool")
Fan of clones, I have almost all the DMs (DM11L, DM15L, DM41L, DM32, DM42, DM41X) but I also have the PXs (PX11C, PX12C, PX15C, PX16C, PX41C and the PX41CX prototype that I am testing for Alex Garza ) and what interests me the most is being able to transfer programs from one machine to another via PC.
So a 42LC why not! about $30!

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-29-2023, 07:59 AM
Post: #10
RE: low cost 32S on ESP32-S3
Asked about the K005, M5Stack support (support@m5stack.com) told me :
Quote:Yes. K005 is EOL already.
We are going to upgrade it to a new version, which should be in Q2 or Q3 of 2024.

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-29-2023, 02:47 PM
Post: #11
RE: low cost 32S on ESP32-S3
I received my two M5 Cardputer (quickly...48 hours from California via FedEx)
Then on my Win7 Pro 64bits desktop PC impossible to find the right drivers... no COMx???
So Win10 laptop and everything works:
I load 10LC on the first (in COM4) then 32LC on the second (in COM3)... strange this change of COM port.
when loading finished (?) too fast??? I don't know but once unplugged from the USB, ON at the back and... NOTHING! the M5 does not turn on!
Pb power supply? Loading not completed?
However, I followed the instructions scrupulously.

PS: for the battery how to recharge? via USB?

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-29-2023, 05:04 PM
Post: #12
RE: low cost 32S on ESP32-S3
Another option for burning the firmware is to use the M5Stack Easyloader at:

https://docs.m5stack.com/en/quick_start/...der_packer

You select the 3 .bin files and tell the program what address to put them, and it will produce a .exe file. Windows will give a warning that it's from an unrecognized source, so use at your own discretion.

I've attached a screenshot for the ESP32S3 download tool, in case that helps.

The M5Stack Cardputer actually has 2 batteries - one for Cardputer and one for the M5Stamp. The diagram on the back indicates that to charge the M5Stamp, the power switch must be on. It looks like it uses the 5V in for charging the Cardputer battery, so I would recommend using a USB-A to USB-C cable (charging from a 5V USB-A source), although a USB-C to USB-C cable may work.

   
Find all posts by this user
Quote this message in a reply
12-29-2023, 06:59 PM
Post: #13
RE: low cost 32S on ESP32-S3
(12-29-2023 05:04 PM)arhtur Wrote:  Another option for burning the firmware is to use the M5Stack Easyloader at:
https://docs.m5stack.com/en/quick_start/...der_packer
You select the 3 .bin files and tell the program what address to put them, and it will produce a .exe file. Windows will give a warning that it's from an unrecognized source, so use at your own discretion.
I've attached a screenshot for the ESP32S3 download tool, in case that helps.
The M5Stack Cardputer actually has 2 batteries - one for Cardputer and one for the M5Stamp. The diagram on the back indicates that to charge the M5Stamp, the power switch must be on. It looks like it uses the 5V in for charging the Cardputer battery, so I would recommend using a USB-A to USB-C cable (charging from a 5V USB-A source), although a USB-C to USB-C cable may work.
Thank you for all those informations.
1) I found the correct drivers for Win7.
2) I found out why nothing was working: I'm a stupid donkey! Too eager to have the 10LC and the 32LC at the same time, I mixed up the downloads a bit...
So my first test of the 10LC works.
AWESOME !!!
I'm not going to bed early... (8 p.m. in France)
I will post photos tomorrow.
Again thanks to you.

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
12-30-2023, 04:49 PM
Post: #14
RE: low cost 32S on ESP32-S3
My "32LC" is also finished and tested.

   

http://ti58c.phweb.me
http://clones.phweb.me
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)