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


Forums > C64 Coding > $1800 question
2003-05-01 14:46
Cybernator

Registered: Jun 2002
Posts: 154
$1800 question

Here're the bits of $1800 register (on 1541).

Bit7 - ATN IN (Connected to CA1 of VIA)
Bit6 - Secondary address
Bit5 - " - "
Bit4 - ATN A
Bit3 - CLK OUT
Bit2 - CLK IN
Bit1 - DATA OUT
Bit0 - DATA IN

Ok, the first problem is that when I set ATN to 1 (from C64 side), the DATA IN line (on 1541) locks to 1. Also some problems appear in the other direction (1541 to C64). What has ATN to do with DATA ???

I have noticed that ATN A is output. Isn't this uni-directional line? (C64 to 1541). The C64 doesn't have ATN IN.

So then, wtf is ATN A ???
2003-05-01 15:23
cadaver

Registered: Feb 2002
Posts: 1153
This isn't possibly an accurate or scientific reply, but basically the DATA line goes low automatically by a circuit in the diskdrive, when ATN goes low (to send a reply to the computer)

By setting ATN A to 1, this mechanism is disconnected. This way the diskdrive can send data in both DATA & CLK lines, when ATN is used as a timing signal by the computer. But remember that the user must then disconnect all other drives, so that they don't mess up the process by holding DATA low themselves.
2003-05-01 18:11
Cybernator

Registered: Jun 2002
Posts: 154
Cadaver wrote:
"This isn't possibly an accurate or scientific reply, but basically the DATA line goes low automatically by a circuit in the diskdrive, when ATN goes low (to send a reply to the computer)"

So this way the kernal checks if there are any drives connected on the bus. I wondered how would it communicate if you set ATN, as kernal does that when sending the primary and secondary addresses. There comes ATN A :)
Thanks for the info, Cadaver!

Cadaver wrote:
"By setting ATN A to 1, this mechanism is disconnected. This way the diskdrive can send data in both DATA & CLK lines, when ATN is used as a timing signal by the computer. But remember that the user must then disconnect all other drives, so that they don't mess up the process by holding DATA low themselves."

That doesn't matter as the loader I'm coding is supposed to be used in a demo. What matters is speed, and 2bit ATN seems to be the fastest and still alowing interrupts.

I'm still having problems with the protocol. I discovered some behaviours of these lines by experimenting, but I'm not sure at all if it's correct. So here's what I found out:

Both for C64 and 1541:

- If you set the OUT bit (of DATA or CLK) to 1, the IN bit will lock to 1, and you cannot receive data. (*Solution: set OUT to 0, before reading IN :))

For 1541:

- The IN bits directly reflect OUT bits from the other side (the C64). (This seems to be correct as the command is passed, and received correctly in my loader. :))

For C64:

- The IN bits are inverted. (Eg. if 1541 sets DATA OUT to 1, the C64 will read 0 at its DATA IN).

Are these things correct ???
If not, someone please correct me.

---

*- If I take the joystick ports as an example: the bits are normally set to 1, unless the pin is grounded by the joystick switches. That's the way all other ports work, so you'll get 0 as soon as any device grounds the line. To get 1, _all_ devices have to release the line (ie. not to ground it). But the serial port does the other way. It's 0 if all devices set the OUT to 0. I assume that the registers are inverted. Can anyone tell me something more on this?
2003-05-02 12:21
Cybernator

Registered: Jun 2002
Posts: 154
Found another thing: If you simply set ATN A to 1, it won't work either.
Graham told me that ATN A is in fact ATN OUT, and diskdrives can communicate through these lines. (I don't see practical use for it).
However, if ATN OUT (on C64) and ATN A (on 1541) are equal, the lines should have no problems. In case you only set ATN A to 1, it will behave as if you have done it through the C64, and DATA will lock again.

So, always set bit 4 to be equal to bit 7... :)
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
Fred/Channel 4
Matt
JEZ
Jetboy/Elysium
chesser/Nigaz
Brataccas/HF
Nordischsound/Hokuto..
Guests online: 82
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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