Register

Serial port questions

Discuss issues related to the fx-9860G Software Development Kit
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: Serial port questions

Postby SimonLothar » Fri Mar 01, 2013 5:40 pm

happy wrote:Cable is loose too.
Could you drop a photo like this, please?
Image
This is a jack, which fits well. I am very curious, how the connectors of your cable look like.
I'll be back!

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Serial port questions

Postby happy » Sat Mar 02, 2013 5:26 am

Hope this helps..

Image

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

Re: Serial port questions

Postby nsg » Sun Mar 03, 2013 12:01 am

Happy,

as i wrote before I also have a problem connecting 2 casio calculators together.
Today, i figured out what i was doing wrong, same thing may be happening to you too.
I opened the case thinking to adjust springs (whatever that means) and it became immediately apparent that I do not insert connector all the way through.
I had to push it pretty hard before it went "click". The amount of force I had to apply was borderline disturbing and i was almost afraid to brek something.
After I applied similar procedure to the other calculator (I mean, inserting connector until it clicks), i had no problems establishing communication between them.

On a side note, it would really improve your close-up pictures if you learned how to use "macro" button.

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Serial port questions

Postby happy » Sun Mar 03, 2013 6:23 am

nsg wrote:I had to push it pretty hard before it went "click".
...
On a side note, it would really improve your close-up pictures if you learned how to use "macro" button.


NSG, You are a saviour! That was indeed the problem, thank you! I don't have a camera, used my phone to click the pic.

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

Re: Serial port questions

Postby Casimo » Sun Mar 03, 2013 8:21 am

Casimo wrote:Maybe you have to press stronger.

;)
Image

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Serial port questions

Postby happy » Sun Mar 03, 2013 12:51 pm

Casimo wrote:
Casimo wrote:Maybe you have to press stronger.

;)


Thanks. The suggestion to look out for the 'click' did it though.

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

Re: Serial port questions

Postby gbl08ma » Sun Mar 03, 2013 6:56 pm

Yeah... I have noticed that usually you must apply a bit of pressure, on the 3-pin female port of Prizms which never had that port used, in order for the connector to be fully inserted. That extra bit of pressure usually goes unnecessary as you use the port more. I don't know if this is true for other Casio devices with 3-pin ports.

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Serial port questions

Postby happy » Mon Mar 04, 2013 11:36 am

Transmit buffer:

1) I should check free space by calling Serial_GetFreeTransmitSpace() before calling Serial_BufferedTransmitNBytes(), right?

2) If I keep calling Serial_BufferedTransmitNBytes() and there is no cable attached, will the buffer get full at some point? When/how is this buffer cleared?

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: Serial port questions

Postby SimonLothar » Mon Mar 04, 2013 12:03 pm

happy wrote:1) I should check free space by calling Serial_GetFreeTransmitSpace() before calling Serial_BufferedTransmitNBytes(), right?
Serial_BufferedTransmitNBytes() returns 2 instead of 0, if there is not enough buffer space available. So it is not necessary to call Serial_GetFreeTransmitSpace() beforehand.
happy wrote:2) If I keep calling Serial_BufferedTransmitNBytes() and there is no cable attached, will the buffer get full at some point? When/how is this buffer cleared?
The serial transmit procedures are not aware of whether a cable is attached or not. Available data are sent interrupt driven until the transmit buffer is empty. Hence the buffer is cleared automatically.
I'll be back!

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Serial port questions

Postby happy » Mon Mar 04, 2013 1:45 pm

SimonLothar wrote:Serial_BufferedTransmitNBytes() returns 2 instead of 0, if there is not enough buffer space available


Am I right in assuming that: 2 means that none of the data from bytes_to_transmit was written to the buffer?

If yes, don't I need to keep calling Serial_BufferedTransmitNBytes() with the same data until it returns 0? So, this can't be blocking, right? My program is in a main loop looking for user input. Whenever user enters something (say in a text box), I need to transfer it via serial, so I call Serial_BufferedTransmitNBytes(). But I can't build the retry logic here (keep calling the function till 0 is returned) because it would block the user. So I should have a queue in a timer and the main loop should write to the queue? And the function in the timer should take care of error codes, retries etc.?

PreviousNext

Return to Casio fx-9860 SDK

Who is online

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