{"id":40,"date":"2007-04-18T15:40:09","date_gmt":"2007-04-18T15:40:09","guid":{"rendered":"http:\/\/www.pyrofersprojects.com\/blog\/?page_id=40"},"modified":"2009-04-15T13:13:32","modified_gmt":"2009-04-15T13:13:32","slug":"mmiec","status":"publish","type":"page","link":"https:\/\/www.pyrofersprojects.com\/blog\/mmiec\/","title":{"rendered":"MMieC"},"content":{"rendered":"<p class=\"para\">This is a project to replace the CBM 1541 floppy drive on the C64 with an MMC card.<br \/>\nI dont want a HUGE 1541 connected to my DTV, so im making an MMC reader that will emulate the 1541.<br \/>\n<a href=\"http:\/\/www.pyrofersprojects.com\/images\/pict0272.jpg\"><img decoding=\"async\" align=\"left\" src=\"http:\/\/www.pyrofersprojects.com\/thumbs\/pict0272_small.jpg\" \/><\/a>  <script type=\"text\/javascript\"><!-- google_ad_client = \"pub-9911057097907605\"; google_ad_width = 300; google_ad_height = 250; google_ad_format = \"300x250_as\"; google_ad_type = \"text_image\"; google_ad_channel =\"\"; google_color_border = \"DDDDDD\"; google_color_bg = \"DDDDDD\"; google_color_link = \"0000DD\"; google_color_text = \"000000\"; google_color_url = \"800000\"; \/\/--><\/script> <script type=\"text\/javascript\"> <\/script><br \/>\nA schematic has been provided for me by Jussi, thanks go to him for this as I dont have the time to draw things like this up!<br \/>\n<a href=\"http:\/\/www.pyrofersprojects.com\/15413\/pic_iec_v1.pdf\">Schematic for MMieC<\/a><\/p>\n<p>The hardware is very simple, the MMC uses the hardware SPI port on the PIC, The IEC bus on portB.<br \/>\nPin \u2013 Function<br \/>\n13 \u2013 SPI Sel=C2 Chip select for MMC<br \/>\n14 \u2013 SPI Clk=C3 Clock data to MMC<br \/>\n15 \u2013 SPI Din=C4 SPI Data out of MMC<br \/>\n16 \u2013 SPI Dout=C5 SPI Data in to MMC<\/p>\n<p>28 \u2013 atn=B7 IEC ATTENTION<br \/>\n27 \u2013 clk=B6 IEC clock<br \/>\n26 \u2013 dat=B5 IEC Data, all pins on IEC are bi-directional<\/p>\n<p>A serial debug port on C,<br \/>\n17 \u2013 tx=C6 Serial Data out of PIC<br \/>\n18 \u2013 rx=C7 Serial Data in to PIC<\/p>\n<p>2 \u2013 Led1=A0<br \/>\n3 \u2013 Led2=A1<br \/>\n4 \u2013 MMC detect=A2 For detection of MMC insert<\/p>\n<p>This initial board is a standard DIL package but im going to use a surface mount SOIC for the final design to keep ths size compact. The 18LF2520 runs from 3.3v, so the DTV can power it. A small 5pin header could take both power and IEC data from the DTV to the MMieC. For use on an actual C64 you need to split that header off to IEC and Power seperately, and i\u2019d recommend running it from a good regulated 3.3v supply. Its possible to make the board run from 5v by using resistors between the PIC and the IO pins for the MMC and DTV, but the MMC still requires 3.3v power.<br \/>\nThe serial output is at the chip level, so 3.3v and will need level conversion to connect to real serial port. Im using a USB serial adaptor chip that has ttl io and also supplies 3.3v for the PIC.<br \/>\n<script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-4526948230635423\";\n\/* 300x250, created 4\/15\/09 *\/\ngoogle_ad_slot = \"4264399593\";\ngoogle_ad_width = 300;\ngoogle_ad_height = 250;\n\/\/-->\n<\/script><br \/>\n<script type=\"text\/javascript\"\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><br \/>\nIt works too, here is a sample output that reads a file from an MMC and puts the output to the serial port of my PC.<\/p>\n<pre>Initialising SPI Mode on MMC           - [OK]\r\nBringing MMC out of IDLE               - [OK]\r\nSetting Block length to  64bytes       - [OK]\r\nLocating Boot Record                   - [0200]\r\nValidating FAT Descriptor              - [FAT16]\r\nChecking for valid FAT16 format        - [OK]\r\nCurrent Volume Name                    - [NO NAME    ]\r\nBytes per sector                       - [0200]\r\nTotal Disk Sectors                     - [F4C0]\r\nTotal Disk Clusters                    - [F2B8]\r\nSectors per cluster                    - [0001]\r\nSectors Per FAT                        - [00F3]\r\nTotal number of FAT Sectors            - [01E6]\r\nTotal number of ROOT Entries           - [0200]\r\nNumber of Root Sectors                 - [0020]\r\nNumber of Data Sectors                 - [F2B8]\r\nNumber of Hidden Sectors               - [0040]\r\nRoot Directory Start Sector            - [0228]\r\nData Area Start                        - [0248]\r\nFAT Sector Start                       - [0042]\r\nFirst Filename                         - [TESTFILE.TXT]\r\nFirst entry 0003 F8 FF FF FF FF FF 04 00 05 00\r\nfile sector 0248\r\nTHIS IS A TEST FILE.<\/pre>\n<p>Here is a second test with slightly modified MBR detection running on a 64meg Sandisk (thanks Jussi)<\/p>\n<pre>Initialising SPI Mode on MMC.......... - [OK]\r\nBringing MMC out of IDLE               - [OK]\r\n\r\nSetting Block length to 512bytes       - [OK]\r\nLocating Boot Record                   - [6A00] start_lsec= 3157557\r\nValidating FAT Descriptor              - [FAT16]\r\nChecking for valid FAT16 format        - [OK]\r\nCurrent Volume Name                    - [NO NAME    ]\r\nBytes per sector                       - [0200]\r\nTotal Disk Sectors                     - [0000]\r\nTotal Disk Clusters                    - [3FBA]\r\nSectors per cluster                    - [0004]\r\nSectors Per FAT                        - [007A]\r\nTotal number of FAT Sectors            - [00F4]\r\nToral number of reserved sectors       - [0001]\r\nTotal number of ROOT Entries           - [0200]\r\nNumber of Root Sectors                 - [0020]\r\nNumber of Data Sectors                 - [FEEB]\r\nNumber of Hidden Sectors               - [0020]\r\nRoot Directory Start Sector            - [0115]\r\nData Area Start                        - [0135]\r\nFAT Sector Start                       - [0021]\r\nNO NAME     Volume Directory\r\n\r\nBOUNDER\r\n\r\nReading File d.pr.g 0 Bytes Long.\r\nFirst entry 0001 F8 FF FF FF 03 00 04 00 05 00\r\nfile sector 0130\r\n\r\n0 Bytes Printed<\/pre>\n<p>As you can see the LFN entry for BOUNDER messed it up. A slight mod is needed to skip the LFN entries in the directory so BOUNDER.PRG would appear as the first file, not its LFN entry.   <script type=\"text\/javascript\"><!-- google_ad_client = \"pub-9911057097907605\"; google_ad_width = 728; google_ad_height = 90; google_ad_format = \"728x90_as\"; google_ad_type = \"text_image\"; google_ad_channel =\"\"; google_color_border = \"DDDDDD\"; google_color_bg = \"DDDDDD\"; google_color_link = \"0000DD\"; google_color_text = \"000000\"; google_color_url = \"800000\"; \/\/--><\/script> <script type=\"text\/javascript\"> <\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a project to replace the CBM 1541 floppy drive on the C64 with an MMC card. I dont want a HUGE 1541 connected to my DTV, so im making an MMC reader that will emulate the 1541. A schematic has been provided for me by Jussi, thanks go to him for this as [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-40","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/pages\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":1,"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/pages\/40\/revisions"}],"predecessor-version":[{"id":231,"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/pages\/40\/revisions\/231"}],"wp:attachment":[{"href":"https:\/\/www.pyrofersprojects.com\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}