This project aims to create a USB CD-ROM device. Unlike typical devices that imitate a CD-ROM drive, this project emulates one. The concept allows users to store an ISO image or other types of CD-ROM images on an SD card, which is then presented as a CD-ROM to the computer. At the time of writing, it functions well with ISO images but does not support hot extraction of the SD card. This limitation will be addressed by modifying SCSI commands and responses to enable the host to eject the CD as well. The schematic includes media sensing, represented by a switch connected to RB7. The SD card slots have two pins that short when a card is inserted. The card operates at 3.3V, necessitating a 5V to 3.3V converter if the circuit is powered by the USB voltage source. This is achieved using a simple Zener diode and resistor; caution is advised regarding component values and power dissipation, as some components may become hot. The device exposes a Mass Storage Device (MSD) interface to the USB host. Reference to Microchip examples and the USB MSD specification is recommended. Wireshark is a useful tool for debugging commands and responses, allowing identification of issues where the host may become unresponsive due to incorrect device responses. The SCSI commands are particularly crucial, as documentation for CD-ROM drives is limited compared to disk drives, making it essential to have a reliable reference. A Sandisk U3 pendrive with CD-ROM emulation was utilized for storing internal programs, ensuring they are non-removable and can autorun. Proper descriptor configuration is necessary, and two bulk endpoints (IN & OUT) must be set up for data transfer. Data and SCSI commands/responses will utilize these endpoints. A thorough understanding of the Command Block Wrapper (CBW) and Command Status Wrapper (CSW) structures is important for effective implementation. Some data, such as SD capacity, is hardcoded due to challenges with the SD card, but dynamic calculation should be achievable. The device operates effectively under Windows (tested with Wireshark and VirtualBox on a Linux host) and Linux, though it does not automount the disk. This may not be an error, as similar issues were observed with Sandisk devices. SCSI commands can be complex; returning a "Command not Valid" error is often a practical solution for unknown commands. Booting from the CD-ROM has not been successful, likely related to BIOS limitations. Debugging the BIOS is difficult since VirtualBox does not support USB booting. To copy the ISO to the SD card, the dd command must be used to overwrite all data, including the MBR and partition table, ensuring the entire card content mimics ISO9660 media. Future enhancements may include the ability to copy ISOs within FAT partitions, allowing emulation of floppy disks, CD-ROMs, etc., using the same device. An IP KVM is envisioned, with emulated mouse and drives, while only keyboard and VGA capture remain.
The USB CD-ROM emulation project utilizes a combination of hardware and software components to achieve its functionality. The circuit design integrates an SD card interface, USB communication, and SCSI command processing to facilitate the emulation of a CD-ROM drive. The SD card serves as the storage medium, where ISO images are stored and accessed by the host computer as if they were on a physical CD-ROM.
The media sensing mechanism is implemented using a switch connected to the microcontroller pin RB7, which detects the presence of an SD card. This feature is crucial for ensuring that the system can respond appropriately when a card is inserted or removed. The conversion from 5V to 3.3V is essential for compatibility with the SD card, and careful selection of the Zener diode and resistor values is necessary to prevent overheating and ensure stable operation.
The USB interface is configured to present the device as a Mass Storage Device (MSD), adhering to the USB MSD specification. This involves setting up two bulk endpoints for data transfer, allowing the host to read from and write to the SD card. The implementation of SCSI commands is central to the operation of the emulated CD-ROM, and a thorough understanding of the command structure is necessary to ensure proper communication between the host and the device.
Debugging tools like Wireshark play a vital role in monitoring USB traffic and identifying issues in command processing. This is particularly important given the limited documentation available for SCSI commands specific to CD-ROM emulation. The project also highlights the importance of testing across different operating systems to ensure compatibility and functionality.
Future developments may focus on enhancing the device's capabilities, such as supporting additional file systems or improving the user experience with features like hot swapping of the SD card. The potential for integrating additional emulated devices, such as floppy drives, could expand the utility of this project beyond simple CD-ROM emulation. Overall, this project represents a significant step towards creating a versatile USB-based storage solution that leverages existing technologies in innovative ways.This little project aims to create a USB CD-ROM device. Unlike the typical deviced which tries to imitate this isn`t a real CD-ROM drive, it just emulates it. The idea is to allow the user to store a ISO image or other kind of CD-ROM image in a SD card to expose it as a CD-ROM to the computer.
At the time of writing it works quite well, only teste d with ISO images and doesn`t allow hot extraction of the SD card. This will be fixed, but requires some tweaks on SCSI commands and responses in order to allow the host to eject the CD too. The schematic is prepared for media sensing, as represented by the switch connected to RB7. My SD card slots have 2 pins which get shorted when a card is inside the slot. The card works at 3. 3V so a 5V to 3. 3V converter is needed in case you want to supply the circuit with the USB voltage source. This is done by using a simple zener and a resistor. Be careful with the values and the power dissipated, some pieces may become hot! The device exposes a MSD to the USB host. You can have a look at Microchip examples for reference and the USB MSD spec. It`s important to use wireshark to debug the commands and their responses, this way you`ll know where the host gets stuck (typically when device sends bad respones the host keeps trying and trying over and over again triggering device resets too).
The most important part are the SCSI commands. They are poorly documented for CDROM drives (as opposed to disk drives) so it`s crucial to have a reference to have a look. I used a Sandisk U3 pendrive which features CDROM emulation for storing internal programs (so they can`t be removed and can be autoruned!).
I won`t get into details, just simple description. You need to fill the descriptors properly (have a look at a pen drive with wireshark and the USB specs. ) and setup 2 bulk endpoints (IN & OUT) to tranfer data. The data and the SCICS commands/responses will travel using those EP. It`s important to fully understand the CBW and CSW structures and make a good use of them. I have some data hardcoded (such as SD capacity) because the SD card is driving me mad, but you should be able to change everything to be dynamically calculated.
It works great under Windows (tested with Wireshark and VirtualBox under Linux host) and Linux, but it doesn`t automount the disk. I dunno if it`s an error, but Sandisk`s doesn`t get mounted too, so it`s not my fault at all! SCSI commands are a headache, just return the Command not Valid error when you don`t know what to do.
That usually makes the whole thing work. I haven`t been able to boot from the CDROM, as opposed to the disk emulation. I think it`s a BIOS related problem, so no worries at all. I`d like to be able to debug the BIOS, but it`s almost impossible given that VirtualBox doesn`t support USB boot :( Almost forgot! To copy the ISO to the SD card you have to copy using dd command and overwriting all the data (including MBR, partition table, etc.
) so the entire card content is an ISO9660 media. In the future I will implement copying ISOs inside FAT partitions, this way I could emulate floppy, cdrom, etc. using the same device. I have in mind an IP KVM, having emulated mouse and drives only keyboard and VGA capture lasts. 🔗 External reference
Designing and building a USB sound card has become straightforward with the PCM2702 integrated circuit from Texas Instruments. The PCM2702 is a 16-bit digital-to-analog converter featuring two digital-to-analog output channels. Its integrated interface controller adheres to USB 1.0 standards....
Here is a small FM transmitter circuit designed for desktop or laptop use, allowing users to enjoy movies and music from a distance. This USB-powered FM transmitter connects to a computer or MP3 player and broadcasts on a tape...
The 5 V from USB appears to be powering the LED on the laptop power brick. Therefore, even when the power brick is turned off at the wall outlet, the LED remains illuminated. When the USB is unplugged, the...
This pyrometer is used to measure the temperature of an incandescent body. The principle behind this measurement is that the hotter the body, the spectrum of the emitted radiation will shift.
A pyrometer is a non-contact temperature measurement device that...
The computer needs at least 180 millivolts peak-to-peak and the condenser microphone in my headset produces about 20 millivolts peak-to-peak into a 2.2k load with normal speech levels. There are USB ports on the machines, so I can use...
This schematic illustrates a simple DIY solar cell phone or USB charger circuit. It is designed to charge any device that can be powered from a computer USB port, such as MP3 players, cell phones, and iPhones. The circuit...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more