505 board converting to serial output

Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: 505 board converting to serial output

Post by Mark »

The disk boot code is basically the same for 8" and 5.25".
Upon start the disk boot code initializes the PIA, drive 1 is selected, the code checks for track 0 and keeps stepping down until the signal is active. Then it checks the index signal, looping until it is active and then looping until it is inactive. Then it resets the disk ACIA and starts reading data.

One tool you could use to identify where the code is stuck is the 6502 Non-maskable interrupt.

I wrote an NMI handler that sits between the OSI NMI vector (0130) and the IRQ vector (01C0) using all available space which will print out the instruction address, processor status, registers and stack pointer to the serial port.

To trigger it, you need to pull pin 6 of the 6502 low. Although there is some protection against nested interrupts, it's best if it is a single debounced pulse. (To be honest, I just ground the pin through a 470ohm resistor when I want to trigger it.)

When triggered it will print a line like:
"NI=FD=09 P=A4 A=80 X=00 Y=FF K=24"

Where FD09 is the address of the current instruction being processed
P is the processor status register corresponding to the processor flags NV-BDIZC
A,X,Y are the register values
K is the value of the stack pointer (before interrupt)

Attached is the source and object files for 65A and 65V monitors. After loading the machine should end up back at the reset prompt. The NMI handler should survive RESETs fine.
One caveat is that the interrupt handler is swapped out when disk BASIC is loaded, and would have to be reinstalled when BASIC is running, but that shouldn't be an issue for this problem. (The ACIA address needs to be changed for C1P users).

Good Luck!

Code: Select all

;
;Simple NMI handler for OSI C2/C3/C4/C8
;Will print NMI address and registers to serial port upon interrupt
;Will need to be reinstalled if BASIC is loaded from disk as BASIC swaps stack & zero page out

;code lives in stack between $0130 and $01BF, just below IRQ handler
;To load, start monitor and load code.

;To generate NMI, pull pin 6 of 6502 low temporarily, perhaps with a 470ohm resistor to ground.
;Although multiple interrupts may be generated, they should mostly be ignored when one is being processed

ACIA=$FC00	;change to $F000 for C1P

*=$0130-7
	;0129 Set C3/65A Go address (reset vector) Y=6C, X=FC, A=FF, P=4, k=FD PCh PCl
	.BYTE $6C,$FC,$FF,$04,$FD,$01,$29
	
*=$0130	;NMI entry point
	;CLD
	PHA			;we push A
INIRQ=*+1
	LDA #$00
	BNE NOIRQ	;avoid recursive interrupts
	INC INIRQ
	TXA
	PHA			;we push X
	TYA
	PHA			;we push Y

LOOP
	JSR PRNMSG
OFFSET=*+1
	LDA $0108,X ;since X is set in subroutine (TSX), need to add 2 to get real values
	JSR PHEXA
	DEC OFFSET
	CPY #$00
	BNE LOOP

	JSR PRNMSG
	TXA

	ADC #$07	;carry is set from prnmsg
	JSR PHEXA	;print stack pointer before interrupt
	
	LDX #$06	;restore modified values
	STX PRNIDX
	LDX #$08
	STX OFFSET
	
IRQEXIT			;prepare to return to regularly scheduled pgm
	PLA
	TYA
	PLA
	TAX
	DEC INIRQ	;2 instruction window of nested interrupts
NOIRQ
	PLA
	RTI	

PRNMSG
	LDX #$00
PRNIDX=*+1
	LDY #$06	;start with last msg 1st
MLOOP
	LDA MSG,X
	BEQ CHKY
	CPY #$00
	BNE NXTONE	;not interested in this msg, don't print
	JSR OUTPUT
NXTONE
	INX
	BNE MLOOP
CHKY
	LDA #$3D
	INX
	DEY
	BPL MLOOP
	DEC PRNIDX
	LDY PRNIDX
	TSX
	BNE OUTPUT	;assume K is never 0


; PRINT HEX BYTE (A)
PHEXA
	PHA
	LSR	A
	LSR	A
	LSR	A
	LSR	A
	JSR	PHEXA1
	PLA
PHEXA1
	AND	#$F
	ORA	#'0'
	CMP	#'9'+1
	BMI	PHEXA2
	CLC
	ADC	#7
PHEXA2
	
OUTPUT
	PHA
OUTPUT1
	LDA ACIA		;wait for TxEmpty
	LSR A
	LSR A
	BCC OUTPUT1
	PLA
	STA ACIA+1
	RTS

MSG
	.BYTE " K",0
	.BYTE " Y",0
	.BYTE " X",0
	.BYTE " A",0
	.BYTE " P",0
	.BYTE 0
	.BYTE $0D,$0A,"NI",0
Attachments
NMI-C2-C3-C4-C8.zip
(2.52 KiB) Downloaded 12 times
nama
Posts: 369
Joined: Wed Mar 30, 2011 9:44 am
Location: New Zealand
Contact:

Re: 505 board converting to serial output

Post by nama »

Hi Mark, Thank you very much for sharing that.
I did as you said, and I too used the shorting pin 6 with a 470R resistor. I get the following (I did it a number of times):


NI=FE=03 P=A4 A=82 X=26 Y=06 K=24
NI=FE=00 P=24 A=41 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=00 P=24 A=41 X=26 Y=FF K=24
NI=FE=00 P=24 A=41 X=26 Y=FF K=24
NI=FE=04 P=24 A=41 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=04 P=24 A=41 X=26 Y=FF K=24
NI=FE=00 P=24 A=41 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=04 P=24 A=41 X=26 Y=FF K=24
NI=FE=03 P=A4 A=82 X=26 Y=FF K=24
NI=FE=04 P=24 A=41 X=26 Y=FF K=24
NI=FE=00 P=24 A=41 X=26 Y=FF K=24

Is this just looping at the H/D/M menu?
When I press 'H' the address changes when I ground NMI, but when I press 'D' it hangs, and I dont get any response from your program when grounding NMI. A reset then gets me back to the menu and you program is still in memory.

2P (1mhz 32k) - 502 + 8k + CEGMON + garbage collector fix BASIC, D&N MEM-CM9 + 24k, 540 (mono) [SOLD]
4PMF (2mhz 24k) - 505, 540, 527, D13 + 5.25" + Gotek
Superboard RevD - CEGMON + 610 board 24k + D13
Spares - 3 x 527, 1 x 505, Backplane
bxdanny
Posts: 335
Joined: Thu Apr 16, 2015 2:27 pm
Location: Bronx, NY USA

Re: 505 board converting to serial output

Post by bxdanny »

