Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Autres questions


Index du Forum » Autres questions » How do I use the serial communication function of the 9750giii or 9860gii?
Wangchai Hors ligne Membre Points: 3 Défis: 0 Message

How do I use the serial communication function of the 9750giii or 9860gii?

Posté le 03/07/2025 11:13

How do I use the serial communication function of the 9750giii or 9860gii? I want to create a g1a plugin to use the TRS serial port to enable the 9750giii or 9860gii to connect to the ESP32C3 for interfacing with the AI API. However, I have no idea how to develop this function using the SDK. According to the AI's prompt, it informed me of many header files that do not exist in the SDK, such as serial.h or files in syscalls.src, and I always couldn't find a way to open the serial port.


Lephenixnoir Hors ligne Administrateur Points: 25218 Défis: 174 Message

Citer : Posté le 03/07/2025 11:34 | #


Alright, so... it is possible, the functionality is there in one way or another, but the APIs are lacking. So it'll take some effort.

Currently the only driver available for the serial port is the OS driver, which is used through the Serial syscalls. These are available pretty much everywhere, including the fx-9750G III and the fx-9860G II.

Can you elaborate on what your project looks like so far? What SDK are you using? Is your project in a working minimal state? What calculator models are you testing on?

If you have the older SDK (official fx-9860G SDK maybe), you should define and invoke the syscalls. If you have the fxSDK, it's the same but you need to world switch when calling these functions. (I keep saying I'll write a proper driver one day.)

In case you already know what you're doing; below are all the details. If not, no worries, we can take the time to go through it.

Here's the original documentation for the serial syscalls: https://bible.planet-casio.com/simlo/chm/v20/fx_legacy_Serial.htm
You'll need some but not of all of these (those that you don't understand, you probably don't need either). Here's the assembly code for declaring them, add the syscalls in the list then save it as *.S if using GCC (e.g. fxSDK), preprocess it manually if you're using the old fx-9860G SDK:

#define SYSCALL(name, id)           \
.global name                       ;\
name:                              ;\
         mov.l   syscall_table, r2  ;\
         mov.l   1f, r0             ;\
         jmp     @r2                ;\
         nop                        ;\
.balign 4                          ;\
1:      .long   id

SYSCALL(_Serial_Open, 0x0418)
// other syscalls go here...

syscall_table:
        .long   0x80010070

You also need to prototype the functions in a header and then you're good to go. If using gint (fxSDK), you'll want to world switch whenever you use serial logic (you can leave the serial port open during these swiches):

void my_serial_logic(void) {
    // use serial functions here...
    Serial_BufferedTransmitOneByte('H');
    Serial_BufferedTransmitOneByte('i');
    Serial_BufferedTransmitOneByte('!');
    // ...
}
// to call
#include <gint/gint.h>
gint_world_switch(GINT_CALL(my_serial_logic));

Mon graphe (27 Juin): (MQ || Rogue Life) ; serial gint ; passe gint 3 ; Azur ; ...) || (shoutbox v5 ; v5)
Wangchai Hors ligne Membre Points: 3 Défis: 0 Message

Citer : Posté le 03/07/2025 15:26 | #


now i am using official fx-9860G SDK, and my program hasn't been officially written yet, I'm stuck on not knowing how to enable the serial port. However, according to your instructions, it seems that I can turn on the serial port. But currently, I haven't received my TRS cable. I plan to connect these two calculator after the completion and see if they can communicate normally. Thanks your help!
fx-9860gii, fx-9750giii
Lephenixnoir Hors ligne Administrateur Points: 25218 Défis: 174 Message

Citer : Posté le 03/07/2025 15:28 | #


Excellent, good luck!

Before I forget, be wary of the usual caevats of the older SDK on newer models: everything related to "SH4 compatibility" will apply (the G-III has a SH4 CPU, to G-II likely too, and the SDK targets SH3 models), meaning you can't use IsKeyDown() unless you go through this tool. Also the SDK function GetKeyWait() doesn't work. Aaand that should be the main pitfalls.
Mon graphe (27 Juin): (MQ || Rogue Life) ; serial gint ; passe gint 3 ; Azur ; ...) || (shoutbox v5 ; v5)

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2025 | Il y a 145 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd