- Output from X-07 is ASCII with CRLF line terminators (converted to LF using
igncr
stty flag) EE1F
routine only needs CR- Input files should have UNIX style LF line terminators (converted to CR using
tr
) - Maximum baud rate seems to be 240bps when sending data to the X-07 using the
EE1F
routine. As it is not supported by the Arduino, it is simulated when sending using pipeviewerpv -L 30
(the unit is bytes per second).
GND D10 D12
├10K┤ |
(2) (4) (6) (8)
(1) (3) (5) (7) (9)
| |
D11 D13
Pin no. | Signal name | Direction | Contents |
---|---|---|---|
1 | LTxD | -> | OPT transmission DATA |
2 | FG | Frame ground | |
3 | N.C. | ||
4 | TxD | -> | Transmitted DATA |
5 | RxD | <- | Received DATA |
6 | CTS | <- | Other device receiving |
7 | RTS | -> | X-07 receiving |
8 | SG | Signal ground | |
9 | VBB | -> | Unstable power supply |
#include <Arduino.h>
#include <SoftwareSerial.h>
#define BAUDS 4800
#define RX_PIN 10
#define TX_PIN 11
#define RTS_PIN 12
#define CTS_PIN 13
SoftwareSerial serial2(RX_PIN, TX_PIN, true);
void setup()
{
Serial.begin(BAUDS);
while (!Serial);
serial2.begin(BAUDS);
digitalWrite(RTS_PIN, HIGH);
}
void loop()
{
while (serial2.available()) Serial.write(serial2.read());
while (Serial.available() && digitalRead(CTS_PIN) == HIGH) serial2.write(Serial.read());
}
Assuming that the Arduino USB serial interface is assigned to /dev/ttyACM0
:
$ stty -F /dev/ttyACM0 4800 raw -hupcl -echo igncr
- Start the reception on the computer :
$ cat /dev/ttyACM0 | pv > prog.bas
- Configure the serial port on the X-07
INIT#1,"COM:"
- Create a new BASIC program in X-07 text memory :
NEW
10 INPUT "NAME";A$
20 PRINT "HELLO ";A$
30 END
- Send the BASIC listing to the serial port :
LIST#1
- Press
Ctrl-c
on the computer once the X-07 reaches the end of the listing (prompt is back). The BASIC listing will be saved inprog.bas
.
- Clear the X-07 text memory and set its standard input to serial :
NEW
INIT#5,"COM:"
EXEC &HEE1F
- Send the content of the file to the X-07 (convert LF to CR & throttle output to 240bps) :
$ echo -e '\nEXEC &HEE33' | cat prog.bas - | tr '\n' '\r' | pv -L 30 > /dev/ttyACM0
10 INIT#5,"COM:"
20 EXEC &HEE1F
#!/usr/bin/env bash
set -e
X07_BAUDS="${X07_BAUDS:-4800}"
X07_TTY="${X07_TTY:-/dev/ttyACM0}"
help() {
echo "
Usage:
${0##*/} [command] filename
Commands:
send Send file to X07
receive Receive file from X07"
}
send() {
echo -e '\nEXEC &HEE33' | cat $1 - | tr '\n' '\r' | pv -L 30 > $X07_TTY
}
receive() {
cat $X07_TTY | pv > $1
}
case $1 in
send|receive)
[ ! -n "$2" ] && echo "Missing filename" && help && exit 1
stty -F $X07_TTY $X07_BAUDS raw min 0 time 20 -hupcl -echo igncr
$1 $2
;;
*)
echo "Unknown command: $1" && help && exit 1
;;
esac
exit 0