在Microchip的论坛中发了个帖子,询问有关单片机直接读取U盘信息的问题,有个老外回帖了,但是不太肯定他回答的正确性,希望各位大侠给点意见,谢谢!
提问:As now I'm doing a LED display project, want to show some images on the LED matrix. PIC18F4550 now can control LED display well. But I want to change to store these images in a USB flash disc, then make the PIC18F4550 to read bitmap file automatically once USB disc is plugged in. How can I make that happen? Yesterday, I attended the Microchip seminar in Australia, I asked the staff of Microchip that is there any difference of USB mass storage between USB flash disc and SD card, he said yes, they are totally different. But I just got confused, because they all compliant with USB 2.0 specification.
回答:
Basic Differences
SD/MMC Card
1. SPI or 4bit parallel bus connection between Host and Card
2. Needs an USB Adapter to translate between USB and the SD/MMC card interface
3. Can be plugged into many different devices directly.
USB Flash disc
1. USB only interface (Controller mode only)
2. Needs a USB HOST i.e. PC or PDA (with USB Host controller) to do communications.
With regards to your project
The PIC18F4550 is a controller only USB interface so cannot talk to the USB flash disc which needs a USB Host.
The SD/MMC card can be used because it uses a SPI interface, and would need some filesystem code (e.g. FAT16) so you can read the files from the SD card.
One way is to transfer the file directly to your board using the 18F4550 USB interface and external FLASH.
Alternatively when USB-OTG is released on Microchip devices it may be possible to interface with a generic Mass storage device such as a USB Flash drive.