{"id":318,"date":"2016-05-18T23:24:59","date_gmt":"2016-05-18T23:24:59","guid":{"rendered":"http:\/\/avitech.com.au\/?page_id=318"},"modified":"2017-11-12T12:32:45","modified_gmt":"2017-11-12T12:32:45","slug":"current-loop-interface-2","status":"publish","type":"page","link":"https:\/\/avitech.com.au\/?page_id=318","title":{"rendered":"Current Loop Interface #2"},"content":{"rendered":"<h3>USB-Powered 20mA Current Loop Interface<\/h3>\n<p><a href=\"#introduction\">Introduction<\/a> \u00a0 <a href=\"#description\">Description<\/a> \u00a0 <a href=\"#settings\">Settings<\/a> \u00a0 <a href=\"#project-status\">Project Status<\/a> \u00a0 <a href=\"#downloads\">Downloads<\/a><\/p>\n<h3><a name=\"introduction\"><\/a>Introduction<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"319\" data-permalink=\"https:\/\/avitech.com.au\/?attachment_id=319\" data-orig-file=\"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?fit=622%2C480&amp;ssl=1\" data-orig-size=\"622,480\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;5.6&quot;,&quot;camera&quot;:&quot;NIKON D7000&quot;,&quot;created_timestamp&quot;:&quot;1430710927&quot;,&quot;focal_length&quot;:&quot;200&quot;,&quot;iso&quot;:&quot;400&quot;,&quot;shutter_speed&quot;:&quot;0.0025&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"cli2-rev-1-pcb-622-480\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?fit=622%2C480&amp;ssl=1\" class=\"alignright size-medium wp-image-319\" src=\"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?resize=300%2C232&#038;ssl=1\" alt=\"cli2-rev-1-pcb-622-480\" width=\"300\" height=\"232\" srcset=\"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?resize=300%2C232&amp;ssl=1 300w, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?resize=150%2C116&amp;ssl=1 150w, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2016\/05\/cli2-rev-1-pcb-622-480.jpg?w=622&amp;ssl=1 622w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This board is useful for connecting a computer to a current-loop peripheral.<\/p>\n<p>It was primarily designed for connecting a current-day PC to a Model 33 Teletype without the need for any external power supply. Simply connect the PC to the board via a USB cable, and connect the Teletype&#8217;s 20mA current loop cable directly to the board. It also has RS232 inputs (and built in baud rate conversion functionality) if you would prefer to connect via the PC&#8217;s RS232 port. This will however require the use of an external 5V or 12V power supply (a wall wart will be sufficient).<\/p>\n<p>This board can also be easily adapted for other uses. For example:<\/p>\n<ul>\n<li>The drive current can be increased from 20mA to 60mA, by changing a few component values<\/li>\n<li>It can be used to connect a vintage computer (via its RS232 port) to terminals or printers via 20mA current loop<\/li>\n<li>It can be used to connect a current-day PC to the current loop interface of a vintage computer (provided the vintage computer&#8217;s current loop circuitry can be switched to &#8220;passive&#8221; mode)<\/li>\n<\/ul>\n<p>This board is intended to be the &#8220;active&#8221; end of the current loop. It is important to know that when connecting two devices via current loop, one (and only one!) device should be configured as &#8220;active&#8221; and the other device should always be configured as &#8220;passive&#8221;. The active device will generate the loop voltage, and regulate or limit the loop current. Typically the active device is not opto-isolated from the device it forms part of. The passive device does not inject any voltage or current into the loop. Typically the passive device isolates the current loop from the other circuitry within the device. Often this is done using opto-couplers. Because my board is not fitted with any opto-couplers, it is not designed to operate as the passive end of a current loop connection. Please see my &#8220;Current Loop Board 1&#8221; project if you are looking for a circuit for the passive end of the current loop.<\/p>\n<h3><a name=\"description\"><\/a>Description<\/h3>\n<p>The main parts of the circuitry are:<\/p>\n<ul>\n<li>On-board switch mode power supply. This provides power for the current loops and for the board&#8217;s own circuitry. A potentiometer is provided to adjust the current loop voltage within the range of 14V to 28V. Depending on the jumper settings used, the power supply takes its input from the USB port or from an external supply (5V to 12V, AC or DC). If using an external supply, a 5VDC 1A or 12VDC 500mA plug pack is recommended.<\/li>\n<li>Analogue circuitry to drive the transmit-data, receive-data and reader-enable current loops. Current is regulated in the loops at approximately 20mA by way of current-sensing circuitry. So there is no need to change any current limiting resistors if you vary the loop voltage.<\/li>\n<li>Indicator LEDs for power and to show activity on the TX and RX current loops.<\/li>\n<li>A &#8220;Type B&#8221; USB connector, to connect the board to a PC.<\/li>\n<li>A DB9F connector, which will connect directly to a PC&#8217;s 9-pin serial port using a straight-through cable. It will also connect directly to a USB-to-DB9 RS232 adapter.<\/li>\n<li>A DB25M connector, for general purpose RS232 use. You can use this to connect to other RS232 devices. It has jumpers to configure it as a DTE or DCE device, to help simplify the RS232 cabling requirements.<\/li>\n<li>A PIC microcontroller that performs the tasks of bridging between the PC side (USB or RS232) and the current loop.<\/li>\n<\/ul>\n<p>The PIC microcontroller provides the following functionality (however &#8211; functionality relating to 5-bit Teletypes will be removed soon, to simplify the settings menu)<\/p>\n<ul>\n<li>Teletype-side byte length (5-bit, 8-bit)<\/li>\n<li>PC-side data format (ITA2\/USTTY, printable ASCII, full 7-bit ASCII, binary)<\/li>\n<li>Teletype baud rate (45.4, 50, 75, 91.67, 100, 110, 132, 300, 600, 1200, 2400, 4800, 9600)<\/li>\n<li>Handling of bit D7 from Teletype (strip from keyboard, strip from all, no strip)<\/li>\n<li>Data sent to PC via USB port (no, yes)<\/li>\n<li>Data sent to PC via RS232 port (no, yes)<\/li>\n<li>Newline character from PC (CR, LF, CR+LF)<\/li>\n<li>Newline sequence to Teletype (CR, LF, CR+LF, CR+LF+LS+LS)<\/li>\n<li>Fast Teletype LFs at left margin (no, yes)<\/li>\n<li>Teletype 5-bit character set (ITA2, USTTY)<\/li>\n<li>Teletype unshifts on CR (no, yes)<\/li>\n<li>Teletype unshifts on SPACE (no, yes)<\/li>\n<li>Teletype characters per line (30 to 250)<\/li>\n<li>Column counter reset trigger (CR, LF)<\/li>\n<li>Teletype action at right margin (keep printing, CR, LF, CR+LF, Discard-silently, Discard-bell)<\/li>\n<li>Convert TABs to SPACEs (no, yes)<\/li>\n<li>Tab stop interval (2 to 16)<\/li>\n<li>RS232 baud rate (110, 300, 600, 1200, 2400, 4800, 9600)<\/li>\n<li>RS232 mode (off, Mirror USB I\/O, Emulate tape reader\/punch, Hex dump)<\/li>\n<li>RS232 CTS timeout in mSec (0, 1, 2, 5, 10, 20, 50, 100, 200, 250)<\/li>\n<\/ul>\n<p>The PIC also has some built-in test messages that can be printed on the Teletype (whether or not a PC is connected). To access this feature, press the &#8220;Select&#8221; button 1, 2 or 3 times in quick succession. The PIC will then transmit the corresponding test message to the Teletype via the current loop interface.<\/p>\n<h3><a name=\"settings\"><\/a>Settings<\/h3>\n<p>The PIC chip stores a number of user-changeable settings that affect the functionality of the board, as described above.<\/p>\n<p>To view and change the settings:<\/p>\n<ul>\n<li>Connect a PC (or terminal) to the board via RS232 (at 9600 baud) or USB.<\/li>\n<li>Use a terminal program on the PC to communicate with the board. TeraTerm or PuTTY work well.<\/li>\n<li>Press the &#8220;settings&#8221; button on the board. The settings menu will display on your PC.<\/li>\n<li>Use the arrow keys on your PC&#8217;s keyboard to view and change the settings. Press &#8220;X&#8221; when done.<\/li>\n<\/ul>\n<p>The settings will be documented more fully when the firmware has been completed. Some settings are a little complicated, but most can be understood from the options\/values provided in the settings menu itself.<\/p>\n<p>Here is a screen shot showing the settings menu, though note this is still undergoing change (most of the changes will be to simplify the settings menu):<\/p>\n<pre>Current Loop Driver, Version 0.15, Unreleased\r\n\r\n       Current loop word length:            8 data bits\r\n       PC-side data format:                 Full ASCII (7-bit)\r\n       Teletype baud rate:                  110\r\n       Handling of D7 from Teletype:        Strip D7 only for keyboard data\r\n       Data sent to PC via USB port:        Only keyboard data\r\n       Data sent to PC via RS232 port:      Only keyboard data\r\n       Newline character from PC:           CR\r\n       Newline sequence to Teletype:        CR\r\n       Fast Teletype LFs at left margin:    NO\r\n       Teletype 5-bit char. set:            USTTY\r\n       Teletype unshift on CR:              NO\r\n       Teletype unshift on SPACE:           NO\r\n       Teletype chars per line:             66\r\n       Column counter resets on:            CR\r\n       Teletype action at right margin:     Keep printing\r\n       Convert TABs to SPACEs:              YES\r\n       Tab stop interval:                   4\r\n       RS232 baud rate:                     9600\r\n       RS232 mode:                          Mirror USB I\/O\r\n       RS232 CTS timeout (msec):            ??????\r\n       File transfer protocol:              XMODEM\r\n\r\nPress X to exit when done<\/pre>\n<h3><a name=\"project-status\"><\/a>Project Status<\/h3>\n<p><em>Note: The firmware still needs some significant improvements.\u00a0 I am currently (November 2017) actively working on it.<\/em><\/p>\n<h4>12 November 2017<\/h4>\n<p>I am half-way through the process of significantly revising (simplifying) the user interface.<\/p>\n<p>Recent modifications include:<\/p>\n<ul>\n<li>Adding 3 front-panel rotary switches to control the key functional selections. These control the format of data passing through the USB and RS232 interfaces (OFF, Hex-Dump, Unfiltered, Filtered) and how the Reader Enable output works (OFF, ON, CTS Level Triggered, CTS Edge Triggered)<\/li>\n<li>Added A\/D code to read and process the data from the 3 front-panel rotary switches (each switch uses just one analog input to the PIC)<\/li>\n<li>Removed the 5-Bit\/8-Bit option from the settings menu. Instead, this is now specified at compile time<\/li>\n<li>Fixed a bug in the code so that this program can now be loaded (and upgraded) using the HID bootloader. This means that a PIC programmer won&#8217;t be needed to upgrade the firmware in the field<\/li>\n<\/ul>\n<h4>6 May 2015<\/h4>\n<p>PIC firmware is rough but mostly operable. Most (not all) of the functionality listed above has been implemented. The firmware needs work in 4 main areas:<\/p>\n<ul>\n<li>Remove all options relates to 5-bit Teletypes, in order to simplify the settings menu. A dedicated 5-bit board will be put together in the future.<\/li>\n<li>Implement code to initialise the settings. Presently the settings have to be initialised manually. Operation is unpredictable until the settings have been initialised.<\/li>\n<li>Implement watchdog timer.<\/li>\n<li>Implement functionality that will allow user code on a PC to control reader-enable on the ASR33 paper tape reader.<\/li>\n<\/ul>\n<p>Further testing is also needed to refine firmware and hardware.<\/p>\n<p>This page was last updated on 19 May 2016.<\/p>\n<h3><a name=\"downloads\"><\/a>Downloads<\/h3>\n<p><a href=\"https:\/\/avitech.com.au\/mm-files\/current-loop-interface-2\/20mA-driver-kicad-files-20141127.zip\">Schematic and PCB Layout (KiCAD files)<\/a><\/p>\n<p><a href=\"https:\/\/avitech.com.au\/mm-files\/current-loop-interface-2\/schematic-20141211.pdf\">Schematic (PDF)<\/a><\/p>\n<p><a href=\"https:\/\/avitech.com.au\/mm-files\/current-loop-interface-2\/user.c\">PIC source code (user.c) [as at 27-DEC-2014]<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>USB-Powered 20mA Current Loop Interface Introduction \u00a0 Description \u00a0 Settings \u00a0 Project Status \u00a0 Downloads Introduction This board is useful for connecting a computer to a current-loop peripheral. It was primarily designed for connecting a current-day PC to a Model 33 Teletype without the need for any external power supply. Simply connect the PC to ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/avitech.com.au\/?page_id=318\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-318","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P7xTsk-58","jetpack-related-posts":[{"id":766,"url":"https:\/\/avitech.com.au\/?page_id=766","url_meta":{"origin":318,"position":0},"title":"RS232 Connectors","author":"malcolm","date":"19-July-2016","format":false,"excerpt":"This page sets out some basic information about serial connectors used for RS232-level asynchronous serial communications. Protocol and signal levels When TXD and RXD lines are in the IDLE state (and for a Logic 1 on these lines): TTL logic lines are at +5V RS232 lines are at -VE voltages\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/08\/de9-connectors-numbered-pins-300x225.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1628,"url":"https:\/\/avitech.com.au\/?page_id=1628","url_meta":{"origin":318,"position":1},"title":"DEC BC01V RS232 Cable","author":"malcolm","date":"17-January-2017","format":false,"excerpt":"DEC BC01V Cable For the PDP-8, the KL8-E (M8650) and KL8-JA (M8655) connect to the outside world via a 40-pin \"Berg\" connector, arranged as 2 rows of 40 pins as shown here. These boards supports 20mA current loop or RS232 communications, depending on the cable that is connected to it.\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2017\/01\/berg-on-kl8ja-300x169.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2149,"url":"https:\/\/avitech.com.au\/?page_id=2149","url_meta":{"origin":318,"position":2},"title":"Current Loop: Design Notes","author":"malcolm","date":"13-June-2017","format":false,"excerpt":"This page has notes of things I've discovered in relation to the current-loop interface as used on PDP-8 and PDP-11 computers. DEC Current loop cable DEC's main interface cable for OMNIBUS PDP-8's and PDP-11's is the KL8, which is shown on page 51 of the PDP-8\/e Engineering Drawings on Bitsavers.\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2017\/06\/vt100-tech-manual-extract-page-3-6-1024x430.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2017\/06\/vt100-tech-manual-extract-page-3-6-1024x430.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2017\/06\/vt100-tech-manual-extract-page-3-6-1024x430.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2017\/06\/vt100-tech-manual-extract-page-3-6-1024x430.jpg?resize=700%2C400 2x"},"classes":[]},{"id":4387,"url":"https:\/\/avitech.com.au\/?page_id=4387","url_meta":{"origin":318,"position":3},"title":"For Sale","author":"malcolm","date":"15-May-2021","format":false,"excerpt":"These are the items I currently have available for sale. All items are pickup from Macleod Vic 3085 Australia, or I will drop off unboxed at Pack and Send in Eltham, for you to arrange freight. You can reach me by sending me a message from the HOME page. Page\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/avitech.com.au\/mm-files\/items-for-sale\/vt220-ta642e3878\/main-300x225.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5917,"url":"https:\/\/avitech.com.au\/?page_id=5917","url_meta":{"origin":318,"position":4},"title":"DEC MINC-11 at System Source","author":"malcolm","date":"5-June-2022","format":false,"excerpt":"This page is about the MINC-11 in the System Source collection in Hunt Valley, Maryland. Current Status I visited System Soure in June 2022 and spent some time working on this MINC-11, attempting to get it running. It comes up with a PDP-11\/03 ODT prompt, if the Normal\/Halt switch on\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/06\/PXL_20220607_201500140.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/06\/PXL_20220607_201500140.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/06\/PXL_20220607_201500140.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/06\/PXL_20220607_201500140.jpg?resize=700%2C400 2x, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/06\/PXL_20220607_201500140.jpg?resize=1050%2C600 3x, https:\/\/i0.wp.com\/avitech.com.au\/wp-content\/uploads\/2022\/06\/PXL_20220607_201500140.jpg?resize=1400%2C800 4x"},"classes":[]},{"id":2447,"url":"https:\/\/avitech.com.au\/?page_id=2447","url_meta":{"origin":318,"position":5},"title":"SerialDisk Operational Notes","author":"malcolm","date":"1-August-2017","format":false,"excerpt":"I use Kyle Owen's excellent SerialDisk software to run OS\/8 on my PDP-8\/e. This page sets out my notes relating to the ongoing care and maintenance of my existing SerialDisk setup. It does not explain how to initially setup SerialDisk. Note: I also have a separate webpage (not yet on\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/avitech.com.au\/index.php?rest_route=\/wp\/v2\/pages\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avitech.com.au\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/avitech.com.au\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/avitech.com.au\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avitech.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318"}],"version-history":[{"count":16,"href":"https:\/\/avitech.com.au\/index.php?rest_route=\/wp\/v2\/pages\/318\/revisions"}],"predecessor-version":[{"id":2855,"href":"https:\/\/avitech.com.au\/index.php?rest_route=\/wp\/v2\/pages\/318\/revisions\/2855"}],"wp:attachment":[{"href":"https:\/\/avitech.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}