Overclocking


#1

As explained in the Pokitto Magazine volume 1, page 34, it is safe to set your Pokitto’s clockspeed to 72mhz by setting _OSCT=2. This can’t be done by making a #define in your code.

Here are instructions depending on which IDE you’re using (this is a wiki, feel free to add more):

  • PyInSky: Python games run at 72mhz by default.

  • FemtoIDE:
    Open project.json and add "-D_OSCT=2" to the Pokitto section in CPPFlags and CFlags.

  • Makefile:

C_FLAGS += '-D_OSCT=2'
CXX_FLAGS += '-D_OSCT=2'
  • Embitz: In project properties - build settings - defines tab, add _OSCT=2

  • PlatformIO: -D _OSCT=2 in build_flags in platformio.ini, e.g.

build_flags =
  -D _OSCT=2
  -std=c++11

Extra notes:

  • Overclocking has no effect on the Simulator.
  • The Emulator will increase the amount of instructions that it needs to execute per second, but if your computer can’t handle the extra work, overclocking will actually result in a slowdown.

#2

It can’t? It seems to be working for me (putting in My_settings.h). FPS is going way up.


#3

The FPS number goes up, but is it actually getting any faster?
The code that actually changes the speed is in mbed’s system file, which does not include My_settings.h.


#4

Not sure, I trusted the FPS :smiley: I’ll take a closer look at it.


#5

If in the #defines, the clock counter will speed up and the fps will appear faster. But for OSCT to actually affect the SysClock speed, it has to be given on the build settings


#6

I have a stupid question… would overclocking mess up the RTC time ?


#7

Not a stupid question at all

The RTC has its own 32kHz crystal exactly for these kind of reasons. It is independent of the core


#8

Maybe another stupid question: are there negative side effects by doing this overclocking? Or are there situations where you definitely would not want to use overclocking?


#9

sd card reading fails sometimes

sometimes there is a little noise on screen


#10

Ah the price of going ludicrous speed.


#11

Doesn’t it have an impact on the produced heat and consequently also on the lifespan of the pokitto?
Or is this effect very limited?


#12

The same core runs at 100Mhz in the LPC M4F dual-core (M4 & M0) chip.

72 Mhz is nothing for modern chips


#13

Ok nothing to worry about then :smile:


#14

I don’t fully understand how to do this in Embitz.
Where do you add this _OSCT=2?


#15

In project properties - build settings - defines tab


#16

If I go to project properties, there is no such thing as build settings

However there is a Project build options:

And here I do not find the defines tab…

Maybe I should be looking somewhere else?


#17

I do see a #defines tab on that screenshot…


#18

If I get chance I’ll look into improving the instructions and/or maybe finding a better way than doing it per-project, but I don’t really use EmBitz much anymore (partly because I got fed up with dealing with those build settings menus).


#19

Ok I have found it now… I was a bit confused by the # symbol, thinking that would result in a regular #define


#20

Technically it is a regular define,
but it has to be defined before the compiler even starts for the right library to see it and respond to it.

(Or that’s how I understood it anway.)

Putting it in the #define tab basically makes the IDE pass the right command line option to the compiler to make sure it’s defined at the start of compilation.