GP32 Setting Cpu Clock, The Unknown Parameter


SvOlli

Certified Guru
Joined
May 4, 2004
Messages
161
Location
Hannover, Germany
Website
svolli.org
Hi there,

for a music player I'm hacking on right now I want to set the CPU speed to something between 100 and 133 MHz. Since it's a music player I want to get the real sample rate as close to 44100Hz as possible. For that I want to experiment with the CPU speed settings.

Two of them are really easy to catch on. One is the CPU frequency (MCLK) itself, the other sets the other sets the dividers for HCLK and PCLK. But the third one is a mystery to me. It seems to be the one that's called PLLCON in the CPU docs. But how and what does it affect? I assume that this register is the one that I need to finetune to get as close to 44100Hz audio as possible.

Could anyone point me out to the docs / formulas needed to understand what this register affects and how?

Greetings,
SvOlli
 
You'll have to do a search, the post is buried pretty deep. I made my own library for overclocking in my obsolete overclocking tester (mirko's now replaces it):

http://www.gp32x.de/board/index.php?showtopic=5546

If I remember correctly, the third parameter is the RAM mode. Lower values can increase the speed accessing RAM, but can make things unstable if the CPU clock is set too high. Ram Mode 0 can go as high as around 80MHz without affecting stability, otherwise use Ram Mode 2. I'm reciting this from memory (haven't looked at the docs in a long while) so I might be wrong.
 
Last edited by a moderator:
I'm not sure if we're talking about the same thing.

For the call:
/* 132 MHZ, Ram Mode 2*/
GpClockSpeedChange(132000000, 0x24001, 2);

I understand the first and the third parameter, but not the second one. And from what I've seen in other people's code, there are slightly different values possible. So I want to know how to get the possible values for that parameter, so that I can try if and how they affect the sound rate.

Greetings,
SvOlli
 
Ahhh now I understand. I used to know the exact answer to this question, but I've since forgotten :( It's been discussed on these boards before, and I'm too lazy to search for the answer myself :p

However, I DO know where to get these values. You can get them from pllset, a program made by Samsung for their CPU. You can find it on spiv's site: http://www.cs.helsinki.fi/u/jikorhon/condev/gp32/
 
You're right, the second parameter does end up going in PLLCON but it's got 3 parts to it (the first two digits, the 3rd and 4th digits, and the 5 digit) and I'm too lazy to look up what they correspond to :)

Anyway, have a look at this thread, and definitely get pllset.
 
Last edited by a moderator:
Back
Top