Commodore 1541

From C64-Wiki
(Redirected from 1541)
Jump to: navigation, search
Commodore 1541
Alt
Device Name: 1541 Drive
Manufacturer: Commodore
Media Type: 5 1/4" single-sided floppy disk
Storage Capacity: 170 kB
Release Price: U$ 900
Released: 1982
Discontinued: 1993
Processor: MOS 6502 at 1 Mhz
RAM: 2 kB
ROM: 16 kB
Data Bus: {{{Data Bus}}}
Data Connector: {{{Data Connector}}}
Power Requirements: 100, 120, 220, or 240 V
50/60 Hz
25 W (30 W Max)
Power Connector: 4-pin DIN
Firmware: CBM DOS
License: Proprietary
Manual: {{{Manual}}}
Predecessor: {{{Predecessor}}}
Successor: {{{Successor}}}
Info: differents designs
Forerunner: VIC-1540
Follower: 1551/1570


The Commodore disk drive 1541 or CBM-1541 (early models: VIC-1541 or - Germany only - VC-1541) is useable with 5,25"-disks. This disk drive has only one read/write head. It is connected with a data cable on the serial bus to the Commodore 64. In consequence of the long production time of the C64, the 1541 was produced with various cases, with internal or external power supplies, starting in 1983. Two newer models were introduced later, the 1541C (in 1986) and the 1541-II (in 1988).

Features[edit]

The successor of the VIC-1540, which can only be used with the VIC-20, the 1541 can be used with the C64, with the VIC-20, and also with all the later Commodore 8-bit home computer models: the C128/D/DCR, C16/116 and Plus/4. However, it will be slower than the 1570/1571 on the C128, and also slower than the 1551 on the C16/C116/Plus-4, so it is mainly recommended for the C64.

On the front of the case are 2 LEDs - in the original 1541, a green one that lights up as long as the drive is powered, and a red one controlled by the drive's firmware to display working status (the colors are reversed on some later models). When the red LED is flashing, it means that an error has occurred.

On the back side of the case are two interfaces for serial data cables, the power switch and power connector. On the 1541-II are two DIP-switches to change the device number (default 8) to any number in the range from 8 to 11. If using only one disk drive, the drive number should always be kept at 8, as that is what most software is hard-wired to use; however, if more than one drive is connected to a computer, each should get its own unique drive number in ascending order.

Depending on the specific model, the power supply was either internal or external to the drive. Earlier models came with an internal power supply which generated significant, often fatal amounts of heat. Later models came with an external power supply to eliminate heat damage to the internal circuits and mechanics. The models with external power supply use +5V and +12V direct current, just like modern hard drives, and it is easy to solder a new plug to a power supply for an external PC hard drive enclosure and use it with a newer model 1541 in case its own power supply should break or be lost.

One side of a 5,25"-disk in the 1541 has a capacity of 174,848 bytes, which are 683 blocks, but only 664 blocks are useable. The 1541 is a one-sided drive, which means that the back side of a disk can only be used by taking it out and manually flipping it over. Such a "flippy disk" needs to get an additional notch in the cover opposite the one that's already there, or else the back side can't be written to; disk notchers used to be sold especially for this purpose, but you can also use a pair of scissors and some care.

