GP2X Extreme Underclocking


A_SN

Active Member
Joined
Jun 8, 2006
Messages
899
Here's the thing, I have a game written that can run fine at 32 MHz, the lowest frequency I could stably make it run at. The thing is, it could run slower, but I don't know how to do.

Basically, it seems that we can play with 3 settings that make up the 32-bit register 0x910 (and not 0x808). Now we have some code on http://wiki.gp2x.org/wiki/CPU_Frequency we can use for that, only it's not telling us how we can change some of these settings for things to work better at frequencies <32 MHz.

Does anyone out here know how to deal with these 3 settings?
 
A_SN said:
Here's the thing, I have a game written that can run fine at 32 MHz, the lowest frequency I could stably make it run at. The thing is, it could run slower, but I don't know how to do.

Basically, it seems that we can play with 3 settings that make up the 32-bit register 0x808. Now we have some code on http://wiki.gp2x.org/wiki/CPU_Frequency we can use for that, only it's not telling us how we can change some of these settings for things to work better at frequencies <32 MHz.

Does anyone out here know how to deal with these 3 settings?



Haven't checked out the datasheet, but what does 0x808 have to do with it? It looks like an interrupt status register, not clock related.. do you mean 0x910? From this the lower limit should be something like 20MHz before it breaks, if it busts higher than that then perhaps there's a lower limit in hardware?

From what I see the algorithm at the bottom doesn't match up with the top values anyway. There are probably extra bits near the upper part of the halfword that do something else, and pdiv clearly corresponds to something too (maybe a fine adjustment), as well as scale (clearly a course adjustment).
 
Last edited by a moderator:
There is a simple formula for calculating output clock of a PLL:

// Fout = (m * Fin) / (p * 2^s)
// m = MDIV+8, p = PDIV+2, s = SDIV

Fin is input clock and is fixed to 7372800 (a crystal inside GP2X).
Fout is output clock for the CPUs.

So basically by adjusting MDIV, PDIV and SDIV you can get different output clocks. You can get the same output clock with multiple settings. You can play around to see how different PDIV,SDIV settings affect stability.
 
notaz said:
There is a simple formula for calculating output clock of a PLL:

// Fout = (m * Fin) / (p * 2^s)
// m = MDIV+8, p = PDIV+2, s = SDIV

Fin is input clock and is fixed to 7372800 (a crystal inside GP2X).
Fout is output clock for the CPUs.

So basically by adjusting MDIV, PDIV and SDIV you can get different output clocks. You can get the same output clock with multiple settings. You can play around to see how different PDIV,SDIV settings affect stability.
Now that's interesting. Do we know what works more or less good? By the way, I'm pretty confident we could add that whole formula to the wiki
 
Last edited by a moderator:
Thanks notaz, very informative as usual. Speaking of timings, did you ever work out the LCD refresh stuff?
 
I tried to run my menu application at 50Mhz, which worked for me, but people with different display settings couldn't get it running. Just a word of warning ;)
 
Exophase said:
Thanks notaz, very informative as usual. Speaking of timings, did you ever work out the LCD refresh stuff?
Yes, already used them in gpfce. But setting the refresh to 50/60Hz causes interlacing artifacts, so it's probably better to set it to 100/120Hz and sync to every other vsync pulse. But then, you get bottom-right pixel problem, which is better that interlacing IMO. Also, faint diagonal lines sometimes appear when using these settings (only happened a few times). Code to set to perfect (or near) 120.00Hz is already in MAME, I also have 100.00Hz settings is somebody needs them (will add to next PicoDrive release).
 
Last edited by a moderator:
notaz (or anyone else who'd happen to know), right now I can run the gp2x stably at about 13 MHz, but the screen becomes a huge jam, would you know how to deal with the lcd controller so that it doesn't happen?
 
Back
Top