I recently decided to try out some experiments with my Arduino and a GameBoy. First, I removed the crystal from the board and soldered a wire to the middle and top connection point and hooked them up to GND and the output of my waveform generator. As you can see by creating a similar 16MHz sine wave, the Arduino still works the same way as it did before.
But by for example decreasing the frequency to half of that, the PWM frequency also gets halved which proves that my waveform generator clock signal actually works. And fun fact the current draw dropped from 20mA at 16MHz to 16mA at 8MHz and the lowest clock frequency I was able to use in a somewhat stable manner was around 1kHz at a current draw of 12mA.
But enough with playing around because it was time to crank up the frequency and as you can see at around 25.6MHz the system still worked perfectly fine while delivering a 100kHz PWM signal. So I tried even higher frequencies and the limit I reached was at around 40MHz at which point the Arduino did not run stable anymore and glitched around.
In conclusion a 100kHz PWM Signal with 8bit resolution is easily achievable with an Arduino and we should look out for glitches in the next GameBoy test which signalize that we are reaching the overclocking limit. So time to unpack my tri wing screwdriver and start removing every screw I found in the enclosure of my GameBoy.
And after a couple of minutes I was in and next had a closer look at all the ICs and components. Now in my opinion this component might create our clock signal because the printed on label of 8.388 can very easily stand for the MHz value. So I powered the GameBoy with my lab bench power supply and probed all the pins of the component.
It seems like we are truly working with an 8.4MHz clock signal and by further finding out that there are only 2 slightly different signals distributed across all pins, it seems like we are looking at a crystal oscillator. But to apply my own altered signal I obviously had to somehow remove it which was possible with a bit of hot air and patience and as you can see we truly only got two pins to which I soldered extensions wires next to do the upcoming testing more easily.
Now of course at this point we could get ourselves such a crystal oscillator kit with a variety of frequencies that we could simply swap between for the limit testing. But I liked the fine adjustment of my waveform generator which is why I hooked it up to GND of the GameBoy and this time the lower pin and as you can see it works just fine.
Once again it was quite funny to decrease the clock frequency in order to find out how the game looks and sounds in slow motion mode. But as before going up was my goal and I am happy to report that twice the frequency of 16MHz was not a problem for the GameBoy which is actually a great speed to get through the game quickly.
Best of all there are 16MHz crystals everywhere so a simple mod like this with a switch and two crystals as modes is certainly possible. But anyway I wanted to see the limit and that seems to be just above 20MHz at which point the music glitched and the display turned off which basically concludes my experiments. So I restored the functionality of my GameBoy because it is a bit precious to me and I hope you maybe learned something through this video while hopefully being entertained.
If so consider supporting me through Patreon so that I can keep producing videos. As always don't forget to like, share, subscribe and hit the notification bell. Stay creative and I will see you next time.
WEBVTTKind: captionsLanguage: enLet me tell you what this GameBoy and this microcontroller board both have in common. Their main control chip is based on digital electronics meaning all information are stored as either a binary 1 or 0. And all the chip basically does is shifting the 1 and 0 from and to other registers to fulfill more complex functions like for example playing Pokemon. But while playing back in the days it always felt like the game speed was a bit too slow and luckily nowadays I am aware of a solution to increase this speed which is called overclocking. So in this video let me briefly explain what overclocking is, how we can use it with a microcontroller to actually make it more useful and finally explore the circuitry of my GameBoy to find out what the maximum overclocking limit is.Let's get started! This video is sponsored by Altium who offer probably the most professional PCB designer software on the market. It comes with all the functions you could ever need when it comes to not only designing a simple and quick PCB but also a very complex and demanding one. And best of all you can try their software out for free by clicking the link in the video description. So why not give it a shot?First off let's answer the question what overclocking is?As stated before a GameBoy or Microcontroller works by moving around 1 and 0 which electrically speaking is a high or low voltage signal. But how do they know when exactly they have to move the bits around and thus keeping all parts of the system in sync?Well, for that digital electronics pretty much always come with a clock signal which is basically a voltage signal with a defined frequency and two threshold values that tell the system when it is time to move on to the next bit. To understand this theory a bit better we can have a look at a practical component that generates such a clock signal which is this 4 pin oscillator. According to its datasheet it only requires 5V and GND applied to it in order to spit out our desired signal.So let's do just that with the help of my lab bench power supply and have a look at the output on the oscilloscope. As you can see we got a square wave whose on and off time is about the same and whose frequency is spot on 8MHz, definitely suitable as a clock signal. Now with a frequency of 8MHz it means that our digital electronics system moves new bits around every 125ns and thus it obviously can do a total of 8 Million of them in a second. And I think at this point it should be very clear how to speed things up by simply increasing this clock frequency and thus letting the system do more tasks per second. Of course all of this is not recommended by the manufacturer because with a higher clock frequency, the semiconductors have more to do in a second and thus requiring more current which can make things unstable and eventually even destroy everything but I guess that is what I want to find out. So as a first example I got my trusty Arduino Nano here which I often like to use to generate a high frequency PWM signal whose Duty Cycle I can fine adjust. Such voltage signals are suitable when it comes to for example building switched mode power supplies.But there is one big problem with my Arduino which is the reason why I actually used this Teensy microcontroller so far for this particular power supply I built during a previous video. By doing a bit of very simple Teensy programming we can set its frequency easily to 100kHz while still being able to fine adjust the duty cycle in 256 steps aka 8bit. The Arduino programming on the other hand is not only a bit harder to do but even by setting the timer to its optimal settings we can only reach a frequency of 62.5kHz while achieving a resolution of once again 8bit.So the problem is simply that my power supply design needs a switching frequency that the Teensy can deliver but not the Arduino, YET! Responsible for the clock signal of the Arduino is this small part right next to the microcontroller that apparently comes with 3 pins.So I did the most sensible thing by probing those three pins while the Arduino was running and it seems like the middle one is GND while the other two feature a sine voltage with a frequency of 16MHz. And yes this sine voltage is this time our clock signal and it is a sine voltage because it not only introduces less noise into our system but also because we are dealing with a crystal oscillator here.In comparison to the square wave oscillator we had a look at before which utilizes mostly discrete components, a crystal oscillator is basically a piezo element whose mechanical resonance frequency we take advantage off. Thus by building up a kind of electrical resonance circuit the crystal oscillates and thus helps us creating the clock signal which due to the nature of resonance comes as a sine wave. And since we know that the clock frequency is 16MHz, we can divide 16 Million by the 256 8bit steps to calculate the max PWM frequency which is of course the same as we measured. So according to the math we would need a clock signal of 25.6MHz to get a 100kHz PWM signal which we can surely try out by simply removing the crystal from the board, soldering a wire to the middle and top connection point and hooking them up to GND and the output of my waveform generator. As you can see by creating a similar 16MHz sine wave, the Arduino still works the same way as it did before. But by for example decreasing the frequency to half of that, the PWM frequency also gets halved which proves that my waveform generator clock signal actually works. And fun fact the current draw dropped from 20mA at 16MHz to 16mA at 8MHz and the lowest clock frequency I was able to use in a somewhat stable manner was around 1kHz at a current draw of 12mA. But enough with playing around because it was time to crank up the frequency and as you can see at around 25.6MHz the system still worked perfectly fine while delivering a 100kHz PWM signal. So I tried even higher frequencies and the limit I reached was at around 40MHz at which point the Arduino did not run stable anymore and glitched around. In conclusion a 100kHz PWM Signal with 8bit resolution is easily achievable with an Arduino and we should look out for glitches in the next GameBoy test which signalize that we are reaching the overclocking limit.So time to unpack my tri wing screwdriver and start removing every screw I found in the enclosure of my GameBoy.And after a couple of minutes I was in and next had a closer look at all the ICs and components. Now in my opinion this component might create our clock signal because the printed on label of 8.388 can very easily stand for the MHz value.So I powered the GameBoy with my lab bench power supply and probed all the pins of the component.It seems like we are truly working with an 8.4MHz clock signal and by further finding out that there are only 2 slightly different signals distributed across all pins, it seems like we are looking at a crystal oscillator. But to apply my own altered signal I obviously had to somehow remove it which was possible with a bit of hot air and patience and as you can see we truly only got two pins to which I soldered extensions wires next to do the upcoming testing more easily. Now of course at this point we could get ourselves such a crystal oscillator kit with a variety of frequencies that we could simply swap between for the limit testing. But I liked the fine adjustment of my waveform generator which is why I hooked it up to GND of the GameBoy and this time the lower pin and as you can see it works just fine. Once again it was quite funny to decrease the clock frequency in order to find out how the game looks and sounds in slow motion mode. But as before going up was my goal and I am happy to report that twice the frequency of 16MHz was not a problem for the GameBoy which is actually a great speed to get through the game quickly. Best of all there are 16MHz crystals everywhere so a simple mod like this with a switch and two crystals as modes is certainly possible. But anyway I wanted to see the limit and that seems to be just above 20MHz at which point the music glitched and the display turned off which basically concludes my experiments. So I restored the functionality of my GameBoy because it is a bit precious to me and I hope you maybe learned something through this video while hopefully being entertained. If so consider supporting me through Patreon so that I can keep producing videos. As always don't forget to like, share, subscribe and hit the notification bell. Stay creative and I will see you next time.