home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sample.zip / sample.txt < prev   
Text File  |  1993-09-17  |  8KB  |  182 lines

  1. Documentation for sample.exe, a program 
  2. written by Helge Hafting.
  3.  
  4. There are 2 executable files:
  5. sample_n.exe - with norwegian texts.
  6. sample_e.exe - with english texts.
  7. Install the one you want to use and rename it to sample.exe
  8.  
  9. sample.exe is a program for high-speed 8-bit sampling under
  10. os/2.  The program turn the pc into a simple & cheap logic
  11. analyzer, maybe useable for hobby electronics and such.
  12. Sampling rates of approximately 700kB/s has been achieved
  13. on a 25MHz 386sx, with ISA bus.
  14.  
  15. Sampled data may be viewed as 8 bits that take the values 
  16. 0 and 1, or as a continous graph.  The latter is useful if the
  17. data is sampled from a DA converter.
  18.  
  19. The program can be set up for sampling from any I/O address,
  20. so it will work with any i/o card that provides input at an
  21. i/o address.  Even a standard parallel port (printer port) may
  22. be used.
  23.  
  24.  
  25. USING THE PROGRAM
  26.  
  27. The program has a PM interface, and should therefore be
  28. almost self-explanatory.  Experiment a bit, and you'll learn it.
  29. Numbers (such as the sample buffer size) are converted by the
  30. c function strtoul().  They can be decimal without a 
  31. leading 0: 1024, hex with the 0x prefix: 0x800 or 
  32. octal with a leading 0: 02000.  
  33.  
  34. The data is displayed in two windows.  One is a digital 
  35. representation showing each bit.  The other is an analog
  36. representation, assuming that you are using a DA converter. 
  37. (Be sure that you connect the LSB of the DA to the LSB of the
  38. digital port, or the data will look very strange.)  
  39. Both windows are scrolled with a scroll bar below them.  
  40. There is also a slider between the windows.  It is used to drag
  41. a 1-sample wide line across the data windows, making it easier
  42. to see exactly where data changes.  It is also possible to zoom
  43. in on data, using the zoom menu.
  44.  
  45. The program has three ways of searching through sampled data:
  46. "x=a"  This is an exact match.  Type in the byte value you
  47. want to find, and start the search.
  48. "a<=x<=b" Type in upper and lower limits, and start the search.
  49. This is useful for analog signals sampled with a DA converter.
  50. "01*" This is useful if you are looking for situations where
  51. some bits are 0, some are 1, and some are don't care conditions.
  52. Use the radio button array and specify 1, 0 or * (don't care)
  53. for each bit.  Pressing the search button again will bring 
  54. you to the next sample that matches the search criteria.
  55.  
  56. Interactive help and file operations are not implemented yet.
  57.  
  58. For a quick test, use configure to set the sample buffer to 
  59. 100kB and the i/o port to 64.  Then press ok in the configure
  60. dialog, and press the sample button. 
  61.  
  62.  
  63. TECHNICAL INFO:
  64.  
  65. Sampling rate:
  66. The program use the rep insb instruction for sampling.  A 386
  67. uses 6 clocks per sample, a 486 uses 8 clocks per sample.
  68. A 386 may therefore sample faster than a 486.  The 486 is
  69. optimized for other things than I/O.  You will usually get
  70. sampling rates lower than cpuclock/6, as the cpu isn't the only
  71. limit.  An ISA bus run at only 8MHz, and has several waitstates 
  72. per 8-bit i/o address access.  I haven't tested EISA,MCA or 
  73. local bus sampling.  RAM speed and possibly waitstates inserted 
  74. by the i/o card will also limit sampling speed.
  75. If you want to find out what sampling rate you get with
  76. your particular machine, try sampling a signal (preferably a
  77. square wave) with a known frequency.  100kHz is a good test
  78. frequency.
  79. You may loose a few samples now and then because of ram refresh.
  80. You will also loose 1-2 samples per 4k block, when the MMU
  81. has to read a new page table entry.
  82.  
  83.  
  84. Os/2 considerations:
  85. The program achieves its high sampling rate by using all 
  86. the cpu time when sampling.  You will see that the mouse stop
  87. responding a few seconds if you sample several megabytes.  
  88. The program reserves the cpu by turning off interrupts during
  89. sampling, this is a somewhat nasty thing to do.  There will be
  90. no multitasking or running of background programs when sampling
  91. is going on.  Even device drivers will stop.
  92. Processor exceptions and non-maskable interrupts can still
  93. occur.  This is a problem, because os/2 will re-enable
  94. interrupts and resume multitasking if it gets an NMI or 
  95. exception.  This will give strange sampled data, as the machine
  96. will sample at full speed for 1 timeslice (usually 30ms), then 
  97. do something else for a while, then sample at full speed another 
  98. time slice, and so on.
  99. NMI's don't usually happen, unless your machine is equipped
  100. with a watchdog timer.  The only processor exception you may get
  101. is page faults.  The sample buffer must be allocated in real memory, virtual memory on disk won't work.  This is because:
  102. 1. Os/2 re-enables interrupts after a page fault.
  103. 2. The time needed to get a page from disk is long, tens of
  104.    thousands of samples will be lost.
  105. You will know that a page fault happened if you get disk 
  106. accesses during sampling.  If that happens, try again with a 
  107. smaller buffer.  Allocating 3MB on an 8MB machine seems to work 
  108. fine.
  109.  
  110. The scroll bar will probably not work properly with buffers
  111. larger than 14MB, due to PM limitations.
  112.  
  113.  
  114. PLANNED FUTURE ENHANCEMENTS:
  115. (not in order of priority.)
  116.  
  117. 1. Enabling all the menu choices etc. that currently don't
  118.    do anything, such as help and a possibility to save
  119.    and load data.
  120.  
  121. 2. Optional slower sampling.  Many uses don't require 700kB/s.  
  122.    If you want to take a look at the serial port (in order to
  123.    find out why a modem connection don't work), then a lower
  124.    rate could be useful.
  125.  
  126. 3. Changing colors and resizing the window.
  127.  
  128. 4. Support for setting up i/o cards:  Some i/o cards may require
  129.    that certain values are written to certain i/o ports or
  130.    memory addresses before sampling can be done.  (In order to
  131.    set up a port as an input, for example.)
  132.  
  133. 5. 16-bit and 32-bit sampling.  32-bit won't be very useful
  134.    on an ISA bus.  16-bit sampling may be faster than 8-bit
  135.    on an ISA bus, as fewer waitstates are specified for 16-bit
  136.    i/o...
  137.  
  138. 6. Automatic trigging.  For now, you have to use the sample 
  139.    button, the menu or ALT S in order to start sampling.
  140.  
  141. 7. Fix known bugs, such as:
  142.    a: the window don't look good in 1024x768 resolution
  143.    b: The slider may get wrong size when zooming, if you are
  144.       using better than 640x480 resolution.
  145.    c: Moving the slider around sometimes leaves a black line
  146.       that shouldn't be there. 
  147.    d: english texts are sometimes a little too long. 
  148.  
  149. None of these enhancements are difficult to implement.  But my
  150. time is limited, so I will only implement what people want.
  151. Feel free to mail me and suggest improvements.
  152. ---------------
  153.  
  154. This is a shareware program.  You may freely use and copy it
  155. as much as you want.  Please include this text with any copies.
  156.  
  157. Commercial users will have to pay me $10 in order to use the program commercially in any way.  Use the snail mail 
  158. address when sending money.
  159.  
  160. The program will be updated according to what people want. So 
  161. mail me if you have suggestions, questions, or bug reports,
  162. or find the program useful.
  163.  
  164. My email addresses are:
  165. hafting@idt.unit.no
  166. hafting@pvv.unit.no
  167. I won't be available on the internet forever.  If the above
  168. addresses don't work, try my snail mail address:
  169.  
  170. ---------------------
  171. |   Helge Hafting   |
  172. |   Poverudvn. 22   |
  173. |   N-3440 R¢yken   |
  174. |   NORWAY          |
  175. ---------------------
  176.  
  177. (The "¢" in "R¢yken" is supposed to be an "o" with 
  178.  a slash through it.  If this is a problem, use an
  179.  ordinary "o" instead.) 
  180.  
  181.  
  182.