No announcement yet.

udrive write problems

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16

    If you try to open a nonexstant file for reading you get 4 bytes of 0x00 (the length), you then send the 'read' ACK and the response will be a NAK


    • #17

      Hi Thanks for your help so far. The Z80 code is now OK working fine with the 12 byte filesize.
      There is still the additional byte not shown in the manual. I have checked carefully and the sequence I get is - after sending the command + file name to uDrive 4 bytes are received back which are the file size then after sending ACK from the computer the Udrive starts sending data but the first byte is 00 and not as described in the manual (Page 11 of 16) as the first 5 bytes.
      This first byte is 15H if no file or 00 if file OK.
      Of course they are the first 5 bytes if this check-byte is ignored but I think that this should be made clear in the manual.


      • #18

        If you look at the file in Windows with a hex editor is this 0x00 in the file?


        • #19

          Hi Yes you are right, some of my files have a zero byte at the start. These are some of the files I had written using CP/M - the ones written with a PC are OK.
          Unfortunately I was using one of these files for the most recent tests. Sorry about my unkind words regarding your manual! and thanks for making me check.

          I am writing files with 32-byte packets and reading them with no handshaking. In the manual on page 13 of 16 at the top of the page (no handshaking). The first data being sent to the uDrive is data+filename followed by 6 bytes, whereas the example below (using handshaking) shows data+filename followed by 5 bytes.
          When I was having problems writing I did add an additional zero byte since I was using no handshaking and this could account for the extra zero at the start of some files. I am not saying that the manual is wrong but it seems strange to me.