6704c5ebf6bcc0c1604f615b1a497364.ppt
- Количество слайдов: 12
INTERFACES and PROGRAMMING for the Physics Laboratory Invited Talk, Bucharest, October 1999 Prof. Dr. R. Lincke Inst. für Experimentelle und Angewandte Physik der Universität Kiel • • The Beginning: Commodore 64 8 -Bit System for the PC Using the PC Printer Port Windows: New Possibilities and New Problems UNIMESS Microcontroller Programming Under Windows
Interfaces Built in Kiel 1. Commodore 64 The USERPORT of the C 64 contained 1 Byte bidirectional + 1 Bit out. We used it with a) a 2 -channel Preamplifier, b) a Steppermotor- and Relay-Interface, c) a Digital- and Timer-Interface. Sampling rates were as high as 60. 000 8 -bit values per second. The Programs were written in Commodore-BASIC with SIMON´s BASIC for Graphics: Ci= 56576; y = PEEK(Ci+1) {for reading ADC}; POKE Ci, 64 {for switching relay}.
Interfaces Built in Kiel 2. 8 -Bit-Card for PC This system was centered around an 8 -bit card sitting in a standard slot. It contained all the logic including two ADCs and DACs, three 16 bit timers and an 8 -bit digital port. Preamplifiers, Schmitt-triggers, stepper-motor controls etc. were contained in three separate interface boxes. The programming was done in TURBO PASCAL : adc 1=$104; port. B=$101; y: =PORT[adc 1] {making one AD conversion}; PORT[port. B]: =1 {switching relay #1}; Modern 12 -bit ADCs and interrupt problems with fast PCs and basic problems with the operating system WINDOWS made this interface system obsolete.
Interfaces Built in Kiel 3. ADTI on the PRINTER PORT Modern printer ports permit most bits to be defined as input or output. This allows the construction of some extremely simple interfaces: ADTI: 2 -channel 12 -bit ADC (multiplexed) with preamplifier, 2 -channel digital in, 2 -channel digital out, 12 -bit DAC. RMI: 4 relays (max 3 A/50 V), 2 stepper-motor controls. Both interfaces can be operated simultaneously (LPT 2 and extra LPT 3) using Turbo Pascal.
Problems with Using Modern Hard- and Software in the Teaching Lab • • • Modern operating systems use multitasking. This prohibits time critical measurements. Ports cannot be addressed directly. Measurement of short times (<10 ms) is difficult. ISA-bus is too fast. There are too many diverging port- and bus standards. Programming languages (Delphi, Visual Basic, C++ etc) are very powerful and very complex. They take too much time from physics and should be left for professionals.
Interfaces Built in Kiel 4) UNIMESS at the Serial Port Serial communication RS 232 An interface for a WINDOWS system needs intelligence: only with a microcontroller can one record a series of fast equidistant AD-values. The measuring routines must be programmed in the controller‘s assembly language. A programming language suitable for calling these routines, communicating with the PC and graphing and evaluating the data is the graphical language Lab. View.
The Microcontroller PIC 16 C 64 • • • PRO 33 independent I/O-lines 2 k. B program EPROM 128 byte RAM 3 internal timers operating frequency up to 20 MHz SPI-/I 2 C bus etc. RISC architecture 8 stack levels minimal external hardware • • CONTRA no prepared data/address bus no internal data RAM no good development tools mathematical functions difficult
Development Tools for the PIC 16 C 64 Producing the Source Codes Compiling Programming the PIC Emulation In PICAssembler: ð Texteditor In C: MPASM (Freeware) Universalprommer (e. g. : ALL-03 A) PIC-In-Circuit. Emulator (app. 1500 DM) ð C-Compiler (e. g. CCS 230 DM) Surrounding: Simulator ð MPLAB 3. 4 (Microchip Freeware) PSIM (Freeware) ðMPDriveway (Ai. Sys ca. 500$)
UNIMESS Block Diagram 12 -Bit AD-Converter 50 ksps ± 10 V (x 1, x 2, x 4, x 8) RAM for 1000 AD-Values 2 DA-Converters 12 Bit ± 5 V 4 Digital I/O-Ports TTL Schmitt-Trigger 2 Stepper-Motor Controls 4 Relays 5 A/250 V/50 W Motion Detector yet installed) Microcontroller PIC 16 C 64 16 Mhz (not Timer Function Basis 1 s RS-232 -Port to PC Baud Power Connector +5 V, ± 12 V 38400
UNIMESS Serial Communication with Lab. View
Programming UNIMESS with Lab. View A Graphical Programming Language The program code of an RC-control
UNIMESS and Lab. View A Pair for the Physics Laboratory • • Contents of the Lab no program code, object oriented programming modern software, modern techniques of communication frontend and program structure are produced by the student a wide variety of physics problems can be solved parallel to learning Lab. View and interfacing Advantages even students without any previous knowledge of programming can master the subjects in a very short time (about 3 times faster than with TURBO Pascal) highly motivating by ‚instant results‘ and attractive graphics very low price: Lab. View Student Edition DM 99, -Material for Interface DM 400, --
6704c5ebf6bcc0c1604f615b1a497364.ppt