Commodore bus explained

Commodore serial
Type:Peripheral bus
Designer:Commodore International
Design Date:[1]
Manufacturer:Various
Production Date:1980–present
Length:1.8 meters maximum[2]
Hotplug:No
Daisy Chain:Yes, up to 31 devices
External:Yes
Electrical:Open collector 5 V
Maximum Current:[3]
Data Signal:Yes
Data Style:Serial
Physical Connector:DIN connector
Num Pins:6
Pin1:Service Request
Pin1 Name:SRQ
Pin2:Ground
Pin2 Name:GND
Pin3:Attention
Pin3 Name:ATN
Pin4:Clock
Pin4 Name:CLK
Pin5:Data
Pin5 Name:DATA
Pin6:Reset
Pin6 Name:RESET
Pinout Caption:Female socket from the front.

The Commodore serial bus (IEC Bus), is Commodore's interface for primarily magnetic disk data storage and printers for Commodore 8-bit home computers: the VIC-20, Commodore 64, Commodore 128, Plus/4,[4] Commodore 16, and Commodore 65.

Description and history

The parallel IEEE-488 interface used on the Commodore PET (1977) computer line was too costly, so a cost reduced version was developed, which consisted of a stripped down, serial version of the IEEE-488 interface, with only a few signals remaining; however, the general protocol layout was kept. Commodore began using this bus with the VIC-20 (1980). Connection to the computer uses a DIN-6 connector (DIN 45322).

Transfer speed

Setup Speed Effective bitrate
400 bytes/s 3 200 bit/s
20 480 bit/s
41 600 bit/s
Theoretical 20 μs

Interface

Pinout[5]
Pin Name Function
1 /SRQIN Service request input to let peripherals request to be served by the host (C64). Used by the C128 for fast transfers.[6]
2 GND Ground
3 /ATN Serial ATN In/out. Set low by the host (C64) to indicate the beginning of a serial data transfer.
4 /CLK Serial CLK In/out. Used for software handshaking.
5 /DATA Serial DATA In/out. Data bit transfer.
6 /RESET Resets peripherals and also resets an older C64.

Protocol description

The bus signals are digital single-ended open collector TTL and active when low. Bus devices have to provide their own power.

Because the bus lines are electrically open collector it works like a long OR gate between all device line drivers. The logical value for ground is true and vice versa. Any device may set a line "true". A line only becomes "false" if all devices signal false.

Transmission begins with the bus talker holding the Clock line true, and the listener(s) holding the Data line true. To begin the talker releases the Clock line to false. When all bus listeners are ready to receive they release the Data line to false. If the talker waits more than 200 μs without the Clock line going true (idle state), listeners have to perform End-or-Identify (EOI).[7]

If the Data line being false (released) isn't acknowledged by the talker within 200 μs, the listener knows that the talker is in the process of EOI that means "this character will be the last one". When the listener detects the 200 μs timeout, it must acknowledge this by pulling the Data line true for at least 60 μs, and then release it. The talker can revert to transmitting again within 60 μs by pulling the Clock line true.[7]

Data is eight bits starting with the least significant bit. The Data line is set according to the bit to send (1=true=ground). Once the Data line is set, the Clock line is released to false. The Clock and Data lines will be held steady for at least 20 μs (except for Commodore 64 that needs 60 μs). After 8 bits has been sent, the talker releases the Data line to false and the listener then acknowledge the talker by pulling the Data line true within 1000 μs. After this the talker sets the Clock line true and listener sets the Data line true thus back where the transmission begun. If an EOI is signaled by holding the Clock line false the transmission is ended and the listener acknowledge this by pulling the Data line true for 200 μs.[7]

The ATN line is set to true and bytes are sent like above to all devices, but the byte is interpreted as one of the commands "Talk," "Listen," "Untalk," and "Unlisten". That tell a specific device to become a talker or listener. Only devices with matching device numbers switch into talk and listen mode. A secondary address may also follow.[7]

On higher logical level the host will set the ATN line to true and transmit the bytes "Device number 8, listen", "Secondary address 2, open". Next it will set the ATN line false and the host then becomes the talker, holding the Clock line true. The device will be the listener, holding the Data line true. The host will transmit the specific open command and end it with an EOI signal sequence. After this the host will set with ATN line true, "Device number 8, unlisten". Followed up by ATN line true and "Device number 8, listen", "Secondary address 2, data". Then the host sets the ATN line false and sends the data. When the host has finished sending data the ATN line is set to true and "Device number 8, unlisten" is sent.[7]

When it is necessary to switch roles and make the host a listener and the device a talker the occurs after a talk command has been sent to the device. The host sets the Data line true and releases the Clock line to false. The device waits for the Clock line to go false and then pulls it to true and release the Data line to false. After this sequence the standard talk-listener interaction may follow.[7]

