Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums

Forums > CSDb Discussions > Error message: "Found more than one drive on IEC bus" with C128D metal and recent demos
2017-11-08 10:26
Monte Carlos

Registered: Jun 2004
Posts: 263
Error message: "Found more than one drive on IEC bus" with C128D metal and recent demos

Sorry for this lamer question. I use an C128D(metal), currently (although i have used C64 for years until i got room problems with the complete setup).
I have attached a 1541 ultimate and changed the internal 1571 drive to device no 10 by cutting the solder pads. The ultimate has dev no 8. This way i can watch many, mostly old, demos with 1541U. However, the most current demos always complain about more than one drive being enabled. Ok, i thought, plugging off the internal 1571 from the mainbord should fix the problem. I was wrong. The loaders still complain about more than one drive.
Am i wrong with my understanding that plugging off the internal drive also disables the ATN signal?
... 34 posts hidden. Click here to view all posts....
2017-11-09 20:48

Registered: Apr 2002
Posts: 955
If running a small "shut up everybody who's not #8" program before watching that demo is too much, wellÂ… yeah. :)
2017-11-09 21:11
Monte Carlos

Registered: Jun 2004
Posts: 263
I did already with this

#include <cbm.h>
#include <stdio.h>

char openFile(void){
	char openErr;
	if ( (openErr = cbm_k_open()) ){
		printf("Open failed: Return value = %d\n", openErr);	
	return openErr;

void main(void){
	char drivecmd[] = "u0>\x09";
	char openErr;
	cbm_k_setlfs (15, 8,15);
	cbm_k_setnam (drivecmd);
	if ( !(openErr = openFile()) ){
		printf("Successfully changed device\n");
		printf("Could not change device\n");

and this

OPEN 1,ID,15,"M-W"+CHR$(119)+CHR$(0)+CHR$(2)+CHR$(0)+CHR$(0):CLOSE 1 

My software solution attemps were not of much use up to now.
However, your drive code suggestion is different.
I could place an installation code into the root dir of the 1541U usb stick, so that i could execute it anytime before watching demos.
Didn't know that ATN call and answer chain could be influenced by software.
2017-11-09 21:32

Registered: Apr 2002
Posts: 955
The ATN problem is automatic acknowledgement by hardware on the physical layer, not the drive's address on the protocol layer.
The drive automatically pulls the DATA line low if the incoming ATN signal does not match the drive's ATNA setting.

Since the typical demo loader uses a 2bit+ATN protocol, ATN is used for clocking and is being toggled all the time. Any device on the bus not setting its ATNA value to match the incoming ATN signal in time would then invalidate what's sent on the DATA line by the current talker.

So the solution is to have a small routine running on all other drives than the one you're running the demo from, which would sample ATN and set ATNA accordingly, in a very tight loop, while it leaves the DATA and CLK lines unasserted.

(Note: 1581 ATN acknowledgement can be turned off, but 1541 and 1571 in all their variants must run software to achieve the same effect.)
2017-11-09 22:09
Monte Carlos

Registered: Jun 2004
Posts: 263
Unfortunately i did not bother very much about drive code and iec protocol and so on during my scene times. However, thank you very much for the discussion. Maybe i should have a look in the floppy chapter of my holy c64 bible.

No one who still uses a C128 dcr?
2017-11-09 22:20

Registered: Apr 2002
Posts: 955
I will hack up something as soon as time permits, and your problem has finally convinced me to add this feature to the upcoming next iteration of my loader. :)

Oh, and i have a C128DCR which Graham once gave me, but i rarely use it, and then only with the built-in drive.
2017-11-11 14:01

Registered: Apr 2002
Posts: 955
Here it is now, a little program to silence offending drives when running demos with 2-bit+ATN loaders. This one is hardcoded for #9. ACME source. Not tested on realthing yet.

        tightloop = 0; 1 might work better on 1541, 0 might work better on 1571

        !to "busoff.prg", cbm

        * = $0801

        !word 2048, 2017; link, line number
        !byte $9e; SYS
        !text "2064"
        !byte 0, 0, 0; end

        !text "+H!"

        lda #9   ; device number
        jsr listen

!if tightloop {
        ldx #0
datalo: lda atnlo,x
        jsr $ffa8; IECOUT
        cpx #atnloend - atnlo
        bne datalo
        jsr $ffae; UNLSTN

        lda $ae  ; FA
        jsr listen
        ldx #0
datahi: lda atnhi,x
        jsr $ffa8; IECOUT
        cpx #atnhiend - atnhi
        bne datahi
        jsr $ffae; UNLSTN

        lda $ae  ; FA
        jsr listen
        ldx #0
exec:   lda command,x
        jsr $ffa8; IECOUT
        cpx #endcommand - command
        bne exec
        jmp $ffae; UNLSTN

listen: ldx #0
        stx $90  ; STATUS
        sta $ae  ; FA
        jsr $ffb1; LISTEN
        lda #$6f ; open channel 15 (command/error channel)
        jsr $ff93; LSTNSA
        lda $90
        bmi error

error:  brk

        !text "M-E"; memory-execute
        !word drivecode
!pseudopc $0205 {
    !if tightloop = 0 {
        ; the simple approach
        lda #$20
        sta $1801; 2 MHz on 1571
        lda #$00 ; ATNA cleared, CLK OUT low, DATA OUT low
        ldx #$10 ; ATNA set, CLK OUT low, DATA OUT low
--      bit $1800; wait for ATN IN high
        bpl --
        stx $1800; set ATNA
-       bit $1800; wait for ATN IN low
        bmi -
        sta $1800; clear ATNA
        bpl --   ; loop
    } else {
        ; the not-so-simple approach
        lda #$ff
        sta $1803; set all port bits as outputs
        lda #>$0300
        sta $1801
        lda #$7f
        sta $1802; set only ATN IN as input
        lda #$00 ; ATNA cleared, CLK OUT low, DATA OUT low
        ldx #$10 ; ATNA set, CLK OUT low, DATA OUT low
        sta $1800
        jmp ($1800)

!if tightloop {
atnlo:  !text "M-W"; memory-write
        !word $0300
        !byte $16
        jmp ($1800)
        !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        sta $1800
        jmp ($1800)

atnhi:  !text "M-W"; memory-write
        !word $0380
        !byte $13
        stx $1800
        jmp ($1800)
        !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        jmp ($1800)
2017-11-12 21:40
Monte Carlos

Registered: Jun 2004
Posts: 263
Wow that was fast. I'm very curious to test it on the real hw.
2017-11-13 09:49

Registered: Apr 2002
Posts: 955
Would be cool if you could check both variants. Both should work, but i'm not so sure about various bus setups. The internal 1571 has the shortest physical path to the host computer's serial port, so it should all just work.

Anyhow, if your tests prove successful, i can safely add this feature to the loader. :)
2017-11-13 11:03

Registered: Oct 2002
Posts: 432
Might shamelessly copy that, been too lazy so far :-)
2017-11-13 11:24

Registered: Apr 2002
Posts: 955
As long as i show up in the credits under "help" or "additional code" or something, all is well. Open source works fine as long as there is proper attribution. :)
Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
Users Online
The Human Co../Maste..
Heavy Stylus/RGCD
JackAsser/Booze Design
Guests online: 38
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 Comaland 100%  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 Lunatico  (9.6)
8 We Come in Peace  (9.5)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Daah, Those Acid Pil..  (9.5)
3 Pandemoniac Part 2 o..  (9.5)
4 Treu Love [reu]  (9.5)
5 Merry Xmas 2017  (9.4)
6 Arok 20 Invitation  (9.4)
7 Dawnfall V1.1  (9.4)
8 In Memoriam BHF  (9.4)
9 Dawnfall  (9.4)
10 Synthesis  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.9)
2 Veto  (9.8)
3 Mirage  (9.7)
4 Jailbird  (9.6)
5 Hein  (9.5)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.09 sec.