Register

Prizm 3 wire serial communications

Discuss issues related to the Casio Prizm 3rd party development
Senior Member
Posts: 69
Joined: Sat Feb 02, 2013 4:29 am
Calculators: Casio Cfx Series, Casio fx-CG10

Prizm 3 wire serial communications

Postby nsg » Sat Feb 09, 2013 8:56 pm

I tried to see what singnals on a 3 wire communication port look like.
I only have one casio calculator (Prizm) and cannot connect it to anything else to establish communication session.

I plugged the cable and hooked up oscilloscope to base stem and middle band (as internet suggests).

Then I tried to Send(A). Here is what I got:
Image

There was also Com error on calculator side.

Hree is wha tSend38k(A) looks like:
Image

On smaller resolution another packet is visible, 46ms awa from the first one.
Image

There was no error this time.

What is the communication protocol?

Senior Member
Posts: 369
Joined: Tue Jan 03, 2012 11:24 pm
Calculators: Casio Afx 1.0, Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG20, Casio Classpad fx-CP400

Re: Prizm 3 wire serial communications

Postby helder7 » Sat Feb 09, 2013 10:36 pm

Nice diagrams, thanks for sharing.

The communication protocol (syscalls) is documented in fx_calculators_SuperH_based.chm

I suggest you create a homemade cable, they are cheap and relatively easy to construct if you want explore more the serial port.

BTW: Can you do a diagram of the CGPlayer Audio (audio player for prizm).
SiO2 + CaCO3 ----------> CaSiO3 + CO2

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 3 wire serial communications

Postby SimonLothar » Sat Feb 09, 2013 11:03 pm

Send() opens the com-port wth 9600 baud and sends 0x15. Then it waits for a 0x13 as handshake. If 0x13 is not received in time, the function quits with an error.
Send38K() opens the com-port with 38400 baud and continues like Send().

If either of these functions quit after the timeout, the com-port is closed and the output-driver-circuit is disabled, which produces another signal change.
I'll be back!

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 3 wire serial communications

Postby SimonLothar » Sun Feb 10, 2013 4:33 pm

@nsg
Your osci-signal should look like this.
Image
Perhaps you should switch your osci to DC-coupling.
I'll be back!

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

Re: Prizm 3 wire serial communications

Postby nsg » Sun Feb 10, 2013 5:56 pm

Simon, your picture is more like what i expected to see: nice rectangular shapes.
As i interpret it, the signal is normally high, the first drop is a start bit, then goes 1 0 1 0 1 0 0 0 (which is 0x15 transmitted low bits first).
My oscilloscope does not have a "DC coupling" setting, not that i can see.
I do not understand why my piture comes out distorted. Did you make your measurement by tapping into actual connection with 2 units on both sides of the wire? I only have one Prizm, so I had to measure signal by simply attaching probes to the empty end of a link cable. Mayb the absense of the receving device distorted the signal?

Helder7: my oscilloscope can only sample at 100kHz, that is 100000 samples per second. At 400000 bits per second (that's what player is transmitting accrding to the readme) i would get only one sample per 4 bits and to see a meaningful picture, i need other way around -- 3-4 samples per bit.

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 3 wire serial communications

Postby SimonLothar » Sun Feb 10, 2013 7:18 pm

nsg wrote:As i interpret it, the signal is normally high, the first drop is a start bit, then goes 1 0 1 0 1 0 0 0 (which is 0x15 transmitted low bits first).
Exactamundo.
I do not understand why my piture comes out distorted. Did you make your measurement by tapping into actual connection with 2 units on both sides of the wire? I only have one Prizm, so I had to measure signal by simply attaching probes to the empty end of a link cable. Mayb the absense of the receving device distorted the signal?
I measured open ended, like you (I use a Fluke PM-99).
If your osci is fixed to AC-coupling, the distortion can be explained. With AC-coupling the osci tries to compensate for DC offsets, dynamically adjusting the display baseline. Hence with a constant level over a certain time, the osci "thinks", that a DC offset is present and drives the displayed signal back to the baseline giving the distortions you observed. Usually AC-coupling is not appropriate for rectangular signals.
I'll be back!

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

Re: Prizm 3 wire serial communications

Postby nsg » Sat Mar 16, 2013 6:25 pm

Turns outh that the distortion was due to bad connection. After I fully inserted the 2.5 mm plug (until click) i was able to obtain more presentable form:

Image

Note how voltage goes 0 to 2.8.

My second step is to attempt to communicate with BASIC Stamp 2, which apparently also has TTL-level serial communication capabilities.
Here is what BS2 sending string "af" at 9600 bps true looks like.
Image

Here signal goes 0-5.
Is it safe to connect 0-5V to calculator input?
Specifically, is 0-5 is what MAX23x outputs?

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 3 wire serial communications

Postby SimonLothar » Sat Mar 16, 2013 6:56 pm

nsg wrote:Turns outh that the distortion was due to bad connection. After I fully inserted the 2.5 mm plug (until click) i was able to obtain more presentable form:
That looks much better, indeed.

nsg wrote:Specifically, is 0-5 is what MAX23x outputs?
I just measured 5 V at the TTL-output of my MAX232-based converters.
I'll be back!

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

Re: Prizm 3 wire serial communications

Postby nsg » Sat Mar 16, 2013 11:24 pm

I decided to use old CFX for experiments. I assume that software protocol is identical.

I wrote short cfx program:
Code: Select all
Send(F)

F is 20132028

Here you can see CFX (red) sending 0x15, BS2 (blue) responding with 0x13 and then CFX continues with some long transmission
Image

Here is finer resolution of the responce.
Image
Here is my decoding of this sequence of bits:
(0)0101 1100(1)111(0)0110 1010(1)111(0)1000 0010 (1)111(0)0011 001?
Each byte starts with start 0 ends with stop 1 followed by any number of 1's until next start
So far I can make up the bytes are 3a, 56, 41, 4c (or cc?)
But BS2 reads 3a 7a ff f5 af ff ff ff and consistently. So i confused for now.
Also, funny thing, but CFX outputs 5V, not 3 like prizm.

Also, Simon, where this information about 0x15 <-> 0x13 exchange is in fx_calculators_SuperH_based document? I only found syscals and some description of protocol 7, which seem like something to do with os flashing, but nothing about BASIC exchange protocol.

EDIT:
I figured out my BS2 bug. Here's what I am getting:
3A:56:41:4C:0:56:4D:0:1:0:1:46:FF:FF:FF:FF:FF:FF:FF:56:61:72:69:61
":VAL" \0 "VM" \0 \1 \0 \1 "F" ff ... "Varia"...
(which is consistent with what i see)

EDIT: found this (connecting to picaxe)
http://www.nexusresearchgroup.com/downloads/Casio-Picaxe-manual.pdf

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 3 wire serial communications

Postby SimonLothar » Sun Mar 17, 2013 8:59 am

nsg wrote:Also, Simon, where this information about 0x15 <-> 0x13 exchange is in fx_calculators_SuperH_based document? I only found syscals and some description of protocol 7, which seem like something to do with os flashing, but nothing about BASIC exchange protocol.
It does not cover the topic.

And after you found this
http://www.nexusresearchgroup.com/downloads/Casio-Picaxe-manual.pdf
the gap seems to be filled.

The Casio to PC RS232 interface on page 12 of this documentation is interesting. I'd like to know the actual voltage levels of the RS232-Rx-pin of this interface. It looks as if it goes to GND instead of -V, which does not match the RS232-specification.
I'll be back!

Next

Return to Casio Prizm SDK

Who is online

Users browsing this forum: No registered users and 21 guests