Download presentation
Presentation is loading. Please wait.
1
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
2
Interfaces Built in Kiel 1. Commodore 64 The USERPORT of the C64 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}.
3
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 inter- face boxes. The programming was done in TURBO PASCAL : adc1=$104; portB=$101; y:=PORT[adc1] {making one AD conversion}; PORT[portB]:=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.
4
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 3A/50V), 2 stepper-motor controls. Both interfaces can be operated simultaneously (LPT2 and extra LPT3) using Turbo Pascal.
5
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 (<10ms) 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.
6
Interfaces Built in Kiel 4) UNIMESS at the Serial Port Serial communication 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 LabView. RS 232
7
The Microcontroller PIC 16C64 PRO 33 independent I/O-lines 2 kB 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
8
Development Tools for the PIC 16C64 Producing the Source Codes CompilingCompiling Programming the PIC EmulationEmulation In PIC- Assembler: Texteditor In PIC- Assembler: Texteditor In C: C-Compiler (e.g. CCS 230DM) In C: C-Compiler (e.g. CCS 230DM) MPASM (Freeware) Surrounding: MPLAB 3.4 (Microchip Freeware) MPDriveway (AiSys ca. 500$) Surrounding: MPLAB 3.4 (Microchip Freeware) MPDriveway (AiSys ca. 500$) Universal- prommer (e.g.: ALL-03A) PIC-In-Circuit- Emulator (app. 1500 DM) Simulator PSIM (Freeware)Simulator
9
UNIMESS Block Diagram 12-Bit AD-Converter 50 ksps ±10V (x1, x2, x4, x8) Microcontroller PIC 16C64 16 Mhz 2 DA-Converters 12 Bit ±5V 4 Digital I/O-Ports TTL Schmitt-Trigger 2 Stepper-Motor Controls 4 Relays 5A/250V/50W RAM for 1000 AD-Values Motion Detector (not yet installed) Timer Function Basis 1 s RS-232-Port to PC 38400 Baud Power Connector +5V,±12V
10
UNIMESS Serial Communication with LabView
11
Programming UNIMESS with LabView A Graphical Programming Language The program code of an RC-control
12
UNIMESS and LabView 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 LabView 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:LabView Student Edition DM 99,-- Material for InterfaceDM 400,--
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.