News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_llopis

4MB RAM expansion ports trigger drive motor?

Started by llopis, 22:09, 22 March 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

llopis

I noticed that while I'm trying to detect existing RAM expansions, the text will cause the drive motor to turn on. As I dug a bit deeper into it, I noticed that even though #7800 and #7A00 are reserved for the 4MB expansion, if you write #C5 to either of them on a CPC 6128 or a 6128 Plus, you'll turn on the drive motor. Writing #C4 will turn it off.

You can even do this from BASIC with out &7800,&c5 and out &7800,&c4

Why is that? Is there some decoding of partial bits going on that is being triggered by that?


And the followup question: Is there any way to detect all existing RAM without triggering that? My strategy has been to start in #78 and work my way up to #7F writing the port and the bank to RAM and then checking which ones are correct in the right location. Is there a better approach that allows me to skip the ports that are causing the motor to turn on?

GUNHED

You use the wrong ports, set unused bits to 1, never to 0!!! Because 0 activates a line.


My 4 MB works perfect. See FutureOS memory tool.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

llopis

Quote from: GUNHED on 22:27, 22 March 21
You use the wrong ports, set unused bits to 1, never to 0!!! Because 0 activates a line.

My 4 MB works perfect. See FutureOS memory tool.


Oh interesting! I had made this note to myself:


;; 7 - always 1
;; 6 - always 1
;; 5 - bank
;; 4 - bank
;; 3 - bank
;; 2 - always 1
;; 1 - block
;; 0 - block

So you're saying that bits 2, 6, and 7 should always be 0 instead of 1?
Edit: Oh, no wait, you're saying I should set them to 1, I misread that. So I think I'm doing that correctly, right?

GUNHED

No, you're using port &7800 instead &78FF.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

llopis

Quote from: GUNHED on 22:46, 22 March 21
No, you're using port &7800 instead &78FF.
Oooohhh, those bits! I'm so used to them not mattering that I didn't even think about it! :-) Thanks!

pelrun

#5
It's a common misunderstanding about the CPC's io architecture. When the documentation for a device says certain bits are "don't care", it specifically means only that device doesn't care, another device in the system may/will. You have to ensure every other device stays off, so any bits you aren't explicitly using have to be 1.
The top 6 bits are especially important here, as each independently enables a single function when it's 0. Once you know this, it's pretty obvious why &7800 also triggered the disc drive:
15 - Gate Array
14 - CRTC
13 - Upper ROM banking
12 - Printer
11 - PIO
10 - FDC


GUNHED

Yeah, because of the low bits. Bit 7 = 0 activates the FDC / Motor flip flop. See:


https://www.cpcwiki.eu/index.php/765_FDC#Accessing_the_FDC_765
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod