home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / control / ibmic232 / ibmic232.doc next >
Text File  |  1986-08-22  |  8KB  |  148 lines

  1.  
  2.  
  3.         Controlling ICOM Radios with an IBM-PC
  4.  
  5. This article consists of two parts. Part 1 documents how I connected my ICOM
  6. IC-271A and IC-471A radios to the parallel printer port on my MIT
  7. (Made-in-Taiwan) PC clone. Part 2 consists of C source to subroutines that
  8. can be called by programs running on the PC.
  9.  
  10. Before you warm up your soldering iron, I highly recommend that you get and
  11. read a copy of the article "Computer Control of Icom R71, 271, 471 and 751
  12. Radios" by Richard Bisbey, NG6Q, that appeared in the April 1986 Ham Radio
  13. on page 47. In it he describes how to install the EX-309 computer interface
  14. and how it operates. Richard has clearly been probing around the innards of
  15. ICOM radios for some time and has discovered some useful "tricks" that
  16. circumvent various misfeatures in the radio.  I found the article to be
  17. extremely useful; the skimpy documentation provided by ICOM would have
  18. required much more trial-and-error experimentation.
  19.  
  20. Reading the Printer
  21.  
  22. Just about everybody with an IBM-PC has more parallel printer ports than they
  23. need. They're simple, so manufacturers of add-on multifunction cards like
  24. to toss them in "for free". Since the ICOM EX-309 computer interface requires
  25. a parallel connection, it seems like those extra printer ports ought to be
  26. useful for something. They are, but there's a glitch.
  27.  
  28. A PC printer port is output only (who needs to read data from a printer?)
  29. You *can* control an ICOM radio with an output-only port, but you can't read
  30. information back from the radio.
  31.  
  32. Fortunately, it is very easy to modify a garden-variety PC printer port
  33. (both clones and Real IBM) to allow both input and output, and the modification
  34. shouldn't even affect normal operation. You only need to cut one trace
  35. and to add one jumper. The secret to this easy mod is that 1) the standard
  36. printer interface uses a 74LS374 to drive the output connector, and 2) an
  37. input buffer to read back the state of the output pins is already provided.
  38. (Why the designer thought a programmer would want to read back the state of
  39. a write-only printer data port is beyond me, but I'm happy just the same that
  40. they put it in. Perhaps it was only meant for testing purposes).
  41.  
  42. According to the IBM Options and Adapters Technical Reference, the '374 is
  43. U41 on the monochrome/printer adapter, U18 on the AT Serial/Parallel adapter
  44. and U4 on the plain Printer Adapter. (Check your schematics if you have a
  45. clone). It's an 8-bit latch with tri-state outputs. In the original design,
  46. OE/ (pin 1) is grounded, always enabling the outputs. If you liberate
  47. this pin from ground and connect it instead to a spare output bit that just
  48. happens to be available on the 74LS174 hex D latch that drives the
  49. miscellaneous printer control lines, you can disable the '374 by setting
  50. this bit.  This keeps it from interfering when you read data back from the
  51. radio. The '174 is U39 on the monochrome board, U4 on the AT Serial/
  52. Parallel card, and U7 on the plain Printer Adapter. Note that the '174
  53. pin numbering may be different from board to board, but the pin you
  54. want is the one that latches BD5 from the data bus. On the monochrome card
  55. and "plain" printer adapter this is pin 15, while it's pin 10 on the AT
  56. Serial/Parallel card. Note also that while on the IBM cards the input to
  57. this unused latch is already connected, it is left unconnected on some clone
  58. cards (such as mine).  It must be jumpered to BD5 on the data bus.
  59.  
  60. As long as software leaves this control bit alone, the printer port will still 
  61. function normally. I.e., the default power-up state of the data port is
  62. "output" mode.
  63.  
  64. Once you've modified your printer port (and verified that it still works)
  65. the more tedious part of the job must be done. The problem is that there's no
  66. standard connector pinout for parallel ports (analogous to RS-232 for serial
  67. ports), so you need to build an adapter plug that shuffles the pins between
  68. the ICOM and the PC. The connector on the PC is a DB-25, the same plug used
  69. for RS-232. Various computer accessory suppliers (such as Inmac) supply
  70. solderless "wire-your-own-null-modem" RS232 adapter kits that make this very
  71. convenient. You get male and female DB25 connector shells, a plastic case that
  72. snaps together, and a supply of wires with male and female pins that snap
  73. into the connector shells. You can thus easily permute the pins any way
  74. you want.  There's only one proper way to connect the 8 data bits (unless you
  75. like shuffling bits around in software) but the connections for the
  76. various strobe and ack signals are somewhat arbitrary. However, you're
  77. probably best off using the assignment I chose, since that will allow
  78. you to run my software without having to modify it.
  79.  
  80. Adapter Wiring
  81.  
  82. Here's the wiring I used in my adapter. I assume that you'll use a male DB-25
  83. on the computer end of the 24-pin ribbon cable going to the EX-309 connectors.
  84. Note that the EX-309 uses a 24-pin GPIB-style connector, so make sure you
  85. install the DB-25 on the ICOM bus cable correctly; pin 1 of the DB-25 should
  86. connect to pin 1 on the EX-309's connector. Note also that because of the
  87. different pin layouts on the two connectors, pins 1-12 on the DB-25 correspond
  88. to pins 1-12 on the EX-309, BUT pins 14-25 on the DB-25 correspond to pins
  89. 13-24 on the EX-309. Pin 13 on the DB-25 is unused.
  90.  
  91. Printer Pin    Printer Function    Icom DB25 pin        Icom Function
  92. 2        Data bit 0        1            Data bit 0
  93. 3        Data bit 1        2            Data bit 1
  94. 4        Data bit 2        3            Data bit 2
  95. 5        Data bit 3        4            Data bit 3
  96. 6        Data bit 4        5            Data bit 4
  97. 7        Data bit 5        6            Data bit 5
  98. 8        Data bit 6        7            Data bit 6
  99. 9        Data bit 7        8            Data bit 7
  100. 17        SLCTIN            9            RP
  101. 1        STROBE            10            SRQ/
  102. 14        AUTO FDXT        22 (21 at radio)    WP
  103. 10        ACK            23 (22 at radio)    DAV/
  104. 18-25(any)    GND            25 (24 at radio)    GND
  105.  
  106.  
  107. Programming Info
  108.  
  109. Once you've wired the adapter, the various ICOM signals appear as follows.
  110. (This assumes the base addressing used for the monochrome adapter/printer
  111. port; adjust if your port is at a different address). Note that some of the
  112. ICOM bus lines are negative true, and others are positive true. Some (but
  113. not all) of the printer port's control and status lines are inverted as well.
  114. This has already been taken into account here. (The choice of bit assignments
  115. was in part made so that the radios would see an idle interface when the
  116. printer port is left in its uninitialized, power-up state).
  117.  
  118. 3BCH (read/write): the 8-bit data bus. The direction of data flow is
  119. controlled by bit 5 in port 3BEH.
  120.  
  121. 3BDH (read only):
  122. Bit 6 (i.e., mask 40h) is the DAV bit, active low (a zero bit corresponds
  123. to the ICOM saying that Data is AVailable).
  124.  
  125. 3BEH (write only):
  126. Bit 0 (01H) controls the SRQ line to the radio, active high (setting this bit
  127. to a one tells the radio that Service is ReQuested).
  128. Bit 1 (02H) is the WP (Write Pulse), active low.  Note that this bit should
  129. be kept high when the interface is idle, although it will not have any
  130. effect as long as SRQ is inactive.
  131. Bit 3 (08H) is the RP (Read Pulse), active low. This bit should also be
  132. kept high when the interface is idle.
  133. Bit 4 (10H) is the IRQ (Interrupt ReQuest enable) bit that allows the ACK
  134. input pin to cause an interrupt. Since DAV is connected to the ACK input,
  135. this makes it possible to make the computer-to-radio protocol interrupt
  136. driven. This isn't usually worth it, though.
  137. Bit 5 (20H) controls the direction (input/output) of the 8-bit data port.
  138. (This was the bit we had to wire up on the interface card). Clearing this
  139. bit puts the data port in output (computer -> radio) mode; setting it allows
  140. the computer to read data from the radio.
  141.  
  142. Part 2 of this article will list the C sources for driving the radios.
  143.  
  144. Phil Karn, KA9Q
  145. 21 August, 1986
  146.  
  147.  
  148.