Page 1 of 1
Howto switch PIO mode for ATA device
Posted: Sun Jan 13, 2013 3:11 pm
by razer
How can I switch the PIO mode aof an ATA device from PIO0 to PIO4?
Thanks, Regards razer
Re: Howto switch PIO mode for ATA device
Posted: Mon Jan 14, 2013 6:35 pm
by Gigasoft
Send command EFh (set features) with feature=3 (set transfer mode) and count=12 (PIO mode 4).
Re: Howto switch PIO mode for ATA device
Posted: Tue Jan 15, 2013 7:57 am
by razer
Thanks for your reply.
I tried to implement this using following code:
Code: Select all
// Set PIO 4 mode
outbp (port + 1, 0x03); // Select feature 3 (set transfer mode)
outbp (port + 2, 0x0C); // Transfer mode = PIO 4
outbp (port + 6, 0xA0); // Master drive
outbp (port + 7, 0xEF); // Set features command
uint8 status = inbp(port + 7);
I have some question since it doesn't seem to work.
Is this configuration right?
What's the expected status code? (The drive always returns 0x50 for it)
Regardless of the transfer mode setting, I don't see any speedup. Maybe the drive doesn't understand the commands?
Robert
Re: Howto switch PIO mode for ATA device
Posted: Tue Jan 15, 2013 7:21 pm
by Gigasoft
You can check if the drive supports PIO mode 4 in the result of the IDENTIFY DEVICE commmand, where bit 1 of word 64 will be set if it does. You also have to configure the host controller to use the selected timing. The way to do this depends on the controller.