Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!brianw From: brianw@microsoft.UUCP (Brian Willoughby) Newsgroups: comp.sys.apple Subject: Re: Oscilloscopes Summary: Apple II Plus and two custom cards Keywords: oscilloscopes, tektronix Message-ID: <9321@microsoft.UUCP> Date: 5 Dec 89 06:20:56 GMT References: <0.net.apple@pro-lep> <5862@wpi.wpi.edu> <1935@psuhcx.psu.edu> <1989Dec1.150557.9527@eng.umd.edu> Reply-To: brianw@microsoft.UUCP (Brian Willoughby) Organization: Microsoft Corp., Redmond WA Lines: 63 It can be done - but I don't think you can 'purchase' such a beast. You'll have to design the hardware and software yourself: I have written a program for my Plus which (with a little hardware support) gives me much of what I would want an Oscilloscope for, but it is certainly no replacement. Cost is the governing factor here. I had already built my own stereo Analog to Digital conversion card, but I had trouble setting the gain and DC offset controls to get the maximum sound without distortion. The oscilloscope project grew out of a need for some graphical feedback during the recording process. I borrowed a M6840 Programmable Timer Chip from another card I designed, and used it as a variable time base. The interrupts from the 6840 fetch A/D conversions from the first card and store them in a buffer, while the main routine graphs the values to the (single) HiRes screen. The main routine synchronizes with the interrupt routine so that it does not graph data before it arrives. The interrupt routines also shut themselves down (i.e. use less CPU time to allow the graphics routines to run faster) whenever the buffer has enough data to fill a screen. Then the main routine signals the interrupt to fill the buffer again as soon as it has finished plotting the current screen. This technique results in some input data values being lost between the last data plotted on one screen and the first data plotted on the next screen. If you are familiar with oscilloscopes, you'll note that they also cannot display EVERY point, because some time is spent in retrace while the electron beam is disabled. As an added 'gimmick' feature, I have the main routine spin until a rising edge is detected. This duplicates the 'trigger' mode of many 'scopes. There are also a few other tasks for the interrupt routine - so it doesn't fully shut down - it just executes fewer lines of code rather than waste valuable CPU time. I haven't ever seen this technique used in other interrupt controlled programs, but it really is a time saver. At 1 MHz, the Plus can handle data reasonably well at the highest A/D rate I need - 48 kHz - but the screen doesn't update incredibly fast. Slowing the rate to 10 or 20 kHz allows updates faster than the eye can discern. The problem is that the higher rates cause the Apple CPU to spend nearly all of its time in the storing of data into the buffer, and little time is left for graphing. This speed restriction is removed now that I have an AE TransWarp in my Plus. Even 48 kHz input rates (in mono) result in very fast screen updates. Some of the other tasks of the interrupt routine are to keep track of the local minimum and local maximum for use by a peak indicating bar graph which I display below the main screen of the 'scope. My purpose for this is so that any input data above or below the maximum A/D range can be detected even if it arrives during 'horizontal retrace' or the 'trigger' period. The average value of each screen of data is computed and displayed (once per screen, of course) just to the right of the 'scope display. All of these features together make audio sampling a breeze. Now I just need to redo everything for the GS (if I ever get one). P.S. I have the latest sampler from Ensoniq (the guys who made the GS sound chip [Digital Oscillator Chip]), so I haven't had much use for the old 8 bit Apple ][ Plus sampler that I designed. Such is the progress of technology. Brian Willoughby UUCP: ...!{tikal, sun, uunet, elwood}!microsoft!brianw InterNet: microsoft!brianw@uunet.UU.NET or: microsoft!brianw@Sun.COM Bitnet brianw@microsoft.UUCP