RCASIO/WCASIO Version 1k 970619 rcasio and wcasio have been modified so that they will handle almost all the special symbols and non-English letters (such as the stressed vowels in Spanish). There are a few of the characters which still can't be translated and these are printed in the casio.out file as a backslash followed by the hexadecimal representation of the Casio character. 980516 Version 1k My Casio's batteries died and I lost everything. So I had to actually use wcasio to try to restore the Casio from my backup file. It didn't work very well. Version 1k contains the fixes to wcasio to make it correctly upload all items understood by a SF-4600B from a file previously created by rcasio. USE AT YOUR OWN RISK. I have used the program to backup my casio many times and I have checked that data and found that it correctly stores all the info in the backup file. My Casio is an SF-4600B and is the only one that the program has been tested on so far. I also inadvertently deleted every entry in my phone book and used wcasio to restore all of it from the backup file so it appears to work well too. BUT USE AT YOUR OWN RISK! In Version 1i I have modified the I/O routine used by WCASIO and I am hoping that it will now work properly for other Casio users. To test wcasio you can use the small test.dat file included with this archive to upload one test telephone entry to your Casio. If it works, you can always delete it from your Casio using option 2 with the FUNC key. I've also included symbols.out which can also be uploaded to your Casio. It contains as many special symbols as I could find. rcasio translates Casio's codes for these symbols into the Amiga's codes and wcasio converts them back again. This will make the file produced by rcasio more readable for users of languages which use letters other than those in the English alphabet. At the moment the programs must be used with the CLI. Once I have converted the code to the SAS compiler, I'll make a version which can use icons too. The casio must be set to send/rcv 8 data bits, 1 stop bit and no parity. 1. CASIO backup and restore Before using these two programs you should be aware of a few shortcomings in what the CASIO can backup and restore. If the CASIO is reset or totally loses power then, before you do anything else, you must enter the communication menu and reset the CASIO to 8 bit transmission (it powers up as 7) and set the correct baud rate, because you won't be able to restore from a backup file until this is done. The following items are also not backed up and must be restored manually: - EVERY item in the HOME/WORLD menu, such as the home time, timezone, DST, 12/24hrs, sound settings etc. are reset and not saved by a backup. - in the phone menu, the extra labels FREE 1, FREE 2 etc., are reset and are not saved by the backup procedure. So if you change, for example, FREE 1 to FAX: then you must manually reset this yourself. The backup program is called rcasio and all that is required to use it is to start it running and then using the CASIO menu to tell the CASIO to send all data. The rcasio program APPENDS all the received output to the file casio.out in the current directory. This allows you to select single items for backup from different menu items and append them all to one file if you wish to do so. Usually, though, you would backup all items and then rename casio.out to some other name. The default speed is 9600 baud and the default device is serial.device unit 0. These can be changed by using the -b, -s and -u arguments. E.G. rcasio -b4800 -sibmser.device -u2 will tell the rcasio program to use the ibmser.device unit 2 at 4800 baud. A word of caution here though. I have a GGII card with two serial ports which use ibmser.device and I found that although rcasio works fine, the wcasio program will only work correctly once and then your system has to be rebooted for it to work again, This appears to be a problem in the ibmser.device driver code because I don't have any trouble with the standard amiga serial port. The rcasio program shows which type of item is being received from the Casio and shows a count of the items as they are received. The wcasio program is used to send data from a backup file to the Casio and has the same arguments as the rcasio program. You must always specify the name of a backup file as an argument to the program with the optional arguments first. E.G. wcasio -b4800 -sibmser.device -u3 all.out Both programs can also be used to save or restore private data. This should be done by saving to a separate file. You must enter your secret password to the CASIO before transferring the data, otherwise the data will be transferred to or from the main area. 2. CASIO Record Format The basic structure of the data sent between the Casio and a computer is similar to an INTEL HEX dump. Each record begins with a colon followed by four pairs of hexadecimal characters which describe the data on the current line. These four pairs of hex characters are always present. The remainder of the line depends upon the type of record and may contain pairs of hex data bytes. The last pair of hex characters on the line is always a two's complement checksum of all the preceding pairs of hex chars. The data are NOT sent as lines so each record does NOT have a CR/LF after it. To make the structure of the data easier to see, the records will be shown below as if there were a CR/LF after each one. If, for the moment, we assume that only one item (e.g. one phone number entry) in the Casio is transmitted, then the general structure of what is sent is: :Data Mode description record :Entry 1 record 1 :Entry 1 record 2 : " " :Entry 1 record n :End of Entry Record :End of Transmission Record The Data Mode description record specifies whether the following data entry is a phone book, memo, reminder, schedule, etc. entry. This is followed by several records which contain the actual data for this entry. For example, if a phone mode item is sent, there will be lines of data for the name entry, the phone number, the address and the Free entries. The End of Entry Record signifies the end of this specific Entry in the Casio. The End of Transmission Record (EOT) is actually not sent by the Casio if you send only one Entry, but if you send ALL data then the EOT is sent. If the Casio is in receive mode, the computer can send an EOT whenever it wishes and this will cause the Casio to exit from the data communication mode and return to whichever menu item you were in when you first selected data communication. When multiple entries are sent from one mode, one data mode record is sent followed by several Entry data records each of which is followed by an End of Entry Record. When all modes are sent, each block of entries are preceded by a Data Mode description record. 3. Casio Protocol When data transfer is to take place, the transmitting end sends pairs of CR/LF until either the receiving end transmits an XON (0x11) or until a timeout is reached. The CR/LF pairs are sent roughly every half second by the Casio and it sends 15 of them before giving up. My "wcasio" program will send CR/LF until it sees the XON, a 60 second timeout timer expires, or until the user manually terminates the attempt by typing the Control-C character. Once the XON has been received, the data records are transmitted. Acknowledgement of correct receipt of records is only done after a Data Mode description record and an End of Entry Record (which means that for the End of Entry record the acknowledgement means that the checksum for the preceding data Entry records and this End of Entry Record are correct). If the checksum(s) is correct then a # is sent, otherwise a ? character is sent. The Casio will transmit a ! character if the user has manually terminated the data communication mode. This can happen whether it is sending or receiving. 4. File format. The data in "casio.out" is stored in such a way that it can be read with a normal text editor such as "ed". This allows you to be able to read most of the data, such as the telephone directory. However, you must not change the data at all unless you know exactly what you are doing because you can introduce errors in to the file which prevent it from being restored to the Casio. There are some changes you can make which will not cause a problem because the wcasio program recomputes the line lengths and checksums when it sends data to the Casio. Until I document this properly, or you really understand the format anyway, it's best to modify data in the Casio and then back it up. 5. Hardware Interface. Casio sells a hardware interface for the BOSS but it is very expensive for what it contains. I just made up a simple interface using the MAX-232 chip. There is another program on Aminet for the Casio BOSS which also contains a circuit diagram for an interface - see hard/misc/mcc040.lha Here's a brief description of the interface I use. USE THIS AT YOUR OWN RISK. A homebrew interface to connect a Casio BOSS to an Amiga. If you have a +5V supply then an interface using the MAX-232 chip is very easy to build. It requires only 4 electrolytic capacitors. The MAX-232 spec. sheet shows all 4 of them as 22uF although I used 2 x 4.7uF (Pins 1 and 4) and 2 x 47uF (Pins 2 and 6). Two of them are connected between pins 1 and 3, and 4 and 5 : | | +ve | | -ve Pin 1 -----| |------ Pin 3 | | | | | | +ve | | -ve Pin 4 -----| |------ Pin 5 | | | | Then the third cap has its positive side connected to pin 2 and the negative side to ground. The fourth cap has its *negative* side connected to Pin 6 and the *positive* side goes to ground. The +5V supply goes to pin 16. Pin 15 is ground. The Amiga 1000 has a +5V output on Pin 21 of the DB25 serial device port and this can be connected directly to Pin 16 on the MAX-232. Unfortunately, all later Amigas changed the pinouts and do not have +5V on the DB25 serial device port. If you only have a +12V DC supply available then you'll have to use a 5V regulator to supply power to the chip. The absolute maximum DC supply rating at pin 16 for the MAX-232 is +6V and it would be best not to exceed about 5.5V to be on the safe side! If you use the +12V DC available on pin 9 of the later Amigas (such as the A3000) then you must be VERY careful not to short this pin to ground. It is fused and although the fuse itself costs about $5, having it replaced could cost as much as $100. In the A3000 the fuse is located at the back of the machine underneath the platform that supports the hard drive, floppy drive, and power supply which means that the entire machine must be taken apart just to get at that tiny fuse! The wiring for the Casio and the computer is as follows: Casio stereo plug: MAX-232 tip: Pin 11 TTL/CMOS input centre ring: Pin 12 TTL/CMOS output ground ring: Pin 15 ground I found that the only 3/32" stereo plugs I had in my junkbox were old Radio Shack ones and the plastic shell on these plugs is too wide to allow you to fit the plug in the Casio. So, instead, I use a 1/8" stereo plug and then use a Radio Shack stereo adapter from 1/8" to 3/32" (RS# 274-373). This adapter has a tapered end and will fit easily into the Casio jack. For a DB-25 the connections to the computer are: DB-25 MAX-232 2 Pin 13 Rx RS-232 input 3 Pin 14 Tx RS-232 output 7 Pin 15 ground 6-20 no connection At the db25 connector you must jumper Pin 20 to Pin 6. This takes the DTR output signal from Pin 20 and feeds it back into DSR in 6. The amiga serial routines will not read data from a serial port unless they see DSR active. The other MAX-232 pins are unused and can be left floating. Just FYI they are: Pin 7 RS-232 output Pin 8 RS-232 input Pin 9 TTL/CMOS output Pin 10 TTL/CMOS input Pete Hardie Peter.Hardie@usask.ca ACKNOWLEDGEMENTS. Thanks go to Vince Herried KA8CTE who supplied me with his serial I/O routines which work with some other Casio BOSS models. My old I/O routines would only work with my SF-4600B (still don't know why though). Further thanks to Oliver who discovered that SERF_RAD_BOOGIE makes the I/O routines work properly (Version 1h).