Author Topic: Casio Prizm - Color graphic calculator  (Read 99451 times)

0 Members and 1 Guest are viewing this topic.

Offline uberspire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +57/-0
    • View Profile
    • Uberspire
Re: Casio Prizm - Color graphic calculator
« Reply #210 on: October 11, 2010, 09:10:53 pm »
It seems there's been some confusion bewteen RAM and ROM in some posts above.

TI's applications are stored in ROM (Flash-ROM).
Casio's add-ins are equivalent, and are stored in ROM too.

So the geometry add-in has nothing to do with the RAM of the Prizm.
Yes, Casio addins are stored in ROM (Flash). But to be executed, it has to be loaded into the RAM. Well, at least, it's how it's done on Casio calcs. I believe this is true actually for TI and Casio calcs. Flash is good for storage, but not good for running programs off of and is very slow (compared to RAM). Read and write cycles will shorten down the life of the flash chip and kill it. TI's I think do this too: copies program from Flash and places them into a space of RAM reserved by the OS to be executed. I'm pretty sure the TI-89 does that for sure. On Z80 based TI-8X's, portions of a program are copied into RAM when necessary by code banking (or as some of you call code swapping) due to the 16-bit addressing limit on the Z80.

I think a lot of confusion comes from the way TI uses it's RAM (to store user data), whereas Casio uses it's RAM in a more modern computer-ish way. (The 61KB of BASIC program memory is actually a tiny chunk of Flash. On the fx-9860G, a hack was done to expand the available BASIC programming storage from 64KB to I think 300KB since it's just Flash memory, not RAM. The RAM is completely separate from the 61KB)

A better way to explain this is to use your computer as an example. All your programs are stored on your hard drive, not in your RAM. When you want to run a program, the program is loaded from the hard drive to your RAM and hence RAM get's used up (this also explains why if you have a slow hard drive, booting up will take longer). Running the program from hard drive will kill your hard drive and is extremely slow. On our calcs, we use Flash instead of a hard drive, but it's basically the same idea.

Someone with enough knowledge about TI hardware is gonna have to confirm if TI calcs do this too.
« Last Edit: October 11, 2010, 11:09:27 pm by kucalc »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio Prizm - Color graphic calculator
« Reply #211 on: October 11, 2010, 09:14:17 pm »
Strange, I swear some flash APPS runs fine even when you're almost out of user RAM, on a 83+. Example, you got 200 bytes of free RAM and still can run MirageOS. I know there are SafeRAM areas but I doubt only about 2 KB of code is copied to the calc at a time. It might be good that someone like Calc84maniac, BrandonW, FloppusMaximus, KermMartian or ThePenguin77 confirms this.

Also I thought only rewriting the flash chip sectors weared it out, not reading?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Casio Prizm - Color graphic calculator
« Reply #212 on: October 11, 2010, 09:15:05 pm »
I am 100% sure that the TI-83+ to TI-84+SE run Apps directly from Archive.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: Casio Prizm - Color graphic calculator
« Reply #213 on: October 11, 2010, 09:17:30 pm »
It seems there's been some confusion bewteen RAM and ROM in some posts above.

TI's applications are stored in ROM (Flash-ROM).
Casio's add-ins are equivalent, and are stored in ROM too.

So the geometry add-in has nothing to do with the RAM of the Prizm.
Yes, Casio addins are stored in ROM (Flash). But to be executed, it has to be loaded into the RAM. My experience with programming on the fx-9860G tells me this. I believe this is true actually for TI and Casio calcs. Flash is good for storage, but not good for running programs off of and is very slow (compared to RAM). Read and write cycles will shorten down the life of the flash chip and kill it. TI's I think do this too: copies program from Flash and places them into a space of RAM reserved by the OS to be executed. I'm pretty sure the TI-89 does that for sure. On Z80 based TI-8X's, portions of a program are copied into RAM when necessary by code banking (or as some of you call code swapping) due to the 16-bit addressing limit on the Z80.

I think a lot of confusion comes from the way TI uses it's RAM (to store user data), whereas Casio uses it's RAM in a more modern computer-ish way. (The 61KB of BASIC program memory is actually a tiny chunk of Flash. On the fx-9860G, a hack was done to expand the available BASIC programming storage from 64KB to I think 300KB since it's just Flash memory, not RAM. The RAM is completely separate from the 61KB)

Interesting...
So it's like the TI-Nspire.


Thank you very much for sharing your knowledge. :)
TI-Planet co-admin.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Casio Prizm - Color graphic calculator
« Reply #214 on: October 11, 2010, 09:18:30 pm »
Thank you very much for sharing your knowledge. :)
Yes, thank you.  I've been learning a lot with every word you post. :)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Casio Prizm - Color graphic calculator
« Reply #215 on: October 11, 2010, 09:21:52 pm »
Thank you very much for sharing your knowledge. :)
Yes, thank you.  I've been learning a lot with every word you post. :)

Ditto. I think there needs to be a unified Casio-TI forum. The calcs are similar enough for it.

EDIT: Also, there are types of Flash that can execute almost as quickly as RAM. I doubt TI spent the money to implement them, but perhaps one of the people mentioned previously could comment.
« Last Edit: October 11, 2010, 09:25:23 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio Prizm - Color graphic calculator
« Reply #216 on: October 11, 2010, 09:33:58 pm »
Well the thing is that there are already some Casio forums: CasioKingdom and Casiocalc. There are some french forums too, so it may be hard for us to attract Casio users with so many TI users around. It would be cool, though. There could be a TI-BASIC to Casio BASIC or Casio BASIC to TI-BASIC transition tutorial for those who want to program for both at once.

Offline uberspire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +57/-0
    • View Profile
    • Uberspire
Re: Casio Prizm - Color graphic calculator
« Reply #217 on: October 11, 2010, 09:51:53 pm »
I'm just guessing and I could be totally wrong, because I'm not a TI guy, but the portion of RAM used by the OS is temporarily replaced by your flash app. When you close or exit out of your flash app, a system call to some portion of RAM (your SafeRAM probably?) that still contains a tiny piece of the OS that will load back the OS from the ROM to the RAM. That would explain your case of why APPS still run fine when you're almost out of RAM.

Also I thought only rewriting the flash chip sectors weared it out, not reading?
I believe that is true for most flash chips. But it would be slower to run off a program that was on Flash, than on RAM since Flash typically have longer reading cycles than RAM.

