| ??? 04/17/03 04:48 Read: times |
#43585 - IDE drive memory mapped |
Has anybody here tried connecting an IDE drive in memory-mapped I/O mode?
I have seen many circuits using 8255 chips or 8051 port pins, but never a completely memory-mapped version. I have just built a test circuit, and it seems to work. So far I have only tried reset'ing the drive and reading the "Identify device" data. The data I got back on the first attempt looked like random data. But the data was identical on every read, and changed when I connected a different drive... Then I tried inserting a 1ms pause between each read, and then the data looked better. The CHS data and type number matched the data printed on the drive. But the LBA sector count still looks strange. On one drive I got 12 and 115 on another. I am not sure if it's just my code that's bad. Here is the code I use for reading the cylinder count: //Word 1, Cylinders l = idel; i = ideh << 8; i += l; prints("Cylinders: "); sprintf(str, "%i", i); prints(str); prints("rn"); upause(1); idel is the xdata address of the IDE data-register. ideh is a latch that stores the high data byte. Here is the code for the LBA sector count: //Word 60-61, Capacity in LBA sectors l = idel; z = ideh << 24; z += l << 16; upause(1); l = idel; z += ideh << 8; z += l; prints("Capacitet i LBA sektorer: "); sprintf(str, "%lu", z); prints(str); prints("rn"); upause(1); Did I make a simple mistake? I'm not that experienced in ยต-controller C yet... Does anybody know why the extra pauses between reads are nescessary? And how short can i likely make them? I use a Siemens C501 running at the "standard" speed 11.0592MHz BTW. Best regards, Mikkel C. Simonsen |
| Topic | Author | Date |
| IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
| RE: IDE drive memory mapped | 01/01/70 00:00 | |
RE: IDE drive memory mapped | 01/01/70 00:00 |



