BBC Master grumpy sideways RAM detection

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 4:54 pm

My master's suddenly got grumpy detecting sideways RAM using the routines in the new bitshifter's demo - it seems to get the banks with the lower sideways ram wrong more often than not...

This would seem to suggest that the ROMSEL register's misbehaving? Am I right in thinking this is in the MEM CONTR IC (IC20?) The other symptom I've got is with the 80186 (real one) installed, if I hit break to bring up a * prompt so I can turn it off, it just hangs with Acorn TUBE 80186 in MODE 0 and I never get a * prompt, control break will boot from the beebscsi again... I wonder if this is a red herring though?

Prince of Persia's working so far as I can tell, that uses all the memory (but the banks are hard coded)... Any guidance/thoughts on where to start poking gratefully received! :)

d.

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 5:39 pm

Actually, it's nothing to do with the coprocessor, any mode other than 7/135 just hangs after the OS processor banner on break...

User avatar
1024MAK
Posts: 8217
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by 1024MAK » Sun Jan 13, 2019 6:36 pm

You know what to do, remove bits until the symptoms change...

Mark

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 6:42 pm

Free from bits it still behaves the same way :( The next step is to start desoldering things :'(

Is there a disassembly of MOS 3.2? I'd like to work out what it's doing on soft break as that should point at where the issue lies... I'm sure I saw one somewhere but can't for the life of me find it...

d.

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Sun Jan 13, 2019 6:58 pm

Daniel,

Do you have one of the cheap 16-bit logic analyzers? e.g. one of these:
https://hobbycomponents.com/cypress/242 ... ment-board

If so, you could try to capture a trace from the 65C12 and feed it through the 6502 Decoder.

Dave

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 7:00 pm

I do! - Is there a potted "how to hook it up" guide?

d.

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Sun Jan 13, 2019 7:03 pm


User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Sun Jan 13, 2019 7:12 pm

danielj wrote:
Sun Jan 13, 2019 7:00 pm
I do! - Is there a potted "how to hook it up" guide?
Unfortunately, it's more complicated than it should be.

Mostly because the details of capturing depend on:
1. Whether you are on Windows, Linux, or OSX
2. Whether you are doing an asynchronous capture (sample at 12MHz) or a synchronous capture (one sample per falling edge of phi2, Linux only)
3. Whether you are using sigrok-cli to do the capture (multi platform) or fx2pipe (linux)

Synchronous capture is better, but it's harder to get working and is Linux only.

What host do you have available?

Dave
Last edited by hoglet on Sun Jan 13, 2019 7:15 pm, edited 3 times in total.

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 7:14 pm

I can MacOS on a laptop, I can probably reach from the pc with linux either in a VM or using the Windows Linux Subsystem (ubuntu)? I suspect I'll need a test clip too...

d.

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Sun Jan 13, 2019 7:19 pm

It's probably easiest to start with sigrok. Like I did here.
viewtopic.php?p=182748#p182748

A 40-pin DIP test clip makes things much much easier.

It depends how much energy/enthusiasm you have.

(Shame you are not coming to ABUG, this would be a nice project)

Dave

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Sun Jan 13, 2019 7:25 pm

In terms of wiring for an asynchronous capture, you connect the following signals:

Code: Select all

 - data: pin B0..B7
 -  rnw: pin D0
 - sync: pin D1
 -  rdy: pin D2
 - phi2: pin D3
 -  rst: pin D6
-    0V: pin GND
Then the command to do a capture using sigrok-cli is:

Code: Select all

sigrok-cli -d fx2lafw --config samplerate=12MHz:captureratio=1  -o data1.bin -O binary --triggers D14=r --samples=12M
This waits for a rising edge of rst to start, so you:
1. Hold the BREAK key down
2. Run the sigrok-cli command
3. Release BREAK

That then captures 1 second of activity.

If you get as far as this, I can run the 6502 decoder for you.

Dave
Last edited by hoglet on Sun Jan 13, 2019 7:28 pm, edited 3 times in total.

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 7:28 pm

OK - I'll have a look and see what I've got in the tank to have a go at this. I think at this stage I'm just going to resort to rather a lot of clips or see if I can jerry-rig something with a 40pin IC socket...

cmorley
Posts: 707
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by cmorley » Sun Jan 13, 2019 7:35 pm

It's a shame you're not ABUGing next weekend. Perhaps you could ask someone from Manchester who is going to bring it down & hoglet to do a log?

User avatar
jgharston
Posts: 3359
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by jgharston » Sun Jan 13, 2019 7:48 pm

danielj wrote:
Sun Jan 13, 2019 6:42 pm
Is there a disassembly of MOS 3.2? I'd like to work out what it's doing on soft break as that should point at where the issue lies... I'm sure I saw one somewhere but can't for the life of me find it...
http://mdfs.net/Info/Comp/Acorn/Source/MOS.htm

Are the sideways RAM links set correctly?

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 7:57 pm

Links are correct, it was behaving fine yesterday, just today it seems to have gone odd. I'm convinced this mode 7/135 being fine on soft reset, but if you're in another mode it hangs on soft reset before displaying the Filing System Banner (properly hung, caps lock does nowt) thing points at what's going pear shaped :)

d.

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Sun Jan 13, 2019 8:21 pm

What happens if you *UNPLUG the file system ROM?

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 8:31 pm

good plan. One mo! :)

