Quiz of the day: GLUE Test pin

GFA, ASM, STOS, ...

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Quiz of the day: GLUE Test pin

Postby ijor » Tue Aug 23, 2016 11:26 am

Quiz of the day (or the week):

What is the purpose of GLUE's TEST pin? Why it is named like that?

The winner gets a t-shirt with a full die picture of GLUE ... not really, can't make it or ship it, but I wish I could :)

This is strictly more a hardware than a software question. But coders will be more interested than hardware guys ...

User avatar
Cyprian
Atari God
Atari God
Posts: 1398
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Quiz of the day: GLUE Test pin

Postby Cyprian » Tue Aug 23, 2016 12:58 pm

does it freeze CPU by inserting waitstates?
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

nbz
Atarian
Atarian
Posts: 6
Joined: Tue Nov 22, 2011 9:34 pm

Re: Quiz of the day: GLUE Test pin

Postby nbz » Wed Aug 24, 2016 12:21 am

My guess: it was meant to be a RESET pin, and when it's actually used as a RESET pin, it syncronizes component timings, thus eliminating the whole wakestate mess. But you'll tell us that Atari messed up the board layout, ...

(I'm aware that this guess is outright evil, but there's got to be something quiz-worthy about that TEST pin)

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Quiz of the day: GLUE Test pin

Postby ijor » Wed Aug 24, 2016 2:09 am

nbz wrote:My guess: it was meant to be a RESET pin, and when it's actually used as a RESET pin, it syncronizes component timings, thus eliminating the whole wakestate mess.


YES! That's (almost) exactly what it is. Congratulations! :)

This pin provides POR (Power On Reset) functionality when high. The pin is tied to ground, so it should never be high. Well, almost never. At power up time, when the voltages didn't yet stabilize, all sort of weird things can happen, including sensing this pin as high.

When POR is asserted (TEST high and RESET low), GLUE initializes the 2MHZ clock and the sync counters. This 2MHZ clock drives GLUE video logic timing. The phase alignment between this clock and MMU's own 2MHZ clock (see my post with the MMU clock generation logic) is what makes the wakestate.

Now, if you take control of this pin somehow, disconnect it from ground and attach it to some custom logic, you could change the wakeup at willing!

I wasn't there to know if that is the actual reason that Atari named it TEST, but seems reasonable that they used it for this purpose.

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2034
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: Quiz of the day: GLUE Test pin

Postby calimero » Wed Aug 24, 2016 5:43 am

So Atari was aware of wakestates but did not bother to fix this problem?
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

User avatar
Cyprian
Atari God
Atari God
Posts: 1398
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Quiz of the day: GLUE Test pin

Postby Cyprian » Wed Aug 24, 2016 9:31 am

nice shot nbz
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

User avatar
troed
Atari God
Atari God
Posts: 1182
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Quiz of the day: GLUE Test pin

Postby troed » Wed Aug 24, 2016 9:38 am

ijor wrote:Now, if you take control of this pin somehow, disconnect it from ground and attach it to some custom logic, you could change the wakeup at willing!


Wow!

I've had an idea of creating a circuit that would read some output value of the ST and power cycle until it gets the "right" value - together with wakestate-detecting code in a bootsector. Thus allowing me to program a wanted wakestate value and then wait for the computer to happen into it.

This method sounds a lot simpler to create logic for :D

/Troed

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Quiz of the day: GLUE Test pin

Postby ijor » Wed Aug 24, 2016 1:09 pm

calimero wrote:So Atari was aware of wakestates but did not bother to fix this problem?


Well, of course that I don't have any insider authoritative info to be sure. But now, after studying Shifter and MMU internal logic, I believe they indeed were aware of multiple wakestates. If you check Shifter's reload logic that I posted in the other thread, you can see that it doesn't depend on the number of cycles between DE and LOAD (and that is one of the main issues that vary with the wakestate). Hard to believe the designer of that logic (Shiraz, or whoever it was) didn't observe that it does indeed change across power up cycles.

And if they were aware, why they didn't fix it? Good question. May be they didn't care? Anyway, it is not trivial. The most correct solution requires external analog logic to detect power up properly, and output a board level signal that need to be synchronized with the main clock. A simpler method, probably good enough here, would be to make MMU to produce the external 2MHZ clock instead of GLUE. GLUE would input this clock and then both clocks would be always aligned.

The problem in either case, is that (apparently) there are no free pins in MMU to implement that. I said apparently, because MMU has two VCC and two GND pins. I don't know if that was actually necessary. GLUE, using the same base gate array uses just one. Multiple GND pins is always good, but perhaps they could free one VCC pin?

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Quiz of the day: GLUE Test pin

Postby ijor » Wed Aug 24, 2016 1:17 pm

troed wrote:I've had an idea of creating a circuit that would read some output value of the ST and power cycle until it gets the "right" value - together with wakestate-detecting code in a bootsector. Thus allowing me to program a wanted wakestate value and then wait for the computer to happen into it.


LOL. Our recent email exchange gave me the idea of bringing this issue.

Yes, you could make a rather simple logic. Just assert TEST for a few cycles on RESET. That would randomly change the wakeup every time you press the reset button. Or, a more sophisticated design could actually select the desired wakestate. That would require some logic to sense the MMU phase.

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2034
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: Quiz of the day: GLUE Test pin

Postby calimero » Thu Aug 25, 2016 10:20 am

thanx for clarifications.

So you need hardware modification to be able to bring TEST pin up (5V) since this pin is grounded on ST, right? There is no way to do this in software?

"Wakestate" consequence did not appear on ST users until invention of Spectrum512 technique for displaying more colors, right?
What I am trying to say is that "wakestates" does not affect "normal" operation of ST (does not affect even non GEM programs), but it affects only high-end-optimized-cycle-precise routs in special cases; something that Atari probably did not consider to be ever exposed on ST :)
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

User avatar
troed
Atari God
Atari God
Posts: 1182
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Quiz of the day: GLUE Test pin

Postby troed » Thu Aug 25, 2016 11:26 am

calimero wrote:"Wakestate" consequence did not appear on ST users until invention of Spectrum512 technique for displaying more colors, right?


Actually "Spectrum 512 pixels" is another wakestate that I don't think is perfectly nailed down yet (unless it's in Ijor's latest Shifter findings). The GLUE-MMU wakestates denominated WS1-WS4 only affects fullscreens/sync scrollers and while they did affect early demos the commercialized sync scrollers all (I believe) worked around them using "wakestate safe" timings (without knowing that's what they were - back then we thought there were "random" fluctuations affecting such timings).

The only "normal" ST operation affected by wakestates is that graphics is physically shifted as to the exact location on the screen :D So, if you were to pinpoint the exact placement of pixels on your monitor, you would see that it can be in four different locations, differing by one pixel from eachother.

/Troed

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Quiz of the day: GLUE Test pin

Postby ijor » Thu Aug 25, 2016 1:05 pm

troed wrote:Actually "Spectrum 512 pixels" is another wakestate that I don't think is perfectly nailed down yet ...


That's something I yet have to test. I don't think I ever seen the issue.

What happens when it doesn't work? Does it happen on the actual Spectrum 512 program as well? Or only when you mix Spectrum 512 effects with full screen or syncscroll?

The only "normal" ST operation affected by wakestates is that graphics is physically shifted as to the exact location on the screen :D So, if you were to pinpoint the exact placement of pixels on your monitor, you would see that it can be in four different locations, differing by one pixel from eachother.


If you add the effect of Shifter wakestates, low rez pixels can be at 16 different positions! But differing each by just one quarter pixel only.

nbz
Atarian
Atarian
Posts: 6
Joined: Tue Nov 22, 2011 9:34 pm

Re: Quiz of the day: GLUE Test pin

Postby nbz » Thu Aug 25, 2016 1:53 pm

I actually felt slightly bad about my post. I mean, this was only my fourth post here, the last three were from 2011, and I'm coming into this expert's discussion, knowing nothing at all about hardware, posting some mischievous bullshit...

This is my second biggest facepalm while saying "ooohh Ataaahhriiiiiii" since discovering that the mere act of moving the mouse under TOS will cost roughly a third of CPU time due to a storm of interrupts (while the keyboard controller should've been able to provide mouse position info by polling it once a frame, ffs).

User avatar
troed
Atari God
Atari God
Posts: 1182
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Quiz of the day: GLUE Test pin

Postby troed » Thu Aug 25, 2016 2:24 pm

ijor wrote:
troed wrote:Actually "Spectrum 512 pixels" is another wakestate that I don't think is perfectly nailed down yet ...


That's something I yet have to test. I don't think I ever seen the issue.

What happens when it doesn't work? Does it happen on the actual Spectrum 512 program as well? Or only when you mix Spectrum 512 effects with full screen or syncscroll?


It's a persistent state (so, wakestate - power cycling is the only solution) where there's a pixels difference between graphics displayed on screen and when a palette change happens. So if you match palette changes vs graphics (like Spectrum 512 was the first to do) if you're pixel accurate in one state you might show black pixels in the other, the palette change hasn't "happened" when it "should". It happened with the release Spectrum 512 software, the manual basically said to power cycle if they happened.

In modern software (like Photochrome, and MPP I believe) there's thus the option to be "Spectrum 512 pixels safe" by making sure no palette switch is pixel perfect but has a one pixel buffer.

(It's not because of ST wakestates DE-to-LOAD differences - the issue is the same on STE)

trivia: One of the reasons {Closure} ran from my machine and not the compo machine at STNICCC 2015 is precisely because my own mega-optimized 50 palette-changes-per-scanline Photochrome display routine turned out to cause "Spectrum 512 pixels" on the compo machine. Fixed in the released version ...

fpgaarcade
Atari freak
Atari freak
Posts: 54
Joined: Thu Sep 20, 2007 10:06 pm
Location: Sweden

Re: Quiz of the day: GLUE Test pin

Postby fpgaarcade » Thu Aug 25, 2016 2:44 pm

The TEST pin is used as part of functional test. It's used to speed up the H/V counter testing during production.

It's combined with the reset pin to the counters

reset_test <= RESET and TEST

and the vertical counter

vertclk_test <= TEST xor VERTCLK

p_vs_cnt : process(reset_test, vertclk_test)
begin
if (reset_test = '1') then
vs_cnt <= (others => '1');
elsif rising_edge(vertclk_test) then
if vs_term then -- load
vs_cnt(0) <= '1'; -- lsb
vs_cnt(1) <= not (XMDE1 and NTSC);
vs_cnt(2) <= (XMDE1 and PAL);
vs_cnt(3) <= not (XMDE1 and PAL);
vs_cnt(4) <= XMDE1 and NTSC;
vs_cnt(5) <= XMDE1 and NTSC;
vs_cnt(6) <= XMDE1;
vs_cnt(7) <= XMDE1;
vs_cnt(8) <= '0';
else
vs_cnt <= vs_cnt + "1";
end if;
end if;
end process;

/Mike

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Quiz of the day: GLUE Test pin

Postby ijor » Thu Aug 25, 2016 4:09 pm

troed wrote:It's a persistent state (so, wakestate - power cycling is the only solution) where there's a pixels difference between graphics displayed on screen and when a palette change happens. So if you match palette changes vs graphics (like Spectrum 512 was the first to do) if you're pixel accurate in one state you might show black pixels in the other, the palette change hasn't "happened" when it "should". It happened with the release Spectrum 512 software, the manual basically said to power cycle if they happened.


It sounds a lot like Shifter wakestates.

(It's not because of ST wakestates DE-to-LOAD differences - the issue is the same on STE)


So this probably confirms that the STE has Shifter wakestates as well. It should.

ijor
Hardware Guru
Hardware Guru
Posts: 3028
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Quiz of the day: GLUE Test pin

Postby ijor » Thu Aug 25, 2016 4:11 pm

fpgaarcade wrote:It's used to speed up the H/V counter testing during production.
vertclk_test <= TEST xor VERTCLK


Yes, I forgot about that. Toggling the pin advances the V counter. So may be that's why they called it TEST, hard to know.

Anyway, it is also used as POR, and resets the 2MHZ counter as well, which does affect the wakestate. If they really used it for testing other wakeups or not, I of course have no idea.

reset_test <= RESET and TEST


You changed RESET polarity, I guess. Because it should be: (not RESET) and TEST.

vs_cnt(1) <= not (XMDE1 and NTSC);


That's your name or theirs? That's (XMDE1) how they call the REZolution shadow register, XMODE, I guess?

fpgaarcade
Atari freak
Atari freak
Posts: 54
Joined: Thu Sep 20, 2007 10:06 pm
Location: Sweden

Re: Quiz of the day: GLUE Test pin

Postby fpgaarcade » Thu Aug 25, 2016 6:57 pm

Correct. X means active low, well spotted!
RESET <= not XRESET; << IO pin

"That's (XMDE1) how they call the REZolution shadow register, XMODE, I guess?"
Yup


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests