Hej,
ponizej wklejam opis projektu, ktory bedzie zamieszczony w kolejnym magazynie ABBUC-a.
Na pelne dokumentacje, software i hardware trzeba jeszcze poczekac do JHV (25.10.2014).
SIO2BT project is a set of hardware and software solutions related to the wireless Bluetooth communication between the 8-bit Atari computers and Bluetooth (BT) enabled Serial Input Output (SIO) devices.
Due to delay in the Bluetooth data transmission it was necessary to modify the original Atari OS. For that reason the timeout values (which could not be met) were increased.
A tool for patching Atari OS rom files for Atari 800 and for Atari XL/XE is provided as a part of the project.
Thanks to Stefan Dorndorf it is possible to patch QMEG 4.04 for Bluetooth as well.
Additionally there are disk images (*.atr) available for Atari XL/XE for those who want to use SIO2BT with original, not modified Atari computers.
Another difficulty was missing information about the SIO Command Line status. Hardware handshaking had to be replaced with a software solution for Command Frame detection.
Most of the Bluetooth transceivers available on the market are based on the CSR BC417143 chipset supporting SPP (Bluetooth Serial Port Profile). Two Bluetooth transceivers plugged between any two legacy serial devices would (in theory) be transparent and would appear as if they were connected via cable. In practice missing hardware handshaking and non-deterministic delays cause problems if the protocols rely on timing or on handshaking. And this is exactly the case with the SIO Protocol.
The BT transceivers provide RxD and TxD lines (TTL voltage level), which can be connected directly to the DATA OUT and DATA IN lines of the Atari SIO port.
Once configured for the SIO Communication (Baudrate = 19200, etc.), a Bluetooth transceiver can be paired with a PC. When a device is paired, the Bluetooth Software Stack on the PC creates a virtual serial port for it. Opening such ports establishes a Bluetooth connection between the PC and the transceiver. A PC can run the software emulating SIO devices.
I have adapted one of the most popular tools for emulating SIO devices – AspeQt 0.8.8 – for communication via Bluetooth. The tool is licensed under GNU General Public License version 2.0 (GPLv2) and my source code modifications are available freely to everyone.
The modifications include:
- a bug fix for Windows to support COM port numbers higher than 9
- a removal of a background image in the logger window, which consumes a lot of the CPU power (especially visible with weak machines like Raspberry Pi)
- software command frame detection (SOFTWARE handshaking)
- configurable delay for writing data to the Atari
The additional delay for writing is required for Bluetooth, because an Atari expects (according to the SIO specification) a minimum time delay between the “Acknowledge” Byte and the “Complete” Byte.
This timing is critical and unfortunately can not be guaranteed by Bluetooth. If we send two bytes waiting X milliseconds in between, the first byte can get stuck somewhere in the Bluetooth stack and the second byte will catch it up so they will arrive one after each other at the Atari. The Atari could skip the second byte and keep waiting for it. Luckily (after a certain timeout) the last Command Frame would be repeated and the communication would continue.
Using a Logic Analyzer and „trial and error“ approach I had to face the fact that there is no 100% guarantee for fast and error free communication. I can recommend a delay value of 10 milliseconds (default setting) for the most cases and bigger values for machines with slower Bluetooth stacks.
The SOFTWARE handshaking can also be used (even without any delay) with cheap USB2Serial cables (TTL) that do not support hardware handshaking.
There is one drawback of the SOFTWARE handshaking that should be understood by the users. The emulated SIO device is analyzing data coming from the Atari to detect an incoming Command Frame. We are on the safe side if our device is the only SIO device on the bus. However if the Atari writes data to a different physical SIO devices on the bus, the data (for example a disk sector) can include bytes that build a valid Command Frame. In such cases our device would incorrectly react upon it.
My recommendation is NOT TO USE other physical SIO devices when working with SOFTWARE handshaking, or to use them only to provide data to Atari.
As a part of the project I have provided a binary version of the AspeQt for Windows users and the source code for Linux users (tested successfully under Windows XP, Windows 7 and Ubuntu).
As long as the SIO devices are emulated on a PC, there is no real advantage of wireless communication.
However if SIO devices are emulated on a smartphone, we do not need a PC at all. Many people carry smartphones with them. Games can be downloaded from the internet and immediately loaded to the Atari from an emulated Disk Drive. One day we could even go one step further and introduce a new SIO Device – an intelligent network device with a TCP/IP stack...
I decided to support the Android platform (the iOS does not support Bluetooth SPP).
The SIO2BT App can be downloaded from the Google Play Store to any smartphone with Android 2.1 or higher.
ATARI 65XE + SIO2BT