Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Harvey ! (Registered 2024-11-25) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Fastloaders & serial transfer timing
2016-02-29 09:41
lft

Registered: Jul 2007
Posts: 369
Fastloaders & serial transfer timing

This is a continuation of an off-topic discussion in X2016 Competitions: Your Input Wanted!.

There was some concern about serial transfer routines that might fail due to small margins.

I tried adding one safety cycle per bit pair in the transfer routine of Spindle. This caused an average slowdown of 1.5% for my benchmark scenario.



Crosses are bitfire 0.3, just to get some perspective.
Hollow circles are the latest unreleased Spindle with the original (fast) transfer routine.
Green circles are the latest unreleased Spindle with the new (possibly more robust) transfer routine.

I'm thinking that perhaps the robust version should be default, and the fast version available as an option. But on the other hand, nobody has reported any actual issues with the fast code on real drives, so this decision would be based on fear, more or less. Spindle users, what do you say?
2016-02-29 10:00
ChristopherJam

Registered: Aug 2004
Posts: 1408
Quoting lft
We can has loadercompo?


Yassss!

Standard corpus, all segments loaded to $8000 to $ffff (writing under IO if needed), tested while displaying a FLI image (preloaded to bank 2) and calling a ten raster dummy music routine, count cycles using VICE, separate league tables depending on whether or not it fails more than one time in ten when loading from a real 1541 from a disk written with a different 1541.
2016-02-29 10:30
mankeli

Registered: Oct 2010
Posts: 141
It doesn't really matter to me which one is the default, I'll probably use "robust mode" anyway and change to the "fast mode" only if absolutely necessary.
I haven't had any problems with the current mode, but I like compatibility. :)

Other feature suggestions: Support for kernel vectors (IDE64 & Vice without TDE) and API call for "seek to the beginning of file #". (disk drive could then perform the seeking while demo part is still running)
2016-02-29 11:00
Fungus

Registered: Sep 2002
Posts: 680
I think groepaz has a drive with the weird CIA revision that can act up.

Maybe try a soak test for 24 hours just to be sure.
2016-02-29 16:52
doynax
Account closed

Registered: Oct 2004
Posts: 212
I, too, would be most interested to know how big of an issue this is in practice and the percentage of real drives affected.

In any event isn't this effectively the same timing bound on most modern IRQ loaders? That is to say the host waits 14-cycles from toggling ATN to reading the result, while the drive-side waiting loop with 13-cycles of worst-case latency. Or is more subtle than that?

I gather that it is well-known that the 1571DCR can't quite manage this in 1 MHz mode. Presumably the same applies to some other set-ups as well though.

Of course the timing on the open-drain bus isn't symmetrical so perhaps it might be sufficient to delay only the sampling after the rising ATN flanks.

There is also the additional headache of supporting multiple drives on the bus where the additional capacitance surely can't help, unless perhaps balanced out by the stronger pull-ups.

Currently I attempt to detect the reliability of the faster timing at start-up but that's mostly a workaround to a CCS64 bug and seems unlikely to prove reliable given temperature variations and whatever other surprises the real world may have to offer.
2016-02-29 19:19
soci

Registered: Sep 2003
Posts: 479
These three timings are from Bitfire:





Bitfire 0.5 is just as tight as Spindle. Does it fail on Chameleon in standalone mode too?
2016-02-29 19:20
Hoogo

Registered: Jun 2002
Posts: 105
I guess it will be difficult to find such a "bad" drive and someone willing to perform all those tests at the same time.

What about these ideas?
-Increase the length of the serial cable until it fails.
-Create a test program that measures the ratio of the clock speeds of C64 and drive? Not sure if there is really much variation in it.
2016-02-29 19:39
lft

Registered: Jul 2007
Posts: 369
Quoting doynax
Currently I attempt to detect the reliability of the faster timing at start-up
...


I considered that too, but I think it could lead coders astray, especially since Spindle is aimed specifically at trackmos. There is a risk that the coder is timing the demo under perfect conditions, but with a real drive the loader suddenly decides to degrade and run at a lower speed throughout the entire demo because of a single bit error at the wrong moment.

I think it's a better idea to use fixed timing, and give the coder some influence over the risk/speed tradeoff.
2016-02-29 20:08
doynax
Account closed

Registered: Oct 2004
Posts: 212
Quoting Hoogo
I guess it will be difficult to find such a "bad" drive and someone willing to perform all those tests at the same time.
That may admittedly be asking a bit much but hooking up a logic analyzer+oscilloscope to the C64 CIA and 1541 VIA along side the IEC bus on _one_ system while loading down the signal with a decade capacitor/inductor, and playing with a hot air gun/freezer spray and the like to determine the margins ought to be doable. Not that I'm volunteering mind you ;)

Quoting lft
I considered that too, but I think it could lead coders astray, especially since Spindle is aimed specifically at trackmos.
Plus probably get lynched for wasting all of those precious bytes in the resident code..
2016-02-29 21:32
Fungus

Registered: Sep 2002
Posts: 680
When we had this issue with n0sd0s it seemed to be limited to 1571 drives, just to note.
2016-03-01 07:07
Bitbreaker

Registered: Oct 2002
Posts: 504
Quoting soci
These three timings are from Bitfire:
Bitfire 0.5 is just as tight as Spindle. Does it fail on Chameleon in standalone mode too?


Thanks for the test and numbers! So far i have not noticed any drive having problems in the transfer, but due to too strict timing when reading a sector or sector header. This is finally fixed in the next version, even THCM's floppy that is known to be very very picky managed to do a 24h test without any error. I suspect, that this drive is changing clock speed when getting warm in a noticeable way, while rotation speed stays stable. With the three floppys i have at home i never experienced any problems, no matter what i did, so it is about finding those not so in spec drives.

As for chamaeleon i don't know, Groepaz did not rant so far, so guess it is fine :-D
 
... 19 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
zscs
Barfly/Extend
Epyx/TSA
rexbeng
Mike
Alakran_64
Jammer
Electric/Extend
Rock/Finnish Gold
ArturoDente
Britelite/Dekadence
Aomeba/Artline Desig..
Airwolf/F4CG
Guests online: 98
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Wonderland XIV  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.2)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Mutetus  (9.7)
4 Jammer  (9.6)
5 Linus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.064 sec.