I am 100% sure that the TI-83+ to TI-84+SE run Apps directly from Archive.
Hmmm, that actually wouldn't seem very smart in a first glance, but it might make a little sense actually. It's a cheap solution. Z80 is kind of slow (compared to today's ARM and SuperH) so the CPU wouldn't be outrunning the Flash and the programs aren't extremely large (like 100KB or bigger) so not much reading would have to be done.

EDIT: Wait a sec, I don't see how this is actually possible. A Z80 has a 16-bit parallel address bus with an 8-bit parallel bus to load in 1 byte for each cycle. With 16-bit's for addressing, the Z80 would only be able to access the lowest 64KB of Flash max. Well, unless the Flash is split into 64KB memory banks and you access each one separately. Or the Z80 has been modified to have it's address bus extended beyond? And since it's running off Flash, is the data bus on the Z80 swapped or disconnected by a multiplexer and connected to the Flash's data output? But then the RAM would be disconnected and there would be no memory for stacks and variables. Or is it 32KB for program instructions and 32KB for program data (variables and stacks)? Or a 48KB/16KB memory map? I need someone here to explain what's happening.  :-\

Interesting...
So it's like the TI-Nspire.
Yes, I'm pretty sure the TI-nSpire would follow the same scheme as the Prizm or fx-9860G since it uses a modern ARM processor. The TI-nSpire, needs to "boot up" by copying the OS to the RAM. If power is lost to the RAM (bad batteries, or something), it's need to be loaded back in again. That's why the TI-nSpire goes into some sort of sleep mode (instead of having power cut off to everything) so the OS stays within the RAM.

EDIT: Yep, I've been reading your guy's wiki: http://hackspire.unsads.com/wiki/index.php/Memory_layout Quote: "Since 32MB of RAM is available, which is quite a lot, the whole OS code is decrypted from the OS image and copied to RAM at boot time, when the message "Loading Operating System..." is displayed during ~8 seconds. The RAM is also used as temporary storage transparently for the user as described above." The fx-9860G and most likely the Prizm do the same thing, except Casio's don't have that 8 second boot time. :)

Most of today's CPU's are built using Harvard architecture where the program data and instruction memory are separate. Typically, the program data are stored on a hard drive (or some device for storage such as Flash) and the instruction memory is the RAM. All PCs are built this way and almost all computers are like this.
« Last Edit: October 11, 2010, 10:13:28 pm by kucalc »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Casio Prizm - Color graphic calculator
« Reply #218 on: October 11, 2010, 09:52:33 pm »
The transition tutorial sounds interesting. I'll get working on it. :)

EDIT: Yep, I'm going to have to learn Casio-BASIC. It's not much different than TI-BASIC though.
« Last Edit: October 11, 2010, 10:02:22 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio Prizm - Color graphic calculator
« Reply #219 on: October 11, 2010, 09:59:41 pm »
For the safeRAM, there are 3 sections with 768 bytes of RAM used for the screen buffer and stuff like that, another 128 bytes section for storing content to the home screen (16x8 characters) and another section I forgot the size off (it was around 500 bytes if I remember)

Btw I forgot to mention, Kucalc, but this wiki has a lot of good calc documentation for the TI-83+: http://wikiti.brandonw.net . In case no one like BrandonW himself checks this topic soon, it might be good to go check there. I think this page might explain how Flash APPs works: http://wikiti.brandonw.net/index.php?title=83Plus:OS:Variable_Storage_in_the_User_Archive

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: Casio Prizm - Color graphic calculator
« Reply #220 on: October 11, 2010, 10:17:16 pm »
...
I am 100% sure that the TI-83+ to TI-84+SE run Apps directly from Archive.
Hmmm, that actually wouldn't seem very smart in a first glance, but it might make a little sense actually. It's a cheap solution. Z80 is kind of slow (compared to today's ARM and SuperH) so the CPU wouldn't be outrunning the Flash and the programs aren't extremely large (like 100KB or bigger) so not much reading would have to be done.

EDIT: Wait a sec, I don't see how this is actually possible. A Z80 has a 16-bit parallel address bus with an 8-bit parallel bus to load in 1 byte for each cycle. With 16-bit's for addressing, the Z80 would only be able to access the lowest 64KB of Flash max. Well, unless the Flash is split into 64KB memory banks and you access each one separately. Or the Z80 has been modified to have it's address bus extended beyond? And since it's running off Flash, is the data bus on the Z80 swapped or disconnected by a multiplexer and connected to the Flash's data output? But then the RAM would be disconnected and there would be no memory for stacks and variables. Or is it 32KB for program instructions and 32KB for program data (variables and stacks)? Or a 48KB/16KB memory map? I'll have to go read around for a bit.
...
On the TI-83 Plus/TI-84 Plus, executing programs from FlashROM is indeed possible. These models don't actually use a physical Z80, but rather a SoC that has additional hardware that does things beyond what a normal Z80 would be doing. Example: Memory-mapping "pages" of FlashROM in 16KB chunks to sit evenly with the Z80's 64KB physical address space. Memory is arranged in the following manner:
First 16KB: First 16KB of FlashROM
Second 16KB: Some other 16KB "page" of FlashROM
Third 16KB: First (or second?) 16KB of RAM
Fourth 16KB: The other 16KB of RAM. In other models, this too is swappable with some other 16KB chunk of RAM.

In every case, the calculator maps in 16KB of whatever memory is needed at any given point in time. The only thing that isn't user-remappable in the TI-84 Plus series is the first 16KB of Flash, which is where the more important stuff of the OS sits.

Now. I'm not entirely sure *how* the calculator performs the pageflips, but the second 16KB of physical memory is controlled by outputting a page value to I/O port 6, and the third 16KB of physical memory is controlled by outputting a page value to I/O port 7.

All "FlashAPPs" are executed in the 0x4000-0x7FFF range (2nd physical "page"). Multipage apps are achieved by changing the value of port 6. For some obvious reasons, your code shouldn't be executing code on that page during a pageflip, but if you've coded your app creatively, you can change it that way.

For more information, see TI's SDK found here: http://education.ti.com/educationportal/sites/US/productDetail/us_sdk_73_83_84.html

----------------
TL;DR: The calculator divides memory up into 16KB chunks. Ports are used to extend the calculator's ability to address both RAM and FlashROM by remapping them into the Z80's 64KB address space. It's the best they could do with the Z80. We're not complaining (much).

To address another concern, the calculator *is* slow enough (even at 15MHz) to run programs directly from FlashROM without needing to insert "wait cycles". Or rather, the Flash is fast enough to keep up with the Z80.
« Last Edit: October 11, 2010, 10:27:05 pm by Iambian »
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline uberspire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +57/-0
    • View Profile
    • Uberspire
Re: Casio Prizm - Color graphic calculator
« Reply #221 on: October 11, 2010, 10:23:19 pm »
These models don't actually use a physical Z80, but rather a SoC that has additional hardware that does things beyond what a normal Z80 would be doing. Example: Memory-mapping "pages" of FlashROM in 16KB chunks to sit evenly with the Z80's 64KB physical address space.
Ah, ok a System-on-Chip. Yeah, because there would be no way a regular Z80 would be able to do that unless you did some fancy stuff with the address and data buses.

Hmmm, that actually wouldn't seem very smart in a first glance, but it might make a little sense actually. It's a cheap solution. Z80 is kind of slow (compared to today's ARM and SuperH) so the CPU wouldn't be outrunning the Flash and the programs aren't extremely large (like 100KB or bigger) so not much reading would have to be done.
To address another concern, the calculator *is* slow enough (even at 15MHz) to run programs directly from FlashROM without needing to insert "wait cycles". Or rather, the Flash is fast enough to keep up with the Z80.
Heh, yeah, that's what I was saying.

Thanks for clearing this up Iambian. I guess I was just embarrassing myself trying to guess how TI apps get executed, thought it would be same way as Casio. :-[ I guess we now know for sure that Casio and TI (at least the TI-8x ones) load their apps differently.
« Last Edit: October 11, 2010, 10:48:18 pm by kucalc »

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: Casio Prizm - Color graphic calculator
« Reply #222 on: October 11, 2010, 10:43:50 pm »
These models don't actually use a physical Z80, but rather a SoC that has additional hardware that does things beyond what a normal Z80 would be doing. Example: Memory-mapping "pages" of FlashROM in 16KB chunks to sit evenly with the Z80's 64KB physical address space.
Ah, ok a System-on-Chip. Yeah, because there would be no way a regular Z80 would be able to do that unless you did some fancy stuff with the address and data buses.
The really old TI-83's actually used a physical Z80, coupled with some fancy memory mapping hardware to let it access all of it's "ROM". While this doesn't really apply to our example since the memory isn't Flash, the concept is similar. TI just found cheaper ways to implement these schemes. They kinda ... stuck with us.

I figure that this information is only valid for your good ol' Ti-73's, TI-83+/84+(SE)s and perhaps a select few other calculators. You'd have to ask around for how the Ti-89 calcs work, though I think they work in a similar way. The Nspire is completely different and ... well. I'm not the person to ask.

The only reason I know that the old TI-83's used an actual Z80 is because I took apart some person's Ti-83 in my college's math lab and found that sucker. A honest-to-God real Z80. I'll never forget that day. I wasn't able to tell which one was the ROM, which one was the RAM, and which one was the memory mapping hardware. There was some other chip there, too. Couldn't figure out what it could possibly be doing.
« Last Edit: October 11, 2010, 10:46:46 pm by Iambian »
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio Prizm - Color graphic calculator
« Reply #223 on: October 11, 2010, 10:53:22 pm »
One thing I didn't knew is that the 83+ didn't use a real z80 :O

Offline uberspire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +57/-0
    • View Profile
    • Uberspire
Re: Casio Prizm - Color graphic calculator
« Reply #224 on: October 11, 2010, 10:58:01 pm »
I figure that this information is only valid for your good ol' Ti-73's, TI-83+/84+(SE)s and perhaps a select few other calculators. You'd have to ask around for how the Ti-89 calcs work, though I think they work in a similar way. The Nspire is completely different and ... well. I'm not the person to ask.
I agree. The Nspire seems completely different and more akin to what the fx-9860G and Prizm do. Reading around the Hackspire wiki, it seems that with the 32-bit ARM processor in the TI-nSpire you have a 4GB memory map, so you don't really need to do fancy page or memory swapping, since it can access a wider range of memory.

The only reason I know that the old TI-83's used an actual Z80 is because I took apart some person's Ti-83 in my college's math lab and found that sucker. A honest-to-God real Z80. I'll never forget that day. I wasn't able to tell which one was the ROM, which one was the RAM, and which one was the memory mapping hardware. There was some other chip there, too. Couldn't figure out what it could possibly be doing.
Yeah, I remember going through some schematics for a Z80 computer and noting the extra hardware it would take to break the 64KB barrier. Now these days, you've got 32 bit processors with large buses and integrated memory controllers, the extra chips aren't necessary. :)