摘 要:隨著現代電子技術的發展,各種存儲設備的應用越來越廣泛。其中以SD存儲卡的應用最為廣泛,但是由于在傳統的底層硬件體系結構中,一個接口只能連接同種設備,這其實是對現有的資源的浪費。在此提出一種通過AVR單片機和串行轉USB接口來讀取SD卡中數據的方案,真正做到了通過單片機和計算機對各種外設的雙向讀取,通過常規文件系統的讀取方式的改進,能夠兼容各種外部設備使其便攜性進一步增強,進一步提高了已有資源的利用率,能通過單片機和計算機對存儲信息進行有效的管理。實驗證明單次讀取成功率能達到99.8%,因此在數據讀取的穩定性和安全性上是有保障的。本設計具有一定的社會價值和經濟價值。關鍵詞:串口; SD卡; 單片機; USB接口
中圖分類號:TN911-34文獻標識碼:A
文章編號:1004-373X(2010)16-0166-03
SD Card Reader Platform Based on Single Chip and Serial Port
LIU Run
(Physics Department, Qinghai Normal University, Xining 810008, China)
Abstract: the SD memory card is applied widely with modern electronics technology. Due to an interface can only be connected to the same kind of equipment in the traditional underlying hardware architecture, which is a waste of resources. A scheme of using AVR microcontroller and serial transfer through the USB interface to read SD card data, the bi-directional reading through a variety of microcontrollers and computer peripherals is achieved, the external devices are compatible by improving the read method of conventional file system, which improves the utilization of existing resources and portability, the storage information can be managed through the microcontroller and the computer. The experiment proves the success rate of a single reading can reach 99.8%, therefore, the stability and security of the data read is guaranteed.Keywords: serial port; SD card; MCU; USB interface
0 引 言
SD卡[1](secure digital memory card,安全數碼卡)是一種基于半導體快閃記憶器的新一代記憶設備,它被廣泛地于便攜式裝置上使用,例如數碼相機、個人數碼助理(PDA)和多媒體播放器等。SD卡由日本松下、東芝及美國SanDisk公司于1999年8月共同開發研制。大小猶如一張郵票的SD記憶卡,重量只有2 g,但卻擁有高記憶容量、快速數據傳輸率、極大的移動靈活性以及很好的安全性。
本文正是通過AVR單片機經過軟硬結合的設計方案,來讀取SD卡上FAT32文件系統中的數據,FAT32是微軟公司開發的新一代的文件系統,支持更大的存儲容量和長達255個字符的文件名,也可以通過串口轉USB接口芯片通過計算機來訪問存儲器中的數據,從而實現多渠道的立體的訪問方式,進一步提升了資源的利用率。……