|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機 | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計 | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
硬盤讀寫的若干問題! |
| 作者:jiaxh1 欄目:嵌入式系統(tǒng) |
我的程序每次讀出硬盤狀態(tài)寄存器值總是0XFF。 小、以下是我定義的個寄存器地址: sfr DataH=0x90; //P1 sfr DataL=0x80; //P0 sfr RegAddr=0xa0;//P2 sbit Read= P3^7; sbit Write= P3^6; sbit Rst=P3^2; sbit led=P3^5; //********************************* P2.0 接 DA0 P2.1 接 DA1 P2.2 接 DA2 P2.3 接 CS1 P2.4 接 CS0 #define _Status_Control 0x0f #define _Data 0x08 #define _Err_Features 0x09 #define _SecCount 0x0a #define _SecNum 0x0b #define _CylinderL 0x0c #define _CylinderH 0x0d #define _DeviceAndHead 0x0e #define _Status_Command 0x0f 下面是讀狀態(tài)的程序: uchar ReadReg(uchar Addr) { RegAddr=Addr; DataL=0xff; Read=0; Status=DataL; Read=1; return Status; } 幫我看看有什么問題? |
|
|
| 免費注冊為維庫電子開發(fā)網(wǎng)會員,參與電子工程師社區(qū)討論,點此進入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號 |