The version of Commodore DOS (2.6) built into the 1541 disk drive defines the following file formats and characteristics:

  • PRG program files (can be LOADed and SAVEd directly; maximum filesize loadable on C64 in default memory configuration: 202 blocks. The limit is different for other Commodore computers used with a 1541.)
  • SEQ sequential files (only usable with computer applications; often used to hold text; max. filesize 168.656 Bytes)
  • USR user-files (works the same as a sequential file as far as the drive knows; usually used to mark files written in some special way the drive itself doesn't know about and that cannot be read correctly by normal software, such as GEOS files).
  • REL relative files (unlike the other file types, allows a form of random access, i.e. you can't just read it from beginning to end but you can directly access stuff in the middle of the file; only usable with computer applications; max. filesize 167.132 Bytes with max. 65.535 data sets)
  • DEL deleted files (with hints or manipulation of the directory this file type can be viewed)
  • If the < char is printed after the file format, the file cannot be overwritten. It is write-protected by software.
  • If the * char is printed before the file format, the file wasn't properly closed. To delete such a "corpse", use the DOS command VALIDATE!
  • A single directory of files per disk, no sub-directories.
  • Maximum number of files in the directory of one disk is 144.

Although the actual decoding and reading of disk data into the drive's own internal RAM memory happens much faster, the data transfer rate between drive and computer is limited to the very low value of about 300 Bytes/s. It can be made much higher by using a fast loader (up to about 10 KByte/s).

The version number of Commodore DOS among all models of 1541 is version 2.6, but the later models 1541-C and 1541-II nevertheless fix some important bugs. Although not officially supported by Commodore, the ROM code from the 1541-II (but not that from the 1541-C) can be burned into a pair of EPROMs and used in the original 1541 model if you want those bug fixes for that drive too.

Technical Details[edit]

1541 board Rev.A
Transport lock of 1541
1541 User manual
  • Chips: MOS Technology 6502 (CPU) with ca. 1 MHz, 2x VIA MOS Technology 6522
  • RAM: 2 KByte (4x 2114)
  • ROM: 16 KByte; type numbers:
    1541-1:
    325302-01 (DOS V2.6 LoROM $C000-$DFFF),
    901229-XX (DOS V2.6 HiROM $E000-$FFFF)
    1541-C:
    251968-01 (DOS V2.6 $C000-$FFFF)
    1541-2:
    251968-03 (DOS V2.6 $C000-$FFFF)
  • Interfaces: serial bus
  • Total capacity: 174,848 bytes per disk
  • Sequential files: 168,656 bytes per disk
  • Relative files: 167,132 bytes per disk, 65,535 records per file
  • Entries of a directory: 144 per disk
  • Sectors per track: 17 to 21 depending on zone. Outer tracks had more sectors than inner tracks.
  • Tracks: 35. Access to tracks up to 40 or 41 is physically possible, but the standard DOS doesn't use them for data storage. Some copy protection schemes and non-standard DOS versions do use them.
  • Blocks (also known as sectors): 683 (664 blocks free). The 19 sectors on track 18 are reserved to directory (sectors 1 through 17) and meta-data (sector 0).
  • Dimensions:
97 × 200 × 374 mm (3.8 × 7.8 × 14.7 inches)
77 × 184 × 256 mm (1541-II)
  • Weight:
5 kg (11 lb)
1.5 kg (1541-II; without power supply)
  • Current supply: 100, 120, 220 or 240 V with 50 or 60 Hz
  • Power input: 25 W

Disk Drive Commands[edit]

The disk drive is controlled using a number of drive commands. The digit zero after the drive command letter in those commands is not strictly necessary, but its use is highly recommended to avoid triggering an obscure bug under rare circumstances that can lead to junk data being written to a disk rendering its files unusable. In Commodore's double drives such as the CBM4040, which came before the 1541 and other single drives, you could use either a zero or a one here, to denote which of the two drives is meant. When Commodore ported their DOS to single drives, they didn't really clean up the two-drive handling code, which is what causes the bug.

Format a disk (NEW)
OPEN 1,8,15,"N0:Diskname,ID": CLOSE 1
or: OPEN 1,8,15: PRINT#1,"N0:Diskname,ID": CLOSE 1
The diskname has maximum of 16 chars and the ID requires 2 chars.
Initialize drive (INITIALIZE) e.g. to detect a disk change
OPEN 1,8,15,"I0":CLOSE 1
Validate a disk (VALIDATE)
Checks and fixes the disk's meta-data structures (directory, block availability map, etc.)
OPEN 1,8,15,"V0": CLOSE 1
Copy files (COPY)
OPEN 1,8,15,"C0:NewFile=OldFile": CLOSE 1
Copy disk (COPY)
OPEN 1,8,15,"C0=C1": CLOSE 1
Copy the whole disk on a double drive from drive 1 to drive 0.
Concatenate files (COMBINE)
OPEN 1,8,15,"C0:NewFile=OldFile1,OldFile2,...": CLOSE 1
The command string is limited to 40 chars in length!
Rename a file (RENAME)
OPEN 1,8,15,"R0:New_Name=Old_Name":CLOSE 1
The command string is limited to 40 chars in length!
Delete a file (SCRATCH)
OPEN 1,8,15,"S0:filename": CLOSE 1
Wildcards such as * (matches all the remaining chars) or ? (matches one char) are supported.
For example: OPEN 1,8,15,"S0:*":CLOSE 1 all files of a disk will be deleted ("scratched").
With comma (,) more than one file or wildcard mask can be given and multiple matching files actually could be subject of the deletion.
Overwrite a file (REPLACE)
SAVE"@0:filename",8 or
OPEN 1,8,15,"@0:filename,S,W": CLOSE 1.
The REPLACE command is especially prone to triggering the above mentioned bug on the original 1541 (fixed in the 1541-C and the 1541-II) - it may fail with some regularity and you could lose all data of a disk. Unless you know for certain that the drive in question will not be an original 1541, the better way is to first to use SCRATCH and after that the BASIC command SAVE.
  • These VIC-20 and C64 BASIC commands can be used with the disk drive: CLOSE, GET#, INPUT#, LOAD, OPEN, PRINT#, SAVE and VERIFY and the status variable ST. On the post-C64 computer models, additional commands and status variables are available.

Hints[edit]

  • Activate VIC-20 mode for VIC1541 (operates like the VIC-1540 drive, slightly faster, incompatible with C64 unless the screen is blanked): OPEN 15,8,15,"UI-":CLOSE 15
  • Re-Activate default C64 mode for VIC1541: OPEN 15,8,15,"UI+":CLOSE 15
  • Device number (8…15) can be changed temporarily by software with:
    OPEN 15,8,15:PRINT#15,"M-W";CHR$(119);CHR$(0);CHR$(2);CHR$(device number+32)+CHR$(device numver+64):CLOSE 15
  • device number (8…11) can be changed permanently by hardware over DIP-switches ( 1-2 or A-B):
Device
number
DIP-1/A DIP-2/B
8 on on
9 off on
10 on off
11 off off
top: on - bottom: off
  • In some models, that don't have any DIP-switches, the device number can be set by manipulating the terminal tag. The terminal tags are called "device jumpers" on the board of the disk drive.

Content of the test-/demo diskette[edit]

Test/Demo disk
Original package of 1541C

Side 1:

13  HOW TO USE        PRG (engl. instruction 1.part)
5   HOW TO USE TWO    PRG (engl. instruction 2.part)
1   C-64 WEDGE        PRG (Utility Starter C64)
4   VIC-20 WEDGE      PRG (Utility Starter für VIC/VC20)
4   DOS 5.1           PRG (Utility Main Program)
11  COPY/ALL          PRG (Copy Program)
9   PRINTER TEST      PRG (Printer Test)
4   DISK ADDR CHANGE  PRG (Change device number by software)
4   DIR               PRG (Easier using of disk commands)
6   VIEW BAM          PRG (BAM Viewer)
4   CHECK DISK        PRG (Diskcheck with VALIDATE)
14  DISPLAY T&S       PRG (Block Viewer in Decimal or Hexadecimal)
9   PERFORMANCE TEST  PRG (Floppy Check)
5   SEQUENTIAL FILE   PRG (Program example for SEQ-files)
13  RANDOM FILE       PRG (Program example for special DOS-Commands)
558 BLOCKS FREE

Remark: The content of the test-/demo diskette can change slightly depending on the year of construction or model.

Disk Image Format[edit]

Disks for the 1541 disk drive are represented by the D64 disk image format. These disk images are used to transmit entire disks for use with emulators and mass storage devices.

Links[edit]

WP-W11.png Wikipedia: Commodore_1541
Literature