---------------- Disclaimer --------------------------------------------------- WARNING: I don't give any warranty for this hard- and software. Especially I exclude liability for any damage resulting of error in hardware, software or the description! Building this circuit is done a your own risk! I highly recommend to compare this description with the user's manual of the HM 205 and the data sheet of the AT90S8515. This project might be used for non-commercial purpose without any limitation. If you have any suggestions for improvement, please mail them to me. Also if you discover any errors. All files in this package are covered by my copyright! Volker Bosch, 14 Sep. 2000 volker.bosch(at)z.zgs.de ------------------------------------------------------------------------------------- Project "hm205" Reading out the data storage of the HAMEG HM205-2 digital storage oscilloscope via the serial interface of a PC (Linux). 1. Hardware =========== The V24 interface for the HM205 consists mainly of an Atmel micro controller AT90S8515 and an TTL to V24 level shifter MAX 232. The circuit is powered by the HM205 with 5V. for generation standard baud rates, a 7,3728 MHz-Quartz is needed. A quite simple pcb layout can be found in the subdirectory pcb: hm205-if.pcb pcb layout, designed with PCB Ver.1.6.3 (have a look on: ftp.uni-ulm.de) hm205-if-loet.ps the solder side of the pcb (mirrored) hm205-if-bestueckplan.ps the component side of the pcb The pins of the connectors are contacted in the same way as the ATMEL STK200 evaluation board. When you change the quartz of the STK200 board, you could use this pcb for building your HM 205 interface. port connectors (Port A, B, C and D) Pin |signal --------+-------- 1 | Bit 0 (Lsb) 2 | Bit 1 3 | Bit 2 4 | Bit 3 5 | Bit 4 6 | Bit 5 7 | Bit 6 8 | Bit 7 (Msb) 9 | Gnd 10 | Vcc ISP connector Pin |Signal --------+-------- 1 | MOSI 2 | Vcc 3 | NC 4 | Gnd 5 | /Reset 6 | Gnd 7 | SCK 8 | Gnd 9 | MISO 10 | Gnd You have to make the following connections between the AT90S8515 board and the oscilloscope: Port A <--> HM 205 Port C <--> HM 205 Port D.4-7 (High Nibble) is connected via a 4 DIP switch to ground, Jumpers J2 Pin2-Pin3 and Pin4-Pin5 should be shortened AT90S8515 | Dir. | | Description ----------------+-------+-----------------------+------------------------------ PA.0 (39/1) | <- | Hm 205-2:D0 (3) |... PA.1 (38/2) | <- | Hm 205-2:D1 (4) |... PA.2 (37/3) | <- | Hm 205-2:D2 (5) |Data, pulled to gnd PA.3 (36/4) | <- | Hm 205-2:D3 (6) |via 3.3kOhm Pull-down PA.4 (35/5) | <- | Hm 205-2:D4 (7) |when Srq PA.5 (34/6) | <- | Hm 205-2:D5 (8) |inactive (L). PA.6 (33/7) | <- | Hm 205-2:D6 (9) |.... PA.7 (32/8) | <- | Hm 205-2:D7 (10) |... Gnd (20/9) | - | Hm 205-2:DGnd(1,25,26)|Ground Vcc (40/10) | - | Hm 205-2:Vcc (11) |4.5V, 150mA ----------------+-------+-----------------------+------------------------------ PC.0 (21/1) | <-> | Hm 205-2:C1/C2 (17) |H: Ch1, L:Ch2 PC.1 (22/2) | -> | Hm 205-2:/ResAZ(18) |L: Reset read-out counter PC.2 (23/3) | -> | Hm 205-2:ClkAZ (19) |H->L: read-out clock PC.3 (24/4) | -> | Hm 205-2:Srq (20) |H: Read-out mode PC.4 (25/5) | - | Hm 205-2:R/W (21) |not used PC.5 (26/6) | <- | Hm 205-2:TE (22) |L: recording done PC.6 (27/7) | -> | Hm 205-2:Res (23) |L: same as pressing Res button PC.7 (28/8) | - | Hm 205-2:Rem (24) |not used Gnd (20/9) | - | Hm 205-2:DGnd(1,25,26)|Ground Vcc (40/10) | - | - | - ----------------+-------+-----------------------+------------------------------ PD.0/RxD (10) | <- | RS232: RxD(2) | input data PD.1/TxD (11) | -> | RS232: TxD(3) | output data PD.2/Int0 (12) | -> | RS232: RTS(7) | handshake PD.3/Int1 (13) | <- | RS232: CTS(8) | handshake Gnd | - | RS232: Gnd(5) | Ground ----------------+-------+-----------------------+------------------------------ PD.4 | <- | Cfg: RTS/CTS (Sw4) | enable RTS/CTS-Hsk PD.5 | <- | Cfg: Baud.0 (Sw3) | select baud rate PD.6 | <- | Cfg: Baud.1 (Sw2) | select baud rate PD.7 | <- | Cfg: Baud.2 (Sw1) | select baud rate Gnd | - | Cfg: Gnd | Ground ----------------+-------+-----------------------+------------------------------ The connection to the PC should be done with a "crossed" cable: TxD <-> RxD RxD <-> TxD CTS <-> RTS RTS <-> CTS Gnd <-> Gnd DTR } shortened in the connector or DCD } connected right through DSR } The 4 DIP-switch allows the following settings: ----------------+---------------+-------+-------- 1 2 3 | baud rate | 4 | Hsk ----------------+---------------+-------+-------- on on on | 230400 | on | RTS/CTS on on off | 115200 | off | None on off on | 57600 | | on off off | 38400 | | off on on | 19200 | | off on off | 9600 | | off off on | 4800 | | off off off | 2400 | | ----------------+---------------+-------+-------- Used parts: Identifier Description. Hints ---------------------------------------------------------------- IC1 AT90S8515 IC2 MAX232 IC3 78L05 not needed when powered by the osci. C1, 1u/10 ceramic C2,C3 100u Mini Elko C4,C5 22p Ceramic C6,C7 22u/10V Elko C8,C9,C8, C10,C11 10u/16V, standing S1 connector 10p. Coded S2,S3,S4,S5 connector 10p Coded S6 Sub-D 5pol male, print mounting J1 Jumper, 3f. 1x3 J2 Jumper, 5f. 1x5 D1 1N4148 or similar Q1 Quartz HC 18 7,3728MHz R1 4k7 1/4W 5%...10% 2. Firmware =========== The "Firmware" for the AT90S8515 can be found in the subdirectory "avr". You can compile it with the GCC. (I use binutils-000617.tar.bz2 and egcs-20000619.tar.gz). Also you'll need AVR-LIBC (I use avr-libc-20000401.tar.gz). make all should do the Job... The Firmware is included also in compiled version as S-Record file. (hm205_2.srec). It can be programmed with the program "uisp" into the controller. The serial interface for the HM205 supports the following commands: I Initialization of interface and Oscilloscope i Identification of the interface s Status of the oscilloscope d read out the enabled channel r Reset HM 205 (Single Shot Modus) t wait until the signal "TS" becomes active (single shot ended) 1 enable channel 1 2 enable channel 2 0 enable channel according to the front panel button of the HM 205 e release the oscilloscope Status bits (according to the user's manual of the HM205-2): 7 (MSB) REMOTE (not used) 6 RESET 5 TE 4 R_W (not used) 3 SRQ 2 CLK_AZ 1 RES_AZ 0 (LSB) CHI/CHII 3. Software =========== For the host computer (PC) I've written a program for the operating system "Linux". You'll find it in the subdirectory "linux". You should be able to compile the program on any linux computer. It doesn't do any hardware access (I use GCC 2.95.2 and glibc2). the configuration of the program is done with the file "hm205.conf". Here you select the serial interface device and the baud rate as well as the scaling of the oscilloscope's raw data, so that the plot on the pc screen fits to the oscilloscope's display. The program looks for the configuration file in that directory whose name is written in the environment variable "HM205", or in the subdirectory "lib" of the user's home directory (you can change this by adapting the Makefile). The program can only read one oscilloscope channel at a time. The oscilloscope must be in digital (storage) mode. You should freeze the oscilloscope by using the "Hold" button or using single shot mode. Calling the program you have to give the name of the data file to created at the command line. Some more command line arguments are allowed -- calling the program without arguments or with invalid arguments will print a help message on the pc's screen. Warning: The program overwrites files without notification! You should also give the present settings of time base (parameter -t) and vertical amplification (parameter -y) otherwise the value 1 is used. The created data file is an ASCII file. The first column contains the time in seconds, the second columns, separated by TAB, contains the y value in volts. This file can be directly plotted by gnuplot. Volker Bosch, 14 Sep. 2000 volker.bosch(at)z.zgs.de