Post Reply 
Connecting Sharp PC-G850VS to PC
01-15-2023, 02:07 PM
Post: #1
Connecting Sharp PC-G850VS to PC
I've been really interested in getting this machine connected after seeing the awesome Forth development. Unfortunately all I could find for connectivity is building you own device, which is well beyond my skills.

Is there any way to easily connect this machine? I can't imagine that it being so popular in Japan there wouldn't be something off-the-shelf...
Find all posts by this user
Quote this message in a reply
01-15-2023, 06:21 PM (This post was last modified: 01-15-2023 07:44 PM by robve.)
Post: #2
RE: Connecting Sharp PC-G850VS to PC
(01-15-2023 02:07 PM)polbit Wrote:  I've been really interested in getting this machine connected after seeing the awesome Forth development. Unfortunately all I could find for connectivity is building you own device, which is well beyond my skills.

Is there any way to easily connect this machine? I can't imagine that it being so popular in Japan there wouldn't be something off-the-shelf...

There are two ways to "connect" to a PC with Sharp Pocket computer like the PC-G850:

1. use a CE-126P or CE-124 cassette interface, which works quite well to load programs from a PC such as Forth, C and assembly. I use that a lot. But saving programs to a PC is a bit of a pain to record and convert wav files, not to mention that the PC-G850VS Text to Basic converts to upper case!

2. serial interface. The problem is that the old Sharp RS232 serial interfaces, such as CE-T800, CE-135T etc, don't work with voltages below 7V to 8V, which means that USB RS232 adapters almost never work (5V or boosted to 6V is still too low). Also, the PC-G850 has no 15 pin serial interface for SIO, unlike most other Sharp pocket computers have (so you can only use the 11 pin PC-G850(V)(S) with a CE-T800 which I have not tried). There are DIY solutions and there are sites where you can purchase USB interfaces for the PC-G850, PC-E500 and other machines.

The Sharp CE-126P is a handy interface with a thermal printer. You can still find them on auction sites for $50 or less.

Hope this helps.

- Rob

Edit: mention CE-T800

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
01-16-2023, 04:10 PM
Post: #3
RE: Connecting Sharp PC-G850VS to PC
(01-15-2023 02:07 PM)polbit Wrote:  I've been really interested in getting this machine connected after seeing the awesome Forth development. Unfortunately all I could find for connectivity is building you own device, which is well beyond my skills.

Is there any way to easily connect this machine? I can't imagine that it being so popular in Japan there wouldn't be something off-the-shelf...

It seems you can use a cheap USB to Serial TTL cable, look here:
http://drive.google.com/uc?export=view&i...jR0SkVkc0k

Discussion here:
http://www.silicium.org/forum/viewtopic.php?t=41175
Find all posts by this user
Quote this message in a reply
01-16-2023, 05:04 PM
Post: #4
RE: Connecting Sharp PC-G850VS to PC
There is also this. The Generic Bluetooth Module for SHARP Pocket Computer

http://www.silicium.org/forum/viewtopic....=bluetooth

Apparently due to parts shortage it's not available assembled or as a kit. Now I really really really want one Big Grin

- Rob

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
01-16-2023, 09:04 PM (This post was last modified: 01-16-2023 09:15 PM by polbit.)
Post: #5
RE: Connecting Sharp PC-G850VS to PC
Thanks everyone!

I have built the connection using an older FTDI 232R USB-to-Serial connector, from Parallax robotics kit. Everything looks fine when I do TEXT/SIO/LOAD on the Sharp - it shows RECEIVING and busy indicator.

As soon as I start Tera Term or Putty though, connected to the port (proper settings including hardware handshake), I get I/O DEVICE ERROR on the Sharp...
Find all posts by this user
Quote this message in a reply
01-17-2023, 04:02 PM
Post: #6
RE: Connecting Sharp PC-G850VS to PC
(01-16-2023 09:04 PM)polbit Wrote:  Thanks everyone!

I have built the connection using an older FTDI 232R USB-to-Serial connector, from Parallax robotics kit. Everything looks fine when I do TEXT/SIO/LOAD on the Sharp - it shows RECEIVING and busy indicator.

As soon as I start Tera Term or Putty though, connected to the port (proper settings including hardware handshake), I get I/O DEVICE ERROR on the Sharp...

Have you inverted the HIGH and LOW values in the FTDI 232R chip?
Sharp has inverted high's and lows i think.
Find all posts by this user
Quote this message in a reply
01-17-2023, 09:56 PM
Post: #7
RE: Connecting Sharp PC-G850VS to PC
(01-17-2023 04:02 PM)Dan C Wrote:  Have you inverted the HIGH and LOW values in the FTDI 232R chip?
Sharp has inverted high's and lows i think.

In case you don't have the FTDI programming utility, it can be found on the FTDI web site given below. Read the manual carefully - high potential to munge things up Smile

FT_PROG 3.12.31.639 - EEPROM Programming Utility
https://ftdichip.com/utilities/

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
01-18-2023, 12:40 AM
Post: #8
RE: Connecting Sharp PC-G850VS to PC
Yes, inverted using FT_PROG utility and verified changes took.

I've ordered an FTDI cable and another adapter just to rule out the adapter itself... I NEED to get Forth running, ever since getting it on my HP-71b I've been completely hooked.
Find all posts by this user
Quote this message in a reply
01-18-2023, 10:29 AM
Post: #9
RE: Connecting Sharp PC-G850VS to PC
SUCCESS!

A new FTDI adapter did the trick! Now I just need to make it into a permanent cable with the 10k resistor, and I am in business.
Find all posts by this user
Quote this message in a reply
01-18-2023, 03:49 PM
Post: #10
RE: Connecting Sharp PC-G850VS to PC
(01-18-2023 10:29 AM)polbit Wrote:  SUCCESS!

A new FTDI adapter did the trick! Now I just need to make it into a permanent cable with the 10k resistor, and I am in business.

Great!
Find all posts by this user
Quote this message in a reply
02-04-2023, 02:55 AM
Post: #11
RE: Connecting Sharp PC-G850VS to PC
(01-18-2023 12:40 AM)polbit Wrote:  I NEED to get Forth running, ever since getting it on my HP-71b I've been completely hooked.

Great! Big Grin

I'm currently distracted by other work, but will continue working on Forth850 soon again. I'd like to add the ability to load Forth source code directly over SIO into Forth850.

It is already possible to load Forth source code to the TEXT editor (via SIO or tape) and then load it into Forth, but that's cumbersome, see my README.

Suggestions for more improvements to Forth850 are welcome.

- Rob

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
02-12-2023, 03:07 AM (This post was last modified: 02-17-2023 06:04 PM by robve.)
Post: #12
RE: Connecting Sharp PC-G850VS to PC
(01-18-2023 10:29 AM)polbit Wrote:  SUCCESS!

A new FTDI adapter did the trick! Now I just need to make it into a permanent cable with the 10k resistor, and I am in business.

Great to hear! But others have not been so fortunate to get the DIY FTDI adapter for the PC-G850(V)(S) to work. There are several reasons why it may fail. Some are obvious, but the FTDI CST input issue and 3.3V versus 5V FTDI adapter wasn't obvious to me, since the PC-G850 UART operates at 5V.

I'm posting my notes here in case someone finds this useful or would like to comment.

Checklist to avoid problems
  • Adafruit FTDI Friend (FTDI FT232R device) works fine at 3.3V with the PC-G850(V)(S) that uses 5V. I also tried FTDI at 5V by switching the solder jumpers, but wasn't able to send files from the PC-G850 to the PC any longer. I checked everything, continuity, voltage levels, tried another FTDI, etc. Changing back to 3.3V worked again. So 3.3V is probably best (?)
  • The PC-G850 UART signals are inverted. Therefore, the FTDI RXD, TXD, CTS, RTS signals must be inverted. Other non-FTDI chips may not be reprogrammable to invert the levels, such as SparkFun Serial Basic breakout.
  • Sending files with minicom doesn't work reliably on my MacOS M1. After experimentation I found this to be an FTDI driver bug (see next post, because MacOS Intel and Windows appear to work OK). Hardware flow control is supposed to prevent this problem, but apparently the FTDI driver 1.5.0 for MacOS M1 is not respecting its inverted CTS input connected to the PC-G850 RTS? The adapter has a pull-down resistor for the PC-G850 RTS level, which should work to let the PC wait before the PC-G850 is ready, but it doesn't? In my case, measurements show 0.07V for RTS inactive (not ready to receive) and 3.3V for RTS active (ready to receive), which means the signals are OK. To work around this, I added ascii-xfr option -l100 to wait 100ms between lines sent (e.g. see minicom settings below).
  • A power-only USB cable isn't suitable to connect to a FTDI breakout.
  • Install a FTDI driver CP210x or VCP for MacOS/Windows/Linux.
  • UART settings on the PC-G850 and minicom (or picocom etc) should match obviously (e.g. see settings below).
  • Be careful to avoid ESD that can destroy the PC-G850. When connecting the DIY adapter to the PC-G850 discharge static first.
  • When receiving a file on the PC-G850 (TEXT Sio Load), letting the PC-G850 automatically add line numbers is not a good idea, because lines that start with a digit will make the resulting concatenated line number unusable. This may happen when the TEXT Sio Format is set line number = no. Setting line number = yes at least produces an error.
  • When using a microcontroller instead of FTDI to connect to the PC-G850, a level shifter must be used, such as the 74LVC245. Most microcontrollers operate at 3.3V and are not 5V tolerant.

[Image: FTDI-adapter-2.jpg]

My parts list
- Adafruit FTDI Friend (or SparkFun FTDI breakout 3.3V or TTL-232R cable)
- A PCB mount male header breakable with 17 pins or more, for 11 pin + 6 pin connector
- 1.5mm thick polystyrene sheet to construct an adapter box
- 10kOhm resistor

Soldering
The FTDI Friend 6 pin connector aligns with the PC-G850 11 pin layout for a null modem connection. FTDI VCC is not used. Solder 5 wires of 1.5cm (0.6in) in length to connect a 11 pin header to a 6 pin header as follows, see PC-G850(V)(S) Users Guide:
6 pin   11 pin
1 GND   3 GND
2 CTS   4 RTS
3 VCC   -
4 TXD   6 RXD
5 RXD   7 TXD
6 RTS   9 CTS
Also solder the 10kOhm resister between GND and CTS (CTS on the 6 pin side). The resistor is placed length-wise, parallel to the wires.

The adapter box
I made mine with polystyrene, which was a lot simpler than 3D printing. I also cut two matches (the ones that come in a larger box that are thicker and longer than the standard matches) which I superglued to form the edges of the box. The diameter of the matches are exactly the right width to form the box: the connectors fit perfectly. Then a few dabs of hot glue to close the box.

[Image: FTDI-adapter-1.jpg]

Settings and operation
Use FT_PROG FTDI programmer to invert UART RXD, TXD, CTS, RTS.

PC-G850(V)(S) press TEXT then Sio Format to set to baud rate = 9600, data bit = 8, stop bit = 1, parity = none, end of line = CR LF, end of file = 1A, line number = yes, flow = RS/CS

To connect with minicom:
$ minicom -b 9600 -8 -D /dev/tty.usbserial-2 -c on
where /dev/tty.usbserial-2 is for MacOS with Adafruit TDFI Friend and may differ for other OS.

Minicom settings for file transfer are set with CTRL-A Z O then select "File transfer protocols" then add or change the ascii setting:
I ascii /opt/local/bin/ascii-xfr -ens -l100 Y U N Y N
J ascii /opt/local/bin/ascii-xfr -enr Y D N Y N

where /opt/local/bin/ascii-xfr is for MacOS and may differ for other OS.

Set the PC-G850(V)(S) to receiving by pressing TEXT Sio Load. Then send a file with minicom CTRL-A Z S select one file to send.

PS. Sending files as WAV files created with PocketTools the cassette interface CE-126P is at least as fast as the serial interface, but never has any reliability issues Smile And you get a nice little printer that also serves as a battery backup for the PC-G850(V)(S) Big Grin

PPS. See also Silicium about USB cables with HW handshake with the FTDI chip and various Sharp Pocket Computers.

- Rob

Edit: mention FTDI drivers and ESD, add comments, add RealTerm observations.

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
02-13-2023, 04:17 PM (This post was last modified: 02-16-2023 08:29 PM by robve.)
Post: #13
RE: Connecting Sharp PC-G850VS to PC
Update

Further down the rabbit hole...

It seemed crazy to me why the FTDI driver didn't respect the CTS input from the PC-G850 on my MacOS M1 machine as I stated in the checklist. I tested with an Adafruit FTDI Friend and a FTDI USB cable from the FTDI manufacturer. The problem is a bug in the latest FTDI CP210x/VCP driver 1.5.0 for MacOS 12, because testing on Windows with RealTerm shows that the CTS input levels are correct and in fact respected when sending to the PC-G850, as shown in the images below.

CTS is low when PC-G850 not ready to receive and sending to the PC-850 is indeed blocked:

[Image: RT-1.PNG]

CTS is high when the PC-G850 ready to receive, e.g. TEXT Sio Load:

[Image: RT-2.PNG]

Strange behavior with the FTDI 5V adapter however remains, even on Windows, whereas the FTDI 3.3V adapter is fine. It is not possible to send from the PC-G850 to the PC with the FTDI 5V adapter when DTR is set. It should be cleared first manually, before the PC accepts data from the PC-G850:

[Image: RT-3.PNG]

For this reason to fiddle with DTR, it's not practical to use FTDI 5V, but I can't put my finger on the reason why this is any different from the FTDI 3.3V behavior that works fine.

To conclude, the FTDI driver for a Windows machine and Mac Intel machine work. However, the FTDI driver 1.5.0 for MacOS fails to respect FTDI CTS input on a Mac M1. This is totally unexpected and not acceptable!

- Rob

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
02-18-2023, 01:23 PM
Post: #14
RE: Connecting Sharp PC-G850VS to PC
I bought this cable recently, which seems to work fine. The company that makes it has a few other cables in its lineup.
PConnection Cable (USB) for PC-E200/PC-G800 Series https://amzn.asia/d/16D433B
Find all posts by this user
Quote this message in a reply
02-19-2023, 12:36 AM
Post: #15
RE: Connecting Sharp PC-G850VS to PC
(02-18-2023 01:23 PM)Bushcat Wrote:  I bought this cable recently, which seems to work fine. The company that makes it has a few other cables in its lineup.
PConnection Cable (USB) for PC-E200/PC-G800 Series https://amzn.asia/d/16D433B

Thanks, I've not seen this before.

But from USA, the item listing appears but status is "Currently unavailable".

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
02-19-2023, 12:50 AM
Post: #16
RE: Connecting Sharp PC-G850VS to PC
The guy makes them as needed. A handful will pop up soon, I think.
Find all posts by this user
Quote this message in a reply
02-20-2023, 03:47 AM
Post: #17
RE: Connecting Sharp PC-G850VS to PC
I checked the site: they're not taking or shipping direct orders from 1 Jan - 6 Feb, nor 20 Feb - 27 Feb, but anything bought through Amazon ships until sold out. So I'm guessing manufacture and supply is a bit erratic at the moment. I notice on their web site that they do have a NOS cable available: it has the older mini-USB connector rather than the current micro-USB connector. But it's no cheaper, so I wouldn't bother unless you are desperate.

Their eclectic range of stuff seems to come from their background in surveying equipment. They also do printers for pocket computers: they're almost compatible with the CE-126P, print 10 times faster, but programs need modifying to work with the printer (hence the "almost").

https://tmfg.jp/
Find all posts by this user
Quote this message in a reply
Post Reply 




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