OT:PCMCIA ATA command block register programming Q

Hi all,

I have a pcmcia ATA flash card of 10MB. I need to address a particular
sector and do READ/WRITE operation to any 512 bytes in the particular
sector. so i did the following. please note i am using pcmcia ATA I/O
mapped mode.

command block for writing sector

Register operation Reg. address Reg. data

  1. Data Write 0x0 data to be written,say
    0x5a
  2. Feature Write 0x1 0x1 – Enable 8-bit
    transfer
  3. Command write 0x7 0xEF --to set the above
    feature
  4. sector count write 0x2 0x0
  5. LBA (7:0) write 0x3 0x1 – 1 sector
  6. LBA (15:8) write 0x4 0x0
  7. LBA(23:16) write 0x5 0x0
  8. Drv/Hd LBA(27:24)Write 0x6 0xE0/F0 – LBA MODE,

Now i read the status register for checking present status

  1. status Read 0x7 0x50

Now i write the command register

  1. command write 0x7 0x32/0x33

Now I again check the status

  1. status Read 0x7 0x58 – it shows 0x58
  2. error Read 0x1 0x0

command block for reading sector:-

  1. command write 0x7 0x22/23

Now I again check the status

  1. status Read 0x7 0x58 – it shows 0x58
  2. error Read 0x1 0x0

On reading the data register 0x0 , i have the value of 0x0 instead of
0x5a

Can anybody please let me know where am i going wrong…?
Is there any initialisation to be done before making read/write…?
Is there any reset to be performed before read/write…?

Pls throw some light for the above queries…

Thanx ,in anticipation of some help,

Shiva P

THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE ADDRESSEE
and may contain confidential and privileged information. If the reader of this message
is not the intended recipient, you are notified that any dissemination, distribution
or copy of this communication is strictly Prohibited.If you have received this message
by error, please notify the sender immediately, return the original mail to the sender
and delete the message from your system.