HDD IDE ATA 2 interface problems. code wrong?


Closed Thread
Results 1 to 3 of 3
  1. #1
    rastan's Avatar
    rastan Guest

    Red face HDD IDE ATA 2 interface problems. code wrong?

    hi ive been trying to interface my 16f877a with a samsung shd-30560A hard disk drive. its ATA-2 spec at 560MB.
    the attatched code does not read properly from the drive, a previous test (also attatched) where it requests the drives information does work.

    For the program that doesnt work, i got the following output
    Code:
    Ready to Initialize
    head register = 0
    Writing: 11100000
    head register = 11100000
    LBA Mode Activated
    System Initialized and ready
    Writing to number of sectors register
    Writing to LBA
    Writing to command register
    Information:
    
    error register = 0
    Spin down
    as you can see, there is no information being passed back, but the error register is still empty. as if the wrong command is being passed.

    unfortunatly i couldnt upload the ata2 standard paper for reference because the filesize was too big. it can be found easily on the net. cant remember where i got it from though

    thanks everyone for the help

    phil
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    http://hem.passagen.se/communication/ide.html

    From the WEB page:

    This project will explain how an IDE disk drive works.
    You will also learn how to control it and how to read and save data to your disk.
    Build your own interface and get advantage of the mass storage of data in a hard disk.

    * * *

    See also the links at the bottom of the web page.

    Luciano

  3. #3
    rastan's Avatar
    rastan Guest


    Did you find this post helpful? Yes | No

    Default

    thanks Luciano,

    unfortunatly the web page that you provided never provided any more information but through that web page i found that i had missed something. there is a line on the ide connector called ALE.

    it is some sort of old ATX information strobe line and I did not connect this since it has not been used for years, but by doing this it was sending the drive crazy. once i had pulled it up to 5v through a resistor it was fine.

    for further information, i found this by a man called wesley a lot more helpful. plus also the ata2 specfication paper which i found at the t13 website along with all the other specifications.

    just for everyones reference before writing the read command, ALL of the logical block addresses MUST be written to, for example if you were wanting to read lba 0 (master boot record) then you would write 0 to ALL the appropriate registers, not just the lba 0-7 register like i did :P

    thanks again Luciano, i know that not many people will be willing to touch this subject with a 50 foot barge pole but im sure ill be back in a bit asking more questions.

    Also, if anyone else is having a go at this, then i would like to know how you are getting on.

    cheers, phil

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. Line following robot... problems with some code
    By nepstar in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th March 2005, 01:10
  4. Code dsigner lite problems
    By toalan in forum Off Topic
    Replies: 2
    Last Post: - 23rd February 2005, 20:08
  5. Problems with 16F877A code
    By NightHawk2 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th August 2003, 01:36

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts