RetroWiki

Retrograde 64

User Tools

Site Tools


doc:cbm:io:iec:how_serial_bus_works

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:cbm:io:iec:how_serial_bus_works [2020/10/20 22:58] eekdoc:cbm:io:iec:how_serial_bus_works [2023/11/12 23:43] (current) eek
Line 1: Line 1:
-//This article appeared in Compute! issue 38, July 1983 and is Copyrighted 1983 by Jim Butterfield//+//This article appeared in [[https://archive.org/stream/1983-07-compute-magazine/Compute_Issue_038_1983_Jul#page/n179/mode/2up|Compute! issue 38, July 1983]] and is Copyrighted 1983 by Jim Butterfield. This wiki rendition was done by Eek/Retrograde.//
  
 ====== HOW THE VIC/64 SERIAL BUS WORKS ====== ====== HOW THE VIC/64 SERIAL BUS WORKS ======
Line 11: Line 11:
 ===== GROUND RULES ===== ===== GROUND RULES =====
 To understand the workings of this bus, you must work through a few concepts. Later, we'll get To understand the workings of this bus, you must work through a few concepts. Later, we'll get
-technical for this who want it.+technical for those who want it.
  
 The bus, like the IEEE, has two modes of operation: Select mode, in which the computer calls all devices and asks for a specific device to remain connected after the call ("Jones, would you stay in my office after the meeting?"); and Data mode, in which actual The bus, like the IEEE, has two modes of operation: Select mode, in which the computer calls all devices and asks for a specific device to remain connected after the call ("Jones, would you stay in my office after the meeting?"); and Data mode, in which actual
Line 28: Line 28:
 All wires connect to all devices. The wires don't go "one way"; any device can put a ground on a signal line, and all other devices will see it. Indeed, that's the secret of how it works: each wire serves as a common signal bus. All wires connect to all devices. The wires don't go "one way"; any device can put a ground on a signal line, and all other devices will see it. Indeed, that's the secret of how it works: each wire serves as a common signal bus.
  
-When no device puts a ground on a signal line, the voltage rises to almost five volts. We call this the "false" logic condition of the wire. If any device rounds the line, the voltage drops to zero; we call this the "true" condition of the line. Note that if two devices signal "true" on a line (by grounding it), the effect is exactly the same as if only one has done so: the voltage is zero and that's that. We can summarize this as an important set of logic rules:+When no device puts a ground on a signal line, the voltage rises to almost five volts. We call this the "false" logic condition of the wire. If any device grounds the line, the voltage drops to zero; we call this the "true" condition of the line. Note that if two devices signal "true" on a line (by grounding it), the effect is exactly the same as if only one has done so: the voltage is zero and that's that. We can summarize this as an important set of logic rules:
  
-  * A line will become "true" (PULLED DOWN, or 0V) if one or more devices signal true; +  * A line will become "true" (PULLED DOWN, or 0V) //if one or more devices signal true//
-  * A line will become "false" (RELEASED, or 5V) only if all devices signal false.+  * A line will become "false" (RELEASED, or 5V) //only if all devices signal false//.
  
 Remember that we have several lines, but the important ones for information transmission are the Remember that we have several lines, but the important ones for information transmission are the
Line 52: Line 52:
 If the Ready for Data signal isn't acknowledged by the talker within 200 microseconds, the listener knows that the talker is trying to signal EOI. EOI, which formally stands for "End of Indicator," means "this character will be the last one." If it's a sequential disk file, don't ask for more: there will be no more. If it's a relative record, that's the end of the record. The character itself will still be coming, but the listener should note: here comes the last character. If the Ready for Data signal isn't acknowledged by the talker within 200 microseconds, the listener knows that the talker is trying to signal EOI. EOI, which formally stands for "End of Indicator," means "this character will be the last one." If it's a sequential disk file, don't ask for more: there will be no more. If it's a relative record, that's the end of the record. The character itself will still be coming, but the listener should note: here comes the last character.
  
-So if the listener sees the 200 microsecond time-out, it must signal "OK, I noticed the EOI" back to the talker, I does this by pulling the Data line true for at least 60 microseconds, and then releasing it.+So if the listener sees the 200 microsecond time-out, it must signal "OK, I noticed the EOI" back to the talker. It does this by pulling the Data line true for at least 60 microseconds, and then releasing it.
  
 The talker will then revert to transmitting the character in the usual way; within 60 microseconds it will pull the Clock line true, and transmission will continue. The talker will then revert to transmitting the character in the usual way; within 60 microseconds it will pull the Clock line true, and transmission will continue.
