Post Reply 
Sharp PC-G850VS
02-22-2021, 09:28 PM (This post was last modified: 07-08-2022 02:52 PM by robve.)
Post: #141
RE: Sharp PC-G850VS
(02-22-2021 12:26 AM)Eddie W. Shore Wrote:  Does anyone know how to find the integer or fractional part in the C programming module?

Perhaps this is useful Smile

I spent some time today to map the math BASIC functions to C for the G850(V)(S). To use this code, enter the macros and functions (or only the ones you need) with line numbers (use A to auto number) in a new file basic.h on the G850(V)(S). Then add #include "basic.h" in your C program:

/* C equivalents of BASIC math functions - Dr. Robert van Engelen */
/* Written in compact form to save space, using fp (double) and li (long) */
/* WARNING: <,<=,>,>= on floats have a bug on some G850's, instead of x<y use x-y<0 */
/* Functions do not perform any range validity checking on argument values */
/* INT() and FIX() arguments should be in range -2147483648 to 2147483647 */
/* Note that ABS(x) takes a double, whereas abs(n) takes an int */
/* Note that li (long) values must be displayed with printf("%ld",n); */
/* License: BSD-3 open source */

#define fp double
#define li long

#define ACS acos
#define AHC acosh
#define AHS asinh
#define AHT atanh
#define ASN asin
#define ATN atan
#define COS cos
#define EXP exp
#define LN log
#define LOG log10
#define PI 3.141592654
#define RCP 1./
#define SIN sin
#define SQR sqrt
#define TAN tan

fp ABS(fp x){return x<0?-x:x;}
fp CUB(fp x){return x*x*x;}
fp CUR(fp x){return pow(x,1./3);}
fp FACT(li n){fp x=1;while(n>1)x*=n--;return x;}
li FIX(fp x){return x;}
li INT(fp x){return x<0?x-.9999999999:x;}
li NCR(li n,li k){li i=1,j=0;if(k>n-k)k=n-k;while(++j<=k)i*=n-k+j,i/=j;return i;}
li NPR(li n,li k){li i=1;k=n-k;while(++k<=n)i*=k;return i;}
fp POL(fp x,fp y,fp*z){*z=x>0?atan(y/x):y?asin(y<0?-1:1)-atan(x/y):acos(-(x<0));return sqrt(x*x+y*y);}
fp REC(fp x,fp y,fp*z){*z=x*sin(y);return x*cos(y);}
li SGN(fp x){return x<0?-1:!!x;}
fp SQU(fp x){return x*x;}
fp TEN(x){return pow(10,x);}

/* 0<RND(0)<1 gives double float result */
/* 0<RND(n)<=ceil(n) for n>=1 gives integer result */
/* RND(-n)==n new PRNG seed n */
fp RND(fp x) {
static unsigned li s=5323;
if (x<0) return s=-x;
s=8253729*s+2396403;
return x<1 ? (s%32767+1)/32768. : (li)(s%32767*x)/32767+1;
}

Most of the math functions available in BASIC are already defined in C, but the ones that are missing are defined in this code.

Note that the code is very terse to keep it as small as possible. Every punctuation character is significant! Best is to load the code with bas2img and bin2wav over the CE-126P cassette interface (see my earlier post) or directly via RS232.

I also found that the PC-G850(V)(S) user guide has some omissions, such as beep(x,y,z) which is the same BEEP command as in BASIC which works if you have a piezo buzzer installed. Also the ternary operators (?:) and the comma operator (,) are not mentioned, and there are a couple of minor mistakes.

Disclaimer: I tested this code extensively and found no bugs. But I cannot offer any warranty.

I may post a set of C math functions that are missing on the G850(V)(S). Suggestions and contributions are welcome!

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
02-22-2021, 10:29 PM
Post: #142
RE: Sharp PC-G850VS
(02-22-2021 02:53 AM)robve Wrote:  That is not true IMHO. The C compiler/interpreter has the same math functions as BASIC offers, but no more than that, because there is no <math.h> you can #include. However, you can define your own .h file (e.g. math.h) with extra functions that you often use and save it to the file system. Then simply #include "math.h".

This is quite surprising, but thanks for insights on the additional C function support for the built-in BASIC functions. I recall he told me there was a certain entire class of functions that were not provided, which I took to mean something like 'all the trig Fns', 'all the Stats Fns', etc. but perhaps he merely meant that basic functions such as you've provided in your 2nd post, which can be easily assembled from available core functions, were not provided? Also, ROM space limits was a factor (it always is!) so best to spend ROM space on the much more difficult transcendental functions.

In fact, maybe another reason these were not provided for students learning C on this machine was to leave these exact Functions as a challenge to be built in C, as you've done here. It appears you pass!! Smile

Also, thanks for providing the templates. Smile Useful themselves but also good illustrative examples.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
02-23-2021, 04:03 AM (This post was last modified: 07-08-2022 02:52 PM by robve.)
Post: #143
RE: Sharp PC-G850VS
(02-22-2021 10:29 PM)rprosperi Wrote:  This is quite surprising, but thanks for insights on the additional C function support for the built-in BASIC functions. I recall he told me there was a certain entire class of functions that were not provided, which I took to mean something like 'all the trig Fns', 'all the Stats Fns', etc. but perhaps he merely meant that basic functions such as you've provided in your 2nd post, which can be easily assembled from available core functions, were not provided? Also, ROM space limits was a factor (it always is!) so best to spend ROM space on the much more difficult transcendental functions.

Very good points!

I should add that most students learning C typically do not need any of the advanced math functions. They spend a lot of time on other things, like getting to grips with the concept of C pointers to build data structures Smile (or Sad depending what PL you like best).

It might be useful to reproduce most of the math.h functions for the PC-G850(V)(S), even if it is just an exercise. This is a professional calculator forum after all Wink

The C math functions are carefully crafted to prevent catastrophic cancellation, roundoff, and overflow issues. These issues are not for beginners. Entire books have been written on this subject.

Here is my attempt at reproducing the math.h functions and constants for the PC-G850(V)(S). EDIT: added new functions atan2, fmod, erf, erfc, tgamma, and lgamma with everything tested and verified:

/* math.h for the PC-G850(V)(S) - Dr. Robert van Engelen */
/* Written in compact form to save space */
/* WARNING: <,<=,>,>= on floats have a bug on some G850's, instead of x<y use x-y<0 */
/* Note: erf and erfc precision is at least 1.2e-7 (erfcc) */
/* Note: lgamma and tgamma precision is at least 2e-10 (Lanczos) */
/* License: BSD-3 open source */

#define M_E 2.718281828
#define M_LOG2E 1.366512921
#define M_LOG10E .4342944819
#define M_LN2 .693147181
#define M_LN10 2.302585093
#define M_PI 3.141592654
#define M_PI_2 1.570796327
#define M_PI_4 .7853981634
#define M_1_PI .3183098862
#define M_2_PI .6366197724
#define M_2_SQRTPI 1.128379167
#define M_SQRT2 1.414213562
#define M_SQRT1_2 .7071067812

double fabs(double x){return x<0?-x:x;}
double copysign(double x,double y){return y<0?-fabs(x):fabs(x);}
double log2(double x){return log(x)/M_LN2;}
double exp2(double x){return exp(M_LN2*x);}
double cbrt(double x){return pow(x,1./3);}
double floor(double x){return fabs(x)-1e9<0?x<0?(long)(x-.9999999999):(long)x:x;}
double ceil(double x){return -floor(-x);}
double trunc(double x){return fabs(x)-1e9<0?(long)x:x;}
double round(double x){return floor(x+.5);}
double modf(double x,double*y){return x-(*y=fabs(x)-1e9<0?x-(long)x:0);}
double fdim(double x,double y){return x-y>0?x-y:0;}
double fmax(double x,double y){return x-y>0?x:y;}
double fmin(double x,double y){return x-y<0?x:y;}
double hypot(double x,double y){double a=fabs(x),b=fabs(y);return a?b?a-b<0?b*sqrt(1+x/y*x/y):a*sqrt(1+y/x*y/x):a:b;}
double atan2(double y,double x){return x>0?atan(y/x):y?asin(y<0?-1:1)-atan(x/y):acos(-(x<0));}
double fmod(double x,double y){return x-y*trunc(x/y);}

double erfc(double x){double p=1/(1+fabs(x)/2),q=-.18628806+p*(.27886807+p*(-1.13520398+p*(1.4885187+p*(-.82215223+p*.17087277))));p*=exp(-x*x-1.26551223+p*(1.00002368+p*(.37409196+p*(.09678418+p*q))));return x<0?2-p: p;}
double erf(double x){return 1-erfc(x);}
double lgamma(double x){return log((1+76.18009173/(x+1)-86.50532033/(x+2)+24.01409824/(x+3)-1.231739572/(x+4)+1.208650974e-3/(x+5)-5.395239385e-6/(x+6))*2.506628275/x)+(x+.5)*log(x+5.5)-x-5.5;}
double tgamma(double x){return exp(lgamma(x));}

Note that hypot avoids catastrophic overflow by rearranging terms. Macros are used only if the argument(s) is/are guaranteed to be evaluated just once in the macro body. This avoids the common problem with calls like fmax(x++,y++) that fail as a macro. Otherwise, I tried to be as efficient as possible. Unlike the BASIC INT() function posted earlier, the floor(), ceil(), trunc(), round(), and modf() all work on unlimited doubles by using the fact that a long integer can hold up to 9 digits and G850(V)(S) doubles have 10 digit mantissas. This means that values >=1e9 have no fractional part. I used this observation to trick the code to check for |x|<1e9 which means the value has a fraction and can use a long cast in that case to obtain the integer part, otherwise just return the value unchanged.

If you spot an issue or an opportunity for further optimization then let us know!

- Rob

EDIT: replaced #defines with functions and added warning.

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
06-03-2021, 05:30 PM
Post: #144
RE: Sharp PC-G850VS
I just picked up a G850V, and am loving it for C programming. Thank you Rob for the wonderful condensed basic.h and math.h.

I'm not finding many limitations with the device at all, but it is a system where you have to do pretty much everything yourself. Not a lot of built-ins, but I'm finding myself very pleased with the C implementation. Next up, assembly/machine code!

The only thing that I have found as a bit of a limitation is that if you are using a function that's defined in an #include'd file, if you use the trace mode, you can't step line by line through the code. So debug whatever you want to use as an #include first.

Also in the debug mode, sometimes it's difficult to get at the data you want to see, I sometimes jump over to the MON mode to examine memory, but then, unfortunately you lose your runtime state.

Anyways it's tons of fun. Happy hacking everyone!
Find all posts by this user
Quote this message in a reply
06-06-2021, 07:45 PM (This post was last modified: 06-18-2021 05:47 PM by robve.)
Post: #145
RE: Sharp PC-G850VS
(06-03-2021 05:30 PM)silven Wrote:  Happy hacking everyone!

Happy to help with "hacking" on the PC-G850V Smile

A dragon curve C code "hack" that is pleasing to the eye on the small screen and to show how fast this machine can be to draw graphics:

Code:
const char SIN[4]={0,2,0,-2}, COS[4]={2,0,-2,0};
int x, y;
char a;
void dragon(char s, char n) {
  int u, v;
  if (n < 2) {
    u=x+COS[a];
    v=y-SIN[a];
    line(x, y, u, v, 0, -1, 0);
    a=a-s & 3;
    x=u+COS[a];
    y=v-SIN[a];
    line(u, v, x, y, 0, -1, 0);
  }
  else {
    dragon(1, n-1);
    a=a-s & 3;
    dragon(-1, n-1);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  clrscr();
  a=n/2 & 3;
  x=36;
  y=n & 1 ? 16 : 32;
  dragon(1, n);
  getch();
}

Enter a positive integer between 1 and 10, such as 8. Note: larger values are OK, but will produce off-screen graphics.

Edit: change 2 and -2 to 1 and -1 in the SIN[4] and COS[4] tables to produce smaller graphics that fit larger dragon curves on the screen.

One tiny issue that the PC-G850 manual does not mention is that local variables can only be declared in a function block, not in other {...} blocks. There is also no typedef, but #define works just as well. Other than these two minor limitations, this little machine is fun to "hack" some C and Z80 assembly code together.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
06-07-2021, 05:00 PM
Post: #146
RE: Sharp PC-G850VS
(06-06-2021 07:45 PM)robve Wrote:  A dragon curve C code "hack" that is pleasing to the eye on the small screen and to show how fast this machine can be to draw graphics:

What a beautiful little piece of code! I'm just working on a command interpreter and simple csv based database for information collection on the go, and generally just having fun with having such a versatile environment that's so handy.

Do you have a solution for getting data in and out? I'm considering either hacking something together with a breadboard and an ftdi module or springing for one of those premade cables or a printer.

zmc
Find all posts by this user
Quote this message in a reply
06-07-2021, 09:30 PM
Post: #147
RE: Sharp PC-G850VS
(06-07-2021 05:00 PM)silven Wrote:  Do you have a solution for getting data in and out? I'm considering either hacking something together with a breadboard and an ftdi module or springing for one of those premade cables or a printer.

SIO with FTDI. I assume you've read section "USB PC Adapter Cable with Hardware Handshake" with DIY instructions. Watch the UART-TTL signal levels of the PC-G850V. DIY SIO/PIO is best.

To store data on an SD card, see the excellent video by A Menadue: https://www.youtube.com/watch?v=HhB2_JjCkgk

By contrast, I've not had much luck with USB RS232 adapters and SHARP level converters (e.g. CE-T800 and CE-T801 for the PC-G850V or CE-130T for other SHARP). The adapters don't reach the required voltage levels for the SHARP level converters. A DIY works, but there is a small risk of ruining the device if something goes wrong. Adding some diodes and resistors to avoid shorts is a good idea. Then in C just open the SIO with fopen("stdaux", "rw") for half duplex or fopen("stdaux1", "rw") for full duplex mode with "rw" for reading and/or writing. Note that "a+" in the manual should mention "append to a file", not "input and output".

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
06-08-2021, 12:37 PM
Post: #148
RE: Sharp PC-G850VS
The Sharp cables CE-132T and 133T tend to work with more devices than the very early 130T.

The 132T uses an external ac adapter, so less flexible, but it is less dependent on power from the connected device.

The 133T is standalone, but in some cases cannot self-power from the connection.

Here's a cheap 133T for anyone looking for an Sharp 15-pin serial adapter:

https://www.ebay.com/itm/133672149943

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
06-08-2021, 05:18 PM (This post was last modified: 06-12-2021 01:21 AM by robve.)
Post: #149
RE: Sharp PC-G850VS
(06-08-2021 12:37 PM)rprosperi Wrote:  The Sharp cables CE-132T and 133T tend to work with more devices than the very early 130T.

The 132T uses an external ac adapter, so less flexible, but it is less dependent on power from the connected device.

The 133T is standalone, but in some cases cannot self-power from the connection.

Here's a cheap 133T for anyone looking for an Sharp 15-pin serial adapter:

https://www.ebay.com/itm/133672149943

Caveat lector+emptor: I also tried a CE-133T with no luck. The CE-132T could work since it's externally powered, but I don't know for sure.

Note that the CE-133T requires +/-7V input signal at minimum and +/-15V max (see the operating manual). Unfortunately, most USB RS-232C adapters offered online won't spec out the level or mention boosting. I got two USB adapters. One boosts the level to 6V, which is still insufficient.

A DIY adapter is out of the question for me, because I don't want to take the risk of ruining these 80s computers. If anyone is interested, a DIY 15-pin adapter is described here https://www.qsl.net/yt2fsg/pocket/pocket.html and here https://www.simon-lehmayr.de/e_pc.htm (click on PC-1350 then "Connections" at the top of the screen).

EDIT: please note that these adapters will NOT work with the PC-G850V but with older SHARP PC with a 15pin port! For details see https://sharppocketcomputers.com/#level

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
06-09-2021, 02:18 AM
Post: #150
RE: Sharp PC-G850VS
(06-08-2021 05:18 PM)robve Wrote:  The CE-132T could work since it's externally powered, but I don't know for sure.

I believe I still have a CE-132T - if you'd like, I'll loan it to you to see if it works, which would then at least identify something that folks could safely use, even if they are a bit hard to find these days.

Contact me by email if you're interested - I'm only an hour from the city, it may even be possible to meet somewhere in the middle.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
06-11-2021, 07:35 AM
Post: #151
RE: Sharp PC-G850VS
(12-18-2020 07:48 PM)robve Wrote:  The PC-G850 can be nicely used as a calculator, albeit in BASIC, which is cumbersome.

Attached is an RPN Complex Calculator I wrote that emulates the HP-15C. The display shows the T,Z,Y,X stack and its "imaginary stack" S,K,J,I. All of the PC-G850 function keys work. Like the HP-15C it has complex arithmetic, 2-var statistics, STO/RCL registers, and can be extended with BASIC programs (see source code). I also threw in some extra features, such as rational approximation by continued fractions.

[Image: Screenshot_20201218-104116.png]

RUN to start, clears registers
GOTO*R to resume without clearing registers

Keys for operations and functions:
A abs, |XI| -> XI
C ceiling, ceil(XI) -> XI
E x10^ (when entering a number)
F fraction, frac(XI) -> XI
G GCD, gcd(Y,X) -> X
H hyp prefix to [arc]sin,[arc]cos,[arc]tan
I enter imag part / back to real part
J same as I (for engineers)
L linear regression, slope and intercept -> Y,X
M mean of y and x -> Y,X
N floor, floor(XI) -> XI
Q quotient and remainder of Y/X -> X,Y (quotient in X, remainder in Y)
R rational, X -> Y,X such that Y/X approximates the given X within 1E-10
S stddev Sy and Sx -> Y,X
T truncate, trunc(XI) -> XI
V variance of y and x -> Y,X
Y linear estimation of r and y given X=x -> Y,X
^ raise, YJ^XI -> XI
+ add, YJ+XI -> XI
- subtract, YJ-XI -> XI
* multiply, YJ*XI -> XI
/ divide, YJ/XI -> XI
! factorial/gamma, fact(X) gamma(X+1) -> X
% percentage, X/100*YJ -> XI
2ndF SHIFT
SHIFT does not operate
CLS clear entry
CA clear all, restart
SPACE (or SHIFT minus) change sign, -XI -> XI
ENTER push on stack
BS delete
LEFT delete
RIGHT swap XI with YJ
UP roll stack up
DOWN roll stack down
RCM last-x, push LM -> XI
S-CONST (SHIFT CONST) display registers (press key to continue)
CONST STO [+|-|*|/] #register (press digit, or op then digit)
ANS RCL [+|-|*|/] #register (press digit, or op then digit)
F<->E re<->im, swap X with I,
->DEG hh.mmss X -> degree X
->DMS degree X ->hh.mmss X
PI push pi -> X
RND random, push random 0<x<1 -> X
MDF round towards zero, round(XI) -> XI
STAT clear stat registers R2 to R7
M+ stat add Y,X (updates registers R2 to R7 as per HP-15C stat)
M- stat remove Y,X
= enter Basic expression
... any PC-G850 calculator function key such as SIN

The implementation attempts to avoid intermediate overflow and roundoff issues, e.g. Numerical Recipes and "What Every Computer Scientist Should Know About Floating-Point Arithmetic".

New and improved version: annotated with comments and without comments

To extend the program, for example to press Q to produce the quotient and remainder of Y/X, just add an entry for key Q (ASCII 81) line 181:

' Q quotient and remainder of Y/X -> X,Y (quotient in X, remainder in Y)
181 IF A=81 GOTO 1000

1000 IF I<>0 OR J<>0 OR X=0 OR X<>INT X OR Y<>INT Y OR ABS X>=1E10 OR ABS Y>=1E10 GOTO 15 ' error
1010 N=X,X=SGN X*INT(Y/ABS X),Y=Y-N*X: GOTO 40

Enjoy!

Thanks so much !!! I have just discovered this calc and I love it. It is even better now.
Find all posts by this user
Quote this message in a reply
06-16-2021, 11:26 PM
Post: #152
RE: Sharp PC-G850VS
(06-07-2021 09:30 PM)robve Wrote:  
(06-07-2021 05:00 PM)silven Wrote:  Do you have a solution for getting data in and out?

SIO with FTDI. I assume you've read section "USB PC Adapter Cable with Hardware Handshake" with DIY instructions. Watch the UART-TTL signal levels of the PC-G850V. DIY SIO/PIO is best.

So I got an FTDI cable and was able to reflash it to use the inverted signals that the 850 uses. I can send information to the 850 just fine, but when I want to send from the 850 to my PC it blocks and sends nothing.

I'm guessing that it has something to do with flow control. My ftdi cables doesn't break out lines for CTS/RTS, so I just disabled flow control, but it looks like its waiting for something. I'm betting it's something as simple as applying 5v to CD or something like that, but I don't want to start tossing 5V randomly at those pins for fear of breaking something. Smile Any input would be much appreciated.

zmc
Find all posts by this user
Quote this message in a reply
06-19-2021, 03:40 PM
Post: #153
RE: Sharp PC-G850VS
(06-16-2021 11:26 PM)silven Wrote:  So I got an FTDI cable and was able to reflash it to use the inverted signals that the 850 uses. I can send information to the 850 just fine, but when I want to send from the 850 to my PC it blocks and sends nothing.

I'm guessing that it has something to do with flow control. My ftdi cables doesn't break out lines for CTS/RTS, so I just disabled flow control, but it looks like its waiting for something. I'm betting it's something as simple as applying 5v to CD or something like that, but I don't want to start tossing 5V randomly at those pins for fear of breaking something. Smile Any input would be much appreciated.

Some years ago there was a discussion about a DIY adapter on the French forum silicium.org. A summary of this discussion was made available as a pdf file. See the attachment.
I don't own this adapter, and I have not tried to make it, so I can't help on this subject, but maybe you will find some useful information in this document.


Attached File(s)
.pdf  KitsUSBadaptateurPocketsSHARP_5.pdf (Size: 2.18 MB / Downloads: 76)

Jean-Charles
Find all posts by this user
Quote this message in a reply
07-12-2021, 07:11 PM
Post: #154
RE: Sharp PC-G850VS
(06-19-2021 03:40 PM)Helix Wrote:  Some years ago there was a discussion about a DIY adapter on the French forum silicium.org. A summary of this discussion was made available as a pdf file. See the attachment.
I don't own this adapter, and I have not tried to make it, so I can't help on this subject, but maybe you will find some useful information in this document.

If it helps, I just found another DIY adapter on a Japanese web site (Google translate to the rescue). This one is based on the ADM232A and uses a standard RS232 male 9 pin connector, not USB:

http://park19.wakwak.com/~gadget_factory...s232c.html

Here is some interesting info on the G850V UART registers (in Japanese):

http://ver0.sakura.ne.jp/doc/pcg850vuart.html

Disclaimer: I have not tried this DIY RS232 level converter/adapter.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
02-01-2022, 01:37 PM
Post: #155
RE: Sharp PC-G850VS
RE: serial adapter:
RTS&CTS on the G850 must be shortened and pulled to 5V with 1K resistor to circumvent handshake. Disabling flow control in text editor SIO/Format does not suffice.

I built a WiFi adapter to conenct to PC via netcat on linux or putty on Windows, in case this is of interest, feel free to ping me. details here
Cheers
Find all posts by this user
Quote this message in a reply
02-02-2022, 02:00 AM
Post: #156
RE: Sharp PC-G850VS
(02-01-2022 01:37 PM)chrisherman Wrote:  RE: serial adapter:
RTS&CTS on the G850 must be shortened and pulled to 5V with 1K resistor to circumvent handshake. Disabling flow control in text editor SIO/Format does not suffice.

I built a WiFi adapter to conenct to PC via netcat on linux or putty on Windows, in case this is of interest, feel free to ping me. details here
Cheers

I really like this concept!

A couple of weeks ago I saw a bluetooth dongle for the PC-G850, PC-E500, PC-1360, PC-1600 based on the RN42 chip: http://www.silicium.org/forum/viewtopic....24&t=47098

I hope a future version of the WiFi adapter will have the ability to sleep when inactive, or turn off, to reduce power draw.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
02-02-2022, 03:01 AM
Post: #157
RE: Sharp PC-G850VS
(02-01-2022 01:37 PM)chrisherman Wrote:  RE: serial adapter:
RTS&CTS on the G850 must be shortened and pulled to 5V with 1K resistor to circumvent handshake. Disabling flow control in text editor SIO/Format does not suffice.

I built a WiFi adapter to conenct to PC via netcat on linux or putty on Windows, in case this is of interest, feel free to ping me. details here
Cheers

I wonder if that's the same problem I'm having with the PC-1360 and PC-E500... I attempt to transmit data using the CE-133T, and the machine just hangs like it's waiting for something until I kill it with the break key. I'll dig out a couple 1K resistors and play around with my RS-232 tester/breakout adapter. (Granted, I can only easily poke around on the 12V side.)
Visit this user's website Find all posts by this user
Quote this message in a reply
02-02-2022, 01:22 PM
Post: #158
RE: Sharp PC-G850VS
@Dave - Though I don't know for sure, it's likely that this is indeed the same issue, as the E500 and the G850V are really the same family internally, and these things tended to be implemented the same way. And when these were initially developed, hardware handshake lines were commonly used with RTS/CTS, etc. and you need either cables with all the lines, or fake them with pull-ups, etc.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
02-02-2022, 10:59 PM (This post was last modified: 02-15-2022 09:20 PM by chrisherman.)
Post: #159
RE: Sharp PC-G850VS
(02-02-2022 03:01 AM)Dave Britten Wrote:  
(02-01-2022 01:37 PM)chrisherman Wrote:  RE: serial adapter:
RTS&CTS on the G850 must be shortened and pulled to 5V with 1K resistor to circumvent handshake. Disabling flow control in text editor SIO/Format does not suffice.

I built a WiFi adapter to conenct to PC via netcat on linux or putty on Windows, in case this is of interest, feel free to ping me. details here
Cheers

I wonder if that's the same problem I'm having with the PC-1360 and PC-E500... I attempt to transmit data using the CE-133T, and the machine just hangs like it's waiting for something until I kill it with the break key. I'll dig out a couple 1K resistors and play around with my RS-232 tester/breakout adapter. (Granted, I can only easily poke around on the 12V side.)

For the WiFI dongle: Sleep function, status LED, basic "AT" commands and slightly smaller form-factor are WIP.

<<apologies if I say something that is already well established - I'm new to this community>>
You can build a simple "G850 to USB" adapter with just an Arduino Nano and a Breadboard. The nano is great becaus it does 5V TTL logic. (You can use pretty much any Arduino, even 3.3V devices when you build a voltage divider for the TX signal that comes from the G850. I connect a 3.3V pin to the G850's RX pin and it works reliably for quite a while now. ). Use "softserial" - it does the inverted logic and in my github repository is a very simple sketch that send everything from the softserial rx pin to the serial port (i.e. to the USB port) and vice versa.

BTW further up someone posted a concern about ordering G850s from japan: I've bought 3 by now (all G850V or G850VS, because the display is better than the G850's). My experience has been excellent (via ebay). All extremely well packaged and arrived within 2 weeks in (very) good condition (UK). missing lines on the display are fixable (watch Hey Birt's video). So can only recommend.

++++++++++
update: sleep, AT-commands and a smaller form-factor version are now published at https://simplestuffmatters.com/sharp-pc-...al-module/ and https://github.com/chrisherman/G850_RawT...al_Adapter
Find all posts by this user
Quote this message in a reply
04-11-2022, 08:32 PM
Post: #160
RE: Sharp PC-G850VS
I just found this thread and what a joy it’s been to read through. I just dusted off my G850V in order to explore it’s C. Like others on this thread I’m impressed, it’s a much more capable machine than the Casio VX-4. And quite fast as well.

The only thing I miss in C as a random number call, but I’ll try the one posted on this thread.

The other thing I can’t get working is the “void angle(void)” call. It just says Syntax Error. Does anyone know how to put a C program in to Radians when it runs?
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)