Register

Prizm as screen

Discuss issues related to the Casio Prizm 3rd party development
Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Prizm as screen

Postby Casimo » Wed Jan 01, 2014 2:21 pm

I already asked in cemtech, I'd like to use my Prizm as input and output for my Raspberry Pi. gbl08ma said that it is not yet possible to communicate through USB - is that true?
I'm asking because I saw syscalls 0x1353, 0x1354 and some others that seem to be the ones I need.
If so, it would be great if someone could provide a piece of code on how to use these commands :)
Image

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Prizm as screen

Postby SimonLothar » Wed Jan 01, 2014 5:04 pm

The syscalls are the right ones.

With the fx-9860-types, the USB-port on the PC has been accessed via the standard file access API (CreateFile, ReadFile, WriteFile, CloseHandle). Access has been relatively easy.

The mass-storage-interfaces of the fx_CG/-CP-types use the WINDOWS function DeviceIOControl to do establish serial communication. This requires the knowledge of the fx-specific IoControlCodes and their functions.
The problem is: lack of information.
OSUpdateDLL.dll knows the secrets, because OSUpdateDLL.dll (possibly assisted by fxASPI.dll) actually does the communication.

---

Isn't your Raspberry Pi equipped with a serial interface (UART)?
Possibly on TTL-level, so you even do not need a RS232 converter.
Communication via the 3-pin would be not this difficult.
I'll be back!

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Prizm as screen

Postby gbl08ma » Wed Jan 01, 2014 10:40 pm

Won't the 3-pin port be too slow to get a usable framerate on the screen? Unless we lower the quality, for example to just 256 colors...

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Prizm as screen

Postby SimonLothar » Thu Jan 02, 2014 8:12 am

gbl08ma wrote:Won't the 3-pin port be too slow to get a usable framerate on the screen? Unless we lower the quality, for example to just 256 colors...
Sure. A complete 16-bit screen has a size of 162 KiB, which would require 16 seconds to transfer with 115 kBaud. That would be still a problem with USB.

A scheme based on the transfer of a complete VRAM would require a shadow of the Prizm VRAM on the Raspberry Pi, including a Prizm compatible graphical engine and all font-bitmaps.

I'd use short commands instead, like the VT100 control set (possibly extended) and let the Prizm do the drawing job.
And going this way, it would be easier to switch to some alternate displaying hardware, too.
I'll be back!

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Prizm as screen

Postby gbl08ma » Thu Jan 02, 2014 12:52 pm

VT100 won't really work if he wants to display X output through the screen...

Can't the USB do way more than 115200 baud? Or is it too slow on the Prizm, too?

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Prizm as screen

Postby SimonLothar » Thu Jan 02, 2014 10:13 pm

gbl08ma wrote:VT100 won't really work if he wants to display X output through the screen...
What do you mean? An add-in, which is running on a prizm, could wait for VT100 escape sequences, and process the commands. F. i.
ESC[r;cH Move the cursor to row r, column c.

If you need functions, which VT100 does not support, you can implement new ESC-sequences.

gbl08ma wrote:Can't the USB do way more than 115200 baud? Or is it too slow on the Prizm, too?
Of course the USB is faster. On the fx-9860-types, if I remember correctly, it is about 4-times faster. For the prizm, alas, I have no data, because I do not know, how to access a mass-storage-device as serial device...yet.
I'll be back!

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Prizm as screen

Postby gbl08ma » Fri Jan 03, 2014 2:06 pm

SimonLothar wrote:
gbl08ma wrote:VT100 won't really work if he wants to display X output through the screen...
What do you mean? An add-in, which is running on a prizm, could wait for VT100 escape sequences, and process the commands. F. i.
ESC[r;cH Move the cursor to row r, column c.

If you need functions, which VT100 does not support, you can implement new ESC-sequences.
I was talking about displaying a graphical desktop on the Prizm, I think that's what Casimo wants - to display not just a shell, but have the calculator be a X11 screen. If the idea is to have the Prizm display just a shell (text), he can use fxTerm (or whatever it's called) by MPoupe, I think it supports VT100 sequences and colors through the 3-pin port. The UART on the Raspberry Pi will make it very easy, hopefully.

SimonLothar wrote:I do not know, how to access a mass-storage-device as serial device...yet.

I think you'll want to do it the other way around... have the Prizm behave as a serial device instead of a mass-storage device.
I don't know who told me this, maybe you or TeamFX, but the Prizm has some drivers it can chose from in order to make the USB port do different things. I think it has at least four drivers: one for the mass storage (F1 in the USB prompt), one or two for the screen receiver and projector modes (remaining options in the USB prompt), one for the OS update mode and another for the protocol 7.00 mode (or one for both).

When my Prizm had its bootloader accidentally erased, it would display the debug mode with the "ABS NG" message on top, and while it kept working normally after exiting the debug mode, when one connected the USB cable, instead of showing the usual prompt for selecting a mode, it would enter the "Receiving..." screen as seen on older calculators, talking through protocol 7.00 on the USB.
The OS update mode does not appear to run protocol 7.00 (at least I never managed to connect to it with the fx9860 desktop tool), but it certainly is some sort of serial communication (perhaps the same driver is used, only the protocol on top of it is different).
Someone has already sniffed traffic for some modes and documented parts of it, see here: http://prizm.cemetech.net/index.php/USB_Communication

Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Re: Prizm as screen

Postby Casimo » Sun Jan 05, 2014 4:45 pm

I was talking about displaying a graphical desktop on the Prizm, I think that's what Casimo wants - to display not just a shell, but have the calculator be a X11 screen.

That's it, but a shell would also be nice.

With the fx-9860-types, the USB-port on the PC has been accessed via the standard file access API (CreateFile, ReadFile, WriteFile, CloseHandle). Access has been relatively easy.

So it would work with an fx-9860? That would be ok, too - but the screen is a bit small.

Isn't your Raspberry Pi equipped with a serial interface (UART)?

It is. I thought I could do it via plug & play, building something with the GPIO-pins was not what I wanted - I have no experience with them (yet) and I have no board to protect them (yet). But if you say it is the best solution, I'll try it.
Image

Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

Re: Prizm as screen

Postby nsg » Fri Jan 31, 2014 8:40 pm

Casimo wrote:That's it, but a shell would also be nice.


See this post.
viewtopic.php?f=20&t=1473&p=13458&hilit=fxterm#p13458

I managed to use fxterm with a primitive cable (2.5mm plug / 3 separate female headers) -- Pi has 3.3V serial, which is compatible with Prizm, but not FX.
Also, fxterm does not have all keys implemented, so you cannot enter everything. If you want some simple interface to control some device through Pi+Prizm, maybe BBS terminal is good choice (in case you old enough to remember what BBS is)

Return to Casio Prizm SDK

Who is online

Users browsing this forum: Google [Bot] and 16 guests