Line 65: Line 65:
 Now, for each bit, we set the Data line true or false according to whether the bit is one or zero. As soon as that's set, the Clock line is released to false, signalling "data ready." The talker will typically have a bit in place and be signalling ready in 70 microseconds or less. Now, for each bit, we set the Data line true or false according to whether the bit is one or zero. As soon as that's set, the Clock line is released to false, signalling "data ready." The talker will typically have a bit in place and be signalling ready in 70 microseconds or less.
  
-Once the talker has signalled "data ready," it will hold the two lines steady for at least 20 microseconds timing needs to be increased to 60 microseconds if the Commodore 64 is listening, since the 64's video chip may interrupt the processor for 42 microseconds at a time, and without the extra wait the 64 might completely miss a bit.+Once the talker has signalled "data ready," it will hold the two lines steady for at least 20 microseconds timing needs to be increased to 60 microseconds if the Commodore 64 is listening, since the 64's video chip may interrupt the processor for 42 microseconds at a time, and without the extra wait the 64 might completely miss a bit.
  
 The listener plays a passive role here; it sends nothing, and just watches. As soon as it sees the Clock line false, it grabs the bit from the Data line and puts it away. It then waits for the clock line to go true, in order to prepare for the next bit. The listener plays a passive role here; it sends nothing, and just watches. As soon as it sees the Clock line false, it grabs the bit from the Data line and puts it away. It then waits for the clock line to go true, in order to prepare for the next bit.
Line 82: Line 82:
 If EOI was sent or received in this last transmission, both talker and listener "let go." After a suitable pause, the Clock and Data lines are released to false and transmission stops. If EOI was sent or received in this last transmission, both talker and listener "let go." After a suitable pause, the Clock and Data lines are released to false and transmission stops.
  
-[DIAGRAM]+{{:doc:cbm:io:iec:iec-serial_bus_transmission_sequence.jpg?direct&400|}}
  
 ===== ATTENTION! ===== ===== ATTENTION! =====
Line 89: Line 89:
 Normally, the computer is the only device that will pull ATN true. When it does so, all other devices drop what they are doing and become listeners. Normally, the computer is the only device that will pull ATN true. When it does so, all other devices drop what they are doing and become listeners.
  
-Signals sent by the computer during an ATN period look like ordinary characters - eight bits with the usual handshake - but they are not data. They are "Talk," "Listen," "Untalk," and "Unlisten" commands telling a specific device that it will become (or cease to be) a talker or listener. The commands go to all devices, and all devices acknowledge them, but only the ones with the suitable device numbers will switch into talk and listen mode. These commands are sometimes followed by a secondary address, and after ATN is released, perhaps by a file name. +Signals sent by the computer during an ATN period look like ordinary characters - eight bits with the usual handshake - but they are not data. They are "Talk," "Listen," "Untalk," and "Unlisten" commands telling a specific device that it will become (or cease to be) a talker or listener. The commands go to all devices, and all devices acknowledge them, //but only the ones with the suitable device numbers will switch into talk and listen mode//. These commands are sometimes followed by a secondary address, and after ATN is released, perhaps by a file name.
- +
-[DIGRAM]+
  
 An example might help give an idea of the nature of the communications that take place. To open for writing a sequential disk file called "XX," the following sequence would be sent with ATN on:DEVICE-8-LISTEN;SECONDARY-ADDRESS-2-OPEN. When ATN switches off, the computer will be waiting as a talker, holding the Clock line true; and the disk will be the listener, holding the Data line true. That's good, because the computer has more to send, and it will transmit: X;X;comma;s;comma;W - the W will be accompanied with an EOI An example might help give an idea of the nature of the communications that take place. To open for writing a sequential disk file called "XX," the following sequence would be sent with ATN on:DEVICE-8-LISTEN;SECONDARY-ADDRESS-2-OPEN. When ATN switches off, the computer will be waiting as a talker, holding the Clock line true; and the disk will be the listener, holding the Data line true. That's good, because the computer has more to send, and it will transmit: X;X;comma;s;comma;W - the W will be accompanied with an EOI
Line 105: Line 103:
 ===== ATN SEQUENCES ===== ===== ATN SEQUENCES =====
 When ATN is pulled true, everybody stops what they are doing. The processor will quickly pull the When ATN is pulled true, everybody stops what they are doing. The processor will quickly pull the
