fx-9860GII - Arduino - Communication
17 posts
• Page 2 of 2 • 1, 2
- Pedantis
- Junior Member
- Posts: 14
- Joined: Fri Apr 26, 2013 5:57 pm
- Location: BW, Germany
- Calculators: Casio fx-9860GII
Re: fx-9860GII - Arduino - Communication
Ok, but what is its syscall number? I implemented the syscalls in syscalls.src like this:
But were can I find the numbers (like 040C, 0414)? Until now I just googled it.
EDIT: Seems like I just have to remove 0x
- Code: Select all
SYSCALL 040C, _Serial_ReadOneByte
SYSCALL 040E, _Serial_BufferedTransmitOneByte
SYSCALL 0418, _Serial_Open
SYSCALL 0419, _Serial_Close
SYSCALL 0414, _Serial_ClearTransmitBuffer
SYSCALL 0CC5, _InputString
But were can I find the numbers (like 040C, 0414)? Until now I just googled it.
EDIT: Seems like I just have to remove 0x

- Pedantis
- Junior Member
- Posts: 14
- Joined: Fri Apr 26, 2013 5:57 pm
- Location: BW, Germany
- Calculators: Casio fx-9860GII
Re: fx-9860GII - Arduino - Communication
Ok, I was able to implement the syscall correctly. It supports nearly every single mathematical expression (sin, ln, sqrt (as a symbol)) but not spaces and not small chars 
Does anybody know how to do that?

Does anybody know how to do that?
Re: fx-9860GII - Arduino - Communication
You can use your own string input or an implemented one:
1) download mylib
2) include mylib.h
3) declare "struct String * msg;"
4) init string "msg = stringInit("", strlen(test));"
5) get message "stringInput(1, 1, msg, 8, strlen(test), "", 1, INPUT_STRING);"
6) Your data is now "s1->data"
I don't think that you have to clear the transmit buffer more than one time
1) download mylib
2) include mylib.h
3) declare "struct String * msg;"
4) init string "msg = stringInit("", strlen(test));"
5) get message "stringInput(1, 1, msg, 8, strlen(test), "", 1, INPUT_STRING);"
6) Your data is now "s1->data"
I don't think that you have to clear the transmit buffer more than one time

- SimonLothar
- Senior Member
-
- 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: fx-9860GII - Arduino - Communication
Looks like some parity problem.Pedantis wrote:Strangely, the resulted output on my computer looks always like this:
"Loÿrÿeÿm iÿpsum doÿlÿoÿrÿ siÿtÿ ameÿtÿ"
Does somebody know why?
The ÿ always occurs after even-parity characters.
Try to adjust the parity setting on either side:
f.i. here:
mode[ 2 ] = 2;//parity: 0=no; 1=odd; 2=even
I'll be back!
- Pedantis
- Junior Member
- Posts: 14
- Joined: Fri Apr 26, 2013 5:57 pm
- Location: BW, Germany
- Calculators: Casio fx-9860GII
Re: fx-9860GII - Arduino - Communication
SimonLothar: That's exactly what I did yesterday to fix it
Casimo: I already tried that, but I wasn't able to read the information from s1->data...
That works now, but, when compiling, the linker aborts.
First, I got an undefined external symbol error "_stringInput" (which was fixed by changing the name of the specific syscall in syscalls.src), and now he would like to see "_stringInit" defined, but I am not familiar with that syscall and wasn't able to find it in SimonLothars work...
Does somebody know that syscall? Does it even exist?
BTW, Casimo: In your example the information should be stored in msg->data, not in s1->data, or am I wrong?

Casimo: I already tried that, but I wasn't able to read the information from s1->data...
That works now, but, when compiling, the linker aborts.
First, I got an undefined external symbol error "_stringInput" (which was fixed by changing the name of the specific syscall in syscalls.src), and now he would like to see "_stringInit" defined, but I am not familiar with that syscall and wasn't able to find it in SimonLothars work...
Does somebody know that syscall? Does it even exist?
BTW, Casimo: In your example the information should be stored in msg->data, not in s1->data, or am I wrong?
- SimonLothar
- Senior Member
-
- 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: fx-9860GII - Arduino - Communication
stringInput and stringInit are functions contained in mylib.c. These are no syscalls.Pedantis wrote:First, I got an undefined external symbol error "_stringInput" (which was fixed by changing the name of the specific syscall in syscalls.src), and now he would like to see "_stringInit" defined, but I am not familiar with that syscall and wasn't able to find it in SimonLothars work...
Does somebody know that syscall? Does it even exist?
I'll be back!
- Pedantis
- Junior Member
- Posts: 14
- Joined: Fri Apr 26, 2013 5:57 pm
- Location: BW, Germany
- Calculators: Casio fx-9860GII
Re: fx-9860GII - Arduino - Communication
Yes, I just figured that out, sorry
Well, it works now, here is my final code:
Thanks to everybody who helped me starting to code with the SDK!
I'm going to try to add a possibility to enter small characters.

Well, it works now, here is my final code:
- Code: Select all
#include <string.h>
#include "fxlib.h"
#include "mylib.h"
int Serial_BufferedTransmitOneByte(unsigned char);
int Serial_Open(void *sm);
int Serial_Close(int mode);
struct String* msg;
int i;
unsigned int key;
unsigned char demo;
char mode[6];
int AddIn_main(int isAppli, unsigned short OptionNum)
{
messageBox("Use this program to|tweet via serial","fx-9860GII twitter client");
Bdisp_AllClr_DDVRAM();
msg = stringInit("", 50);
mode[0] = 0;
mode[1] = 5;
mode[2] = 2;
mode[3] = 0;
mode[4] = 0;
mode[5] = 0;
Serial_Open(&mode);
stringInput(2,3,msg,19,50,"Tweet",1,INPUT_STRING);
if (strlen(msg->data)>0)
{
for(i=0; i<strlen(msg->data); i++)
{
Serial_ClearTransmitBuffer();
demo=msg->data[i];
Serial_BufferedTransmitOneByte(demo);
Sleep(100);
}
/*This is the tweeting trigger used by the Arduino*/
Serial_BufferedTransmitOneByte('X');
Sleep(100);
Serial_BufferedTransmitOneByte('Y');
/*----------------------------------------------*/
Bdisp_AllClr_DDVRAM();
locate(2,4);
Print((unsigned char*)"Tweeted sucessfully");
while(1)
{
GetKey(&key);
}
}
return 1;
}
#pragma section _BR_Size
unsigned long BR_Size;
#pragma section
#pragma section _TOP
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}
#pragma section
Thanks to everybody who helped me starting to code with the SDK!

I'm going to try to add a possibility to enter small characters.
17 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 43 guests