Showing posts with label rs232. Show all posts
Showing posts with label rs232. Show all posts

Thursday, 8 August 2019

Linux->Falcon serial transfer

After having a look at the Atari Falcon 030 and using the cumbersome floppies for moving files about, I wanted to move files over the serial.

I had lost my null-modem cable and could only find a mirrored 9-pin cable with M-F connectors (what is that for anyway?). The proper null modem cables were still sold at Clas Ohlson in Helsinki. Thanks, Clas Ohlson!

Serial is quite fast for sending a few megabytes or less, which is enough as Falcon files are not that huge.

Obviously, the ports have to be set for the same speed. 115200 proved to be too much, so I went for 57600, which gave a healthy ~5500 bytes per second. (2026 edit: Using an USB-COM adapter I had to work with 38400)

First, I need to set the serial port parameters using the Control Panel. This requires the Control Panel accessory (XCONTROL.ACC) in the boot drive folder and the serial control panel extension (SERIAL.CPX) on the system, at C:\CPX\ for example.

DRVIN.PRG needs to be at the AUTO folder to gain these high speed connections for "Modem 2", otherwise you'll be stuck with the 9600. Edit: It seems the SCC.PRG should be there too. Not sure which of them or both?

If DRVIN is not there, the ACC is likely to bomb if you try to fiddle with the modem 2 parameters.

XYZ on a command line shell at Atari end

To receive files using the ZMODEM protocol, you need XYZ.TTP.

Although the xyz can be run from the desktop, I prefer to use these TTP (TOS-Takes-Parameters) programs from inside a command line shell. It's neater that way and I get to see the program results and recent actions better. Moving files around the system becomes quicker too.

Still testing at 9600, hence the slow speed...
Okami shell is reasonably featured, and you can use some Unix-style parameters, like directing output to a file or a serial port. It's not developed with a Falcon in mind, but using a 2-color video mode it's pretty fast. "mupfel" is another shell, but setting it up seems more involved so I'll look at it later.

I added the following line inside the Okami "profile" file, so the shell will execute it on running. This way I can run the xyz from wherever I happen to be:

xyz=c:/xyz202b/xyz.ttp

Afterwards, using

$xyz

the xyz.ttp will run and wait for a file to be sent. Yes that $ is not exactly as effective as an alias or a proper PATH but it's still far better than working every time from within that folder.

As an aside, editing that profile file is a chore as there are very few choices of a shell-run text editor. I'd hate to jump between a GEM editor and the command line shell now that it's in place. I ended up using something called pro_edit for now, which is rather poor and assumes the display height is 400. ST video modes to the rescue.

But if it's only a matter of adding one line to the profile, then appending that line with echo xyz=c:/xyz202b/xyz.ttp>>profile will work.

Obviously, after the file transfer is in place text files could be transferred from the Linux... But as the point is to toy around with the Falcon, why move over all the tasks to some other computer?


sz at Linux

Unlike Atari, Linux doesn't have an abundance of strange 'terminal emulator' programs, possibly because the terminal is so integral to the system.

There's minicom, but practically minicom (or anything else) uses rz and sz for file transfer protocols, so it's better to use these from the Linux terminal command line directly.

These need to be installed first. If there is a permission problem with the serial port then the user has to be added to the dialout group.

I followed a suggestion of calling sz from a tiny script (named zsend in the example) which ensures the serial port speed is correct:

#!/bin/sh

DEV=/dev/ttyS0

stty -F $DEV 57600
sz $1 > $DEV < $DEV

The ttyS0 is the device for the serial port, in my case it's already a part of the motherboard. An USB->RS232 port is often called ttyUSB0. dmesg | grep tty reveals the device names.

Saving this script as zsend, it can be made into an executable with chmod +x zsend, after which ./zsend filename should start the transfer. If Atari is running the xyz.ttp and waiting, then the file should transfer.

A version for receiving files from the PC end, use rz instead of sz.

At TOS, xyz -u filename will upload a file, defaulting to ZMODEM.

I also tried batch uploading with *.* and although everything went fine for a file, the XYZ.TTP at Atari end complained about too many handles or something after about 16-17 files. So, for moving a lot of files it's better to zip things at that end first, no matter how slow it is.

Strangely, uploading from Atari was a slower, some times less than 4000 bps on average. File permissions may need altering on the Linux end and the filenames tend to be uppercase which can be a bit annoying at Linux. -LL option on zip ought to force filenames to lowercase, though.

Backing up AUTO folder and your essential system files with this method is a good idea I think!



At Atari again

Transferring zip files is much more handy than trying to send files with a folder structure, and they are obviously compacted too.

Working with the Okami shell, for added comfort I also added the zip unpacker to the Okami profile:

zip=c:/packers/stzip/zipjr.ttp

...for example. The zipjr.ttp comes out of the stzip.tos self-extracting archive, found here.

$zip -xr file.zip

In Okami, this then becomes the equivalent of running zip from its folder. It appears the zip version I have it likes explicit -xr parameters for extracting and preserving the folder structure.

