The MSX microSD Mapper Wireless is a project aimed at building upon the success of Luciano Sturaro and Fabio Belavenuto’s implementation of the well known MSX SD Mapper.
It features a single slot for microSD cards, a ESP8266 (ESP12E) micro-controller to offer wireless access, and a simplified board design.
With microSD cards becoming increasingly affordable and widely available, that seems to be a better option now. Additionally, the original SD Mapper v2 project had some confusion around the switches used to control the megaram/mapper, which were later changed in versions of the firmware to enable and disable the mapper on v2.
The ESP8266 enables network connectivity for the microSD card when it is inserted into the cartridge slot. Through a WebDAV server, it provides a convenient method for accessing and modifying the cartridge storage from any networked PC at any time, without requiring adapters, and eliminating the need for repeatedly removing and reinserting the memory card.
The cartridge also features a small OLED display to present the IP address acquired via DHCP and writes the information on a IP.CFG file on the root of the microSD card so you can create automation based on the address of the microSD Mapper.
Bill of Materials
The following table documents all the parts that are needed to build the cartridge. I’m also including links to some of the sources for those components in the aim to simplify the process if you decide to build a cartridge by yourself.
You can download all gerber files required to build the PCB using JLCPCB or PCBWay services from the project GitHub here cristianoag/microsdmapperv1: microSDMapper for MSX Computers (github.com)
|C1, C3, C4, C5, C6, C7, C8||0.1uF||0603 100NF Ceramic Capacitor (104)||7||Ali Express|
|C2||100uF||Electrolytic Capacitor SMD 5×5.4mm 100uF 10V||1||Ali Express|
|R1, R2, R3, R6||1K||0603 1K R Resistor||4||Ali Express|
|R5, R7, R8||10K||0603 10K R Resistor||3||Ali Express|
|R4, R9||4.7K||0603 4.7KR Resistor||2||Ali Express|
|R10||330||0603 330 R Resistor||1||Ali Express|
|D1||Red||Led 3mm PTH Red Squared||1||Ali Express|
|U1||ESP-12E||ESP12E – Low cost/Low power WI-FI module for IOT||1||Ali Express|
|U2||LM1117MP-3.3||LOW DROPOUT VOLTAGE REGULATOR (3.3V)||1||Ali Express|
|X1||25 Mhz||SMD 5070 active crystal oscillator OSC 25MHZ 7050 5*7||1||Ali Express|
|IC1||M29F010||PLCC-32 1 Mbit (128Kb x8) CMOS 5V Uniform Sector Flash Memory||1||Ali Express|
|IC2||HM628512||SSOP-32 512K X 8 BIT CMOS SRAM||1||Ali Express|
|IC3||XC95144XL_TQ100||CPLD – Complex Programmable Logic Device 3.3V 144-mc VQFP-100||1||Ali Express|
|Q1||BC858||SOT-23 PNP Transistor||1||Ali Express|
|J1||Right Angle||2.54mm 2 x 40 Pin Male Double Row Pin Header Strip Black||1||Ali Express|
|J2||TYPE F||Memory Card Holder With Self-Elastic slot||1||Ali Express|
|N/A||SOCKET-SMD-PLCC32||SMD SMT PLCC SOCKET ADAPTER IC Block 32P PLCC32||1||Ali Express|
|N/A||0.91 Inch 128×32 white||IIC I2C OLED LCD Display DIY Module SSD1306 Driver||1||Ali Express|
|N/A||Patola Black MSX Cartridge Case||1||Mercado Livre|
I also published the interactive BOM on the project GitHub here https://htmlpreview.github.io/?https://github.com/cristianoag/microsdmapperv1/blob/master/hardware/microsdmapper_v1.2/bom/ibom.html
Programming the CPLD
To program the XC95144XL CPLD used by the microSD Mapper cartridge you will need a Xilinx programmer and the Xilinx ISE Webpack. The table below has links to where you can download/purchase what is needed to program the CPLD.
|Xilinx Platform USB Programmer for FPGAs and CPLDs||Ali Express|
|Xilinx ISE Webpack||Download|
Follow the steps below to synthesize and then program the CPLD using the Xilinx ISE Webpack running on a VM in Windows (you can also use the Linux version):
- Connect the Xilinx programmer to your PC using the USB port.
- Make sure you download the content of the CPLD folder from the GitHub repository.
- Run the Xilinx Platform Studio, wait until the Oracle Virtual box finishes loading the Linux Virtual Machine and presenting the main Xilinx Platform Studio interface.
- Click Open Project and load the sdmapper.xise project from the CPLD folder. You may need to use the Shared Folders option under the Devices menu to expose the content of the CPLD folder to the Virtual Machine OS.
- With the sdmapper.xise project loaded, right click the Implement Design and select the Run option on the menu.
- Wait until the end of the synthesize process. When it finishes you will get a HTML page loaded on the default browser with the summary of the process and a Fitting Status equal to Successful, indicating the synthesize process executed correctly.
- Still on ISE Project Navigator, right click “Configure Target Device” and select Run.
- You are now ready to program the CPLD. Connect a 2×5 pin header to the programmer using a few DuPont jumpers. Make sure you connect the jumpers to the right pins following the images shown below.
- Now insert the header to the appropriate JTAG holes that are located to the upper right corner of the PCB. Make sure the pins coming from the programmer are correctly aligned with the values indicated on the PCB and hold the pin header with your hand making sure it makes contact with the copper field of each hole.
- While using your hand to ensure right contact of the programmer to the PCB JTAG holes, right click the xc95144xl icon and select Program.
- After a few seconds the CPLD will be programmed with the sdmapper.jed file.
Note: If you already has the sdmapper.jed file and just want to program the CPLD, you only need to run iMPACT and select the appropriate file to program the chip. You don’t need to synthetize the VHDL code every time you need to program the CPLD.
Top program the ESP8266 (ESP12E) with the appropriate firmware you have a few options. You can load the compiled file directly to the ESP12E using tools like ESPTOOL or arduinoOTA, or you can use Visual Studio Code with Platform IO to compile and flash the firmware.
Both options can flash the firmware with the ESP8266 connected via a USB cable (requires a development board) or Over the Air Update (OTA). Of course, OTA can only be used after initial configuration, so the ESP12E can have a assigned IP address to be used during the flashing operation.
The initial firmware flash must be executed using a serial over USB with a ESP8266 development board. The table below documents the software and hardware you will need to successfully program the micro-controller used on the microSD mapper wireless.
|ESP8266 Development WIFI Board Test Frame Burning Fixture Tool Downloader for ESP-01S ESP12S ESP12E||Ali Express|
|Visual Studio Code||Download|
If you decide to use Visual Studio Code to flash the firmware over the serial interface, make sure your platform.ini file has the appropriate configuration. In the picture below you can see that in my configuration COM9 is being used to flash the compiled firmware to the micro-controller.
If you want to use esptool to flash the firmware, make sure you download the tool and unzip the file on your computer. Then execute the following command to flash the firmware over serial. Note that in the below command, I’m also using COM9. You need to check which COM interface is configured on your PC when the development board is connected.
esptool.exe -p COM9 write_flash 0x0000 firmware.bin
Flashing the BIOS
The BIOS used on the microSD Mapper is a Nextor ROM that uses the driver created by Fabio Belavenuto and Fabio R. Schmidlin for the original SDMapper. I just made some changes on the assembly code to support the microSD mapper by detecting just one microSD card and also built the ROM using the the current/latest Nextor version (2.1.1).
The modified code can be used to build the driver and the MKNEXROM tool can be used to built the Nextor ROM that needs to be flashed to the cartridge.
If you just want to flash a working version of the Nextor ROM to your cartridge, use the FBL-UPD.COM to load the msdmap.rom executing the following command from your MSX-DOS or NEXTOR in a MSX with the microSD Mapper cartridge inserted:
After executing the command you will get a message that the BIOS was flashed to the cartridge.
You can do that by executing the commands below from the driver folder:
sjasmplus.exe driver.asm mknexrom.exe Nextor-2.1.1.base.dat msdmap.rom /d:driver.bin
Preparing the micro SD card
Connecting the Cartridge to the Wi-Fi Network
When turning the cartridge for the first time after programming the CPLD, BIOS, and preparing the micro SD card, your MSX will boot into the Nextor OS, already with additional 512K of RAM (in mapper mode). If you look the OLED it will be showing that the IP is unset and a message saying “Starting”. After a few seconds you will see the message “SoftAP Active”.
With the SoftAP active, if you check the available Wi-Fi networks on your PC, you will see a new network with the ID MSXSDMAPPER. You need to click and connect to that network, it will not connect you to the Internet, you just need to see that your PC is connected to the MSXSDMAPPER network.
Then, open your browser and navigate to http://192.168.4.1
When the webpage shown below loads on the browser, provide your Wi-Fi network ssid and password, then click Save. Note that in the picture below, my network SSID is MSXW and the password is MSX12345.
Reboot your MSX with the microSD Mapper on the cartridge slot or click the Reboot button and reboots only the ESP12E. The cartridge will connect to your Wi-Fi network and activate the WebDav server after a few seconds.
When you see the message “WebDAV Ready!”, the WebDav server is active and you can use the UNC “\\<IP Address>\DavWWWRoot” to access the content of the microSD card inserted on the cartridge from the PC. In the case below, the UNC I need to use is \\192.168.0.161\DavWWWRoot
Note that the instructions above assume you are using a Windows machine. If you are using Linux, the steps are slightly different.
In the MSX you will notice that a file named IP.CFG was created on the root of the microSD card. The content of the file has the IP address being used by the WebDav server. As you can see below, the IP.CFG file on the MSX has 192.168.0.161 as shown on the OLED display.