d.

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 8:42 pm

Well! There's a thing. Thanks Dave :) - extra brains are fab. It was fine with the FS's unplugged. I then realised that ANFS was in there and I'd obviously taken the econet module out whilst I was testing...

ANFS was the guilty party on this one - once I'd re-inserted the filing system ROMs and plugged the econet module back in it's back to behaving as normal. It also behaved as normal with ANFS unplugged and without the econet module...

So, back to why it's not detecting sideways ram banks properly...

I'll have a bit more of a play - the code it's using is this: https://github.com/bitshifters/beeb-ste ... ib/swr.asm

Sod's law says it'll be some ridiculous intermittent fault!

d.

User avatar
kieranhj
Posts: 749
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by kieranhj » Sun Jan 13, 2019 8:50 pm

danielj wrote:
Sun Jan 13, 2019 8:42 pm
So, back to why it's not detecting sideways ram banks properly...

I'll have a bit more of a play - the code it's using is this: https://github.com/bitshifters/beeb-ste ... ib/swr.asm

Sod's law says it'll be some ridiculous intermittent fault!
More likely to be a bug in our code - apologies in advance if it turns out to be..!
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
sweh
Posts: 2004
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by sweh » Sun Jan 13, 2019 9:11 pm

FWIW

Code: Select all

    lda &8008   ; read byte
    eor #&AA    ; invert, so that we are know we are writing a different value 
    sta &8008   ; write byte
    cmp &8008   ; check that byte was written by comparing what we wrote with what we read back
will misdetect some flash ROM as RAM. I hit this problem and had to put a sleep in there. In my Manager ROM I have

Code: Select all

\ FLASH RAM chips aren't sideways RAM; they require a special command
\ sequence to cause them to enter WRITE mode.  But they can "buffer"
\ results, so a write to the chip may be read back again and the written
\ value returned, even though it never made it to the FLASH storage.
\ But if we pause for long enough (200us?) then the cache is cleared
\ and stuff works as normal
\ Through experimentation a loop value of #&50 is too low; #&80 seems to
\ work.  Let's double that.

.delay_swr_write
        JSR SWR_write
        LDX #0
.delaylp
        DEX
        BNE delaylp
        RTS
This code has the F4/FE30 backwards..

Code: Select all

    sei
    sta &fe30
    sta &f4
    sta swr_slot_selected
    cli
 
Since you have ".swr_select_bank" which does it right, you should probably just call that :-)

But I didn't spot any obvious problem with the main logic.
Rgds
Stephen

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 9:16 pm

For completeness - OK, so it generally finds banks 4, 5 and 6, but it's sometimes finding 0, 1 and 3 instead of 7... Usually 1 if it's getting the wrong one...

d.

User avatar
BeebMaster
Posts: 2645
Joined: Sun Aug 02, 2009 4:59 pm
Location: Lost in the BeebVault!
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by BeebMaster » Sun Jan 13, 2019 9:28 pm

danielj wrote:
Sun Jan 13, 2019 8:42 pm
Well! There's a thing. Thanks Dave :) - extra brains are fab. It was fine with the FS's unplugged. I then realised that ANFS was in there and I'd obviously taken the econet module out whilst I was testing...

ANFS was the guilty party on this one - once I'd re-inserted the filing system ROMs and plugged the econet module back in it's back to behaving as normal. It also behaved as normal with ANFS unplugged and without the econet module...
I'm a bit puzzled as to why it doesn't boot correctly with ANFS but no Econet module, that shouldn't happen. I just tested it myself, and whilst the Master 128 boots, it didn't behave as I'd been led to believe it would:

I thought NFS and ANFS were meant to detect presence of the 68B54 and disable themselves if not present.

Instead, Master 128 (MOS 3.20) and ANFS (4.25) but no Econet module boots and reports "Econet Station 1 No Clock". SHIFT-BREAK (or power-on-SHIFT etc) gives a No clock error, as does any attempt to log on with *I AM. However *. waits forever. [Well, at least one episode of "Open All Hours"].

So maybe if yours isn't booting with ANFS and no module, it's a sign of some other fault which might be upsetting the SRAM as well.
Image

User avatar
MartinB
Posts: 5054
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by MartinB » Sun Jan 13, 2019 9:44 pm

Have you got an UPURS rom handy to pop in Daniel? (or even the disc-based utility versions?) If you repeatedly perform UPXROM ? you should get consistent SWR bank results each time. Just a thought if it helps.... :)


UPXROM.jpg

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Sun Jan 13, 2019 10:13 pm

MartinB wrote:
Sun Jan 13, 2019 9:44 pm
Have you got an UPURS rom handy to pop in Daniel? (or even the disc-based utility versions?) If you repeatedly perform UPXROM ? you should get consistent SWR bank results each time. Just a thought if it helps.... :)
I'll have a look at this tomorrow, thanks Martin :D I'm sure I've got it knocking about somewhere.

Ian, all it seemed to be doing was causing it to hang as described - ADFS was actually the active FS, or DFS, never ANFS - it was just ANFS sat in the background, and I'm guessing when it tootled through assigning space for the FS on soft reset it got mardy for some reason!

d.

User avatar
MartinB
Posts: 5054
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by MartinB » Sun Jan 13, 2019 11:49 pm

Only if it’s handy but it would at least give you an independent check to point the finger in one direction or another. (You don’t need the UPURS cable or PC connected btw, that command switch just performs a local machine interrogation so you only need the rom or UPURS disc.)

User avatar
sweh
Posts: 2004
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by sweh » Mon Jan 14, 2019 12:59 am

FWIW, this is a very very simple tester. On a Master it should print RRRRWWWWRRRRRRRR. It correctly worked with my Master, my Solidisk 2M128 card, and the IFEL RAM/ROM (Flash) card.

Code: Select all

   10DIM D% 1000
   20FOR A=0 TO 2 STEP 2
   30P%=D%
   40[OPT A
   50SEI
   60LDA &F4
   70PHA
   80LDY #0
   90.LP
  100STY &F4
  110STY &FE30
  120LDA &8008
  130EOR #&FF
  140STA &8008
  150LDX #0
  160.DELAYLP
  170DEX
  180BNE DELAYLP
  190CMP &8008
  200BNE ROM
  210EOR #&FF
  220STA &8008
  230LDA #ASC("W")
  240BNE OUT
  250.ROM
  260LDA #ASC("R")
  270.OUT
  280JSR &FFEE
  290INY
  300CPY #16
  310BNE LP
  320PLA
  330STA &F4
  340STA &FE30
  350CLI
  360JMP &FFE7
  370]
  380NEXT
  390CALL D%
Rgds
Stephen

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Mon Jan 14, 2019 10:26 am

danielj wrote:
Sun Jan 13, 2019 8:42 pm
Well! There's a thing. Thanks Dave :) - extra brains are fab. It was fine with the FS's unplugged. I then realised that ANFS was in there and I'd obviously taken the econet module out whilst I was testing...
That's a good data point.

From the subsequent comments, it does seem that hanging in this situation is not typical.

I wonder if something is loading one of the data bus bits, so that the Econet detection code wrongly thinks the 68B54 is present.

I might give this a try in my own Master.

Dave
Last edited by hoglet on Mon Jan 14, 2019 10:26 am, edited 1 time in total.

User avatar
danielj
Posts: 6732
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by danielj » Mon Jan 14, 2019 11:30 am

See what happens in different modes - as the master retains the current mode on soft break. As I said, 7 or 135 is fine, it just barfs in other modes (so I'm not necessarily thinking it's memory that's at fault here...) The only other thing I have in there is a NuLA which is on the same data bus as the processor and the RAM... I'll have to see if I can find the original vidproc...

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Mon Jan 14, 2019 11:48 am

hoglet wrote:
Mon Jan 14, 2019 10:26 am
I wonder if something is loading one of the data bus bits, so that the Econet detection code wrongly thinks the 68B54 is present.

I might give this a try in my own Master.
So this is all very interesting....

In BeebEm and B-Em, locations &FEA0 to &FEA3 all return &FE.

But on my real Master (with no Econet hardware present) they typically return &20.

If I load ANFS 4.25 into Sideways RAM I get:

Code: Select all

Acorn MOS

Econet Station 245 No Clock

BASIC

>_
This matches BeebMaster's observation.

So if there is Econet detection code present, then it's not working correctly.

Daniel, it would be interesting to see what reading &FEA0-&FEA3 returns on you Master (without the Econet card).

I've also just tried the BitShifter's BeebStep demo, and most of the time it correctly detected banks 4,5,6,7 as RAM. But very occasionally (maybe 1 in 10 tries) it wrongly detects bank 2 as RAM, and ends up using 2,4,5,6 (which then causes a crash). So it does seem the test is not robust enough.

I've written a small test program that repeatedly reads location &8008 from slot 2 (the cartridge port) and the results do vary. I think what is actually being read back is the last byte of video data, floating on the data bus. In Mode 7 it's usually &20. In Mode 0 it's usually &00. This is actually pretty interesting, and also could explain the mode sensitivity you are seeing with the ANFS issue.

Dave
Last edited by hoglet on Mon Jan 14, 2019 12:10 pm, edited 1 time in total.

User avatar
hoglet
Posts: 7768
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: BBC Master grumpy sideways RAM detection

Post by hoglet » Mon Jan 14, 2019 11:57 am

And there's more...

If I do *CONFIGURE MODE 0, then press Ctrl-Break, I can replicate the hang that Daniel is seeing with ANFS:

Code: Select all

Acorn MOS

_
Actually, the hang is only temporary. It lasts about 50 seconds, then the boot continue:

Code: Select all

Acorn MOS

Econet Station 245

BASIC

>_
So it's indeed all down to the video data being "stored" on the data bus, and is likely "normal" behaviour.

Dave
Last edited by hoglet on Mon Jan 14, 2019 12:08 pm, edited 2 times in total.

Post Reply