Lharc (lzh) is another often seen archive format, and jaymsa18 may be used for recovering files out of .msa and .st disk images on the Atari end, if the disks play nice with file structure that is.

After all this, I can finally look at Llamazap, an apparently unfinished game by Jeff Minter that can't even be started without a very specific controller. Oh, well.


Thursday, 12 September 2013

Canon X-07


A little beauty, this one. The computer is book-sized and fits into a VHS-case sized plastic binder. It offers pretty much what a home micro would have around 1983, except in a very small portable size. The language is Microsoft BASIC, which was state of the art at the time. Well, the memory is not that impressive, only 8K of which roughly 6 are available to BASIC.

Despite the looks the X-07 is not really a scientific calculator. For example, the math symbols are not directly available but behind SHIFT-combinations as on an ordinary micro. It's of course possible to write some calculator software! The BASIC offers very direct access to screen features such as text and bitmap graphics with commands like PSET, LINE, CIRCLE and FONT$ which can be used for the 5x8 user character definition. I suppose for graphing purposes these are fine and to me this is more flexible than the clunky TI-BASIC found in Texas Instruments calculators, even the newer ones.

On the negative side, the connectors are a bit non-standard. For a tinkerer it's nothing, but of course an ordinary RS232 port would have been nice (It's not even that much smaller). Sadly the resolution is very small, 120x32 pixels, and the display is not backlit. Apparently there's a display adapter which would give an 8-colour display on a television. This would make X-07 even more interesting, although then it would no longer be portable.

The Z80-compatible chip is likely to be on the slow side to conserve power, my hunch is 1mhz. (Edit: Nope, it seems the NSC800N variant is 2.5mhz) Printing and graphics commands are quite slow via BASIC. I don't know how long the battery life is, but I'd assume that the display is not that greedy.



What I like about this machine is that the "booting" time is non-existing. The RAM "disk" is permanent as long as the batteries last. The user chooses a suitable portion of the memory for the RAM files, and code snippets can be stored and retrieved via SAVE and LOAD commands. DIR brings up the file list. It's also possible to RUN "filename" to execute a file without loading it into the text memory.

The RAM is battery-backed and it's also possible to put the display to SLEEP and continue later from where you left. There are some interesting possibilities for using this computer to "upload" tiny pieces of data via the RS232, and I might be tempted to try this later. An "autobooting" command can also be created, for running the program in memory, for example. This makes me think the computer is meant to be customized into a variety of one-purpose devices, possibly a controller for industrial machines.

The eight bits between the nybbles. We've seen this before.
Tape options are of course available and using Audacity on my MiniMac I could store and reload a BASIC program. The format seems straightforward enough and if there's nothing about it on the internet I might examine it a bit further. (Edit: Actually, it's all in the manual. Silly me. Also, there's a webpage about the tape formats.)

I feel positive about this tiny computer. The build quality is high and the Canon competence in calculators also shows here. Everything there is, is pretty well made and thought out.


The memory upgrade:

A Toshiba TC5565PL-15 memory chip adds 8K memory, to a total of 16K. The whole system may need resetting before the memory becomes active. The RAMdisk use becomes a bit more reasonable with this expansion.



How to build an RS-232 cable between Canon X-07 and a PC:

Edit: I'd recommend NOT connecting this serial port directly to a Mac/PC! They have a different voltage level.

It is quite fortunate that a piece like the one below can be stuck into the existing port, by ever so slightly twisting the pins. However, the pin order is not standard so a special cable or an adapter needs to be built.


The diagram below shows how to connect between two port types. A cable between two Canons would of course be symmetrical. Note that the numbering in Canon port follows the order in the manual. (1=LTxD, FG, N.C., TxD, RxD, CTS, RTS, SG, VBB) 

The manual also tells the signal level is not standard, but this did not seem to cause problems when connecting between Canon and a Mac. I just went away and tried, although they should not be compatible. I'd be careful. What I see the RS232 in Canon is likely to be TTL level ("5v") whereas serial ports can be 12v. I suspect modern computers and USB/serial adapters may be accommodating, but I'd be wary of connecting different kinds of computers.


The serial port, seen from the outside.

On the Canon end, you do this to set the port:

INIT #1,"COM:",2400,"B"

4800 is the highest speed. The "B" combines the various parity and bit length parameters into a single letter. B seems to work ok with 8 bits, no parity.

After initializing the channel you can:

PRINT #1,"HELLO" to send a string of characters.

...or OUT #1,65 to send characters out.

...or LIST #1 to output the BASIC listing in ASCII.


Some good resources:

The Canon is quite well documented on the net. There seems to be a whole scene focusing on collecting and enthusing about hand-helds, calculators and even digital wrist watch computers.

Here's a page that tells everything you need to know about various peripherals and extension cards:

http://gtello.pagesperso-orange.fr/cx07_e.htm

Programs for creating tape files:

http://www.mvcsys.de/doc/casioutil.html