Re: Need help debugging IEC timing on #FujiNet

From: Ethan Dicks <ethan.dicks_at_gmail.com>
Date: Tue, 4 Apr 2023 13:36:21 -0400
Message-ID: <CAALmimkozt-Y6ktEfgg4tEyhtQyH9CAkCH2Mqw1xthKjRb4Tjg_at_mail.gmail.com>
On Tue, Apr 4, 2023 at 12:43 PM Thom Cherryhomes
<thom.cherryhomes_at_gmail.com> wrote:
> For those who haven't met me, I'm Thom Cherryhomes, and one of the firmware engineers behind FujiNet, as well as being one of the talking heads of the project.
>
> FujiNet is, for those who don't know, an intelligent network adapter built around the Espressif ESP32 microcontroller...
>
> Specifically, the code that deals with all the IEC transactions, is here:
> https://github.com/FujiNetWIFI/fujinet-platformio/tree/master/lib/bus/iec
>
> What are the timing differences that can cause an absolute nightmare between a c64 and a plus4? How does the 1541 deal with them?

Hi, Thom,

There are definitely some specific low-level timing issues with the
C-64 because of the clock speed and VIC-II chip.  The timings are
_not_ the same as a VIC-20.  The differences are enough that the
cassette tape routines on the C-64 disable video output when
reading/writing the tape (not needed on VIC-20 or PET et al.)  The
1541 has two interface "speeds", one for the C-64, and the older,
faster line speed for the VIC-20.   The 1541 command UI+ sets C-64
speed, and UI- sets VIC-20 speed.  The flag lives at $0023, and
there's a timing routine at $fef3 that injects an additional 40uS when
called.

One C1541 disassembly is at:
http://unusedino.de/ec64/technical/misc/c1541/romlisting.html

The specific spot that checks the UI+/UI- flag and calls the delay as at:

E96E   20 A5 E9   JSR $E9A5     DATA OUT, output bit '0'
E971   D0 03      BNE $E976     absolute jump
E973   20 9C E9   JSR $E99C     DATA OUT, output bit '1'
E976   20 B7 E9   JSR $E9B7     set CLOCK OUT
E979   A5 23      LDA $23
E97B   D0 03      BNE $E980
E97D   20 F3 FE   JSR $FEF3     delay for serial bus
E980   20 FB FE   JSR $FEFB     set DATA OUT and CLOCK OUT

I'm sure others here can chime in with plenty of other observations,
but that's what I have off the top of my head.

Cheers,

-ethan
Received on 2023-04-04 20:00:07

Archive generated by hypermail 2.3.0.