Login
Back to forumSee the full topicGo to last reply

Posted By

TLC
on 2011-02-28
16:16:12
 Re: Random for Real

He must be talking about the "timer stop condition fadeout" effect... at least that's what comes to mind.

Explaining that needs the knowledge of two basic things: 1.) how some of the internal flip-flops of the TED are implemented, and 2.) the way the TED timers are intended to work.

1.) -- some internal bits of the TED are implemented similar-ish to dynamic ram cells (ie. they need to be accessed from time to time in order to keep their state). The best known example is the internal state flip-flop of the TED sound generator (ie. the flip-flop toggled by the counter of the sound generator). Normally, this flip-flop is toggled at least once in 1024*4 single clock cycles. The special sound freq value of $03fe locks up the toggling logic, leaving the flip-flop without access for arbitrary time. Now, the flip-flop will "fadeout" in some 10 or 100msec, ultimately ending up in "1" state. It's possible to write a testprogram which reproduces the effect. Also, sampling the sound output while the fadeout happens will reveal some noise which very noticeably resembles the video timing's frequency components -- which is due to the fact that somewhere _inbetween_ the two stable states, the flip-flop floats, and its state will be interpreted as 0 or 1, depending on the interference received from the neighbouring circuits ie. the other subparts of the TED silicon die.

2.) TED timers can be programmed like this: write timer LO, then timer stops; then write timer HI, timer starts.

The trick here is similar to the previous one -- the flip-flop which inhibits the countdown of the TED timers is "dynamic". Ie. if you write timer LO and just shut up, then the timer will wait for a while -- and after some time, it'll start counting down eventually. This "some time" is highly non-predictable -- you can't really predict "when" the inhibiting flip-flop fades out, since it's an analog measure, depending on chip, voltage, temperature (...although it will likely kick in at around some typical position of the screen first, due to the fact that this moment will be "modulated" by the noise emitted by the TED circuits, similarly to the sound experiment).

I did experiment with this sometime a year and a half ago (if memory serves well). Polling the timer AFAIR didn't work, but setting an interrupt on the timer, and measuring the time spent until the IRQ hit using another timer just did.



Back to top


Copyright © Plus/4 World Team, 2001-2024