Author Topic: 4MB RAM expansion ports trigger drive motor?  (Read 300 times)

0 Members and 1 Guest are viewing this topic.

Offline llopis

  • Supporter
  • CPC6128
  • *
  • Posts: 293
  • Country: es
    • Noel's Retro Lab
  • Liked: 166
  • Likes Given: 137
4MB RAM expansion ports trigger drive motor?
« on: 23:09, 22 March 21 »
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?

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.510
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1198
  • Likes Given: 2822
Re: 4MB RAM expansion ports trigger drive motor?
« Reply #1 on: 23: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.
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.05.02)

Offline llopis

  • Supporter
  • CPC6128
  • *
  • Posts: 293
  • Country: es
    • Noel's Retro Lab
  • Liked: 166
  • Likes Given: 137
Re: 4MB RAM expansion ports trigger drive motor?
« Reply #2 on: 23:40, 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:
Code: [Select]

;; 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?

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.510
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1198
  • Likes Given: 2822
Re: 4MB RAM expansion ports trigger drive motor?
« Reply #3 on: 23:46, 22 March 21 »
No, you're using port &7800 instead &78FF.
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.05.02)

Offline llopis

  • Supporter
  • CPC6128
  • *
  • Posts: 293
  • Country: es
    • Noel's Retro Lab
  • Liked: 166
  • Likes Given: 137
Re: 4MB RAM expansion ports trigger drive motor?
« Reply #4 on: 00:11, 23 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!

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 739
  • Country: au
    • index.php?action=treasury
  • Liked: 412
  • Likes Given: 260
Re: 4MB RAM expansion ports trigger drive motor?
« Reply #5 on: 06:05, 23 March 21 »
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

« Last Edit: 06:08, 23 March 21 by pelrun »

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.510
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1198
  • Likes Given: 2822
Re: 4MB RAM expansion ports trigger drive motor?
« Reply #6 on: 16:39, 23 March 21 »
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 (Recent update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.05.02)