-Clock line true (it's going to send soon), so it may be hard to notice that all other devices release the Clock line. At the same time, the processor releases the Data line to false, but all other devices are getting ready to listen and will each pull Data to true. They had better do this within one millisecond (1000 microseconds), since the processor is watching and may sound an alarm ("device not available") if it doesn't see this take place. Under normal circumstances, transmission now takes place as previously described. The computer is sending commands rather than data, but the characters are exchanged with exactly the same timing and handshakes as before. All devices receive the commands, but only the specified device acts upon it. This results in a curious situation: you can send a command to a nonexistent device (try "OPEN 6,6") - and the computer will not know that there is a problem, since it receives valid handshakes from the other devices. The computer will notice a problem when you try to send or receive data from the nonexistent device, since the unselected devices will have dropped off when ATN ceased, leaving you with nobody to talk to.+Clock line true (it's going to send soon), so it may be hard to notice that all other devices release the Clock line. At the same time, the processor releases the Data line to false, but all other devices are getting ready to listen and will each pull Data to true. They had better do this within one millisecond (1000 microseconds), since the processor is watching and may sound an alarm ("device not available") if it doesn't see this take place. 
 + 
 +Under normal circumstances, transmission now takes place as previously described. The computer is sending commands rather than data, but the characters are exchanged with exactly the same timing and handshakes as before. All devices receive the commands, but only the specified device acts upon it. This results in a curious situation: you can send a command to a nonexistent device (try "OPEN 6,6") - and the computer will not know that there is a problem, since it receives valid handshakes from the other devices. The computer will notice a problem when you try to send or receive data from the nonexistent device, since the unselected devices will have dropped off when ATN ceased, leaving you with nobody to talk to.
  
 ===== TURNAROUND ===== ===== TURNAROUND =====
 An unusual sequence takes place following ATN if the computer wishes the remote device to An unusual sequence takes place following ATN if the computer wishes the remote device to
 become a talker. This will usually take place only after a Talk command has been sent. become a talker. This will usually take place only after a Talk command has been sent.
-Immediately after ATN is released, the selected device will be behaving like a listener. After all, it's been listening during the ATN cycle, and the computer has been a talker. At this instant, we have "wrong way" logic; the device is holding down the Data line, and the computer is holding the Clock line. We must turn this around. Here's the sequence: the computer quickly realizes what's going on, and pulls the Data line to true (it's already there), as well as releasing the Clock line to false. The device waits for this: when it sees the Clock line go +Immediately after ATN is released, the selected device will be behaving like a listener. After all, it's been listening during the ATN cycle, and the computer has been a talker. At this instant, we have "wrong way" logic; the device is holding down the Data line, and the computer is holding the Clock line. We must turn this around. 
-true, it releases the Data line (which stays true anyway since the computer is now holding it down) and then pulls down the Clock line. We're now in our starting position, with the talker (that's the device) holding the Clock true, and the listener (the computer) holding the Data line true. The computer watches for this state; only when it has gone through the cycle correctly will it be ready to receive data. And data will be signalled, of course, with the usual sequence: the talker releases the Clock line to signal that it's ready to send. The logic sequences make sense. They are hard to watch with a voltmeter or oscilloscope since you can't tell which device is pulling the line down to true. The principles involved are very similar to those on the PET/CBM IEEE-488 bus - the same Talk and Listen commands go out, with secondary addresses and similar features. There are fewer "handshake" lines than on IEEE, and the speed is slower; but the principle is the same.+ 
 +Here's the sequence: the computer quickly realizes what's going on, and pulls the Data line to true (it's already there), as well as releasing the Clock line to false. The device waits for this: when it sees the Clock line go 
 +true, it releases the Data line (which stays true anyway since the computer is now holding it down) and then pulls down the Clock line. 
 + 
 +We're now in our starting position, with the talker (that's the device) holding the Clock true, and the listener (the computer) holding the Data line true. The computer watches for this state; only when it has gone through the cycle correctly will it be ready to receive data. And data will be signalled, of course, with the usual sequence: the talker releases the Clock line to signal that it's ready to send. 
 + 
 +The logic sequences make sense. They are hard to watch with a voltmeter or oscilloscope since you can't tell which device is pulling the line down to true. 
 + 
 +The principles involved are very similar to those on the PET/CBM IEEE-488 bus - the same Talk and Listen commands go out, with secondary addresses and similar features. There are fewer "handshake" lines than on IEEE, and the speed is slower; but the principle is the same.
  
 //-End of document\\ Copyright 1983 by Jim Butterfield (published in Compute!)// //-End of document\\ Copyright 1983 by Jim Butterfield (published in Compute!)//
doc/cbm/io/iec/how_serial_bus_works.1603234683.txt.gz · Last modified: 2020/10/20 22:58 by eek

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki