From C64-Wiki
Jump to navigationJump to search

µIEC (micro IEC) is a hardware mass storage device that interfaces commonly available IDE hard disk drives and compactflash (CF) cards to Commodore computers that utilize the IEC serial bus. It is based on the Atmel AVR ATMega128X CPU. The most prominent use of µIEC is emulation/replacement of a Commodore-1541 disk drive for a C64. Hardware and the microcontroller's firmware is available as open source (GPL).

There are three versions of the hardware:

  • The µIEC/IDE contains both IDE and Compactflash interfaces and supports 2 IDE drives or 1 IDE drive and one CF card. This unit is designed to be placed in an enclosure.
  • The µIEC/CF supports 1 CF card, and is designed to be embedded in a device.
  • The µIEC/SD supports 1 SD card, and is designed to be embedded in a device.

History[edit | edit source]

µIEC was designed in early 2005 as a low cost interface that would allow CBM enthusiasts to save data on commonly available IDE hard disk drives.

Development stalled in late 2005 due to stability issues with the firmware. In early 2008, development started again, with an eventual replacement of the µIEC DOS firmware with the more capable sd2iec firmware.

Hardware[edit | edit source]

  • 2005-03-01: µIEC version 1.0 prototype design. ATMega32, 1 IDE drive supported, minimal CBM DOS support.
  • 2005-05-15: µIEC/IDE version 2.0 PCB layout release (differences to version 1: ATmega128, CompactFlash slot, parallel IO port) - 12 pieces made.
  • 2005-05-15: µIEC/CF version 2.0 CB layout release - 24 pieces made
  • 2008-04-01: µIEC/IDE version 2.3 PCB release (minor changes from 2.0)
  • 2008-10-01: µIEC/SD version 3.0 with daughtercard

Firmware[edit | edit source]

As of February, 2008, the original µIEC DOS firmware was retired and the sd2iec firmware was patched to support the µIEC hardware and IDE drives. Further development is being done on sd2iec.

  • 2008-01-31: µIEC DOS 0.4 release. Switch to use open source FatFs FAT library
  • 2008-01-15: µIEC DOS 0.3 release. Add long file name support and initial FAT-allocation code.
  • 2005-05-15: µIEC DOS 0.2 release. Switch to ATMega128 CPU.
  • 2005-03-01: µIEC DOS 0.1 initial release.

Hardware Features[edit | edit source]

  • Support for IDE drives > 137GB.
  • support for CompactFlash (CF) cards.
  • Support for Secure Digital (SD) cards.
  • All ATMega128X IO is available on headers for general purpose experimentation.

FAQ[edit | edit source]

Where can I find more information?[edit | edit source]

  • The Pictures of the Micro IEC Peripheral Page.
  • The sd2iec (firmware) Page.
  • The sd2iec Read Me (WARNING: Points to the most current development revision, so it can contain things that are not available in end-user releases yet.)
  • By joining the google group: http://groups.google.com/group/uIEC-users?hl=en. If one doesn't want to use the web interface, then subscribe to the µIEC mailing list by e-mailing to: uIEC-users+subscribe@googlegroups.com.

What is the default device number (device address)?[edit | edit source]

The default device number is 10 when new or following a reset to defaults.

How do I verify that the µIEC/SD unit is working?[edit | edit source]

The red LED should remain on and the green LED should blink twice when power is supplied, as described below. To verify communications between Commodore and µIEC retrieve the current drive status as follows;

  • OPEN 15,10,15:INPUT#15,E,E$,T,S:CLOSE 15:PRINT E,E$,T,S
  • Or when using a DOS Wedge; @10
  • Using JiffyDOS: @"",10

The unit should return the drive status and current firmware revision; Something like 73,UEIC V0.10.1,00,00. A status of 00, OK,00,00 also means that the unit is functioning correctly.

How do I change the device number (device address)?[edit | edit source]

  • OPEN 15,CD,15,"U0>"+CHR$(ND):CLOSE15 (CD = current device number, ND = (08)new device number) is supported, other U0 commands are currently not implemented.
  • JiffyDOS users: Although JiffyDOS itself does not supply a special option for changing the device number, you can still do so with a generic disk command:
@"U0>{Control-H}" for new device number 8, Control-I for 9, Control-J for 10 etc.
  • There is also a program on the HD utils disk, but it's more work than the above.
  • To make it permanent (as in "survives a power-cycle"), send the command "XW" to the new device number. If you use JiffyDOS, you can send it by using @"XW" (with quotes - otherwise it will error out). See the Extended commands section of the sd2iec Read Me

How do I update the firmware?[edit | edit source]

  • A bootloader is present that will read firmware binary files from the IDE/CF/SD card and update the AVR flash. See Software section for more infomation.

What do the µIEC/SD daughtercard buttons do?[edit | edit source]

  • S1 : Move forward in swaplist
  • S2 : Move backward in swaplist
  • Hold S1: Put unit into "sleep" mode
  • S1 held on boot: use default configuration
  • S3 = Reserved

What do the µIEC/SD LEDs mean?[edit | edit source]

  • RED : Power
  • Green : Activity

The device will flash the green LED once when initializing the device and again for each directory found. If a firmware update is found the unit will flash the green LED 124 times (one on/off flash for each 1K of firmware). Following the upgrade the LED will flash once more when the device is again initialized.

How do I speed up the initialization/boot process[edit | edit source]

Try to minimize the number of files in the root directory. But simply deleting files from the root directory is not sufficient as the FAT filesystem does not remove the entries for deleted files and directories, it simply marks these as "deleted". So the directory scanning code has to loop through all the "deleted" entries in case there is a non-empty entry at the end. A quick format of the SD card (or use a new card) is necessary to minimize the number of "deleted" files and directories in the root directory.

What are the pin assignments on the MicroIEC[edit | edit source]

µIEC/IDE+CF CONN1 pinout:

  • 1 GND
  • 2 /SW2 (2.3 boards only)
  • 3 RXD
  • 4 TXD
  • 5 IEC_SRQ
  • 7 IEC_DATA
  • 8 IEC_CLK
  • 9 IEC_ATN
  • 10 /CF DETECT
  • 12 SD CARD CLOCK/IEC_SRQ (bug, should only be connector to SD CARD CLOCK, not IEC_SRQ on IEC jack)
  • 15 /SW0 (FWD)
  • 16 /SW1 * (BACK)
  • 18 /RESET (/IEC_RESET)
  • 19 VCC
  • 20 GND

µIEC/SD pinout:

  • 1 GND
  • 2 PWR
  • 4 IEC_SRQ
  • 6 IEC_DATA
  • 7 IEC_ATN
  • 8 SWITCH 0 (Move forward in swaplist / sleep)
  • 9 SWITCH 1 (Move backward in swaplist)
  • 10 SWITCH 2 (Reserved)
  • 11 RS232 TXD (5V)
  • 12 RS232 RXD (5V)

Software[edit | edit source]


  • Reads firmware .bin file from IDE drive or CF card (FAT32, FAT16, and FAT12 supported) and updates ATMega flash if needed
  • On powerup, power LED is on. Activity LED will dim as bootloader scans root directory of partition #1 for new firmware file.
  • If an updated firmware is found, activity light blinks as each sector of firmware is loaded into the unit.
  • Firmware (.bin) needs to reside in the root directory or the first drives's primary partition. Only file size and signature have to match.

See also[edit | edit source]

Links[edit | edit source]