Menu

#52 delay fix after RESET(DATA_OUT) and wait for DATA_IN

uncategorized
closed
None
3
2020-06-26
2013-04-25
Anonymous
No

Hello,

i have found a problem in the send_byte function, that in some cases it doesn't wait for DATA_IN(ACK) from Drive, btw. DATA_IN will not be resetted so fast:

--- opencbm-0.4.2a/sys/libiec/sendbyte.c    2006-03-09 18:31:35.000000000    +0100
+++ opencbm-0.4.2a-fix/sys/libiec/sendbyte.c    2013-04-23 23:38:36.000000000 +0200
@@ -83,10 +83,11 @@
     cbmiec_release_irq(Pdx);
     PERF_EVENT_VERBOSE(0x1059, 0);


-    for(i=0; (i<libiec_global_timeouts.T_17_Times) &&    !(ack=CBMIEC_GET(PP_DATA_IN)); i++)
+    for(i=0; (i<libiec_global_timeouts.T_17_Times); i++)
     {
         PERF_EVENT_VERBOSE(0x105A, 0);
         cbmiec_udelay(libiec_global_timeouts.T_17_SEND_FRAME_HANDSHAKE_T_F);
+        if (ack=CBMIEC_GET(PP_DATA_IN)) break;
     }
     PERF_EVENT_VERBOSE(0x105B, 0);

Also discussed http://www.forum64.de/wbb3/board2-c64-alles-rund-um-den-brotkasten/board107-sonstiges/board6-daten-bertragung/p732140-opencbm-timeout-bugfix-windowsumsetzung-gesucht-war-xa1541-will-nicht-so-recht/#post732140

For linux i have allready fixed and testet it very well, but for windows i dont't have any programming experience, so i'm not able to build it new. Maybe you can build us a new windows version including this fix.

Many Thanks!

Regards

kbr

Discussion

  • Anonymous

    Anonymous - 2013-04-26

    Hello,

    I am not convinced that this is actually a fix to a bug, or if your transistors are just too slow.

    Anyway, I will investigate on this. Can you also send me the Linux version of your patch?

    • Spiro
     
  • Spiro Trikaliotis

    • assigned_to: Spiro Trikaliotis
    • Group: v0.4.2 --> v0.4.99.94
     
  • Anonymous

    Anonymous - 2013-04-28

    Ok, let's name it an enhancement to use cheeper transistors, but at this time you have to wait at least 100µs for the BETWEEN BYTE TIME, so it doesn't hurt to wait at least 100µs after releasing DATA.

    Here the linux fix:

    --- opencbm-0.4.2a/sys/linux/cbm_module.c   2007-11-11 18:16:54.000000000 +0100
    +++ opencbm-0.4.2a-fix/sys/linux/cbm_module.c   2013-04-23 00:35:33.000000000 +0200
    @@ -344,8 +344,9 @@
            }
            local_irq_restore(flags);
    
    
    -       for( i = 0; (i < 20) && !(ack=GET(DATA_IN)); i++ ) {
    -               udelay(100);
    +       for( i = 0; (i < 20); i++ ) {   // wait at least once
    +               udelay(100);            // to give DATA_IN time to release
    +               if (ack=GET(DATA_IN)) break;
            }
    
            DPRINTK("ack=%d\n", ack);
    

    Many thanks in advance!

    kbr

     
  • Spiro Trikaliotis

    • Group: v0.4.99.94 --> uncategorized
     
  • Spiro Trikaliotis

    • status: open --> closed
    • discussion: enabled --> disabled
     
MongoDB Logo MongoDB