Those interrupts are coming from the serial port ACIA when receiving characters. So try lifting that chip's interrupt line (U1C, pin 7). It shouldn't be connected to NMI, but it seems like it is. [I suspected something like that when you were having trouble with the 540 board, but then thought that couldn't be the case, since you are receiving characters OK now.] You could also move it to the IRQ line (there might be pads on the board to jumper it to either IRQ or NMI), since that is normally disabled at reset, and some software just may need that connection. Or you could redo the ROM, changing the byte at relative location $00BE from $B1 to $11, which would disable interrupts being generated by the serial port.

The disk boot code is actually in the same ROM page as the code that generates the H/D/M?, so it is identical for all OSI bus disk systems, whether 5.25" or 8". Have you tried swapping out the Gotek for the real 5.25" drive? If it started with the head on an inner track, you could at least see if it was seeking to track 0 or not. What kind of activity would you expect to see from the Gotek that you are (still I presume) not seeing?
Last edited by bxdanny on Mon Mar 25, 2024 4:59 pm, edited 1 time in total.
No current OSI hardware
Former programmer for Dwo Quong Fok Lok Sow and Orion Software Associates
Former owner of C1P MF (original version) and C2-8P DF (502-based)
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: 505 board converting to serial output

Post by Mark »

The interrupt response you get when triggering NMI at the H/D/M? prompt looks normal. However getting no response after hitting 'D' would seem to indicate the 6502 has locked up entirely! That happens in a NMOS 6502 if it executes a range of "illegal" instructions. These are basically any instruction that ends in 02 except 82 A2 C2 and E2. The question is how is this happening? Is there a misprogrammed byte in the ROM? Is there something that happens to the bus when accessing the disk controller? Very strange. I suppose the NMI handler output could be thwarted by a reset ACIA - it could write to the display instead.

If we add a few more bytes to the NMI routine, we could also respond to IRQ interrupts exactly the same as NMI. To change it quick we can add 4C 30 01 to the end of the loader. Since IRQ is masked by the interrupt disable bit, and nothing clears that bit in the boot code, I don't think its an IRQ problem, plus you've already lifted the NMI as an experiment, so it doesn't seem related to that either.

You've also run the boot code out of RAM which also doesn't work, where other disk access programs do.

Are your chips the 'A' versions? 2Mhz compatible? One thing is that the 505 generates the WAIT signal when accessing any I/O hardware & ROMS, which should slow the clock to 1MHz. Perhaps there is a problem with that -- or there is some sort of bus contention... I'm just grasping at straws.

You could run the whole machine at 1MHz by pulling the WAIT line on the backplane low with a 470 Ohm resistor. Maybe it works at a slower speed? Check the 6502 clock to see if it really is <1Mhz when WAIT is active.
nama
Posts: 369
Joined: Wed Mar 30, 2011 9:44 am
Location: New Zealand
Contact:

Re: 505 board converting to serial output

Post by nama »

Thanks for the replies.
I'm just working through some of the things you both mentioned.
So I'm just going to pop stuff into this message piecemeal as I work through it all.
Firstly, Danny, I lifted pin 7 of U1C. But again that didn't effect anything :-(
Also to answer your question, I would expect the screen of the Gotek to change to show it's being accessed, and also to seek to tk0 (I even set it to not be on tk0 using the disktest software and then tried, but still no seek to tk0), so basically it seems to do absolutely nothing. It works perfectly as is with my 600 superboard.
Mark, I added that extra bit of code to the end of the NMI file you sent. Not sure If I'm then supposed to ground the IRQ pin, but doing that has no effect...but acutally pressing 'D' with you new modified code loaded produces this:

NI=FF=08 P=B4 A=44 X=00 Y=06 K=FB
NI=FF=0A P=B4 A=44 X=00 Y=FF K=FB
NI=FF=0C P=B4 A=44 X=00 Y=FF K=FB
NI=FF=0E P=B4 A=44 X=00 Y=FF K=FB
NI=FF=10 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=12 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=14 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=16 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=18 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=1A P=B4 A=44 X=00 Y=FF K=FB
NI=FF=1C P=B4 A=44 X=00 Y=FF K=FB
NI=FF=1E P=B4 A=44 X=00 Y=FF K=FB
NI=FF=20 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=22 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=24 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=26 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=28 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=2A P=B4 A=44 X=00 Y=FF K=FB
NI=FF=2C P=B4 A=44 X=00 Y=FF K=FB
NI=FF=2E P=B4 A=44 X=00 Y=FF K=FB
NI=FF=30 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=32 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=34 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=36 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=38 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=3A P=B4 A=44 X=00 Y=FF K=FB
NI=FF=3C P=B4 A=44 X=00 Y=FF K=FB
NI=FF=3E P=B4 A=44 X=00 Y=FF K=FB
NI=FF=40 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=42 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=44 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=46 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=48 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=4A P=B4 A=44 X=00 Y=FF K=FB
NI=FF=4C P=B4 A=44 X=00 Y=FF K=FB
NI=FF=4E P=B4 A=44 X=00 Y=FF K=FB
NI=FF=50 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=52 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=54 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=56 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=58 P=B4 A=44 X=00 Y=FF K=FB
NI=FF=5A P=B4 A=44 X=00 Y=FF K=FB
NI=FF=5C P=B4 A=44 X=00 Y=FF K=FB
NI=FF=5E P=B4 A=44 X=00 Y=FF K=FB
NI=FF=60 P=B4 A=44 X=00 Y=FF K=FB

...where upon it stops at address $FF60.
*Actually there were only a couple of times when it didn't actually stop, but paused very briefly, and then continued showing this...
NI=22=02 P=B5 A=FF X=44 Y=00 K=0C
NI=22=04 P=B5 A=FF X=44 Y=FF K=0C
NI=22=06 P=B5 A=FF X=44 Y=FF K=0C
NI=22=08 P=B5 A=FF X=44 Y=FF K=0C
NI=22=0A P=B5 A=FF X=44 Y=FF K=0C
...
NI=25=40 P=B4 A=FF X=44 Y=FF K=0C (then it stops)

Now, If it didn't continue on into the $22XX addresses (as above) and stopped at $FF60, and then I grounded NMI I get the following (with multiple groundings):

NI=FF=90 P=26 A=00 X=44 Y=FF K=1A
NI=FF=90 P=26 A=00 X=44 Y=FF K=1A
NI=FF=93 P=26 A=00 X=44 Y=FF K=1A
NI=01=33 P=26 A=00 X=44 Y=FF K=16
NI=FF=90 P=26 A=00 X=44 Y=FF K=1A
NI=FF=90 P=26 A=00 X=44 Y=FF K=1A
NI=FF=94 P=26 A=00 X=44 Y=FF K=1A
NI=FF=94 P=26 A=00 X=44 Y=FF K=1A
NI=FF=93 P=26 A=00 X=44 Y=FF K=1A
NI=FF=93 P=26 A=00 X=44 Y=FF K=1A
NI=FF=90 P=26 A=00 X=44 Y=FF K=1A
NI=FF=90 P=26 A=00 X=44 Y=FF K=1A
NI=FF=93 P=26 A=00 X=44 Y=FF K=1A
NI=FF=93 P=26 A=00 X=44 Y=FF K=1A
NI=FF=93 P=26 A=00 X=44 Y=FF K=1A
NI=FF=94 P=26 A=00 X=44 Y=FF K=1A

As it was spitting out the first lot of text after pressing 'D' I also tested the clock on the 6502 (pin 37)...~2mhz
Otherwise (e.g. at the H/D/M menu) the clock is at ~1mhz...which, if I'm not misunderstanding, is opposite to what you described!
I've tried multiple 6502 CPUs, including a 65c02, a R6502P and a 6502AD.
That's where I am at at present, will update this post if new information comes to light.

*Edit - Pulled the wait line low, and get 1mhz consistently (even when the modified NMI code is loaded and pressing 'D' and getting the dump). Still no disk access observed.

2P (1mhz 32k) - 502 + 8k + CEGMON + garbage collector fix BASIC, D&N MEM-CM9 + 24k, 540 (mono) [SOLD]
4PMF (2mhz 24k) - 505, 540, 527, D13 + 5.25" + Gotek
Superboard RevD - CEGMON + 610 board 24k + D13
Spares - 3 x 527, 1 x 505, Backplane
bxdanny
Posts: 335
Joined: Thu Apr 16, 2015 2:27 pm
Location: Bronx, NY USA

Re: 505 board converting to serial output

Post by bxdanny »

Well, we know that you ARE getting NMI interrupts. Since they are not coming from the serial port, they must be coming from the disk interface. When you lifted the 6502's NMI pin before, it was when the Gotek unit wasn't actually working. Now that it is, if you try that again, I expect it will work.

The IRQ outputs of the disk PIA (U1A) are pins 37 and 38. I expect you will find that one of them is jumpered to the NMI line (and there are in fact pads for doing that). Disconnecting that should also get the system booting. At least I expect so.
No current OSI hardware
Former programmer for Dwo Quong Fok Lok Sow and Orion Software Associates
Former owner of C1P MF (original version) and C2-8P DF (502-based)
nama
Posts: 369
Joined: Wed Mar 30, 2011 9:44 am
Location: New Zealand
Contact:

Re: 505 board converting to serial output

Post by nama »

Just about to race off to work, but thought I should try this as it'll only take a few moments.
Lifting the NMI pin on the 6502 and trying 'D' still doesn't result in any response from the drive.
If I then loaded Marks modified NMI code (with the NMI pin still lifted !) I get the following when pressing 'D' (it's a long list):


NI=FF=02 P=37 A=44 X=00 Y=06 K=E1
NI=FF=04 P=37 A=44 X=00 Y=FF K=E1
NI=FF=06 P=37 A=44 X=00 Y=FF K=E1
NI=FF=08 P=37 A=44 X=00 Y=FF K=E1
NI=FF=0A P=37 A=44 X=00 Y=FF K=E1
NI=FF=0C P=37 A=44 X=00 Y=FF K=E1
NI=FF=0E P=37 A=44 X=00 Y=FF K=E1
NI=FF=10 P=37 A=44 X=00 Y=FF K=E1
NI=FF=12 P=37 A=44 X=00 Y=FF K=E1
NI=FF=14 P=37 A=44 X=00 Y=FF K=E1
NI=FF=16 P=37 A=44 X=00 Y=FF K=E1
NI=FF=18 P=37 A=44 X=00 Y=FF K=E1
NI=FF=1A P=37 A=44 X=00 Y=FF K=E1
NI=FF=1C P=37 A=44 X=00 Y=FF K=E1
NI=FF=1E P=37 A=44 X=00 Y=FF K=E1
NI=FF=20 P=37 A=44 X=00 Y=FF K=E1
NI=FF=22 P=37 A=44 X=00 Y=FF K=E1
NI=FF=24 P=37 A=44 X=00 Y=FF K=E1
NI=FF=26 P=37 A=44 X=00 Y=FF K=E1
NI=FF=28 P=37 A=44 X=00 Y=FF K=E1
NI=FF=2A P=37 A=44 X=00 Y=FF K=E1
NI=FF=2C P=37 A=44 X=00 Y=FF K=E1
NI=FF=2E P=37 A=44 X=00 Y=FF K=E1
NI=FF=30 P=37 A=44 X=00 Y=FF K=E1
NI=FF=32 P=37 A=44 X=00 Y=FF K=E1
NI=FF=34 P=37 A=44 X=00 Y=FF K=E1
NI=FF=36 P=37 A=44 X=00 Y=FF K=E1
NI=FF=38 P=37 A=44 X=00 Y=FF K=E1
NI=FF=3A P=37 A=44 X=00 Y=FF K=E1
NI=FF=3C P=37 A=44 X=00 Y=FF K=E1
NI=FF=3E P=37 A=44 X=00 Y=FF K=E1
NI=FF=40 P=37 A=44 X=00 Y=FF K=E1
NI=FF=42 P=37 A=44 X=00 Y=FF K=E1
NI=FF=44 P=37 A=44 X=00 Y=FF K=E1
NI=FF=46 P=37 A=44 X=00 Y=FF K=E1
NI=FF=48 P=37 A=44 X=00 Y=FF K=E1
NI=FF=4A P=37 A=44 X=00 Y=FF K=E1
NI=FF=4C P=37 A=44 X=00 Y=FF K=E1
NI=FF=4E P=37 A=44 X=00 Y=FF K=E1
NI=FF=50 P=37 A=44 X=00 Y=FF K=E1
NI=FF=52 P=37 A=44 X=00 Y=FF K=E1
NI=FF=54 P=37 A=44 X=00 Y=FF K=E1
NI=FF=56 P=37 A=44 X=00 Y=FF K=E1
NI=FF=58 P=37 A=44 X=00 Y=FF K=E1
NI=FF=5A P=37 A=44 X=00 Y=FF K=E1
NI=FF=5C P=37 A=44 X=00 Y=FF K=E1
NI=FF=5E P=37 A=44 X=00 Y=FF K=E1
NI=FF=60 P=37 A=44 X=00 Y=FF K=E1
...pauses here briefly...
NI=22=02 P=B5 A=FF X=44 Y=00 K=E3
NI=22=04 P=B5 A=FF X=44 Y=FF K=E3
NI=22=06 P=B5 A=FF X=44 Y=FF K=E3
NI=22=08 P=B5 A=FF X=44 Y=FF K=E3
NI=22=0A P=B5 A=FF X=44 Y=FF K=E3
NI=22=0C P=B5 A=FF X=44 Y=FF K=E3
NI=22=0E P=B5 A=FF X=44 Y=FF K=E3
NI=22=10 P=B5 A=FF X=44 Y=FF K=E3
NI=22=12 P=B5 A=FF X=44 Y=FF K=E3
NI=22=14 P=B5 A=FF X=44 Y=FF K=E3
NI=22=16 P=B5 A=FF X=44 Y=FF K=E3
NI=22=18 P=B5 A=FF X=44 Y=FF K=E3
NI=22=1A P=B5 A=FF X=44 Y=FF K=E3
... (continues on for a long time)...
NI=24=D7 P=B4 A=FF X=44 Y=FF K=DC
NI=24=D9 P=B4 A=FF X=44 Y=FF K=DC
NI=24=DB P=B4 A=FF X=44 Y=FF K=DC
NI=24=DD P=B4 A=FF X=44 Y=FF K=DC
NI=24=DF P=B4 A=FF X=44 Y=FF K=DC
NI=24=E1 P=B4 A=FF X=44 Y=FF K=DC
NI=24=E3 P=B4 A=FF X=44 Y=FF K=DC
NI=24=E5 P=B4 A=FF X=44 Y=FF K=DC

And at this point it stops and I notice that the LED on the Gotek turns off (first time I've seen the drive do anything outside of the DiskTest program)...

EDIT - I did a power cycle and the next time I tried the same thing, it stopped at $FF60. I think It's time to track down a real floppy drive.

Ok, I'm off to work, will pick up on this again when I get home, and I will also recheck that PIA (U1A) pins 37 and 38 are not connected to the NMI line.
Thanks

2P (1mhz 32k) - 502 + 8k + CEGMON + garbage collector fix BASIC, D&N MEM-CM9 + 24k, 540 (mono) [SOLD]
4PMF (2mhz 24k) - 505, 540, 527, D13 + 5.25" + Gotek
Superboard RevD - CEGMON + 610 board 24k + D13
Spares - 3 x 527, 1 x 505, Backplane
nama
Posts: 369
Joined: Wed Mar 30, 2011 9:44 am
Location: New Zealand
Contact:

Re: 505 board converting to serial output

Post by nama »

So I checked the NMI line again, and it's not connected to anything that I can see. It's certainly not connected to either of the two PIAs pin 37 or 38.

I made a video showing the system doing the DiskTest. Although there were a couple of read back errors, in general it seems to work:
https://www.youtube.com/watch?v=6KQwzTw-J-s

2P (1mhz 32k) - 502 + 8k + CEGMON + garbage collector fix BASIC, D&N MEM-CM9 + 24k, 540 (mono) [SOLD]
4PMF (2mhz 24k) - 505, 540, 527, D13 + 5.25" + Gotek
Superboard RevD - CEGMON + 610 board 24k + D13
Spares - 3 x 527, 1 x 505, Backplane
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: 505 board converting to serial output

Post by Mark »

Looking at the list of addresses posted, we can see the ROM access in the $FFxx range, and the a jump to $22xx. The only way that happens is if the disk has been read and the data loaded into memory. It would appear the disk controller & drive are working. Its possible the data read is garbage though, especially if an interrupt happens during disk read.

The original interrupt code only handled NMI, but by adding 4C 30 01 to the end of the loader, it will also respond to IRQ, but with the same display, making them visually indistinguishable. However the processor status register 'P' shows the state of the IRQ interrupt disable bit (bit 2). So it looks like IRQ disable flag is set and remains set through the entire boot process (as expected). The 'P' register value displayed is the value stored on the stack at the time of interrupt, not the value in the interrupt handler, which I believe sets the "I" flag whenever processing interrupts.
So that would rule out IRQ interrupts, leaving NMI.

Attached is a program with separate irq nmi & brk handlers which inits the disk PIA. Maybe it'll show something... Let it run until it goes back to H/D/M? prompt...
Attachments
nmiport.zip
disk PIA CB1 test
(594 Bytes) Downloaded 13 times
nama
Posts: 369
Joined: Wed Mar 30, 2011 9:44 am
Location: New Zealand
Contact:

Re: 505 board converting to serial output

Post by nama »

Thanks again!
I ran you latest program, but first some updates. I was able to find a nice working 5.25" drive and have been playing with that. Basically it exhibits exactly the same issues as the Gotek. No problem using the Disk Test tool at all, but pressing 'D' does nothing. At the very least surely it should move the head to track0...but it doesn't do anything visible. No problem moving the heads and zeroing the heads in the Disk Test Program though. Also, I now know why the LED is always on on the Gotek, the real 5.25" drive is the same, and that's probably because the motor spins constantly. Also the head is always loaded...is that what it's supposed to do?

Anyway, here is the results from your latest test program, this is with the real 5.25" drive installed.

Init disk ctrl w/ irqs disabled
Init disk ctrl w/o CB1 IRQ
Init disk ctrl w/ CB1 IRQ
doneH/D/M?D
BRK @FF08 P=B4 A=44 X=00 Y=06 K=FC
BRK @FF0A P=B4 A=44 X=00 Y=1D K=FC
BRK @FF0C P=B4 A=44 X=00 Y=1D K=FC
BRK @FF0E P=B4 A=44 X=00 Y=1D K=FC
BRK @FF10 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF12 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF14 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF16 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF18 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF1A P=B4 A=44 X=00 Y=1D K=FC
BRK @FF1C P=B4 A=44 X=00 Y=1D K=FC
BRK @FF1E P=B4 A=44 X=00 Y=1D K=FC
BRK @FF20 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF22 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF24 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF26 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF28 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF2A P=B4 A=44 X=00 Y=1D K=FC
BRK @FF2C P=B4 A=44 X=00 Y=1D K=FC
BRK @FF2E P=B4 A=44 X=00 Y=1D K=FC
BRK @FF30 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF32 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF34 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF36 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF38 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF3A P=B4 A=44 X=00 Y=1D K=FC
BRK @FF3C P=B4 A=44 X=00 Y=1D K=FC
BRK @FF3E P=B4 A=44 X=00 Y=1D K=FC
BRK @FF40 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF42 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF44 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF46 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF48 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF4A P=B4 A=44 X=00 Y=1D K=FC
BRK @FF4C P=B4 A=44 X=00 Y=1D K=FC
BRK @FF4E P=B4 A=44 X=00 Y=1D K=FC
BRK @FF50 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF52 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF54 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF56 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF58 P=B4 A=44 X=00 Y=1D K=FC
BRK @FF5A P=B4 A=44 X=00 Y=1D K=FC
BRK @FF5C P=B4 A=44 X=00 Y=1D K=FC
BRK @FF5E P=B4 A=44 X=00 Y=1D K=FC
BRK @FF60 P=B4 A=44 X=00 Y=1D K=FC
...at which point it stops.

2P (1mhz 32k) - 502 + 8k + CEGMON + garbage collector fix BASIC, D&N MEM-CM9 + 24k, 540 (mono) [SOLD]
4PMF (2mhz 24k) - 505, 540, 527, D13 + 5.25" + Gotek
Superboard RevD - CEGMON + 610 board 24k + D13
Spares - 3 x 527, 1 x 505, Backplane
Post Reply