Hardware description

Resource utilization

The device uses an Atmel AVR Atmega32 running internal 8 MHz oscillator, which is approximately 7.6 MHz on a 3.3 V supply.

The IEC signalling is implemented by changing the port status between high impedance and active low. The internal pullup is not utilized, and there are no pullups on the DTV version schematic. The pullups on the DTV mainboard are sufficient.

The hardware SPI is utilized for communication with the SD-card and the UART can be used for debug printing.

As of firmware v0.7 the SDCARD_DETECT mechanical switch is utilized. The result is a tremendous improvement in usability. Now SD cards insertion and ejection just works, and it is not required to do LOAD"<<",8 any more. The write protect mechanical switch now also has the desired effect.

I/O

The following I/O connections are expected by the software according to the setup in config.h. It is possible to reconfigure almost all I/O lines except SPI. Features such as DEVICE9 jumper, SDCARD_DETECT and SDCARD_WP can also be removed by changing config.h.

 
Hardware SPI is used for MMC/SD card access:
  PB7   SCK, output                          
  PB6   MISO, input                        
  PB5   MOSI, output                       
  PB4   SS, output 
                                
The IEC bus:
  PC0   ATN, input               
  PC1   DATA, open collector emulation
  PC2   CLOCK, open collector emulation

LEDS:
  PA0   (active low) IEC communication going on
  PA1   (active low) Fat dirty indicator (don't remove flash media)

DEVICE9 jumper
  PA2   If jumped to GND, MMC2IEC acts as device 9, otherwise 8        
    
SDCARD_DETECT
  PD2   Must connect to GND when SD CARD is present in socket

SDCARD_WP
  PD6   Must connect to GND when SD CARD is not write protected

Hardware-wise there are two versions of the MMC2IEC device: A DTV version and a C64 version.

DTV Version

This version is the simplest with no level conversion at all. The AVR runs at 3.3 V from the DTV and interfaces the SD-Card and the DTV directly. Strictly speaking you have to use an Atmega32L low voltage version, but I have not had any problems running non low voltage AVR's at 3.3 V at 8 MHz.

The schematic is quite simple:

MMC2IEC dtv version schematic

I made the board layout as compact as possible and with no components on the bottom side, allowing for fitting into my Wooden DTV:

MMC2IEC dtv version schematic

Finally I got the PCB ordered and I was quite pleased with the result. After soldering the device looked like this:

MMC2IEC dtv version PCB top
MMC2IEC dtv version PCB bottom

See how I embedded it into my Wooden DTV here

C64 Version

When MMC2IEC has to interface a real C64, level conversion has to be done somewhere, since the IEC bus operates at 5V and the SD-Card can maximally handle 3.3 V. As the SD-Card interface is the must demanding speed-wise, I chose to do the level conversion at the IEC bus signals.

Mosfets were used for level conversion of the open-collector bus signalling, see schematic. The interfacing is a clever little circuit that allows both sides to pull low using the mosfet, while high impedance state is achieved when neither side pulls low. The pull up resistor on the AVR side is to ensure that the rise time in high impedance state is fast enough.

For powersupply, a 3.3 V regulator from Texas Instruments was intended, but I got a 3.0 V version instead. It works just fine.

MMC2IEC C64 version schematic

My current effectuation of the C64 MMC2IEC, with the v0.7 firmware, works very well. It loads and saves PRG files flawlessly, just as the DTV version. But I'm not happy with the hardware yet. For one thing, it uses batteries, and I have not found a suitable casing yet. I'll post pictures when I'm done with it.

 

Previous: Software description  -  Next: Usage guide