News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_TFM

FutureOS corner

Started by TFM, 05:12, 01 October 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TFM

Quote from: gerald on 13:46, 07 October 12
On 6128, the data read during the IN A, (C) is FF. Playing with the logic analyser threshold, you can observe that the bus is floating and as weakly pulled up quickly goes from 0x78 to 0xFF. Z80 reads 0xFF
In case the Z80 reads &FF the routine should exit (recognizes, that there is no mouse) and the system should run fine (no lock up).
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

00WReX

Hi TFM,

I am happy to perform any testing you require, but Gerald is the man for the Logic Analyser stuff  ;)

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

TFM

Great. I intend to upload on update of the OS soon, but asselbling always take hours, because I have to adapt a lot of direct addresses.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

robcfg

Nice team work!


And on top of that we learnt something new about or beloved CPC, hehe  8)

arnoldemu

#204
Quote from: TFM/FS on 22:28, 07 October 12
In case the Z80 reads &FF the routine should exit (recognizes, that there is no mouse) and the system should run fine (no lock up).
assumptions are not good ;)

But, I am really happy the answer was found :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

#205
Maybe I understand where you driving at. However if you get a CPC, check its ports, see the unused are ususally &FF. Then you repeat it with some other CPCs - then you have a strong point for an assumption.
The problem is, once a while you have to assume some things. How could you run a program without assuming basic functionality of the system? The question is more where to draw the border. But that's getting philosophic now...  ;)

Well, yesterday I added some smaller OS functions to FutureOS. Now I intend to get the SPARtan bit working. Then I assemble and update the homepage (if there is no trouble).
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

gerald

#206
Well, a good practice is to assume that non driven port is unknown, even if hundred read always return the same value. The exception is when the official specification says it shall return 0xFF.

In fact it would be better to find a way to be sure an interface we intend to use is present, store this info and then use it when needed.
I know this is not trivial if the interface has not been designed that way. ::)

For this specific issue we can use the fact that read value is the last byte of the IN instruction. Follow it with and INI or IN with a different register target at the same port and check that the value is the last instruction byte or not.
If you get twice 0xFF you may assume the interface is not present (ok, except if the interface should return 0xff, but then the chosen port is not suitable for the test  :laugh: )
If you get last  byte of instruction, you also can conclude that the expected interface is not present.

Side note : if on all CPC  a non driven data bus is going to 0xFF after a motherboard specific time, we are just f....d-up as we may still get one exception where it would not be 0xFF nor the last instruction byte, but something between  :P

EDIT : typo

arnoldemu

@Gerald: You have told me how I can now detect cpcs with this type of bus :)
I will write a test soon.

in theory, if interrupt mode 2 was used, the value on the bus is the last byte of the instruction read?

is it more possible that the 8255 is the one which controls the floating bus?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

gerald

Quote from: arnoldemu on 19:25, 08 October 12
@Gerald: You have told me how I can now detect cpcs with this type of bus :)
I will write a test soon.
If you do that,  you will save me some time  :D (Yes,I know I am lazy  :laugh: )

Quote from: arnoldemu on 19:25, 08 October 12
in theory, if interrupt mode 2 was used, the value on the bus is the last byte of the instruction read?
Only if the bus is not pulled up, like for the IN. In fact interrupt acknowledge is issuing some kind of IN when in mode 2 (M1 is low instead of high).

Quote from: arnoldemu on 19:25, 08 October 12
is it more possible that the 8255 is the one which controls the floating bus?
I cannot tell for sure. There is nothing on the schematic that can explain the pull-up on data bus.
A possible explanation is the TTL input pad leakage from all IC connected to that data bus. From one revision to an other, this may change.
Also, on plus, the ASIC may have bus keeper in its data pad. This would prevent the bus to change when not driven. Unfortunatly I do not have a scope to check this.

TFM

#209
Quote from: gerald on 19:20, 08 October 12
Well, a good practice is to assume that non driven port is unknown, even if hundred read always return the same value. The exception is when the official specification says it shall return 0xFF.
Well, IIRC then the specificatin does tell this :-D But I'm not 100% sure, because I can't remember exactly where I did read it. Amstrad Firmware manual?

Quote from: gerald on 19:20, 08 October 12
In fact it would be better to find a way to be sure an interface we intend to use is present, store this info and then use it when needed.
I know this is not trivial if the interface has not been designed that way. ::)
What I do is to write the Millenium byte to the SF2 RTC and read it again, this can be done very quick. After that, a bit get's set (or reset) in the FutureOS configuraton bytes. So later on the application / OS must just check this bit. Shall work (now) that way.

EDIT: I'm not into hardware - period ;-) But the AY is connected to the PIO, which is connected to the Z80, which (for me) may could be a reason for the floating/nonfloating bus. ???
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Bryce

Which bus exactly is supposedly floating? I'd like to check the hardware, it seems very unlikely.

Bryce.

TFM

Carpe noctem.... I used the night and here it is: The update - And I really hope the bug in now corrected. Please let me know :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

00WReX

YES...It works, excellent work TFM very nice indeed...well done.

So it now works on the MC0020I main board....probably just needs a + user to confirm, but looking very good so far.

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

00WReX

Forgot to mention, great work by gerald with the logic analyser  :)

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

gerald

New version is OK as well on my plus (MC0122C).


gerald

Quote from: Bryce on 21:50, 08 October 12
Which bus exactly is supposedly floating? I'd like to check the hardware, it seems very unlikely.

Z80 data bus when no IC is driving it

TFM

Thank you all soooo much!!! I'm glad to hear that it runs. Let's see I try to assemble the Plus Version during the coming days, but today I started another experiment in the lab, which needs me to sit at the microscope 7-9 hours a day, so computing will get less effective. But your great help here is a strong source of motivation  :) :) :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Executioner

Quote from: arnoldemu on 19:25, 08 October 12
in theory, if interrupt mode 2 was used, the value on the bus is the last byte of the instruction read?

What places data on the bus depends on which chips are selected at the time. The Z80 sets /M1 low and /IORQ, but it doesn't set the /RD line low, so, depending on the decoding logic in the hardware, so long as no device drives the data bus without the /RD signal low, the data present should be #FF. The Z80 actually waits for 4 complete cycles before reading the value on the data bus, so if there was any residual voltages from the previous device/memory access they should be well and truly gone.

gerald

Quote from: Executioner on 02:02, 10 October 12
What places data on the bus depends on which chips are selected at the time. The Z80 sets /M1 low and /IORQ, but it doesn't set the /RD line low, so, depending on the decoding logic in the hardware, so long as no device drives the data bus without the /RD signal low, the data present should be #FF. The Z80 actually waits for 4 complete cycles before reading the value on the data bus, so if there was any residual voltages from the previous device/memory access they should be well and truly gone.
Well, if no device is driving the bus, we are in the same situation as the IN : I would expect #FF only if the bus is pulled up.

Bryce

That's a bit of a design flaw. I would have expected at least a row of weak pull-ups somewhere on the board if no IC offers this internally, but it seems that the bus really could float in certain situations.

Bryce.

TFM

The work on the SPARtan idea continues fine. I hope to finish it today, so with some luck I will be able to post a new update soon, to show how it works. As usual a lot of things must be done to see small differences on the screen  ???
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

#221
Made it  :D

See attached file, new update of the OS (English only, nights are short ;-))

Now the SPARtan bit is working. To activate it:

- Install the new ROMs (at 10, 11, 12 and 13 dezimal)
- Go to the MON Icon
- Press D
- Enter &B96E
- Press E, then Copy, then enter "10"
- Press ESC and X, and you are back in the Desktop

Now you see. .... few icons only :P

By activating a drive (and press little Enter of Fire 2) the DIR Icon pops up, by activating the DIR icon (and press little Enter of Fire 2) the file icons pop up.
OK, Info, and Time/Date Icons are only shown when needed.


EDIT: I made a crappy Youtube-Video. GFX are much better on a real CPC.

Using the SPARtan Bit under FutureOS on Amstrad/Schneider CPC - YouTube
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Executioner

Quote from: gerald on 14:35, 11 October 12
Well, if no device is driving the bus, we are in the same situation as the IN : I would expect #FF only if the bus is pulled up.

Well, something pulls it up since the normal CPC/Z80 always provides #FF for an IN when no device is driving the bus. I was under the impression the Z80 ifself must have an internal pull-up on the buffer for the data bus, but I can't see any mention of it in the documentation. It may be possible to test the voltages on a Z80 simply connected to GND/+5V to determine their levels.

gerald

Quote from: Executioner on 06:46, 16 October 12
Well, something pulls it up since the normal CPC/Z80 always provides #FF for an IN when no device is driving the bus. I was under the impression the Z80 ifself must have an internal pull-up on the buffer for the data bus, but I can't see any mention of it in the documentation. It may be possible to test the voltages on a Z80 simply connected to GND/+5V to determine their levels.

You may not have read the full thead then :
Most CPC will return 0xFF, not all : FutureOS corner
At least some 6128 and 6128+ are not  ;)

TFM

After 3 days only 1 download of that new FutureOS with the SPARtan bit... well, guess I wasted my time. First people suggest things, then they are probably not that much interrested. But so is life.
Now I guess it would be a good idea to change the arrangement of some icons, to reduce the chaos on screen when no drives is tagged, or no DIR is read(=buffered).

I already updated the Config-OS utility to be able to set / reset the SPARtan bit. The release will follow soon. I may change/update some smaller things too.

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod