Friday, January 11, 2013

Coding all Week

This past week I spent most of my free time after work writing code. Mostly:
  • a main loop
  • lots of logging functions
  • a function to translate the active phase line to an absolute track location on the disk image
  • a function to load a NIC disk image file from disk and break it into tracks
  • a function to convert a bit of disk data into four bits of SPI data that hopefully conforms to the Disk ][ read pulse
I am trying to use the NIC disk image format from the SDISKII project for now. It is the most similar to the raw stream coming from the Disk ][ drive. A normal .nib image is not much different and should be easy to implement once I get this thing working - which it certainly isn't...

If you are keeping score, my goal was to have a disk emulator that did not use a special image format, did not need a connection to another computer, and could use SD cards. At this point, the disk emulator doesn't work, it uses a special image format, it requires a USB connection to another computer, and it does not use SD cards. UGH. At least I still have a few weeks. No time to fix it this weekend, family stuff to do.


  1. "it requires a USB connection to another computer"

    or in otherwords you need more ram?

    when I started trying, I was thinking about just using the uart on an avr clocking bits out at 1Mbps (which is easily handled by most uC's) but never tried it. get a micro with ~8K of ram on it (atmega2650?) and you will have space to waste for your code, and 4K to hold an entire track in ram, clock your SPI fast enough to sneak 4K into ram while the stepper heads are delayed (on the last step) and it might be possible?

    just thoughts, nothing ever tested, but that was my guess on how I could do it

  2. I was just referring to the fact that I chose the UM232H for the proof of concept. Funny, I was just looking into the RAM on megaAVRs today. ATmega 1280 or 2560 have enough RAM to hold a track, but it seems like overkill. I think that because I would using the native SPI on the microcontroller rather than bit-banging, there should be enough time/cycles in between bytes to load in data byte by byte from the SD card on the fly.

  3. I can tell you I am using the AVR hardware though a library to read FAT32 at an 8Mhz clock using 6 inch wires to a level shifter, through 3 inch wires to an SD card... and a breadboard with the MCU clocked at 16Mhz

  4. What do you think of my idea for your drive? it is an old RF modulator repurposed for passthrough and connector on top.

  5. THat's great! I HAVE one of those for the IIc!