home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / osborne / osuart.doc < prev    next >
Text File  |  1994-07-13  |  4KB  |  159 lines

  1. The Osborne I's uart is memory mapped in bank 2 at locations
  2. 02A00H and 02A01H.  The traditional way of getting at the port
  3. was to have some assembly language code located above 04000H.
  4. This code normally takes the form of:
  5.  
  6.     DI
  7.     OUT    00H
  8.  
  9. To change back you have used the following:
  10.  
  11.     OUT    01H
  12.     EI
  13.  
  14. The uart is mapped with 02A00H as the status/control word and
  15. 02A01H as the data word.  So to write some data to the data port
  16. of the uart, the following code would have been used:
  17.  
  18.     DI
  19.     OUT    00H
  20.     STA    02A01H
  21.     OUT    01H
  22.     EI
  23.  
  24. This is the new method that uses code that is already in the BIOS
  25. and the ROM.  What you have to do is set up somthing like the
  26. following code:
  27.  
  28. ;Output a control word to the 6850 chip
  29.  
  30. CTLPOUT:
  31.     MOV    C,A        ;Put the character in C
  32.     LXI    D,013CH
  33.     JMP    SWITCH
  34.  
  35. ;Input the status of the 6850 chip
  36.  
  37. STATUS:    LXI    D,0181H
  38.     CALL    SWITCH
  39.     RET            ;The status will be in A
  40.  
  41. ;Output a charater to the 232 port
  42.  
  43. DTLPOUT:
  44.     MOV    C,A        ;Put the charater in C
  45.     LXI    D,010FH
  46.     JMP    SWITCH
  47.  
  48. ;Input a character from the 232 port
  49.  
  50. DTLPIN:    LXI    D,0115H
  51.     CALL    SWITCH
  52.     RET            ;The character will be in A
  53.  
  54. SWITCH:    LDA    SWITCH1+2
  55.     ORA    A
  56.     RZ            ;Nont installed yet
  57. SWITCH1:
  58.     JMP    0036H        ;The 00 is replaced by INIT
  59.  
  60. ;END OF CODE
  61.  
  62. The code should be installed with the following code:
  63.  
  64. INIT:    LDA    0002H        ;High order bit of the BIOS addr
  65.     STA    SWITCH1+2
  66.     RET
  67.  
  68. ;END OF CODE
  69.  
  70. When using this method of getting to the 6850 chip, you should
  71. always call the STATUS routine before calling DTLPIN because
  72. DTLPIN will wait for a character and if there is no character for
  73. a while, the program will be locked up.  The code that is used to
  74. mask off and check the status bits is still the best way of
  75. checking for Ready-for-the-next-character and Character-is-
  76. waiting.
  77.  
  78. The data words are the usual ascii characters.  The data for the
  79. control word is in the first chart.  The status word definitions
  80. are in the second chart.
  81.  
  82. In the following charts, CR0 is the least significant bit and CR7
  83. is the most significant bit.
  84.  
  85.  
  86. CR7              FUNCTION
  87.  
  88.  X        Is not used on the Osborne.
  89.  
  90. CR6   CR5          FUNCTION
  91.  
  92.  0     0    Enables the internal modem port on the Osborne.
  93.  0     1          Not used on the Osborne.
  94.  1     0    This is the normal setting.
  95.  1     1    Transmits a BREAK level on the data output.
  96.  
  97. CR4  CR3  CR2          FUNCTION
  98.  
  99.  0    0    0    7 Bits, Even parity, 2 Stop bits
  100.  0    0    1    7 Bits,  Odd parity, 2 Stop bits
  101.  0    1    0    7 Bits, Even parity, 1 Stop bit
  102.  0    1    1    7 Bits,  Odd parity, 1 Stop bit
  103.  1    0    0    8 Bits,   No parity, 2 Stop bits
  104.  1    0    1    8 Bits,   No parity, 1 Stop bit
  105.  1    1    0    8 Bits, Even parity, 1 Stop bit
  106.  1    1    1    8 Bits,  Odd parity, 1 Stop bit
  107.  
  108. CR1   CR0          FUNCTION
  109.  
  110.  0     0    19,200 Baud
  111.  0     1      1200 Baud
  112.  1     0       300 Baud
  113.  1     1    Master Reset
  114.  
  115. A Master Reset (03H) must be written to the uart before a new
  116. setting is sent and as the first thing written to the uart after
  117. the program starts.  The 19,200 baud setting does not seem to
  118. work on the Osborne I.
  119.  
  120. CR0
  121.  0    Data not available
  122.  1    Data available
  123.  
  124. CR1
  125.  0    Not ready for new data
  126.  1    Ready for new data
  127.  
  128. CR2
  129.  0    Carrier present
  130.  1    Carrier lost
  131.  
  132. CR3
  133.  0    Clear to send (hooked to the CTS line)
  134.  1    Not clear to send
  135.  
  136. CR4
  137.  0    No framing error
  138.  1    Framing error
  139.  
  140. CR5
  141.  0    No overrun error
  142.  1    Overrun error
  143.  
  144. CR6
  145.  0    No parity error
  146.  1    Parity error
  147.  
  148. CR7
  149.  X    Not used on the Osborne I
  150.  
  151.  
  152. I hope that this code modification will make it easier for you to
  153. install a term program on your system.
  154.  
  155. he Osborne I
  156.  
  157.  
  158. I hope that this code modification will make it easier for you to
  159. install a term program on