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


Forums > C64 Coding > Drive coding: safe maximum time between $1c01 reads?
2008-03-16 11:54
tlr

Registered: Sep 2003
Posts: 1538
Drive coding: safe maximum time between $1c01 reads?

There was some discussion here previously: Job codes'n buffers

Graham mentions that the rotational speed of an 1571 is often >320 rpm.
I've heard of ~280 rpm on some drives.
So what is the safe distance?

Is the following partial decode safe? (assuming no page crossings)
    ldy #<n>
lp:
    bvc .
    clv
    ldx $1c01
    lda tab,x
    sta buf,y
    dey
    bpl lp
I'm thinking it is. A lap would be 22 cycles (=2+2+4+4+5+2+3).
Assuming min/max 280/330 rpm and a minimum write distance of 26 cycles gives a practical min distance of 26*(280/330)=22.06 cycles.
Maybe I'm missing something in addition... jitter perhaps?

Is 280/330 rpm a too narrow assumption?

EDIT: calculated this on 28 cycles by mistake, corrected it to 26 cycles.
2008-03-16 12:40
MagerValp

Registered: Dec 2001
Posts: 1017
Thinking about a d64 compatible 4-8 GCR scheme?
2008-03-16 18:32
tlr

Registered: Sep 2003
Posts: 1538
No, normal GCR.
2008-03-16 20:15
MagerValp

Registered: Dec 2001
Posts: 1017
Interesting, what would tab do?

I did a partial decode while reading, but mainly shifting to line up the nybbles better.
2008-03-16 20:18
tlr

Registered: Sep 2003
Posts: 1538
tab is a "sparse" table remapping bits to arrive in linear order at the c64 end.
2008-03-31 16:45
tlr

Registered: Sep 2003
Posts: 1538
I have since reduced the distance to 20 cycles, so it should be safe enough.

I have some other questions though:

1. What is the safe spin-up time across drives?
The 1541 ROM seems to use 1 second for this, but that feels like a bit overkill.

2. What can be considered safe stepping/settling times?
The 1541 ROM has slow stepping, and uses acceleration to get higher speed during long movements.
2008-04-02 16:26
raven
Account closed

Registered: Jan 2002
Posts: 137
Not counting the clv & $1c01 read, i've gone as high
as 18/19 cycles between reads.
That DID backfire on some drives (X2001 1541 drive *caugh*)

17 seems to work fine though, but you can also do
some dirty tricks, like use 19 cycles after one $1c01 read,
then use 15 after the next one, so it averages out..
2008-04-02 18:27
tlr

Registered: Sep 2003
Posts: 1538
Quote: Not counting the clv & $1c01 read, i've gone as high
as 18/19 cycles between reads.
That DID backfire on some drives (X2001 1541 drive *caugh*)

17 seems to work fine though, but you can also do
some dirty tricks, like use 19 cycles after one $1c01 read,
then use 15 after the next one, so it averages out..


17 cycles + bvc + clv would be 21 in total then. One below my calculated worst case.

In my routine 20 cycles (total) is the maximum delay, then 16, 17, 17 and 19.
Seems safe then! :)

The 1541 rom seems to use 19 cycles max:
.8:f4d4   50 FE      BVC $F4D4
.8:f4d6   B8         CLV
.8:f4d7   AD 01 1C   LDA $1C01
.8:f4da   91 30      STA ($30),Y
.8:f4dc   C8         INY
.8:f4dd   D0 F5      BNE $F4D4
.8:f4df   A0 BA      LDY #$BA
.8:f4e1   50 FE      BVC $F4E1
.8:f4e3   B8         CLV
.8:f4e4   AD 01 1C   LDA $1C01
.8:f4e7   99 00 01   STA $0100,Y
.8:f4ea   C8         INY
.8:f4eb   D0 F4      BNE $F4E1


How about step delays?
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
Røly/Mayday!
Brittle/Dentifrice
Oxbow/Xenon
tlr
goerp/F4CG
Grue
nc513
Guests online: 110
Top Demos
1 Edge of Disgrace  (9.6)
2 Coma Light 13  (9.6)
3 Bromance  (9.6)
4 Uncensored  (9.6)
5 Memento Mori  (9.5)
6 Unboxed  (9.5)
7 Lunatico  (9.5)
8 Wonderland XII  (9.5)
9 Comaland 100%  (9.5)
10 Christmas Megademo  (9.5)
Top onefile Demos
1 Copper Booze  (9.6)
2 Daah, Those Acid Pil..  (9.5)
3 Dawnfall V1.1  (9.5)
4 Cityscape 2730  (9.5)
5 Lovecats  (9.5)
6 To Norah  (9.5)
7 Elite Code Mechanics  (9.4)
8 Barry Boomer - Trapp..  (9.4)
9 Offering  (9.4)
10 For Your Sprites Only  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Performers  (9.4)
3 Oxyron  (9.3)
4 Fossil  (9.3)
5 Crest  (9.2)
Top Organizers
1 Burglar  (9.9)
2 Irata  (9.8)
3 Sixx  (9.8)
4 Taper  (9.8)
5 hedning  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2021
Page generated in: 0.037 sec.