home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / rs232ts2 / RS232TST.DZC / RS232TST.DOC
Encoding:
Text File  |  1993-06-07  |  5.0 KB  |  114 lines

  1. RS232TST - SIO Status Register Test
  2. ===================================
  3.  
  4. RS232TST reads the Z80 SIO (Serial Input/Output) status register and places 
  5. the result in the ZCPR3 user registers.  After RS232TST is run, registers 0 
  6. through 7 will contain either 0 or 1, depending on the value of the respec- 
  7. tive bits in the status byte.  The complete status byte is placed in 
  8. register 8. 
  9.  
  10. RS232TST makes information about the status of the Serial I/O available to 
  11. both ZCPR scripts (via the IF REG command) and applications (via calls to 
  12. Z3LIB) independant of hardware configuration.  A power-on script could, for 
  13. instance, selectively run BYE, depending on whether or not a modem is 
  14. connected to the system and turned on.  
  15.  
  16. Three configuration bytes in the first sector of RS232TST are clearly marked 
  17. and may be patched with any file patch utility to permanently set several 
  18. operating parameters as follows:
  19.  
  20. PORT    marks the byte selecting the port to be read by RS232TST.
  21.  
  22. RESET    marks a byte flag which, if set nonzero, causes a Reset External/ 
  23.     Status Interrupts command to be performed prior to reading the 
  24.     status byte.  This is required if the current status of the Data 
  25.     Carreir Detect and Clear To Send lines are to be correctly reported.  
  26.     On the other hand, The Interrupt Pending and Break/Abort bits are 
  27.     reset following a Reset External/Status Interrupts command, clearing 
  28.     any information which they may have contained.
  29.  
  30. WHEEL    If set nonzero, RS232TST is wheel protected, and will return a ZCPR3 
  31.     error code 6 if invoked, making it invisible on a secure system.  
  32.     Wheel protection status is reflected in the information presented on 
  33.     invocation with the conventional "//" self documentation request.
  34.  
  35.  
  36. THE SIO STATUS BITS
  37. ===================
  38.  
  39. The bits in the SIO status bits reflect various conditions within and at 
  40. the inputs of the Z80 SIO chip.  These are discussed briefly below.  For a 
  41. complete discussion of the Z80 SIO 3884/5/7, consult the Mostek or Zilog 
  42. reference manuals on the Z80 chip set.
  43.  
  44. Bit 0    Recieve Character Available.
  45.     ============================
  46.     This bit is set when at least one character is available in the 
  47.     receive buffer.  It is reset when the receive FIFO is empty.
  48.     
  49. Bit 1    Interrupt Pending
  50.     =================
  51.     Any interrupting condition in the Z80 SIO causes this bit to be set, 
  52.     however it is readable only on SIO Channel A.  This bit is used 
  53.     mainly on systems which do not have vectored interrupts, and 
  54.     eliminates the need for polling all the Channel A and B status bits 
  55.     to check for interrupt conditions.
  56.     
  57. Bit 2    Transmit Buffer Empty
  58.     =====================
  59.     This bit is set whenever the transmit buffer becomes empty during 
  60.     asynchronous operation.
  61.     
  62. Bit 3    Data Carrier Detect 
  63.     =================== 
  64.     This bit shows the state of the Data Carrier Detect input at the 
  65.     time of the last change of any of the five External/Status bits 
  66.     (DCD, CTS, Synch/Hunt or Break/Abort), and is latched until 
  67.     interrupt conditions are satisfied.  The RESET flag must be set in 
  68.     RS232TST to read the current status of the DCD input line.  
  69.  
  70. Bit 4    Sync
  71.     ====
  72.     In asynchronous mode, this bit follows the inverted state of the 
  73.     ~SYNC input, and thus shows the state of this input. It is latched 
  74.     by a transition of any of the other input or condition bits (DCD, 
  75.     CTS or Bread/Abort), and thus shows the condition of the ~SYNC input 
  76.     at the time of the transition.  Following a Reset External/Status 
  77.     Interrupt command, it shows the current state of the SYNC input.  
  78.     This bit must be read immediately after a Reset External/Status 
  79.     Interrupt command to read the current state of the ~SYNC input.  In 
  80.     actual practice, the ~SYNC input may be tied to the Data Receive 
  81.     input.  
  82.     
  83. Bit 5    Clear to Send
  84.     =============
  85.     This bit is similar to the Data Carrier Detect.  To show the true 
  86.     current status of the incoming CTS line, it must be read immediately 
  87.     after a Reset External/Status Interrupt command.  Setting the RESET 
  88.     flag in RS232TST will accomplish this.
  89.     
  90. Bit 6    Transmit Underrun
  91.     =================
  92.     This bit is not used in asynchronous communication, and is always 
  93.     set by a Reset External/Status Interrupt command.
  94.     
  95. Bit 7    Break/Abort
  96.     ===========
  97.     In Asynchronous mode, this bit is set when a Break sequence (null 
  98.     character plus framing error) is detected in the data stream.  
  99.     
  100. In actual practice, only the status of bits 3 (DCD) and 5 (CTS) will be of 
  101. concern, since these are the bits which show modem status.  If, however, the 
  102. RESET flag is set off, RS232TST may be used to read the input from any port, 
  103. in which case, the meaning of the bits returned in the ZCPR registers will 
  104. depend on the application.
  105.     
  106. Questions, bug reports or suggestions for further development may be 
  107. directed to:
  108.  
  109. Lindsay Haisley
  110. 14206 Spreading Oaks Drive
  111. Leander, TX  78641
  112. 512-259-1190  Voice
  113. 512-259-1261  BBS (Znode 77)
  114.