MSX Worldwide 7.16Mhz programming contest

by djh1697 on 02-04-2006, 17:51
Topic: MRC
Tags: Challenges
Languages:

MSX Worldwide have just launched a new MSX development challenge called the 7.16MHz programming contest. The goal of the challenge is to write an MSX-DOS program that calculates the current Z80 CPU speed

  • As fast as possible
  • As accurate as possible
  • In as little memory as possible
  • As original as possible

At the price of a small penalty, non-homebrew external hardware can be used as well. More information on this benchmarking challenge can be found on MSX worldwide

Relevant link: MSX worldwide

Comments (13)

By snout

Ascended (15187)

snout's picture

02-04-2006, 20:37

Nice idea! But... shouldn't it be a 'Z80/R800 benchmark'-challenge or something? I don't really see what 7.16Mhz has got to do with it, specifically...

By Manuel

Ascended (15204)

Manuel's picture

02-04-2006, 22:11

snout - well detecting R800 is very easy. Determining the exact clock frequency of a Z80 is a lot more interesting. E.g. my Sony HB-G900P runs on about 8MHz... I'm curious to see if any contribution to this competition can detect that properly.

By snout

Ascended (15187)

snout's picture

02-04-2006, 22:16

True that, but that still doesn't explain why the contest specifically mentions 7.16Mhz. Apart from the ordinary 3.5Mhz, lots of variations between ~4MHz and ~8Mhz are possible. Especially when msd starts disconnecting those wait pins ^_^ Tongue

By djh1697

Paragon (1380)

djh1697's picture

02-04-2006, 22:42

Would it it possible to read the internal real time clock, do some sort of loop, then re-read the internal clock?

The difference in the time could be used to determine the clock speed? Since the internal real time clock keeps the time what ever speed the CPU runs at, doesn't it?

By ARTRAG

Enlighted (6114)

ARTRAG's picture

03-04-2006, 01:34

You can use the VDP interruts for this, or the flag of vertical or horizzontal retrace

By mww

Supporter (8)

mww's picture

03-04-2006, 16:25

Hi snout ! manuel is right!
7.16 Mhz Contest is the name of the benchmark machine.
Your computer can also be 3,5 4 or 8 mhz whatever!
the point is to write a benchmark program which can read the exact cpu-speed!
For help with this the guys of #msxdev @t rizon.net offered their place for questions!
You can find me their as well as " MWW|Alex " ..

For more questions mail to 7mhz-contest@msxworldwide.com

Grtz Alex "Koetje MSX" Koedooder... MSX World Wide Magazine!

By mww

Supporter (8)

mww's picture

03-04-2006, 16:26

2nd line should be instead of
benchmark machine
benchmark contest!
sorry for the typo...

By flyguille

Prophet (3029)

flyguille's picture

03-04-2006, 18:47

interesting and hard to do!.

first, if you do that based on the VDP ints... there is the problem of to determine which NORM is running PAL/NTSC... and which PAL!... so in that way you can to know the vertical freq. A solution can be to measure the amount of VDP ints in one RTC second... but that makes that the program works only on MSX2 or higher or some MSX1...

To use the RTC directly to determine the CPU/clock is impossible because the RTC hasn't the accuracy needed. Because the SECOND register can to change everywhere in the code, and the routine to read is large.

And other thing, is the WAITstates .... that some MSXs has and others NO.

Surely between a range of tolerance can be done something close to the accuracy

By dvik

Prophet (2199)

dvik's picture

03-04-2006, 20:09

MSX Unleashed has quite advanced code to determine how many CPU cycles there are betweeen two VINT's (actually about 1/2 VINT but still...) based on many things, such as extra WAIT states, MSX Engine, M-CYCLES, PAL/NTSC, and genlock. With this knowledge its easy to determine the CPU frequency when compared to an external clock. But this is another big problem. The RTC crystal is probably not more accurate than the one used for driving the CPU. I'd guess that the Moonsound crystal is more exact simply because its 15 years newer. Anyone knows how accurate it is (or prehaps the MSX-AUDIO crystal) and is willing to share the info?

By flyguille

Prophet (3029)

flyguille's picture

03-04-2006, 20:41

is too mucho to take in account, but atleast one thing is as accuracy now as was 25 year ago when was invente... those are the quartz-osc is the electronic component of all... including accuracies clocks... the same used also in MSX. I not see accuracy problems about that component... the problems come that the RTC circuit has also calibrators to offset the quartz freq (a way to make the RTC more accuracy) because the quartz is accuracy in a short period count... imagine this... a 3.582056mhz cristal, (the one used in PAL-N) is acuracy, but needs a trimmer to calibrate it because the componet comes with a TOLERANCE... because the human be can't to manufacture something perfect always... so, the component can naturaly to oscilate some hrz of more or less... no big deal in short time period. But that tolerance about a RTC can on a WEEK (after trillions of tiks) to be unacuraccy in about 30seconds to put an example, and that about a month can be 15 min. and that is unnacuracy and bothers.

but in short terms, who cares if in between one seconds there is 1 or 5 hertz more or less. That is not significant on a meassure purpose.

By dvik

Prophet (2199)

dvik's picture

03-04-2006, 21:08

The frequency of the oscillator driving the Z80 is known (21.477MHz iirc) but the question is how accurate it is, right? The only way to find out is to compare it with a more accurate timer or compare it with the avarage of many not so accurate timers (rtc+msxaudio+moonsound+...).

By Accumulator

Supporter (16)

Accumulator's picture

08-04-2006, 16:08

You can calculate the speed by Scanning a particular interupt line and you know what cycles it takes to execute an instruction.....

By mww

Supporter (8)

mww's picture

08-04-2006, 19:07

I opened a forum topic on MRC.
So we can discuss here further the MWW contest.
http://www.msx.org/forumtopicl6099.html

My MSX profile