Bus commands! Code !! Meaning
device 0x20 Listen, device (0–30)
0x3F Unlisten, all devices
device 0x40 Talk, device
0x5F Untalk, all devices
channel 0x60 Reopen, channel (0–15)
channel 0xE0 Close, channel
channel 0xF0 Open, channel

To read a normal file from the floppy device number 8 the command LOAD "filename",8,1 is issued on a Commodore 64. That causes the following high level communication to take place:

High level protocol! Command !! Destination !! Meaning
/28 Device Listen, device number 8
/F0 Device Open channel 0
Device Send filename bytes
/3F Devices Unlisten all devices
/48 Device Talk, Device number 8
/60 Device Reopen channel 0
Device number 8 becomes the master of the bus
Host Receive byte data
The host becomes the master of the bus (normal operation)
/5F Devices Untalk all devices
/28 Device Listen, device number 8
/E0 Device Close channel 0
/3F Devices Unlisten all devices

The Commodore 1541 floppy drive uses a slower Commodore 64 compatible mode which can be deactivated for faster speed by using the command OPEN 15,8,15,"UI-":CLOSE 15.[8]

Device numbering

Device numbering per Commodore 64 KERNAL ROM[9] ! Device !! Type
0 Keyboard
1 Cassette port
2 RS-232 on the user port or second cassette on PETs
3 Screen
4–5 Printer
6 Typically plotter device
7 Second plotter?
8–15 Disk (10 used by some serial-to-parallel printer interfaces)
16–30 Unknown
31 Reserved as a command to all devices
Device number 0–3 are not associated with the Commodore bus.[9]

Host implementation

The VIC-20 computer and the Commodore 1540 and 1541 floppy drives use the MOS Technology 6522 VIA to handle IEC Bus transmissions. The Commodore 64 and 128 computers and the Commodore 1571 drive use the Complex Interface Adapter.

Common devices

Device Info
NaNinches 170 KB floppy
NaNinches 170 KB floppy
NaNinches 350–410 KB floppy
NaNinches 800 KB floppy
NaNinches single/dual 170 KB floppy
Commodore MPS 801 Dot-matrix printer
Commodore 1515[10] Dot-matrix printer
Commodore 1520 Ballpoint pen printer
Commodore VIC-1525[11] Dot-matrix printer
Commodore VIC-1526 Rebranded MPS 802, dot-matrix printer
Dot-matrix printer
Commodore DPS-1101[12] Daisy wheel printer
INTERPOD Standalone IEEE-488 + RS-232[13]
1 MHz 5 KB computer
1 MHz 64 KB computer
1 MHz 64 KB computer
2 MHz 128 KB computer
1-2 MHz 16 KB computer
1.76 MHz 64 KB computer
3.54 MHz 128 KB computer

See also

External links

Notes and References

  1. Web site: Commodore VIC-20 History . 2016-04-02 . https://web.archive.org/web/20150214045926/http://commodore.ca/products/vic20/commodore_vic-20.htm . 2015-02-14 . dead .
  2. Web site: 2016-04-02 . Building the XE1541 serial cable . (1) 6' or 1.8 meters (max) 4 conductor shielded cable (for serial connection) .
  3. Web site: 2016-04-02 . 2016-03-04 . 6526 complex interface adapter (CIA) . Output Low Current (Sinking); VOL < .4 v (PA0-PA7, PC, PB0-PB7, DB0-DB7) IOL 3.2 mA . https://web.archive.org/web/20160410073735/http://archive.6502.org/datasheets/mos_6526_cia.pdf . 2016-04-10 . dead .
  4. Web site: Using Commodore 1541 disk drive on a Commodore + 4 . 2005-10-03 . 2016-05-15 . The 1541 works with the Plus/4 just fine..
  5. Web site: 2016-04-02 . 2013-12-16 . C64 Serial I/O pinout and wiring @ old.pinouts.ru .
  6. Web site: 2016-04-02 . 2005-12-10 . C-64 Workshop / Pin Connections .
  7. Web site: How the VIC/64 Serial Bus works . 2015-04-17 . 2016-04-28 .
  8. Web site: VIC-1541 . C64-wiki.com. 2016-03-11. 2016-04-28.
  9. Web site: IEC-bus documentation as used for the 1541-III IEC disected. 2008-02-24. 2016-04-28. dead. https://web.archive.org/web/20170116173410/https://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf. 2017-01-16.
  10. Web site: VIC-1515 User's manual Graphic printer by Commodore. April 1981. 2011-11-05. 2016-04-28.
  11. Web site: VIC-1525 Graphics Printer User Manual. Commodore Computer. 22 February 2015.
  12. Web site: Commodore DPS-1101 Daisy Wheel Printer.
  13. Web site: Interpod IEEE-488 Interface. April 2008. 2016-04-28.