From 1980 and during nearly twenty years, SHARP Corporation produced a line of pocket computers programmable in BASIC and machine language. They were neatly engineered machines, and, by some aspects, far more efficient than modern i-things and Androïd devices : zero bugs, instant boot up, no updates needed, and monthes, yes, monthes of battery life.
SHARP PC SIO has a 0-6V voltage, so it could communicate to an Arduino without level shifting. Nevertheless, contrary to the Arduino, SHARP PC uses an inverse logic : 0V is HIGH and 6V is LOW. To make themselves communicate, levels should be inverted, either by hardware or by software.
This way you don't need any other component.
The pocket computer works with two CR 2032 lithium battery, whose capacity is too weak for the Arduino. So it is not possible to power the Arduino with SHARP Vcc pins, except if the SHARP is itself on external power source.
The SoftwareSerial example can be used, with the following changes :
Here is the code for the Arduino:
SoftwareSerial mySerial(10,11,true); // RX, TX, inverse logic
// Open serial communications on standart port:
// set the data rate for the SoftwareSerial port:
if (mySerial.available()) Serial.write(mySerial.read());
if (Serial.available()) mySerial.write(Serial.read());
Upload this sketch to the Arduino, and open the serial monitor.
On SHARP PC, type the following commands :
OPEN "1200,N,8,1,A,F,&1A" LPRINT "HELLO ARDUINO"
The serial port parameters are kept in variable
OPEN$, so next time, simply open the port with command
With Arduino ethernet or wifi shield, or with an ESP8266, you can now do fun tricks, like connecting your SHARP PC to internet or wireless networks.
In the following circuit, an ESP8266 connects to Network Time Protocol servers and send time to the SHARP PC. So the good old pocket computer become an highly accurate atomic clock :)
The ESP8266 uses 3.3V signals. As the communication is from ESP to SHARP only, a simple NOT gate built with a mosfet and a resistor acts as inverter and level shifter :
ESP8266 code : NTPClient.ino
SHARP PC-1460 BASIC program:
10:"A" CLEAR : CLOSE : OPEN "1200,N,8,1,A,F": WAIT 0
40:PRINT " ";H$(0): CALL 1208: GOTO 20
CALL 1208 is a system call specific to PC-1460. It forces LCD display to remain on while BASIC program is running.
The routine is at different addresses on other models :
For PC-1475, PC-E500S and later models, these system calls are no longer needed. Here is the code for PC-1475 :
10:"A" CLEAR : CLOSE : OPEN "1200,N,8,1,A,F"
15:CLS : WAIT 0
30:CURSOR 8: PRINT H$(0): GOTO 25