Inside the TI 84 Python Edition Calculator!

preview_player
Показать описание
TI added Python to their calculators a while back. The rumor was this was done by adding a co-processor. I've been dying to look into this and I finally found one at Staples! Join me on a quest of discovery!
Рекомендации по теме
Комментарии
Автор

Hi! I'm one of the contributors to the third-party C toolchain for the CE. I was working on a patch for the Python app a while back before giving up because there was so little RAM that it couldn't hold all the functions for the main processor's graphics API, even though the Python code was all just like one line per function since it was literally doing all the work on the other processor.
As a software guy, I hadn't really messed around with test points much, beyond dumping the ARM's ROM, so it's good that someone's documented some of those.
I've previously worked out what most of the escape sequences the calculator uses do - of the 7 they've implemented, 2 are entirely custom, and the remaining 5 use the same final character as an ANSI sequence that does about the same thing, but annoyingly none of them are actually standard-compliant. For example, ESC [ m is Set Graphics Rendition, which sets the text color, but it uses entirely different numbers for each color than regular terminals do.
As you speculated, there's also an SPI connection between the two processors, which is used when transferring the firmware, programs, TI-OS lists, certain graphics data, etc. I still haven't entirely figured out how that works, either in terms of protocol, which test points it's using, or what system calls it uses.
As for why the keyboard is doing that - the OS has a complicated system of scan codes and key codes and tokens that it uses, none of which are ASCII, and the keyboard inputs get translated into key codes. The Python app listens for key codes using the OS's functions, then translates them into ASCII strings, and probably wasn't designed with an external keyboard in mind, which is why it's so jank.
eZ80acclaim! is the name of one of Zilog's single chip computers, while the CE uses a different custom ASIC that implements the same eZ80 ISA. And yeah, a lot of the code has been completely untouched for decades - when writing assembly code for it I still find myself primarily referencing SDK documentation for the TI-83 that's nearly as old as I am.
There are also several other TI calculators that have worse names than this one, somehow - there's the TI-83 Premium CE Edition Python, which is exactly the same thing but in French but cheaper and with slightly more software features, and the TI-82 Advanced Edition Python, which is exactly the same thing but in the old style of case and with a different OS.

commandblockguy
Автор

I'm picturing Ben giggling madly as he blurs a different subset of his desktop icons in every camera shot of his computer screen.

PresJPolk
Автор

Why are all electrical engineers so unhinged

Willoww
Автор

"A $130 calculator, while still overpriced, has a removable battery but your $1000 cellphone doesn't!"

Cue X-Files title music...

oldguy
Автор

You’re insane, in the best possible way. I laughed, I cried, I learned. But I probably won’t open up my TI 84 CE Python since I learned all I need to know. Aside: I learned to program in BASIC on the RadShack Model 100, and I too would much rather play with Python on one of my Pis.

MrNoahTall
Автор

I don't know that I'd call this solution janky. They've effectively grafted in an embedded Python subsystem with minimal changes needed to be made to the existing calculator design. Doing so, they don't need to recompile Python to run on the Z80 and none of the calculations running on Python use the Z80. This is a pretty elegant way to introduce a modern programming environment while keeping the rest of the calculator largely unaltered. Contrast this with the WinCE update added to HP Prime and the overhead is almost nothing. What's perhaps more interesting is because the Python module is just a serial connection, you could replace it with anything else which uses a serial connection, not just limiting yourself to Python.

R.B.
Автор

also, it would be pretty great to replace the little chip with literally anything else to add additional functionality, as the calculator is basically just a terminal

notabagel
Автор

This is the weird kind of tech stuff I love from this channel. This, general conversation and talking through a discovery in real time, Bud, singing, more Bud, a can of beer near the end of the video, soldering, and singing. Oh, and just general conversation and talking through a discovery in real time.

BTW, don't forget Bud.

djk
Автор

First time watching this channel, thought it was going to be a much more rudimentary video. Did not expect a sufficiently advanced level of EE knowledge. Very interesting.

transfo
Автор

Great video! Loved the Bud Cameo and the duality of it all.

layton
Автор

Great video! The first escape sequence that you’ve got on the oscilloscope “1B 5B 46” was the equivalent of pressing the END key on the keyboard, to move the cursor to the end of the line, followed by pressing the ENTER key (the 0D at the end).

skesinis
Автор

Great video! It's great to see that our beloved Z80 is not dead!

I would guess they chose UART protocol because it is asynchronous, which corresponds to the nature of the transfers happening: the Z80 sends data to the ARM core, this one will process them and send the response later.
With SPI on the other hand, transfers are all synchronous and initiated by the master (Z80) but the Z80 doesn't know when the ARM core has finished processing the data. In practice they could have added a ready line between both cores with a GPIO, but from what I see, they didn't want to bother with the software.

I would have loved to see the how the data were transferred with a graphical/plotting Python example.

Zealbit
Автор

Always feel a warm happy nerdy feeling watching Ben 👍🥰.

Jimfowler
Автор

This is the first video I've seen from Ben, and I think it's fkn hilarious! This is awesome, you just gained a subscriber!

RT-qdyl
Автор

It should be interesting to see what is coming out of the serial while graphs plotting....

andreagarbin
Автор

Ben: LETS HACK PYTHON!

Ben 40 minutes later: .. I do not know how to program in Python .. 🤭

WilliamZwicky
Автор

I always wondered how these damn python calculators worked, loved the deep dive!

JernD
Автор

24:30 The part you want is an "Analog Switch" like a 74LVC1G315, they're super useful for making mods like this. You can connect the 'gate' input of the switch to the FTDI chip's 'TX activity' pin (normally used for enabling a RS485 output driver and/or blinking the TX activity LED), and just otherwise have the appropriate pullup/pulldown resistor to keep the line connected normally whenever the FTDI is not actively sending a byte (or indeed, when it's disconnected).
(I've used that exact chip for modding in one of those bluetooth wireless serial modules into a USB serial device, worked like a charm!)

AJMansfield
Автор

Wow, I have 2 TI 84s on my desk right now, and up pops your video. Good timing!

DavidSprings
Автор

I saw the [F and said... ANSI! I looked it up and ESC-[F is a "cursor previous line".

kazriko