Jekyll2023-04-15T16:51:08+00:00/feed.xmlNicolas ElectronicsSmall blog about my electronic and programming projects and ideas.Game Boy Oscilloscope, part 32021-01-24T22:00:00+00:002021-01-24T22:00:00+00:00/electronics/pcb%20design/kicad/game%20boy/oscilloscope/2021/01/24/Game-Boy-Oscilloscope-part-3<p><em>Recap:</em><br />
In the October/November magazine of Elektor 2000, there was an article from Steve Willis who made a cartridge for the Game Boy named GBDSO.<br />
This cartridge made the Game Boy into a 2 channel oscilloscope.</p>
<p>These are it’s key features :</p>
<ul>
<li>Dual trace display</li>
<li>Sampling Rate: DC to 1 Msps</li>
<li>Time Base: 100 s to 5 µs/Div</li>
<li>Inputs: AC/DC 1 MegOhm</li>
<li>Input gain: 50 mV to 10 V/Div</li>
<li>Line or chart recorder trace modes</li>
<li>Real-time FFT mode with dB scale</li>
<li>Variable persistence XY mode</li>
<li>PC link for screen or data transfer</li>
<li>5 hrs operation from NiMH batteries</li>
<li>Averaging and Auto trigger functions</li>
<li>Reference trace storage</li>
</ul>
<p>As you can see from the features, this thing is pretty damn cool.<br />
Who knew the Game Boy could do even half of it, let alone real-time FFT?</p>
<p>The GBDSO was a kit sold by Elektor, but because this project is old, they don’t seem to be selling it anymore.<br />
I’m interested in having one of these, so I thought: Why don’t I make one?</p>
<hr />
<p><br /></p>
<h2 id="dead-in-the-water">Dead in the water</h2>
<p>Having worked for a couple months on this project in 2019 and not getting the results I wanted I kind of left it to the side.<br />
As you might remember from part 2, I had a couple different issues with footprints and PCB design.</p>
<p>I wasn’t sure the EPROM survived all the soldering to be honest.</p>
<p>Some stuff happened in 2019 which made me put this project on pause.</p>
<hr />
<p><br /></p>
<h2 id="back-from-the-dead">Back from the dead</h2>
<p>In April and later in December 2020 I got to work on this again and fixed a few errors.</p>
<p>First thing I did was fix all the footprints to match the actual ICs I have.<br />
This was fairly easy to do.</p>
<p>The symbol for the DS1267 digital potentiometer had pin 12 and pin 13 swapped.<br />
This one came from the KiCad library which unfortunately contained the error and I didn’t double check it.<br />
I opened an issue with KiCad, fixed the symbol myself and made a pull request to get this fixed.</p>
<p>Next, I compared the schematic from the GBDSO article with mine and found a couple errors in mine.<br />
Here are a few of the errors I made on the schematic:</p>
<ul>
<li>BAV199 was connected to +5V instead of +5VA</li>
<li>A14 and A15 were switched on the 74HC138 demultiplexer</li>
<li>Voltage divider on TL072 wasn’t correct</li>
<li>The bias voltage on the digital pot had a capacitor in series instead of parallel</li>
</ul>
<p><img src="https://user-images.githubusercontent.com/8619921/78458906-4a8af400-76b5-11ea-833e-aecfa692e56c.png" /></p>
<p>Most errors are attributed to my inattentiveness while recreating the schematic and copy-pasting.</p>
<p>At this point I was confident about my schematic and board, so I ordered a new batch from JLCPCB.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/GBDSO/master/pictures/pcb-front.png" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/GBDSO/master/pictures/pcb-back.png" /></p>
<p>I really love the KiCad 3D view. Look how pretty the board is.</p>
<hr />
<p><br /></p>
<h2 id="third-times-a-charm">Third time’s a charm</h2>
<p>When I got the board from JLCPCB it looked exactly like the 3D model.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/GBDSO/master/pictures/pcb-v2.jpeg" /></p>
<p>I did a visual inspection and everything looked nice.<br />
Only thing left is to populate the board, so I got my red GBDSO and started salvaging all components from there and putting them on the blue board.</p>
<p>When I got to the AT27C256R I put it in my TL866II+ and read it’s content to see if it still worked and to have a backup just in case.<br />
I also compared it to the bin file that’s floating around the internet named something like GBDSO v3.6, and that’s exactly the same as mine.</p>
<p>I managed to get all the components except for the DS1267 digital pot and the MAX114 ADC.<br />
If you remember in part 2, I had to bend the pins inwards to get it soldered on the incorrect footprint.<br />
I haven’t tried, but if I were to bend the pins back I’m sure they would just break.</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (3).jpg" alt="Assembly 2" /></p>
<p>Anyways, once everything was soldered I did a visual inspection and a short circuit inspection.</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/pcb-v2-assembled.jpeg" /></p>
<p>Everything looked like it was going to work, so I put it back in the cartridge and plugged it into my Game Boy.<br />
I was greeted with the oh so familiar Nintendo ping sound and then the GBDSO menu.</p>
<p>After playing around a bit with it I didn’t see anything wrong with the channels like I did on my red board.</p>
<p>Here’s a picture of me measuring the same square wave on channel 1 and channel 2 on different timebases:</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/channel_a.jpg" /></p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/channel_b.jpg" /></p>
<p>I’m so glad it’s finally working. I probably could have gotten it to work in 2019 if I had percevered a bit more, but oh well…</p>
<p>I’ve shared it amongst friends and different social media platforms and the reactions were always nice, which is good to see.</p>
<hr />
<p><br /></p>
<h2 id="elektor-release-the-bin-file">Elektor, release the bin file</h2>
<p>When I first started this project I talked with a few people from Elektor to get them to release the EPROM file, which they were discussing.<br />
I even went so far as contacting the original designer, Steve Willis, to see if he would be willing to release the files.<br />
He agreed with me that open sourcing the project now would be a great idea, but as Elektor bought the design from him, he still felt olbigated to Elektor not to release any files without their consent.<br />
What he also said was that if Elektor would be happy to release the files he’d be happy too.</p>
<p>Now that the project was pretty much all done, <a href="https://twitter.com/pyroesp/status/1347624366142595080">I tweeted Elektor to see if they were willing to release the bin file</a>.<br />
They’re not sure they still have the bin file but all I need is their consent and I can put my backup on the github repository.</p>
<p>As of the time of writing this post I haven’t had a positive reply, so let’s hope for the best!</p>
<p>That’s all for this project, for now at least.<br />
I’ll update this whenever Elektor consents or not to releasing the bin file.</p>Recap: In the October/November magazine of Elektor 2000, there was an article from Steve Willis who made a cartridge for the Game Boy named GBDSO. This cartridge made the Game Boy into a 2 channel oscilloscope. These are it’s key features : Dual trace display Sampling Rate: DC to 1 Msps Time Base: 100 s to 5 µs/Div Inputs: AC/DC 1 MegOhm Input gain: 50 mV to 10 V/Div Line or chart recorder trace modes Real-time FFT mode with dB scale Variable persistence XY mode PC link for screen or data transfer 5 hrs operation from NiMH batteries Averaging and Auto trigger functions Reference trace storage As you can see from the features, this thing is pretty damn cool. Who knew the Game Boy could do even half of it, let alone real-time FFT? The GBDSO was a kit sold by Elektor, but because this project is old, they don’t seem to be selling it anymore. I’m interested in having one of these, so I thought: Why don’t I make one? Dead in the water Having worked for a couple months on this project in 2019 and not getting the results I wanted I kind of left it to the side. As you might remember from part 2, I had a couple different issues with footprints and PCB design. I wasn’t sure the EPROM survived all the soldering to be honest. Some stuff happened in 2019 which made me put this project on pause. Back from the dead In April and later in December 2020 I got to work on this again and fixed a few errors. First thing I did was fix all the footprints to match the actual ICs I have. This was fairly easy to do. The symbol for the DS1267 digital potentiometer had pin 12 and pin 13 swapped. This one came from the KiCad library which unfortunately contained the error and I didn’t double check it. I opened an issue with KiCad, fixed the symbol myself and made a pull request to get this fixed. Next, I compared the schematic from the GBDSO article with mine and found a couple errors in mine. Here are a few of the errors I made on the schematic: BAV199 was connected to +5V instead of +5VA A14 and A15 were switched on the 74HC138 demultiplexer Voltage divider on TL072 wasn’t correct The bias voltage on the digital pot had a capacitor in series instead of parallel Most errors are attributed to my inattentiveness while recreating the schematic and copy-pasting. At this point I was confident about my schematic and board, so I ordered a new batch from JLCPCB. I really love the KiCad 3D view. Look how pretty the board is. Third time’s a charm When I got the board from JLCPCB it looked exactly like the 3D model. I did a visual inspection and everything looked nice. Only thing left is to populate the board, so I got my red GBDSO and started salvaging all components from there and putting them on the blue board. When I got to the AT27C256R I put it in my TL866II+ and read it’s content to see if it still worked and to have a backup just in case. I also compared it to the bin file that’s floating around the internet named something like GBDSO v3.6, and that’s exactly the same as mine. I managed to get all the components except for the DS1267 digital pot and the MAX114 ADC. If you remember in part 2, I had to bend the pins inwards to get it soldered on the incorrect footprint. I haven’t tried, but if I were to bend the pins back I’m sure they would just break. Anyways, once everything was soldered I did a visual inspection and a short circuit inspection. Everything looked like it was going to work, so I put it back in the cartridge and plugged it into my Game Boy. I was greeted with the oh so familiar Nintendo ping sound and then the GBDSO menu. After playing around a bit with it I didn’t see anything wrong with the channels like I did on my red board. Here’s a picture of me measuring the same square wave on channel 1 and channel 2 on different timebases: I’m so glad it’s finally working. I probably could have gotten it to work in 2019 if I had percevered a bit more, but oh well… I’ve shared it amongst friends and different social media platforms and the reactions were always nice, which is good to see. Elektor, release the bin file When I first started this project I talked with a few people from Elektor to get them to release the EPROM file, which they were discussing. I even went so far as contacting the original designer, Steve Willis, to see if he would be willing to release the files. He agreed with me that open sourcing the project now would be a great idea, but as Elektor bought the design from him, he still felt olbigated to Elektor not to release any files without their consent. What he also said was that if Elektor would be happy to release the files he’d be happy too. Now that the project was pretty much all done, I tweeted Elektor to see if they were willing to release the bin file. They’re not sure they still have the bin file but all I need is their consent and I can put my backup on the github repository. As of the time of writing this post I haven’t had a positive reply, so let’s hope for the best! That’s all for this project, for now at least. I’ll update this whenever Elektor consents or not to releasing the bin file.Sega Saturn racing wheel as PC controller2020-12-26T08:00:00+00:002020-12-26T08:00:00+00:00/electronics/reverse%20engineering/sega%20saturn/modification/2020/12/26/Sega-Saturn-racing-wheel-as-PC-controller<p>With the addition of the Sega Saturn to my consoles collection I also acquired a Saturn racing controller.</p>
<p>Around the time I got it oh_bother was testing his awesome force feedback steering wheel on Wreckfest.</p>
<p><strong>You definitely need to check <a href="https://www.twitch.tv/oh_bother">his twitch channel</a> if you enjoy electronics/mechanics stuff.</strong></p>
<p>Not having any racing games, yet, for the Sega Saturn I thought it would be cool to make it into a peripheral for the PC and play with oh_bother and the guys from discord.</p>
<p>And thus the next project was decided!</p>
<p>Below you can see a demo of the steering wheel working on wreckfest:<br />
<a href="https://www.youtube.com/watch?v=E5IDyN7Fv7s"><img src="https://img.youtube.com/vi/E5IDyN7Fv7s/0.jpg" alt="Demo Sega Saturn PC controller" /></a></p>
<p>You can find everything on the <a href="https://github.com/pyroesp/Saturn-Racing-PC">Sega Saturn racing steering wheel repo on my github</a>.</p>
<hr />
<p><br /></p>
<h3 id="saturn-racing-controller-hardware">Saturn racing controller hardware</h3>
<p>So first things first is take the controller apart.<br />
<img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20PCB%201.jpg" alt="saturn controller pcb 1" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20PCB%202.jpg" alt="saturn controller pcb 2" /></p>
<p>There’s a couple wires for the buttons going to the PCB.<br />
The interesting thing is how they read the position of the steering wheel. It looks like an encoder.<br />
<img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20encoder%201.jpg" alt="saturn controller IR" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20encoder%202.jpg" alt="saturn controller encoder" /></p>
<p>The board has a two IR receivers/transmitters that look through the little holes of the steering wheel.<br />
These generate pulses for the controller chip which uses it to know the position of the steering wheel.</p>
<p>Here’s the proprietary Sega chip on the board. Of course no info on the internet.
<img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20encoder%202.jpg" alt="saturn controller proprietary chip" /></p>
<h3 id="communication-reverse-engineering">Communication reverse engineering</h3>
<p>Next thing to do was reverse engineer how the steering wheel actually works.<br />
I added a few header pins on the cable going to the Saturn so I can probe the channels with my beautiful HP54645D.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20PCB%20Logic%20Analyzer%201.jpg" alt="reversing 1" /></p>
<p>After playing around with the steering wheel I rearranged the data on the scope to something more logical.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20PCB%20Logic%20Analyzer%202.jpg" alt="reversing 2" /></p>
<p>At first glance you can see some sort of chip select at the top, bit 1.<br />
Then we have what looks like two clocks on bit 0 and bit 4.
Turns out the clock on bit 0 is actually a ‘request data’ from the Sega Saturn to the controller.<br />
The clock on bit 4 is a ‘data ready’ signal from the controller to the Sega Saturn.</p>
<p>Bit 2, 3, 6 and 7 are data bits, which I’ve confirmed by turning the wheel and looking at the data changing. Also, when pressing buttons on the controller there are low pulses appearing on those signals.</p>
<p>Bit 5 is just vcc on the PCB.</p>
<p>Looking more into the location of pressed buttons in relation with the ‘request data’ and ‘data ready’ signal we can see that a data request happens on both falling and rising edge.<br />
This means we have 10 packets of 4 bits sent from the controller to the Saturn.</p>
<p>The controller has a 9 buttons: UP, DOWN, A, B, C, X, Y, Z and START. The steering is also data sent to the Saturn.<br />
Playing around with these buttons we can figure out their location in the packets:</p>
<ul>
<li>packet 0: unknown data (possibly controller ID ?)</li>
<li>packet 1: unknown data (possibly controller ID ?)</li>
<li>packet 2: DOWN - UP - unknown - unknown</li>
<li>packet 3: B - C - A - START</li>
<li>packet 4: Z - Y - X - unknown</li>
<li>packet 5: unknown data</li>
<li>packet 6: high nibble steering wheel position</li>
<li>packet 7: low nibble steering wheel position</li>
<li>packet 8: unknown data</li>
<li>packet 9: unknown data</li>
</ul>
<p>The steering wheel position is an unsigned byte so a value from 0 to 255.<br />
The center position resets the byte to 127, which is also what you see on the scope.</p>
<hr />
<p><br /></p>
<h3 id="connecting-to-the-pc">Connecting to the PC</h3>
<p>To connect to the PC I used an arduino pro micro which you can find tons of examples on making a USB device with.<br />
It also has enough I/O for connecting to the steering wheel.</p>
<p>I want to be able to use the steering wheel on the PC and on the Saturn.<br />
To do that I want to have two cables I can change with minimal effort.<br />
One cable would have the arduino pro micro on it, and the other is the original cable.</p>
<p>I wired a DB9 connector on the PCB.<br />
The cable for the arduino pro micro and the original cable both got a DB9 connector too.<br />
So now I can plug the arduino pro micro cable when I want to play on the PC and plug the original cable when I want to use it on the Saturn.</p>
<p>Here’s a schematic that shows how it’s all connected:<br />
<img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/arduino%20pro%20micro/Schematic/Schematic.png" alt="reversing 2" /></p>
<p>And here are a few pictures of the hardware:</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Arduino%20Pro%20Micro%20cable.jpg" alt="arduino pro micro plug" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20new%20wiring%202.jpg" alt="reversing 1" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/Saturn-Racing-PC/main/pics/Saturn%20Racing%20Controller%20new%20wiring%201.jpg" alt="db9 plug 2" /></p>
<p>I used DB9 connectors because that’s what I had on hand, but I’d love to have a fancy round connector.<br />
Maybe something like a DIN plug would work nicely here.</p>
<hr />
<p><br /></p>
<h3 id="arduino-pro-micro-code">Arduino Pro Micro code</h3>
<p>I’ve tried adding a few comments here and there to make it easier to understand.</p>
<p>The Saturn controller part uses a few helper functions and a special structure:</p>
<pre><code class="language-C">// Controller Structure
typedef struct{
int16_t x;
union{
uint16_t buttons;
struct{
uint8_t btn_a: 1;
uint8_t btn_b: 1;
uint8_t btn_c: 1;
uint8_t btn_x: 1;
uint8_t btn_y: 1;
uint8_t btn_z: 1;
uint8_t btn_start: 1;
uint8_t btn_up: 1;
uint8_t btn_down: 1;
uint8_t unused: 7;
};
};
}SaturnRacing;
// Initialize controller structure and I/O
void controllerInit(SaturnRacing *ctrl);
// Read controller data (ie. do the controller protocol magic here)
void controllerRead(SaturnRacing *ctrl);
// Used by controllerRead to make the controller protocol)
void controllerEnable(void);
void controllerDisable(void);
void controllerSendReadRequest(void);
void controllerRequestToIdle(void);
void controllerWaitForDataReady(void);
</code></pre>
<p>The structure contains an <code class="language-plaintext highlighter-rouge">x</code>-value which is the position of the steering wheel.<br />
It also has a button word, which is then separated further into the individual button bits on the controller.</p>
<p>The controller functions are there to initialize the structure, reading the buttons and the steering wheel position.</p>
<p>The actual USB stuff uses the <a href="https://github.com/MHeironimus/ArduinoJoystickLibrary">ArduinoJoystickLibrary</a> which is super easy to use.</p>
<p>Just create a Joystick variable with whatever settings you want.</p>
<pre><code class="language-C">// Global joystick variable/object from Joystick library
Joystick_ j(
JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK,
9, 0, // Button Count, Hat Switch Count
true, true, false, // X on, Y on, Z off
false, false, false, // No Rx, Ry, or Rz
false, false, // No rudder or throttle
false, false, false // accelerator off, brake off, steering off
);
</code></pre>
<p>And initialize it in the <code class="language-plaintext highlighter-rouge">setup()</code> function of the arduino.</p>
<p>The main loop can be split into two parts:</p>
<ul>
<li>Reading controller data with <code class="language-plaintext highlighter-rouge">controllerRead(&controller)</code></li>
<li>Setting the USB data of the joystick structure.</li>
</ul>
<pre><code class="language-C">void loop() {
controllerRead(&controller); // Read controller status
j.setXAxis(controller.x); // Set USB joystick X position
j.setYAxis(127); // Set USB joystick Y position (probably not needed)
// Set USB controller buttons
j.setButton(0, controller.btn_a);
j.setButton(1, controller.btn_b);
j.setButton(2, controller.btn_c);
j.setButton(3, controller.btn_x);
j.setButton(4, controller.btn_y);
j.setButton(5, controller.btn_z);
j.setButton(6, controller.btn_up);
j.setButton(7, controller.btn_down);
j.setButton(8, controller.btn_start);
}
</code></pre>
<p>And that’s it.</p>
<p>All that’s left is plugging it into the PC and setting up the buttons in whatever game you want to use this into.</p>With the addition of the Sega Saturn to my consoles collection I also acquired a Saturn racing controller. Around the time I got it oh_bother was testing his awesome force feedback steering wheel on Wreckfest. You definitely need to check his twitch channel if you enjoy electronics/mechanics stuff. Not having any racing games, yet, for the Sega Saturn I thought it would be cool to make it into a peripheral for the PC and play with oh_bother and the guys from discord. And thus the next project was decided! Below you can see a demo of the steering wheel working on wreckfest: You can find everything on the Sega Saturn racing steering wheel repo on my github. Saturn racing controller hardware So first things first is take the controller apart. There’s a couple wires for the buttons going to the PCB. The interesting thing is how they read the position of the steering wheel. It looks like an encoder. The board has a two IR receivers/transmitters that look through the little holes of the steering wheel. These generate pulses for the controller chip which uses it to know the position of the steering wheel. Here’s the proprietary Sega chip on the board. Of course no info on the internet. Communication reverse engineering Next thing to do was reverse engineer how the steering wheel actually works. I added a few header pins on the cable going to the Saturn so I can probe the channels with my beautiful HP54645D. After playing around with the steering wheel I rearranged the data on the scope to something more logical. At first glance you can see some sort of chip select at the top, bit 1. Then we have what looks like two clocks on bit 0 and bit 4. Turns out the clock on bit 0 is actually a ‘request data’ from the Sega Saturn to the controller. The clock on bit 4 is a ‘data ready’ signal from the controller to the Sega Saturn. Bit 2, 3, 6 and 7 are data bits, which I’ve confirmed by turning the wheel and looking at the data changing. Also, when pressing buttons on the controller there are low pulses appearing on those signals. Bit 5 is just vcc on the PCB. Looking more into the location of pressed buttons in relation with the ‘request data’ and ‘data ready’ signal we can see that a data request happens on both falling and rising edge. This means we have 10 packets of 4 bits sent from the controller to the Saturn. The controller has a 9 buttons: UP, DOWN, A, B, C, X, Y, Z and START. The steering is also data sent to the Saturn. Playing around with these buttons we can figure out their location in the packets: packet 0: unknown data (possibly controller ID ?) packet 1: unknown data (possibly controller ID ?) packet 2: DOWN - UP - unknown - unknown packet 3: B - C - A - START packet 4: Z - Y - X - unknown packet 5: unknown data packet 6: high nibble steering wheel position packet 7: low nibble steering wheel position packet 8: unknown data packet 9: unknown data The steering wheel position is an unsigned byte so a value from 0 to 255. The center position resets the byte to 127, which is also what you see on the scope. Connecting to the PC To connect to the PC I used an arduino pro micro which you can find tons of examples on making a USB device with. It also has enough I/O for connecting to the steering wheel. I want to be able to use the steering wheel on the PC and on the Saturn. To do that I want to have two cables I can change with minimal effort. One cable would have the arduino pro micro on it, and the other is the original cable. I wired a DB9 connector on the PCB. The cable for the arduino pro micro and the original cable both got a DB9 connector too. So now I can plug the arduino pro micro cable when I want to play on the PC and plug the original cable when I want to use it on the Saturn. Here’s a schematic that shows how it’s all connected: And here are a few pictures of the hardware: I used DB9 connectors because that’s what I had on hand, but I’d love to have a fancy round connector. Maybe something like a DIN plug would work nicely here. Arduino Pro Micro code I’ve tried adding a few comments here and there to make it easier to understand. The Saturn controller part uses a few helper functions and a special structure: // Controller Structure typedef struct{ int16_t x; union{ uint16_t buttons; struct{ uint8_t btn_a: 1; uint8_t btn_b: 1; uint8_t btn_c: 1; uint8_t btn_x: 1; uint8_t btn_y: 1; uint8_t btn_z: 1; uint8_t btn_start: 1; uint8_t btn_up: 1; uint8_t btn_down: 1; uint8_t unused: 7; }; }; }SaturnRacing; // Initialize controller structure and I/O void controllerInit(SaturnRacing *ctrl); // Read controller data (ie. do the controller protocol magic here) void controllerRead(SaturnRacing *ctrl); // Used by controllerRead to make the controller protocol) void controllerEnable(void); void controllerDisable(void); void controllerSendReadRequest(void); void controllerRequestToIdle(void); void controllerWaitForDataReady(void); The structure contains an x-value which is the position of the steering wheel. It also has a button word, which is then separated further into the individual button bits on the controller. The controller functions are there to initialize the structure, reading the buttons and the steering wheel position. The actual USB stuff uses the ArduinoJoystickLibrary which is super easy to use. Just create a Joystick variable with whatever settings you want. // Global joystick variable/object from Joystick library Joystick_ j( JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK, 9, 0, // Button Count, Hat Switch Count true, true, false, // X on, Y on, Z off false, false, false, // No Rx, Ry, or Rz false, false, // No rudder or throttle false, false, false // accelerator off, brake off, steering off ); And initialize it in the setup() function of the arduino. The main loop can be split into two parts: Reading controller data with controllerRead(&controller) Setting the USB data of the joystick structure. void loop() { controllerRead(&controller); // Read controller status j.setXAxis(controller.x); // Set USB joystick X position j.setYAxis(127); // Set USB joystick Y position (probably not needed) // Set USB controller buttons j.setButton(0, controller.btn_a); j.setButton(1, controller.btn_b); j.setButton(2, controller.btn_c); j.setButton(3, controller.btn_x); j.setButton(4, controller.btn_y); j.setButton(5, controller.btn_z); j.setButton(6, controller.btn_up); j.setButton(7, controller.btn_down); j.setButton(8, controller.btn_start); } And that’s it. All that’s left is plugging it into the PC and setting up the buttons in whatever game you want to use this into.PlayStation 1 pedal controller2020-12-26T00:40:00+00:002020-12-26T00:40:00+00:00/electronics/reverse%20engineering/playstation/modification/2020/12/26/PlayStation-pedal-controller<p>After working on the reset mod I got back into playing Time Crisis on the PlayStation.<br />
I really wanted to play with a pedal button just like on the arcades.<br />
I had read somewhere that you could put a 2nd controller in the PlayStation and step on it and it would work like a pedal button just like on the arcades.</p>
<p>Stepping on a controller was annoying though, so I made a custom pedal controller.</p>
<p>Here’s a demo of the pedal.<br />
<a href="https://www.youtube.com/watch?v=5PXXQ49MqOc"><img src="https://img.youtube.com/vi/5PXXQ49MqOc/0.jpg" alt="Demo PlayStation pedal controller" /></a></p>
<hr />
<p><br /></p>
<h3 id="feikcontroller">feikController</h3>
<p>I dubbed the project feikController, as in fake controller -I know very clever-, because it’s obviously not an official controller.<br />
The code is also more of a proof of concept for making a PlayStation 1 controller.<br />
This fake controller just has one button, the pedal, and it’s set to the ‘X’ button.</p>
<p>It uses the same 16F18325 PIC microcontroller as the PlayStation reset mod.<br />
The PCB is pretty much identical to it, except for a few layout changes and extra pads for the button input.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/feikController/master/pics/pcb-front.PNG" alt="pedal pcb-front" /><br />
<img src="https://raw.githubusercontent.com/pyroesp/feikController/master/pics/pcb-back.PNG" alt="pedal pcb-back" /><br />
<img src="https://raw.githubusercontent.com/pyroesp/feikController/master/pics/schematic.PNG" alt="pedal schematic" /></p>
<p>*Note that I haven’t actually tested the PCB. I’ve used a leftover reset mod PCB.</p>
<hr />
<p><br /></p>
<h3 id="communication">Communication</h3>
<p>I’m pretty sure I already talked about the PlayStation communication in one of the previous posts, so I’ll let you look at those. I’m just going to recap how it works here.</p>
<p>The PlayStation uses some sort of SPI interface to access the memory card and controllers with two chip select lines.<br />
All devices are connected to the same SPI bus which contains: command (CMD), data, acknowledge (ACK) and two chip select lines.</p>
<p>Controller 1 and memory card 1 share the same chip select line and are further differentiated by an address sent by the PlayStation on the command line. Idem for controller 2 and memory card 2 but for the other chip select.</p>
<p>Every byte received from the PlayStation, ie. for every CMD, we also need to send an ACK pulse.</p>
<p>You can see a logic analyzer picture below showing a frame of communication with a guncon.<br />
<img src="/assets/2018-06-14-shooting-bad-guys-2/LA-GUNCON-1.png" alt="GUNCON Logic Analyzer - Shooting Outside of screen" /></p>
<hr />
<p><br /></p>
<h3 id="code">Code</h3>
<p>I’m using the same structure from the reset mod.<br />
This helps me read the commands, differentiate between the memory card and controller, and have a data buffer ready to send.</p>
<pre><code class="language-C">/* PlayStation Controller Command Union */
union PS1_Cmd{
uint8_t buff[PS1_CTRL_BUFF_SIZE];
struct{
uint8_t device_select; // 0x01 or 0x81
uint8_t command; // 0x42 for read switch
uint8_t unused[PS1_CTRL_BUFF_SIZE-2]; // always 0 for controller
};
};
/* PlayStation Controller Data Union */
union PS1_Ctrl_Data{
uint8_t buff[PS1_CTRL_BUFF_SIZE + 1]; // buffer to read data
struct{
uint8_t unused1; // always 0xFF
uint8_t id_lo; // id lo
uint8_t id_hi; // id hi
uint8_t keys_lo; // keys lo
uint8_t keys_hi; // keys hi
uint8_t unused2; // always 0xFF
};
};
</code></pre>
<p>Sending data and receiving commands to and from the PlayStation happens with the SPI module of th 16F18325.<br />
An interrupt is used to determine if the PlayStation is trying to read controller data or memory card data.<br />
If it’s memory card data then our SPI module is disabled until the chip select is high, which indicates that the PlayStation finished reading data out of the memory card.<br />
If it’s the controller then the content of the data buffer is sent byte by byte.</p>
<p>Because we still need to send an ACK and don’t want to pause in an interrupt, I set a flag high that will execute a piece of code in the main loop.</p>
<pre><code class="language-C">// Send Ack to PlayStation
if (send_ack){
// Set the ACK pin to an output, LAT already to 0
CLR_BIT(ACK_TRIS, ACK_OUTPUT);
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns - 500ns
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns - 1us
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns - 1.5us
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns - 2us
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns
NOP(); // 125ns - 2.5us
SET_BIT(ACK_TRIS, ACK_OUTPUT); // Set ACK pin back to input
send_ack = 0;
}
</code></pre>
<p>In this bit of code I’m setting a pin to an output LOW and waiting a bit with NOPs, then turning the pin back to an input as to not interfere with the other devices on the bus.</p>
<p>I’m using NOPs here because I need a very quick pulse of at least 2us.</p>
<p>Reading the button is just a matter of toggling the correct bit in the key status bytes.</p>
<pre><code class="language-C">// Read pedal switch status
if (GET_BIT(PEDAL_PORT, PEDAL_INPUT) != PEDAL_BUTTON_MODE){
#if (PEDAL_BUTTON > 7)
CLR_BIT(data.keys_hi, (PEDAL_BUTTON - 8));
#else
CLR_BIT(data.keys_lo, PEDAL_BUTTON);
#endif
}else{
data.keys_hi = CONTROLLER_BUTTON_RESET;
data.keys_lo = CONTROLLER_BUTTON_RESET;
}
</code></pre>
<p>I’ve set the code up so that you can use either a normal open or normal closed button.<br />
You just need to set the button up with the defines first.</p>
<p>You need 2 bytes to represent all the controller buttons.<br />
Depending on which controller button you want to press through the pedal, you need to clear/set the correct bit in these bytes.<br />
That’s why there is a check to see if <code class="language-plaintext highlighter-rouge">PEDAL_BUTTON</code> is higher than 7.</p>
<p>You can find the bit position for each button in the includes and here:</p>
<pre><code class="language-C">/* Controller Buttons */
#define BUTTON_SELECT 0
#define BUTTON_L3 1
#define BUTTON_R3 2
#define BUTTON_START 3
#define BUTTON_UP 4
#define BUTTON_RIGHT 5
#define BUTTON_DOWN 6
#define BUTTON_LEFT 7
#define BUTTON_L2 8
#define BUTTON_R2 9
#define BUTTON_L1 10
#define BUTTON_R1 11
#define BUTTON_TRIANGLE 12
#define BUTTON_CIRCLE 13
#define BUTTON_CROSS 14
#define BUTTON_SQUARE 15
</code></pre>
<p>The whole code is up <a href="https://github.com/pyroesp/feikController">on the feikController repo on github</a>, go check it out for more info.</p>
<hr />
<p><br /></p>
<h3 id="making-of">Making of</h3>
<p>If you want to look at me struggling to make this then I have a playlist of the stream VODs up on youtube:<br />
<a href="https://www.youtube.com/watch?v=J5fQKmc8AMY&list=PLGaX4WJGgdHhcbQUQQJR6zFgzyka-xVOa"><img src="https://img.youtube.com/vi/J5fQKmc8AMY/0.jpg" alt="Making of: PlayStation 1 pedal controller" /></a></p>
<hr />
<p><br /></p>
<h3 id="other-methods">Other methods</h3>
<p>For those that think this is a bit overkill for just emulating one button of a PlayStation controller, you are correct.</p>
<p>As mentioned before this is more of a proof of concept to make a controller, not specifically for just one button, but that’s the application I needed it for.</p>
<p>An easier way to make a custom controller is modifying an existing controller, but this was not the purpose of the project.</p>
<hr />
<p><br /></p>
<h3 id="future">Future</h3>
<p>I’m confident I can emulate whatever peripheral I want on the PlayStation 1 now.</p>
<p>With that said, I kind of want to make a TAS tool for the PlayStation but haven’t really put much thought into it.<br />
I’m sure I’ll need to connect the TAS controller to a PC but don’t know yet what communication to use and what data will be transmitted.</p>
<p>I’ve put that idea on the todo-list. Who knows, maybe I’ll come up with something eventually.</p>After working on the reset mod I got back into playing Time Crisis on the PlayStation. I really wanted to play with a pedal button just like on the arcades. I had read somewhere that you could put a 2nd controller in the PlayStation and step on it and it would work like a pedal button just like on the arcades. Stepping on a controller was annoying though, so I made a custom pedal controller. Here’s a demo of the pedal. feikController I dubbed the project feikController, as in fake controller -I know very clever-, because it’s obviously not an official controller. The code is also more of a proof of concept for making a PlayStation 1 controller. This fake controller just has one button, the pedal, and it’s set to the ‘X’ button. It uses the same 16F18325 PIC microcontroller as the PlayStation reset mod. The PCB is pretty much identical to it, except for a few layout changes and extra pads for the button input. *Note that I haven’t actually tested the PCB. I’ve used a leftover reset mod PCB. Communication I’m pretty sure I already talked about the PlayStation communication in one of the previous posts, so I’ll let you look at those. I’m just going to recap how it works here. The PlayStation uses some sort of SPI interface to access the memory card and controllers with two chip select lines. All devices are connected to the same SPI bus which contains: command (CMD), data, acknowledge (ACK) and two chip select lines. Controller 1 and memory card 1 share the same chip select line and are further differentiated by an address sent by the PlayStation on the command line. Idem for controller 2 and memory card 2 but for the other chip select. Every byte received from the PlayStation, ie. for every CMD, we also need to send an ACK pulse. You can see a logic analyzer picture below showing a frame of communication with a guncon. Code I’m using the same structure from the reset mod. This helps me read the commands, differentiate between the memory card and controller, and have a data buffer ready to send. /* PlayStation Controller Command Union */ union PS1_Cmd{ uint8_t buff[PS1_CTRL_BUFF_SIZE]; struct{ uint8_t device_select; // 0x01 or 0x81 uint8_t command; // 0x42 for read switch uint8_t unused[PS1_CTRL_BUFF_SIZE-2]; // always 0 for controller }; }; /* PlayStation Controller Data Union */ union PS1_Ctrl_Data{ uint8_t buff[PS1_CTRL_BUFF_SIZE + 1]; // buffer to read data struct{ uint8_t unused1; // always 0xFF uint8_t id_lo; // id lo uint8_t id_hi; // id hi uint8_t keys_lo; // keys lo uint8_t keys_hi; // keys hi uint8_t unused2; // always 0xFF }; }; Sending data and receiving commands to and from the PlayStation happens with the SPI module of th 16F18325. An interrupt is used to determine if the PlayStation is trying to read controller data or memory card data. If it’s memory card data then our SPI module is disabled until the chip select is high, which indicates that the PlayStation finished reading data out of the memory card. If it’s the controller then the content of the data buffer is sent byte by byte. Because we still need to send an ACK and don’t want to pause in an interrupt, I set a flag high that will execute a piece of code in the main loop. // Send Ack to PlayStation if (send_ack){ // Set the ACK pin to an output, LAT already to 0 CLR_BIT(ACK_TRIS, ACK_OUTPUT); NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns - 500ns NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns - 1us NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns - 1.5us NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns - 2us NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns NOP(); // 125ns - 2.5us SET_BIT(ACK_TRIS, ACK_OUTPUT); // Set ACK pin back to input send_ack = 0; } In this bit of code I’m setting a pin to an output LOW and waiting a bit with NOPs, then turning the pin back to an input as to not interfere with the other devices on the bus. I’m using NOPs here because I need a very quick pulse of at least 2us. Reading the button is just a matter of toggling the correct bit in the key status bytes. // Read pedal switch status if (GET_BIT(PEDAL_PORT, PEDAL_INPUT) != PEDAL_BUTTON_MODE){ #if (PEDAL_BUTTON > 7) CLR_BIT(data.keys_hi, (PEDAL_BUTTON - 8)); #else CLR_BIT(data.keys_lo, PEDAL_BUTTON); #endif }else{ data.keys_hi = CONTROLLER_BUTTON_RESET; data.keys_lo = CONTROLLER_BUTTON_RESET; } I’ve set the code up so that you can use either a normal open or normal closed button. You just need to set the button up with the defines first. You need 2 bytes to represent all the controller buttons. Depending on which controller button you want to press through the pedal, you need to clear/set the correct bit in these bytes. That’s why there is a check to see if PEDAL_BUTTON is higher than 7. You can find the bit position for each button in the includes and here: /* Controller Buttons */ #define BUTTON_SELECT 0 #define BUTTON_L3 1 #define BUTTON_R3 2 #define BUTTON_START 3 #define BUTTON_UP 4 #define BUTTON_RIGHT 5 #define BUTTON_DOWN 6 #define BUTTON_LEFT 7 #define BUTTON_L2 8 #define BUTTON_R2 9 #define BUTTON_L1 10 #define BUTTON_R1 11 #define BUTTON_TRIANGLE 12 #define BUTTON_CIRCLE 13 #define BUTTON_CROSS 14 #define BUTTON_SQUARE 15 The whole code is up on the feikController repo on github, go check it out for more info. Making of If you want to look at me struggling to make this then I have a playlist of the stream VODs up on youtube: Other methods For those that think this is a bit overkill for just emulating one button of a PlayStation controller, you are correct. As mentioned before this is more of a proof of concept to make a controller, not specifically for just one button, but that’s the application I needed it for. An easier way to make a custom controller is modifying an existing controller, but this was not the purpose of the project. Future I’m confident I can emulate whatever peripheral I want on the PlayStation 1 now. With that said, I kind of want to make a TAS tool for the PlayStation but haven’t really put much thought into it. I’m sure I’ll need to connect the TAS controller to a PC but don’t know yet what communication to use and what data will be transmitted. I’ve put that idea on the todo-list. Who knows, maybe I’ll come up with something eventually.PlayStation 1 reset mod, part 32020-12-25T23:40:00+00:002020-12-25T23:40:00+00:00/electronics/reverse%20engineering/playstation/modification/2020/12/25/PlayStation-1-reset-mod-part-3<h3 id="recap">Recap</h3>
<p>Some time passed since I’ve made the reset mod for the PlayStation.<br />
Since then, the xStation came out which replaces the whole CD drive. Pretty cool device made on an ESP32!</p>
<p>The xStation has a special menu you can access by pressing the reset button for 2s.<br />
Someone on my github requested I added this feature so the reset mod would work with the xStation.</p>
<p>And so I did.</p>
<hr />
<p><br /></p>
<h3 id="new-firmware">New firmware</h3>
<p>Because the xStation expects a reset of 2s I decided to add a new button combination just for that.<br />
The new button combination is : <strong>SELECT + CROSS + L2 + R2</strong></p>
<p>With this button combination you’ll reset the PlayStation for 2s.<br />
The other combinations still work like before.</p>
<hr />
<p><br /></p>
<h3 id="updating">Updating</h3>
<p>The reset mod has pads on the back of the PCB were you can connect a programmer for ICSP.<br />
Some programmers like the PICKit3 I have can output 5V to power the target which probably isn’t good to put on the 3.5V bus of the PlayStation.<br />
I recommend you disconnect the 3.5V from the PlayStation as there is nothing to block the programmer voltage.</p>
<p>Once connected either compile the program or use the hex file in the release to flash the reset mod.</p>
<p>If you don’t have a programmer then don’t panic, your reset mod can support the xStation too with an extra bit of circuit.</p>
<hr />
<p><br /></p>
<h3 id="no-programmer">No programmer?</h3>
<p>I get that not everyone has a PIC programmer to upgrade the firmware from v1.1 to v1.2.<br />
That is not an issue if you’re ok with adding an extra little mod.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/pulse%20extender/pulse%20extender.PNG" alt="pulse extender schematic" /></p>
<p>The schematic above is a pulse extender for the v1.1 reset mod.<br />
Instead of connecting the reset to the PlayStation motherboard, you connect it to the 555 set as a pulse extender.<br />
The output of the 555 goes to a NPN trasistor which will pull the reset of the PlayStation low for 2s.</p>
<p>Below is my test PCB which I’ve succesfully tested on my PlayStation.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/pulse%20extender/pulse%20extender%20pcb.jpg" alt="pulse extender pcb" /></p>
<p>Obviously you can make it as small and compact as you want, this was just for testing the circuit.<br />
The below oscilloscope image shows the small pulse from the reset mod, in blue, and the long pulse from the 555, in yellow.</p>
<p><img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/pulse%20extender/pulse%20extender%20scope.jpg" alt="pulse extender scope" /></p>
<p>Note1: The 555 here is one that works on the 3.5V. In my test I used a TLC555C.<br />
Note2: Any other pulse extender would work here. This is just a quick no microcontroller fix.</p>
<hr />
<p><br /></p>
<h3 id="thanks-to">Thanks to</h3>
<ul>
<li><a href="https://twitter.com/arcadetv/status/1340730293402169347">ArcadeTV</a> for the request.</li>
<li><a href="https://twitter.com/_ramapcsx2">_ramapcsx2</a> for the xStation and taking the time to respond to a few questions I had.</li>
</ul>Recap Some time passed since I’ve made the reset mod for the PlayStation. Since then, the xStation came out which replaces the whole CD drive. Pretty cool device made on an ESP32! The xStation has a special menu you can access by pressing the reset button for 2s. Someone on my github requested I added this feature so the reset mod would work with the xStation. And so I did. New firmware Because the xStation expects a reset of 2s I decided to add a new button combination just for that. The new button combination is : SELECT + CROSS + L2 + R2 With this button combination you’ll reset the PlayStation for 2s. The other combinations still work like before. Updating The reset mod has pads on the back of the PCB were you can connect a programmer for ICSP. Some programmers like the PICKit3 I have can output 5V to power the target which probably isn’t good to put on the 3.5V bus of the PlayStation. I recommend you disconnect the 3.5V from the PlayStation as there is nothing to block the programmer voltage. Once connected either compile the program or use the hex file in the release to flash the reset mod. If you don’t have a programmer then don’t panic, your reset mod can support the xStation too with an extra bit of circuit. No programmer? I get that not everyone has a PIC programmer to upgrade the firmware from v1.1 to v1.2. That is not an issue if you’re ok with adding an extra little mod. The schematic above is a pulse extender for the v1.1 reset mod. Instead of connecting the reset to the PlayStation motherboard, you connect it to the 555 set as a pulse extender. The output of the 555 goes to a NPN trasistor which will pull the reset of the PlayStation low for 2s. Below is my test PCB which I’ve succesfully tested on my PlayStation. Obviously you can make it as small and compact as you want, this was just for testing the circuit. The below oscilloscope image shows the small pulse from the reset mod, in blue, and the long pulse from the 555, in yellow. Note1: The 555 here is one that works on the 3.5V. In my test I used a TLC555C. Note2: Any other pulse extender would work here. This is just a quick no microcontroller fix. Thanks to ArcadeTV for the request. _ramapcsx2 for the xStation and taking the time to respond to a few questions I had.Life 12020-11-02T07:00:00+00:002020-11-02T07:00:00+00:00/miscellaneous/2020/11/02/Life-1<h3 id="miscellaneous-post">Miscellaneous post</h3>
<p>It feels like yesterday when I made the Playstation 1 reset mod, but looking at the dates on the last posts, it’s been more than a year.<br />
Time flies by so fast, but at the same time it doesn’t feel like it… Not sure if I make sense.</p>
<p>I thought it would be good to have a little update post about what happened since last year’s post.<br />
There have been a few minor and major events since then.</p>
<hr />
<p><br /></p>
<h3 id="new-job">New job</h3>
<p>Starting January 2020 I got into an IT job at the same company.<br />
I’m doing SQL and other IT related stuff now.</p>
<p>Before you ask why someone with an electronics bachelor does IT, you need to know that for the past 5 years I’ve been working in shifts as a technician in a team of 4 or 5 people.<br />
If something stopped working then operators would call us to figure out why. It was rewarding to be able to troubleshoot problems and fix them, essentially helping others.<br />
This of course needed to be done quickly as to not have extended periods of downtime. Production never stops here, it’s 24/7.</p>
<p>Although the job was rewarding, it killed me socially and it was mentally draining. I would get home tired all the time.<br />
I am a shy introvert, so I didn’t go out much before. I do have a few close friends (still do have them) that I hung out with every other couple of weekends.<br />
With them I can pretty much open up and be my normal self instead of the shy guy playing with animals so I don’t have to speak to anyone I didn’t know.</p>
<p>Because I had to work weekends, it means I had less time to see my friends. Although I was with pretty cool team, they’re colleagues and not people I hung out with.<br />
Probably due to my own faults more than anything.</p>
<p>My life up until now was pretty much: wake up, go to work, go home, eat, sleep, repeat. Every few days I had 2 days off and then the shift changed.<br />
Those 2 days off were more for resting and recuperating from previous days than anything else, so no work was done.
I completely left out my passion and hobby which is electronics.<br />
I tried to do some online courses over the years on edx, and I got a couple done with passing grades. It wasn’t easy to stay focused on those for long.</p>
<p>Anyways, seeing as they had an open job in IT, which to me meant normal day job, I thought I “could take back my life” if I got it. And in some ways I did, more on that later.<br />
As it was pretty specific, and because no one else applied, I got the job. It’s not easy, but I’m learning new things every day.</p>
<p>Honestly speaking, I never thougth I would do IT, but here we are.</p>
<p>Having a day job now, I’m not exhausted when I get home in the afternoon. Weekends aren’t just for resting and doing nothing for 2 days straight.<br />
I’ve been more active and working on different projects that I’d like to share with you on other posts.<br />
Recently I worked in converting a Sega Saturn Racing Wheel controller into a PC controller, which I think you’d like to hear.</p>
<p>Having a day job also meant I had my weekends back and so I could hang out with friends again.<br />
But then COVID happened…</p>
<hr />
<p><br /></p>
<h3 id="covid">COVID</h3>
<p>With COVID came working from home, which fortunatelly enough, I was able to do thanks to the new job in IT.<br />
COVID also means not going outside, not seeing friends or family.</p>
<p>So from March up until June I worked from home. The COVID numbers were down and so I had to go back to work.<br />
In Jully I talked about my concerns of the growing number of COVID patients and in mid-Jully I started working from home again.</p>
<p>I have been working from home since then.</p>
<p>It seems that people have been less and less worried about COVID, and misinformation about it has been spreading too.<br />
Numbers are at an all time high again, with 17500 new cases in one day at the end of October.</p>
<p>**NOTE: Source on the 17500 from https://www.worldometers.info/coronavirus/country/belgium/</p>
<p>We try to do everything the docters and the government said about staying home, wearing masks, washing hands, etc etc.<br />
Unfortunatelly a family member we know got COVID from someone else and came home a few times before they were tested.<br />
My parents became ill, starting with my mother and a week later my dad. Then a week or two later I myself got sick.<br />
We all got tested prior to my dad being ill and all were positive except me.</p>
<p>I don’t know if you can imagine the stress I had knowing that both my parents are sick with COVID, both being over 60 years old. I didn’t sleep well for a couple of days.<br />
My dad slept on the couch as my mom didn’t want him with her. The same night we got tested my dad had a ~38°C fever.<br />
She would feel so guilty to have given my dad COVID, she would brake down a few times since the day my dad got ill. It was horrible to not being able to hug her in those moments.<br />
At this point I didn’t give a shit if I got COVID too, but she wouldn’t let me approach her for fear of me catching COVID too.
She tried to have some control over the situation and so I had to isolate myself from them. As to not upset her and make her feel more guilty and stressed than she already is, I went along with what she asked.<br />
I’ve been wearing masks at home since around the 12th of October and although I was isolated in my room, I did go check on them a couple times a day.</p>
<p>Something I did early on was buy an oxymeter, as I had read a lot about how COVID messes up the lungs, and gave it to my mom as she was coughing all day and night.<br />
I think my aunt came by to give us thermometers, or maybe we already had a few, and so every day I would check up on them to see how they were doing.</p>
<p>Dad for the most part was ok, except the fever that came during the night. It was mostly kept under control with Paracetamol. From what he told me, it never got higher than 38.5°C.<br />
He tried the oxymeter a few times and the numbers were always in the high 90s (96 and up) which is very reassuring to see. He didn’t have a cough, so I wasn’t that worried.
10 days later or so, my dad didn’t have any fever anymore, just an ‘itchy’ throat which makes him cough from time to time to this day.
My dad also kept on walking inside the house, as before the COVID hit us I installed him a step counter. He walked a few km every day, I’m sure that helped somewhat to keep him active and fighting.</p>
<p>Mom on the other hand would cough a lot. So much so that her ribs started to hurt. Because of this she would not sleep well either.<br />
I checked on her almost daily to check on her oxygen and although she had lower results than my dad, hers were above 90 (around 90 to 94) too. As reassuring as that was I told her to check it a few times a day.<br />
She too had fever, higher than my dad. This was somewhat kept under control again with Paracetamol.<br />
What worried me more is that she didn’t eat or barely ate for the first couple of days. So I went and picked her up some yogurts and fruit which she could eat with less trouble.<br />
She wasn’t eating a lot but at least she ate something.<br />
For her cough the doctor prescribed her a strong syrop which helped a bit for the first few days. Later though she asked for something stronger and got a machine with which she had to breath in some kind of medicine through a mask.<br />
I’m not sure what it’s called, but this is helping her a lot.<br />
Nowadays mom is still coughing, but way way less than before. She hasn’t had any fever for a good couple days either and she’s been eating so much better.<br />
Mom does have at least one problem due to COVID. If she tries to go from the 1st floor to the 3rd, she has to sit down to catch her breath. Something she did not have before.<br />
She and my dad have been quarantined for more than 2 weeks now and they have started to go on walks together so my mom could exercise a bit. They have steadily been going out for longer and longer time.<br />
Mom also went to do some shopping for food the other day alone, which worried me, but she promised me she would go slowly and nothing bad happened.</p>
<p>As much as we tried to isolate one another and use desinfectant if we ever got out of the rooms, I started having symptoms too.<br />
First I felt pressure in my sinusses, then later I couldn’t breath from my nose and had to use a nasal spray. After that came the fever and then coughing.<br />
I don’t know when it started but I have very limitted sense of smell and taste too.<br />
The fever was gone after a week, but I’m still coughing mostly at night.<br />
I’ve been sleeping 10 to 15 hours a day for a couple of days too because I felt so tired. And no matter how long I slept I was always tired.<br />
I’m still tired now but mostly because I don’t sleep well. Not sure if that’s still a COVID issue.<br />
I’m about a bit more than a week in quarantine and still have no sense of smell and taste, I still cough quite a bit, and I’m always tired.</p>
<p>As far as I can tell, we have been pretty lucky when you see all the people that need respirators, need to go to the hospital, or even the people that die from it.<br />
Dad is fine as far as I can tell, mom is ok and doing a bit better every day, and I’m not doing too bad.<br />
I’m not sure why I tested negative that day, seeing as we didn’t isolate before we knew the results of the family member’s test.</p>
<p>I hope that all of you reading this, and the people around you, are doing ok.<br />
My twitter DMs are always open.</p>
<hr />
<p><br /></p>
<h3 id="bunny-friend">Bunny friend</h3>
<p>For those that know me, I’ve had a bunny for a few years until he got sick and we decided to have him put down for his own good. He was free to go wherever he wanted. I love how he hopped around.</p>
<p>Latelly a good friend of mine got a bunny and since he sent me a picture we’ve been talking at home about maybe getting one that I would take care of in my room. I have 2 rooms with no door in between so it’s a fairly good size room where he could run around.<br />
I’m still thinking about it, but I might be getting a little bunny in the future.</p>
<hr />
<p><br /></p>
<h3 id="other-stuff">Other stuff</h3>
<p>There are other things I don’t feel very confortable talking in details about here, like the fact someone in the family decided to move to another country.<br />
If you’ve ever chatted with me (on discord or other) I may have mentionned this.</p>
<hr />
<p><br /></p>
<h3 id="end">End</h3>
<p>I’m going to end the post here. I’ve said what I felt confortable in saying. I wanted to share with you the fact I have been doing more electronic projects which I’m so happy about. It’s been so long.<br />
I also wanted to share with you that I have a new job and the fact we have COVID (with mild symptoms).</p>
<p>I hope to get around to make the new posts about the projects I’ve been working on these past months, and I hope you’ll like reading them.</p>Miscellaneous post It feels like yesterday when I made the Playstation 1 reset mod, but looking at the dates on the last posts, it’s been more than a year. Time flies by so fast, but at the same time it doesn’t feel like it… Not sure if I make sense. I thought it would be good to have a little update post about what happened since last year’s post. There have been a few minor and major events since then. New job Starting January 2020 I got into an IT job at the same company. I’m doing SQL and other IT related stuff now. Before you ask why someone with an electronics bachelor does IT, you need to know that for the past 5 years I’ve been working in shifts as a technician in a team of 4 or 5 people. If something stopped working then operators would call us to figure out why. It was rewarding to be able to troubleshoot problems and fix them, essentially helping others. This of course needed to be done quickly as to not have extended periods of downtime. Production never stops here, it’s 24/7. Although the job was rewarding, it killed me socially and it was mentally draining. I would get home tired all the time. I am a shy introvert, so I didn’t go out much before. I do have a few close friends (still do have them) that I hung out with every other couple of weekends. With them I can pretty much open up and be my normal self instead of the shy guy playing with animals so I don’t have to speak to anyone I didn’t know. Because I had to work weekends, it means I had less time to see my friends. Although I was with pretty cool team, they’re colleagues and not people I hung out with. Probably due to my own faults more than anything. My life up until now was pretty much: wake up, go to work, go home, eat, sleep, repeat. Every few days I had 2 days off and then the shift changed. Those 2 days off were more for resting and recuperating from previous days than anything else, so no work was done. I completely left out my passion and hobby which is electronics. I tried to do some online courses over the years on edx, and I got a couple done with passing grades. It wasn’t easy to stay focused on those for long. Anyways, seeing as they had an open job in IT, which to me meant normal day job, I thought I “could take back my life” if I got it. And in some ways I did, more on that later. As it was pretty specific, and because no one else applied, I got the job. It’s not easy, but I’m learning new things every day. Honestly speaking, I never thougth I would do IT, but here we are. Having a day job now, I’m not exhausted when I get home in the afternoon. Weekends aren’t just for resting and doing nothing for 2 days straight. I’ve been more active and working on different projects that I’d like to share with you on other posts. Recently I worked in converting a Sega Saturn Racing Wheel controller into a PC controller, which I think you’d like to hear. Having a day job also meant I had my weekends back and so I could hang out with friends again. But then COVID happened… COVID With COVID came working from home, which fortunatelly enough, I was able to do thanks to the new job in IT. COVID also means not going outside, not seeing friends or family. So from March up until June I worked from home. The COVID numbers were down and so I had to go back to work. In Jully I talked about my concerns of the growing number of COVID patients and in mid-Jully I started working from home again. I have been working from home since then. It seems that people have been less and less worried about COVID, and misinformation about it has been spreading too. Numbers are at an all time high again, with 17500 new cases in one day at the end of October. **NOTE: Source on the 17500 from https://www.worldometers.info/coronavirus/country/belgium/ We try to do everything the docters and the government said about staying home, wearing masks, washing hands, etc etc. Unfortunatelly a family member we know got COVID from someone else and came home a few times before they were tested. My parents became ill, starting with my mother and a week later my dad. Then a week or two later I myself got sick. We all got tested prior to my dad being ill and all were positive except me. I don’t know if you can imagine the stress I had knowing that both my parents are sick with COVID, both being over 60 years old. I didn’t sleep well for a couple of days. My dad slept on the couch as my mom didn’t want him with her. The same night we got tested my dad had a ~38°C fever. She would feel so guilty to have given my dad COVID, she would brake down a few times since the day my dad got ill. It was horrible to not being able to hug her in those moments. At this point I didn’t give a shit if I got COVID too, but she wouldn’t let me approach her for fear of me catching COVID too. She tried to have some control over the situation and so I had to isolate myself from them. As to not upset her and make her feel more guilty and stressed than she already is, I went along with what she asked. I’ve been wearing masks at home since around the 12th of October and although I was isolated in my room, I did go check on them a couple times a day. Something I did early on was buy an oxymeter, as I had read a lot about how COVID messes up the lungs, and gave it to my mom as she was coughing all day and night. I think my aunt came by to give us thermometers, or maybe we already had a few, and so every day I would check up on them to see how they were doing. Dad for the most part was ok, except the fever that came during the night. It was mostly kept under control with Paracetamol. From what he told me, it never got higher than 38.5°C. He tried the oxymeter a few times and the numbers were always in the high 90s (96 and up) which is very reassuring to see. He didn’t have a cough, so I wasn’t that worried. 10 days later or so, my dad didn’t have any fever anymore, just an ‘itchy’ throat which makes him cough from time to time to this day. My dad also kept on walking inside the house, as before the COVID hit us I installed him a step counter. He walked a few km every day, I’m sure that helped somewhat to keep him active and fighting. Mom on the other hand would cough a lot. So much so that her ribs started to hurt. Because of this she would not sleep well either. I checked on her almost daily to check on her oxygen and although she had lower results than my dad, hers were above 90 (around 90 to 94) too. As reassuring as that was I told her to check it a few times a day. She too had fever, higher than my dad. This was somewhat kept under control again with Paracetamol. What worried me more is that she didn’t eat or barely ate for the first couple of days. So I went and picked her up some yogurts and fruit which she could eat with less trouble. She wasn’t eating a lot but at least she ate something. For her cough the doctor prescribed her a strong syrop which helped a bit for the first few days. Later though she asked for something stronger and got a machine with which she had to breath in some kind of medicine through a mask. I’m not sure what it’s called, but this is helping her a lot. Nowadays mom is still coughing, but way way less than before. She hasn’t had any fever for a good couple days either and she’s been eating so much better. Mom does have at least one problem due to COVID. If she tries to go from the 1st floor to the 3rd, she has to sit down to catch her breath. Something she did not have before. She and my dad have been quarantined for more than 2 weeks now and they have started to go on walks together so my mom could exercise a bit. They have steadily been going out for longer and longer time. Mom also went to do some shopping for food the other day alone, which worried me, but she promised me she would go slowly and nothing bad happened. As much as we tried to isolate one another and use desinfectant if we ever got out of the rooms, I started having symptoms too. First I felt pressure in my sinusses, then later I couldn’t breath from my nose and had to use a nasal spray. After that came the fever and then coughing. I don’t know when it started but I have very limitted sense of smell and taste too. The fever was gone after a week, but I’m still coughing mostly at night. I’ve been sleeping 10 to 15 hours a day for a couple of days too because I felt so tired. And no matter how long I slept I was always tired. I’m still tired now but mostly because I don’t sleep well. Not sure if that’s still a COVID issue. I’m about a bit more than a week in quarantine and still have no sense of smell and taste, I still cough quite a bit, and I’m always tired. As far as I can tell, we have been pretty lucky when you see all the people that need respirators, need to go to the hospital, or even the people that die from it. Dad is fine as far as I can tell, mom is ok and doing a bit better every day, and I’m not doing too bad. I’m not sure why I tested negative that day, seeing as we didn’t isolate before we knew the results of the family member’s test. I hope that all of you reading this, and the people around you, are doing ok. My twitter DMs are always open. Bunny friend For those that know me, I’ve had a bunny for a few years until he got sick and we decided to have him put down for his own good. He was free to go wherever he wanted. I love how he hopped around. Latelly a good friend of mine got a bunny and since he sent me a picture we’ve been talking at home about maybe getting one that I would take care of in my room. I have 2 rooms with no door in between so it’s a fairly good size room where he could run around. I’m still thinking about it, but I might be getting a little bunny in the future. Other stuff There are other things I don’t feel very confortable talking in details about here, like the fact someone in the family decided to move to another country. If you’ve ever chatted with me (on discord or other) I may have mentionned this. End I’m going to end the post here. I’ve said what I felt confortable in saying. I wanted to share with you the fact I have been doing more electronic projects which I’m so happy about. It’s been so long. I also wanted to share with you that I have a new job and the fact we have COVID (with mild symptoms). I hope to get around to make the new posts about the projects I’ve been working on these past months, and I hope you’ll like reading them.PlayStation 1 reset mod, part 22019-10-22T12:00:00+00:002019-10-22T12:00:00+00:00/electronics/reverse%20engineering/playstation/modification/2019/10/22/PlayStation-1-reset-mod-part-2<h3 id="recap">Recap</h3>
<p>A few months ago I bought a PSIO from Cybdyn System.<br />
This device let’s you play games from an SD card on a PlayStation 1, a bit like krikzz EverDrives for older cartridge based consoles.</p>
<p>After playing around with it for a bit I saw a user on the PSIO forums ask for a way to reset the PlayStation 1 through a button combination.<br />
Unfortunately the PSIO has no access to the status of the buttons on a controller, so this can’t be done from the PSIO.</p>
<p>I had messed around with the PlayStation 1 communication before and I was confident I could build something that would do just that.<br />
From my previous post you can see I managed to make something that worked, but was not perfect.</p>
<p>In this article I’m going to explain what I did afterwards.</p>
<hr />
<p><br /></p>
<h3 id="video">Video</h3>
<p>But first here’s a video of the latest version working:</p>
<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/dBLZW0fIh68" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></p>
<hr />
<p><br /></p>
<h3 id="disclaimer">Disclaimer</h3>
<p>This mod is a piece of hardware you add to the PlayStation. Although you don’t have to modify the motherboard, it still requires a bit of soldering.<br />
I am not responsible if the PlayStation doesn’t work after you’ve installed or removed my mod.<br />
If you don’t know what you’re doing, go to someone that does.</p>
<p><strong>You do this at your own risk.</strong></p>
<hr />
<p><br /></p>
<h3 id="caution">Caution</h3>
<p>It goes without saying that resetting the PlayStation whilst you’re saving data can corrupt the save data and/or the memory card.<br />
Do <strong>NOT</strong> reset the PlayStation when it is writing data to the memory card.</p>
<p>You have been warned.</p>
<hr />
<p><br /></p>
<h3 id="proof-of-concept">Proof of Concept</h3>
<p>Now that we’re done with all the legal bullshit, let’s talk about the previous versions.</p>
<p>The first mod used an Arduino Nano (ATMEGA328P) at 16MHz, powered with the PlayStation 3.5VDC. The program written for it uses the polling method to read the command and data between the PS1 and controller.<br />
Although this works there are two issues:</p>
<ul>
<li>The Arduino Nano is underpowered for the 16MHz at which it’s running, so unexpected behaviour can happen. The datasheet specifies that anything above 8MHz needs to be powered from 5VDC.</li>
<li>The polling method is unreliable as it does miss data, which means that the reset is not instantenious and takes a second. I also don’t like continiously polling for data.</li>
</ul>
<p>Here is a flowchart I made of the first proof of concept code:<br />
<img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/atmega328p/polling/PS1_reset_mod_v1.png" alt="flowchart v1" /></p>
<p>This version is also the one I’m talking about in the first article.<br />
<br />
<br />
In the second proof of concept I tried to use interrupts to remove the polling loop.<br />
I used the two INT interrupts and a timer. The first INT interrupt was looking at the SS signal.<br />
Whenever the SS was pulled low, the interrupt would trigger and start the timer.<br />
The timer would run for a few ms and when it overflowed it would check the SS signal again. If that was still low then it would enable the 2nd INT interrupt on the CLK.<br />
The 2nd INT interrupt would trigger every rising edge and copy the state of the whole input port.<br />
This data would then be rebuilt into the PlayStation CMD and DATA.<br />
Unfortunatelly there where some issues with this that I still am not sure what the causes are.</p>
<p>One issue I found was due to the Playstation controller being powered from 3.5VDC and the Arduino Nano from 5V. The voltage of the signals from the PlayStation were sometimes in the unknown region of the input pin of the Arduino due to resistance, load, etc.</p>
<p>The concept was nicer than the polling loop but it didn’t work. Maybe with a bit more time and troubleshooting this could have worked, but I found that the effort I put into this was waisted due to there being a better way to do this.</p>
<p>Here’s the flowchart for the 2nd proof of concept:<br />
<img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/atmega328p/INT-interrupt/PS1_reset_mod_v2.1.png" alt="flowchart v2.1" /><br />
<br />
<br />
The communication from the PlayStation with the controller is basically SPI, which means that I needed a microcontroller with two SPI modules to be able to read the command and data signals. Because of this I choose the ATMEGA328PB which is an improved version of the ATMEGA328P that has two SPI modules.</p>
<p>And so the 328PB was going to be used in my 3rd proof of concept.</p>
<p>I removed the ATMEGA328P from an Arduino Nano and soldered on an ATMEGA328PB, because they’re pin compatible. The neat thing about this is I have a board that works with the 328PB without any issues, and it has a CH340 USB to UART converter.<br />
The code was written in Atmel Studio and I flashed the ATMEGA328PB with an old USBasp a friend of mine made years ago.<br />
I programmed it so that it would use both SPI modules to read the command and data, without having to make workarounds like in the previous concepts.<br />
This proof of concept worked perfectly, but there were some things that could be improved:</p>
<ul>
<li>The microcontroller was big, too big for what it needed to be. Big in the essence of too many I/O, too much memory, etc.</li>
<li>The ATMEGA328PB, like the 328P version, can’t run at more than 8MHz if it’s powered at 3.3VDC and I felt that that wouldn’t have been enough (even though it probably wold have been fine).</li>
</ul>
<hr />
<p><br /></p>
<h3 id="first-release">First release</h3>
<p>After the 3rd proof of concept I looked at what microchip had available and the 16F18325 was the cheapest microcontroller with two SPI modules.<br />
The 16F18325 can be powered by the 3.5VDC and use it’s internal oscillator with PLL to go up to 32MHz.</p>
<p>So that’s what I’m using in the new mod.</p>
<p>I used MPLABX with the XC8 compiler and a PICKit3 to flash the microcontroller.<br />
The awesome thing about the 16F18325 is that you can select which I/O is connected to which module.</p>
<p>If you look at the Arduino Nano and the ATMEGA28P, you’ll see that each I/O is connected to a module like the UART or the SPI or ADC, but those are fixed…<br />
The 16F18325 can be customized to whatever configuration you want. If you want your UART TX & RX on RA1 & RA2, you can do that.<br />
If it so happens that that wasn’t a good choice, due to for example board layout, you can change the UART TX & RX to somewhere else.</p>
<p>This is amazing! The customizability of the 16F18325 and other microcontrollers like this one is endless.</p>
<p>Each SPI module has a CLK, SS, MISO and MOSI. Because we don’t reply to the data sent, we don’t need MISO.<br />
So those would usually take 6 I/O pins, but thanks to the 16F18325 we can do this with 4 I/O.</p>
<p>The CLK and SS are the same for both SPI modules, so the program connects both SPI CLK to the same I/O. Same thing for the SS.<br />
The MOSI inputs are internally connected to different pins which in turn are connected to CMD and DATA.<br />
And this works perfeclty fine like you can see in the video above.</p>
<p>I have also setup the SPI inputs to be different than the ICSP connections. Although I wouldn’t recommend you to flash the microcontroller when it’s connected to the PlayStation 1, you could.</p>
<pre><code class="language-C">/*
Connection:
RA2 = SS
RC0 = CLK
RC1 = DATA
RC2 = CMD
SDO1,2 = unassigned
RC5 = RESET
*/
// ...
// SETUP SPI1 & SPI2 I/O
SSP1SSPPSbits.SSP1SSPPS = 0x02; // SS1 = RA2
SSP2SSPPSbits.SSP2SSPPS = 0x02; // SS2 = RA2
SSP1CLKPPSbits.SSP1CLKPPS = 0x10; // SCK1 = RC0
SSP2CLKPPSbits.SSP2CLKPPS = 0x10; // SCK2 = RC0
SSP1DATPPSbits.SSP1DATPPS = 0x11; // SDI1 = RC1
SSP2DATPPSbits.SSP2DATPPS = 0x12; // SDI2 = RC2
</code></pre>
<p>The <a href="https://github.com/pyroesp/PlayStation-1-Reset-Mod/releases">first release on the github repository</a> contains everything you need to make the board and flash the 16F18325.</p>
<hr />
<p><br /></p>
<h3 id="schematic-and-pcb">Schematic and PCB</h3>
<p>Below you’ll find the schematic and a 3D render of the PCB.<br />
<img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/mod/schematic.png" alt="Schematic" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/mod/pcb%20-%20front.png" alt="pcb front" /></p>
<p><img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/mod/pcb%20-%20bottom.png" alt="pcb bottom" /></p>
<p>The PCB is 14.5mm by 12mm, so it’s small. The solder pads should be 1.5mm wide.<br />
The pads on the back are smaller because they’re only used for flashing the fimware.</p>
<p>After flashing, put some tape on the back so these don’t make contact with anything on the motherboard.</p>
<p>A guide is being made so that everyone can install this mod in their PlayStation 1.</p>
<hr />
<p><br /></p>
<h3 id="making-the-pcb">Making the PCB</h3>
<p>By downloading the first release on the github repository you’ll get the firmware and the gerber files for the PCB.<br />
Go to JLCPCB and click on the “Quote Now” button for the PCB prototype. These are 2$ for 5 boards (not including shipping).</p>
<p>Upload the gerber files to JLCPCB like they ask you to.<br />
If you don’t know what to select in the parameters below, then these are my settings:<br />
<img src="https://raw.githubusercontent.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/mod/jlcpcb_parameters.PNG" alt="pcb fab settings" /></p>
<p>At the time of writing you can change the PCB width from 1.6 to 0.6mm without additional cost.<br />
Green is the default color, but changing it doesn’t add cost. It does add a day or two in the fabrication of the PCB.</p>
<hr />
<p><br /></p>
<h3 id="changing-buttons">Changing buttons</h3>
<p>Changing the button combination is trivial to do.<br />
Checkout the last chapter in <a href="https://pyroesp.github.io/electronics/reverse%20engineering/playstation/modification/2019/07/07/PlayStation-1-reset-mod.html">the first part of this mod blog post</a>. I have explained how to do it there.<br />
Once done, recompile and flash the microcontroller.</p>RecapPlayStation 1 reset mod2019-07-07T02:00:00+00:002019-07-07T02:00:00+00:00/electronics/reverse%20engineering/playstation/modification/2019/07/07/PlayStation-1-reset-mod<p>I’ve recently acquired a PSIO from Cybdyn System.<br />
It’s a device that’s plugged into the parallel port of a PlayStation 1.<br />
It allows you to play games from an SD card instead of a CD.</p>
<p>If you’ve ever had or heard about Krikzz EverDrive SD cartridges for older consoles, well it’s similar to those.</p>
<p>When you first start the PlayStation with the PSIO plugged in, a menu pops up where you can choose your game.<br />
The only thing missing to the PSIO is a way to get back to this menu once a game has been launched.</p>
<p>Here’s where my mod comes into play.<br />
The purpose of the mod is to be able to reset the PlayStation with a button combination on controller 1, so that you don’t have to get up to reset the PS1.</p>
<p>If you use the code as is then the reset button combination is <strong>L2+R2+START+SELECT</strong> for a digital/analog controller and <strong>A+B+TRIGGER</strong> for a GUNCON.</p>
<p>One thing to note here is that because the controllers are slave devices to the PlayStation, the PS1 won’t reset if it freezes as the communication just stops.</p>
<hr />
<p><br /></p>
<h3 id="video">Video</h3>
<p>Here’s a quick video showing off the mod in action with a digital controller.</p>
<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/lb_uCGyv6pY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></p>
<hr />
<p><br /></p>
<h3 id="disclaimer">Disclaimer</h3>
<p>I’m not responsible for anything you do with this mod.<br />
You do this at your own risk.</p>
<p>If something blows up… You probably fucked up somewhere.</p>
<hr />
<p><br /></p>
<h3 id="parts-needed">Parts needed</h3>
<p>This mod uses an Arduino Nano, 4x 1k Ohm resistors and 1x 500 Ohm resistor or 2x 1k Ohm in parallel.<br />
You’ll also need some wire.</p>
<p>You can find the reset mod program for Arduino Nano here:<br />
<a href="https://github.com/pyroesp/PlayStation-1-Reset-Mod">https://github.com/pyroesp/PlayStation-1-Reset-Mod</a>.</p>
<hr />
<p><br /></p>
<h3 id="installing-the-mod">Installing the mod</h3>
<p>First of all, flash your Arduino Nano with the reset mod program mentioned above. If you don’t know how to do this, google it.<br />
We will remove the USB to UART chip so you won’t be able to program the Arduino Nano once it’s installed.</p>
<p>The next steps are just describing how I did it on my PU-18 motherboard and where I placed the Arduino.<br />
You don’t have to follow this. If you think you’ve found a better place to hide the Arduino then go for it.</p>
<p><br />
<strong>Update 13/07/2019:</strong> The use of the Arduino Nano as described below is actually underpowering the microcontroller.<br />
Looking at the ATMEGA328P datasheet, if you use a 20MHz crystal oscillator then you have to power the microcontroller with 4.5V to 5.5V.<br />
Because it is underpowerd, it could not work as intended. Mine is working fine, but yours might not.<br />
You can power it from the PlayStation 5V by connecting the 5V supply directly to the 5V pin of the Arduino Nano, not the VIN!<br />
I would recommend you add a diode, from the PS1 to the Arduino Nano, as to block the USB 5V from powering the PlayStation motherboard.<br />
Even though the PlayStation input/outputs are 3.5V, the Arduino Nano is always sinking current.<br />
This means that the Arduino Nano never outputs a logic 1 (or 5V) to the PlayStation and thus it’s safe to connect it, even if it’s powered from 5V.<br />
If you do this, then you won’t have to desolder the voltage regulator, nor the CH340 chip.
You’ll also be able to update the firmware on the Arduino Nano without blowing a fuse.</p>
<p><br />
The Arduino Nano will use the controller 3.5V from the PlayStation so I removed the AMS1117 5V voltage regulator.<br />
I also removed the CH340 chip, as I won’t have to use the serial port anymore, and some misc caps/diode.<br />
This way only the ATMEGA328P will be powered by the PlayStation, plus it makes the bottom of the Arduino Nano flat.</p>
<p><strong>Note:</strong> If you keep the Arduino Nano as is and plug it into your computer via USB <strong>after</strong> you installed it in the PS1, you are going to put 5V on the PlayStation 3.5V.<br />
This will do 3 things:</p>
<ul>
<li>Send 5V to the controller through the 3.5V connection: might break stuff, I don’t know…</li>
<li>Send 5V to the PlayStation through the 3.5V connection: might break stuff, I don’t know…</li>
<li>Blow the controller 3.5V fuse (PS605): definitely broken, no more controller or memory card detected until the fuse gets replaced.</li>
</ul>
<p><img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/arduino nano/arduino nano bottom.jpg" alt="Arduino Nano Bottom" /></p>
<p>If you didn’t change the I/O from the code then these are the pins you need to solder resistors to.</p>
<ul>
<li>PB5 - SCK (input, connect to PS1 clock)</li>
<li>PB4 - CMD (input, connect to PS1 TX)</li>
<li>PB3 - DATA (input, connect to PS1 RX)</li>
<li>PB2 - /SS (input, connect to controller 1 select)</li>
<li>PB1 - playstation reset (output, connect to reset of parallel port (pin 2))</li>
</ul>
<p><img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/arduino nano/arduino nano top.jpg" alt="Arduino Nano Top" /></p>
<p>The PlayStation reset pin or PB1 has a 500 Ohm resistor. 1k was too much to pull the reset low.<br />
You could use 2x 1k Ohm resistors in parallel here instead.
All other I/Os use the 1k resistors.</p>
<p>Next you’ll connect the Arduino Nano to the PlayStation.<br />
This is where I connected them:<br />
<img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/motherboard/controller connection.jpg" alt="Controller Connection" /></p>
<p>Here’s a drawing of the connections you’ll need.
<img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/motherboard/controller connection 2.jpg" alt="Controller Connection 2" /></p>
<p>Here’s an extra image so you can see where this is located.<br />
<img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/motherboard/controller connection location.jpg" alt="Controller Connection Location" /></p>
<p>The PlayStation reset can be connected on pin 2 of the parallel port as shown below:
<img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/arduino nano/reset from parallel port.jpg" alt="Reset From Parallel Port" /></p>
<p>For power you want to connect the 3.5V of the PlayStation to the 5V of the Arduino Nano.<br />
Don’t forget the GND either.</p>
<p>This is where I placed my Arduino Nano:<br />
<img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/arduino nano/playstation with mod.jpg" alt="PlayStation with Mod" /></p>
<p><img src="https://raw.github.com/pyroesp/PlayStation-1-Reset-Mod/master/pictures/arduino nano/playstation with mod 2.jpg" alt="PlayStation with Mod 2" /></p>
<p>I used some tape on the bottom of the Arduino so it wouldn’t move.<br />
All the wires are taped too. I also routed the wires with tape on the bottom side of the motherboard so they wouldn’t get pinched or crushed when assembling it all back in one piece.</p>
<hr />
<p><br /></p>
<h3 id="controller-communication">Controller communication</h3>
<p>I previously tried to decode PlayStation controller data so I already know what it looks like.<br />
<img src="/assets/2018-06-14-shooting-bad-guys-2/LA-GUNCON-1.png" alt="GUNCON Logic Analyzer - Shooting Outside of screen" /></p>
<p>NOCASH from <a href="https://problemkaputt.de/psx-spx.htm">problemkaputt</a> has a ton of information about the PlayStation and its controllers.</p>
<p>In short, the PlayStation uses a serial IO which resembles SPI.<br />
From the PlayStation schematics you can see that there’s a TX, RX, CLK and CS. Both memory cards and control port share the same bus.<br />
In addition to the bus and to, I assume, save on IO pins, controller port 1 and memory card 1 share the same CS. Controller port 2 and memory card 2 share a different CS.</p>
<p>To differentiate a controller from a memory card the first byte transmitted from the PlayStation is the address of the device it will access.<br />
A byte of value 0x81 will access the memory card. A byte of value 0x01 will access the controller.<br />
Add to that the CS and it can read the 4 devices plugged in.<br />
The PlayStation will then send a read command, which is byte value 0x42.</p>
<p>For a controller, the next 2 bytes sent are its ID.<br />
For example, the value 0x5A41 is the ID of a digital controller.<br />
After that comes the switch data.</p>
<p>Thanks to NOCASH, I know there are a maximum of 9 bytes that are sent after a controller read command.</p>
<hr />
<p><br /></p>
<h3 id="reading-tx-and-rx">Reading TX and RX</h3>
<p>The Arduino Nano is connected to CS, CLK, TX and RX.<br />
It will only read TX and RX when the CS of port 1 goes low and on the rising edge of CLK.<br />
Reading TX and RX is done through polling because I had a few issues trying to do it using interrupts.</p>
<p>Reading the data is initialised by the CS pin going low.<br />
Then each rising edge of the clock, both TX and RX are read into a buffer.<br />
Because TX and RX are on the same I/O port, I can just do as follows:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> while (!(PS1_PIN_IO & _BV(SS))){ // loop while SS is low
clk = PS1_PIN_IO & _BV(CLK); // read clock input
if (!prev_clk && clk){ // check for rising edge
port[bit_cnt] = PS1_PIN_IO; // read port
++bit_cnt;
if (bit_cnt >= PORT_BUFF_SIZE) // if all bits read, exit loop
break;
}
prev_clk = clk;
}
</code></pre></div></div>
<p>The PS1_PIN_IO is a define for PINB.</p>
<p>Once the data transfer is done, the next step is to reconstruct the TX and RX bytes.</p>
<hr />
<p><br /></p>
<h3 id="decoding-the-data">Decoding the data</h3>
<p>Decoding the data is fairly simple. For 8 saved PINB values in the buffer, get the TX and RX bits out of it and make 2 separate bytes.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> // convert port buffer bits to byte
uint8_t i, j;
for (i = 0; i < PS1_CTRL_BUFF_SIZE; i++){
cmd.buff[i] = convert_buff_to_byte(&port[i*8], _BV(CMD));
data.buff[i] = convert_buff_to_byte(&port[i*8], _BV(DATA));
}
</code></pre></div></div>
<p>This is the buffer to byte conversion function:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>uint8_t convert_buff_to_byte(uint8_t *p, uint8_t b){
uint8_t i, retval;
for (i = 0, retval = 0; i < 8; i++){
if (p[i] & b)
retval |= _BV(i);
}
return retval;
}
</code></pre></div></div>
<p>To further help me in decoding the data, I’ve created 2 unions containing structures.<br />
The first one is used to store the TX bytes.<br />
Once the buffer in this union is filled with data, you can use the structure to help in checking the device and the command.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/* PlayStation Controller Command Union */
union PS1_Cmd{
uint8_t buff[PS1_CTRL_BUFF_SIZE];
struct{
uint8_t device_select; // 0x01 or 0x81
uint8_t command; // 0x42 for read switch
uint8_t unused[PS1_CTRL_BUFF_SIZE-2]; // always 0 for controller
};
};
</code></pre></div></div>
<p>Same for RX, once the buffer is full, you can access the ID, the switches and the analog joysticks/light gun coordinates from the structure.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/* PlayStation Controller Data Union */
union PS1_Ctrl_Data{
uint8_t buff[PS1_CTRL_BUFF_SIZE]; // buffer to read data
struct{
uint8_t unused; // always 0xFF
uint16_t id; // 0x5Ayz - y = type; z = # of half word
uint16_t switches; // controller switches
union{
// light gun only (8MHz clock counter since hsync)
uint16_t x_pos; // if 0x0001 then error, check y_pos
struct{
uint8_t adc0; // right joy X
uint8_t adc1; // right joy Y
};
};
union{
//light gun only (scanlines since vsync
uint16_t y_pos; // if x_pos = 0x0001 && y_pos = 0x000A => not aimed at screen
struct{
uint8_t adc2; // left joy X
uint8_t adc3; // left joy Y
};
};
};
};
</code></pre></div></div>
<hr />
<p><br /></p>
<h3 id="parsing-the-data">Parsing the data</h3>
<p>The data is checked against a few defines in the code.<br />
First it’s going to check if the controller is the selected device and if the read command has been sent.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> // Check first command for device selected
if (cmd.device_select == CMD_SEL_CTRL_1 && cmd.command == CMD_READ_SW){
</code></pre></div></div>
<p>Then it’s checking the ID of the controller.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> // Check ID
switch(data.id){
case ID_GUNCON_CTRL:
// ...
break;
case ID_DIG_CTRL:
case ID_ANP_CTRL:
case ID_ANS_CTRL:
// ...
break;
</code></pre></div></div>
<p>I only have a digital controller, analog controller and GUNCON (light gun) so I have only programmed those IDs in the code.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#define ID_DIG_CTRL 0x5A41 // digital
#define ID_ANP_CTRL 0x5A73 // analog/pad
#define ID_ANS_CTRL 0x5A53 // analog/stick
#define ID_GUNCON_CTRL 0x5A63 // light gun
</code></pre></div></div>
<p>After that it’s going to check whether or not the reset button combination has been pressed against a predefined value.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/* Key Combo */
#define KEY_COMBO_CTRL 0xFCF6 // select-start-L2-R2 1111 1100 1111 0110
#define KEY_COMBO_GUNCON 0x9FF7 // A-trigger-B 1001 1111 1111 0111
</code></pre></div></div>
<p>Changing those defines will change the reset button combination.</p>
<hr />
<p><br /></p>
<h3 id="resetting-the-playstation">Resetting the PlayStation</h3>
<p>Once a reset command from the user has been detected, the Arduino Nano is going to pull the reset line of the PlayStation low for a few ms.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> // Check switch combo
if (key_combo != 0 && 0 == (data.switches ^ key_combo)){
// change RESET from input to output, logic low (PORT is already 0)
PS1_DIR_IO |= _BV(RESET);
delay(100); // hold reset for 100ms
// change RESET back to input
PS1_DIR_IO &= ~_BV(RESET);
delay(REBOOT_DELAY); // wait 30 sec before next reset, this is to prevent multiple reset one after the other
}
</code></pre></div></div>
<p>A reboot delay of 30 seconds is added so that the PlayStation can boot properly before getting a new reset command.</p>
<hr />
<p><br /></p>
<h3 id="changing-button-combination">Changing button combination</h3>
<p>If you want to change your combination, you’ll have to change the key combo defines shown above.<br />
A pressed button returns 0 and all controllers send a 16 bit value for the switch status.<br />
The switch is mapped as follows :</p>
<table>
<thead>
<tr>
<th style="text-align: center">Button</th>
<th style="text-align: center">Bit</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center">SELECT</td>
<td style="text-align: center">0</td>
</tr>
<tr>
<td style="text-align: center">L3</td>
<td style="text-align: center">1</td>
</tr>
<tr>
<td style="text-align: center">R3</td>
<td style="text-align: center">2</td>
</tr>
<tr>
<td style="text-align: center">START</td>
<td style="text-align: center">3</td>
</tr>
<tr>
<td style="text-align: center">UP</td>
<td style="text-align: center">4</td>
</tr>
<tr>
<td style="text-align: center">RIGHT</td>
<td style="text-align: center">5</td>
</tr>
<tr>
<td style="text-align: center">DOWN</td>
<td style="text-align: center">6</td>
</tr>
<tr>
<td style="text-align: center">LEFT</td>
<td style="text-align: center">7</td>
</tr>
<tr>
<td style="text-align: center">L2</td>
<td style="text-align: center">8</td>
</tr>
<tr>
<td style="text-align: center">R2</td>
<td style="text-align: center">9</td>
</tr>
<tr>
<td style="text-align: center">L1</td>
<td style="text-align: center">10</td>
</tr>
<tr>
<td style="text-align: center">R1</td>
<td style="text-align: center">11</td>
</tr>
<tr>
<td style="text-align: center">TRIANGLE</td>
<td style="text-align: center">12</td>
</tr>
<tr>
<td style="text-align: center">CIRCLE</td>
<td style="text-align: center">13</td>
</tr>
<tr>
<td style="text-align: center">CROSS</td>
<td style="text-align: center">14</td>
</tr>
<tr>
<td style="text-align: center">SQUARE</td>
<td style="text-align: center">15</td>
</tr>
</tbody>
</table>
<p>The GUNCON buttons are:</p>
<ul>
<li>A = START</li>
<li>Trigger = CIRCLE</li>
<li>B = CROSS</li>
</ul>I’ve recently acquired a PSIO from Cybdyn System. It’s a device that’s plugged into the parallel port of a PlayStation 1. It allows you to play games from an SD card instead of a CD.Game Boy Oscilloscope, part 22019-04-24T03:00:00+00:002019-04-24T03:00:00+00:00/electronics/pcb%20design/kicad/game%20boy/oscilloscope/2019/04/24/Game-Boy-Oscilloscope-part-2<p><em>Recap:</em><br />
In the October/November magazine of Elektor 2000, there was an article from Steve Willis who made a cartridge for the Game Boy named GBDSO.<br />
This cartridge made the Game Boy into a 2 channel oscilloscope.</p>
<p>These are it’s key features :</p>
<ul>
<li>Dual trace display</li>
<li>Sampling Rate: DC to 1 Msps</li>
<li>Time Base: 100 s to 5 µs/Div</li>
<li>Inputs: AC/DC 1 MegOhm</li>
<li>Input gain: 50 mV to 10 V/Div</li>
<li>Line or chart recorder trace modes</li>
<li>Real-time FFT mode with dB scale</li>
<li>Variable persistence XY mode</li>
<li>PC link for screen or data transfer</li>
<li>5 hrs operation from NiMH batteries</li>
<li>Averaging and Auto trigger functions</li>
<li>Reference trace storage</li>
</ul>
<p>As you can see from the features, this thing is pretty damn cool.<br />
Who knew the Game Boy could do even half of it, let alone real-time FFT?</p>
<p>The GBDSO was a kit sold by Elektor, but because this project is old, they don’t seem to be selling it anymore.<br />
I’m interested in having one of these, so I thought: Why don’t I make one?</p>
<hr />
<p><br /></p>
<h3 id="elektor-saves-the-day">Elektor saves the day</h3>
<p>I’ve been in contact with Elektor, trying to get the binary file for the EPROM.<br />
After a couple of weeks of “I’ve forwarded your question to the tech. department”, they told me they had <em>one</em> EPROM left for the GBDSO.<br />
They were willing to sell it to me for 10€, so of course I bought it!</p>
<p>I tried to read the EPROM with an Arduino, but something was wrong as the bin file I read didn’t work in an emulator.</p>
<hr />
<p><br /></p>
<h3 id="pcb-v1-arrives">PCB v1 arrives</h3>
<p>Oh, how I loathe customs. 1,5 weeks after the PCB was supposed to arrive I get a letter in the mail from our wonderful Belgian customs telling me I need to provide proof of purchase for the package.<br />
I ordered a few extra things from JLCPCB this time, such as:</p>
<ul>
<li>Red PCB</li>
<li>Gold plated</li>
<li>…</li>
</ul>
<p>Total price comes around to 30$. If you buy something that’s 22€ or more then customs can check your packages and you’ll be charged import tax and handling fees…</p>
<p>Anyways, once I proved the GBDSO PCB wasn’t a bomb and payed their ransom, I got the board in the mail another 1,5 week later.<br />
You’ve got to love our postal services.</p>
<hr />
<p><br /></p>
<h3 id="assembling-the-gbdso">Assembling the GBDSO</h3>
<p>Soldering the parts on the GBDSO was going fine. I started with discrete stuff: resistors, capacitors, …</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (1).jpg" alt="Assembly 1" /></p>
<p>Then I started adding the diodes, opamps and other stuff.<br />
Unfortunately I didn’t check the footprint of some of the ICs I’m using.</p>
<p>The digital potentiometer DS1267 is in a wide SOIC16 package. I have a normal SOIC16 footprint.<br />
To try and fix this without having to make a new board, I bent the pins inwards:</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (2).jpg" alt="Assembly 2" /></p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (3).jpg" alt="Assembly 3" /></p>
<p>It looks like it’s going to fit. I added some flux to help and then reflow soldered it with my hot air station.<br />
Here’s the result :</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (4).jpg" alt="Assembly 4" /></p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (5).jpg" alt="Assembly 5" /></p>
<p>As you can see, the pins are bent inwards and soldered to the normal SOIC16 footrpint.</p>
<hr />
<p><br /></p>
<h3 id="missing-ic">Missing IC</h3>
<p>Everything was soldered onto the board, except for the 74HC138 and the MAX114CAG.<br />
Where did I put those? I can’t find them anywhere.<br />
I checked my digikey BOM list online and they weren’t in there!<br />
Time to order some ICs again…</p>
<p>Once I got them I soldered the 74HC138 without issue, but then I messed up again.<br />
The ADC is in a wide TSSOP24 package and I used a normal TSSOP24 footprint.</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (6).jpg" alt="Assembly 6" /></p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (7).jpg" alt="Assembly 7" /></p>
<p>Again, I had to bend the pins inwards to make it fit the footprint. Soldering this with the soldering iron was impossible, so I had to reflow solder it again.</p>
<hr />
<p><br /></p>
<h3 id="assembly-done">Assembly done</h3>
<p>The board is done. I found a 3$ delivered Game Boy game and used it’s shell for the GBDSO.<br />
I was a bit rough cutting the shell, should have used the dremel for this.</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (8).jpeg" alt="Assembly 8" /></p>
<p>That small hole is too low. I checked my technical drawing of the cart and I messed up the distance from top to center of the hole…<br />
I broke off the pin from the shell that should go in that hole and fixed the PCB in KiCad and the tech. drawing, but now the PCB can move a bit so I hope it’s still going to make good contact in the Game Boy.</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (9).jpeg" alt="Assembly 9" /></p>
<p>Unfortunately once I plugged it in, it didn’t work.</p>
<hr />
<p><br /></p>
<h3 id="troubleshooting-part-1">Troubleshooting, part 1</h3>
<p>When powering the GBDSO up into a Game Boy, I had this Nintendo logo no matter which Game Boy I used:</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/troubleshooting-1.png" alt="Assembly 10" /></p>
<p>After a bit of back and forth with the guys on the gbdev discord and looking at the difference between a normal logo and the one I have, it came apparent that D7 is held low for some reason.</p>
<p>As you can see from the image below, those red pixels are missing if D7 is grounded.</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/troubleshooting-2.png" alt="Assembly 10" /></p>
<p>I’m thinking I must have damaged the EPROM when reflow soldering it, as it was difficult to solder and wouldn’t get into place.<br />
But after some probing I found I had D7 shorted to GND on the ADC.<br />
Due to the pin pitch being so small on a TSSOP I didn’t see the shorts, but managed to fix them with desoldering braid.</p>
<p>I only hope that I didn’t break anything on the PCB because of the shorts I had…</p>
<p>I also found out that the digital potentiometer symbol in KiCad, had it’s pin 12 and 13 swapped.<br />
Unfortunately my board was already done, so I have to somehow swap those two pins.
I submitted an issue and fixed the symbol in a pull request to the official KiCad symbols github repo.</p>
<p>The fix isn’t pretty, but it should work:</p>
<p><img src="/assets/2019-04-24-Game-Boy-Oscilloscope-part-2/assembly (10).jpg" alt="Assembly 10" /></p>
<hr />
<p><br /></p>
<h3 id="first-boot">First boot</h3>
<p>After all this troubleshooting was done I checked short between power and GND, and then turned on the Game Boy:</p>
<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/ue8mhNeEI1Q" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></p>
<p>As cool as this is, I wasn’t able to get any waveform on either channels so I’ll have to troubleshoot some more.</p>Recap: In the October/November magazine of Elektor 2000, there was an article from Steve Willis who made a cartridge for the Game Boy named GBDSO. This cartridge made the Game Boy into a 2 channel oscilloscope. These are it’s key features : Dual trace display Sampling Rate: DC to 1 Msps Time Base: 100 s to 5 µs/Div Inputs: AC/DC 1 MegOhm Input gain: 50 mV to 10 V/Div Line or chart recorder trace modes Real-time FFT mode with dB scale Variable persistence XY mode PC link for screen or data transfer 5 hrs operation from NiMH batteries Averaging and Auto trigger functions Reference trace storage As you can see from the features, this thing is pretty damn cool. Who knew the Game Boy could do even half of it, let alone real-time FFT? The GBDSO was a kit sold by Elektor, but because this project is old, they don’t seem to be selling it anymore. I’m interested in having one of these, so I thought: Why don’t I make one? Elektor saves the day I’ve been in contact with Elektor, trying to get the binary file for the EPROM. After a couple of weeks of “I’ve forwarded your question to the tech. department”, they told me they had one EPROM left for the GBDSO. They were willing to sell it to me for 10€, so of course I bought it! I tried to read the EPROM with an Arduino, but something was wrong as the bin file I read didn’t work in an emulator. PCB v1 arrives Oh, how I loathe customs. 1,5 weeks after the PCB was supposed to arrive I get a letter in the mail from our wonderful Belgian customs telling me I need to provide proof of purchase for the package. I ordered a few extra things from JLCPCB this time, such as: Red PCB Gold plated … Total price comes around to 30$. If you buy something that’s 22€ or more then customs can check your packages and you’ll be charged import tax and handling fees… Anyways, once I proved the GBDSO PCB wasn’t a bomb and payed their ransom, I got the board in the mail another 1,5 week later. You’ve got to love our postal services. Assembling the GBDSO Soldering the parts on the GBDSO was going fine. I started with discrete stuff: resistors, capacitors, … Then I started adding the diodes, opamps and other stuff. Unfortunately I didn’t check the footprint of some of the ICs I’m using. The digital potentiometer DS1267 is in a wide SOIC16 package. I have a normal SOIC16 footprint. To try and fix this without having to make a new board, I bent the pins inwards: It looks like it’s going to fit. I added some flux to help and then reflow soldered it with my hot air station. Here’s the result : As you can see, the pins are bent inwards and soldered to the normal SOIC16 footrpint. Missing IC Everything was soldered onto the board, except for the 74HC138 and the MAX114CAG. Where did I put those? I can’t find them anywhere. I checked my digikey BOM list online and they weren’t in there! Time to order some ICs again… Once I got them I soldered the 74HC138 without issue, but then I messed up again. The ADC is in a wide TSSOP24 package and I used a normal TSSOP24 footprint. Again, I had to bend the pins inwards to make it fit the footprint. Soldering this with the soldering iron was impossible, so I had to reflow solder it again. Assembly done The board is done. I found a 3$ delivered Game Boy game and used it’s shell for the GBDSO. I was a bit rough cutting the shell, should have used the dremel for this. That small hole is too low. I checked my technical drawing of the cart and I messed up the distance from top to center of the hole… I broke off the pin from the shell that should go in that hole and fixed the PCB in KiCad and the tech. drawing, but now the PCB can move a bit so I hope it’s still going to make good contact in the Game Boy. Unfortunately once I plugged it in, it didn’t work. Troubleshooting, part 1 When powering the GBDSO up into a Game Boy, I had this Nintendo logo no matter which Game Boy I used: After a bit of back and forth with the guys on the gbdev discord and looking at the difference between a normal logo and the one I have, it came apparent that D7 is held low for some reason. As you can see from the image below, those red pixels are missing if D7 is grounded. I’m thinking I must have damaged the EPROM when reflow soldering it, as it was difficult to solder and wouldn’t get into place. But after some probing I found I had D7 shorted to GND on the ADC. Due to the pin pitch being so small on a TSSOP I didn’t see the shorts, but managed to fix them with desoldering braid. I only hope that I didn’t break anything on the PCB because of the shorts I had… I also found out that the digital potentiometer symbol in KiCad, had it’s pin 12 and 13 swapped. Unfortunately my board was already done, so I have to somehow swap those two pins. I submitted an issue and fixed the symbol in a pull request to the official KiCad symbols github repo. The fix isn’t pretty, but it should work: First boot After all this troubleshooting was done I checked short between power and GND, and then turned on the Game Boy: As cool as this is, I wasn’t able to get any waveform on either channels so I’ll have to troubleshoot some more.Game Boy Oscilloscope2019-03-23T04:00:00+00:002019-03-23T04:00:00+00:00/electronics/pcb%20design/kicad/game%20boy/oscilloscope/2019/03/23/Game-Boy-Oscilloscope<p>In the October/November magazine of Elektor 2000, there was an article from Steve Willis who made a cartridge for the Game Boy named GBDSO.<br />
This cartridge made the Game Boy into a 2 channel oscilloscope.</p>
<p>These are it’s key features :</p>
<ul>
<li>Dual trace display</li>
<li>Sampling Rate: DC to 1 Msps</li>
<li>Time Base: 100 s to 5 µs/Div</li>
<li>Inputs: AC/DC 1 MegOhm</li>
<li>Input gain: 50 mV to 10 V/Div</li>
<li>Line or chart recorder trace modes</li>
<li>Real-time FFT mode with dB scale</li>
<li>Variable persistence XY mode</li>
<li>PC link for screen or data transfer</li>
<li>5 hrs operation from NiMH batteries</li>
<li>Averaging and Auto trigger functions</li>
<li>Reference trace storage</li>
</ul>
<p>As you can see from the features, this thing is pretty damn cool.<br />
Who knew the Game Boy could do even half of it, let alone real-time FFT?</p>
<p>The GBDSO was a kit sold by Elektor, but because this project is old, they don’t seem to be selling it anymore.<br />
I’m interested in having one of these, so I thought: Why don’t I make one?</p>
<hr />
<p><br /></p>
<h3 id="research">Research</h3>
<p>All the info I needed could be found in the article. The schematic and PCB layout were there, as well as a BOM list.<br />
Here you can find the article online : <a href="http://www.radanpro.com/Radan2400/TestShematics/GameBoyScope.pdf">http://www.radanpro.com/Radan2400/TestShematics/GameBoyScope.pdf</a></p>
<hr />
<p><br /></p>
<h3 id="schematic-design">Schematic Design</h3>
<p>I first started by creating a BOM list on digikey. What I couldn’t find I substitued with something similar.<br />
You can find the BOM list at the bottom of the page.</p>
<p>I’m using KiCad as my EDA software. It’s easy to use, open source and it’s free.<br />
There’s nothing much to say about the design. The schematic is essentially the same as the one in the Elektor magazine.</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/schematic-1.png" alt="Schematic" /></p>
<hr />
<p><br /></p>
<h3 id="pcb-design">PCB Design</h3>
<p>The first PCB design I did was pretty simple. The size of the board matched a Game Boy cartridge.<br />
I did however forget that there’s a notch in the top right corner of the board.<br />
<img src="https://github.com/pyroesp/GBDSO/raw/3203120118c3032adb6ad858880712b54764b28c/pcb-front.png" alt="PCB v0" /></p>
<p>When the PCB arrived, I tried putting it in the shell of a game just to realise it wouldn’t fit.<br />
The other thing I realised is that this board was thicker than the PCB of the game I have.<br />
This could potentially damage the connector of the Game Boy, so I opted to redo the PCB.</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/pcb-v0.png" alt="PCB v0" /></p>
<p>Before I started the new version, I made a technical drawing of the dimensions of the PCB of an actual game.</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/freecad/pcb dimensions/cartridge dimensions.svg?sanitize=true" style="max-width:100%;" /></p>
<p>After that I changed the board size in KiCad and started moving components around.<br />
Then I got the idea of programming the EPROM directly onto the PCB.<br />
This prompted me to make a small extension to the PCB which would convert the cartridge to a DIP 28 pin version of the EPROM (AT27C256R).</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/pcb.png" alt="PCB v1" /></p>
<p>The second board arrived and here are a couple of pictures:</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/pcb-v1-front.jpg" alt="PCB v1 front" /></p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/pcb-v1-back.jpg" alt="PCB v1 back" /></p>
<p>See part 2 for the assembly!</p>
<hr />
<p><br /></p>
<h3 id="programming">Programming</h3>
<p>The AT27C256R EPROM on the board needs to be programmed with the GBDSO software.<br />
I wanted to make it as easy as possible, so I added two jumpers on the board and a small extension.</p>
<p>Because the EPROM is in a PLCC32 package, you need an adapter board to program it as all universal programmers use some sort of wide DIP ZIF socket.</p>
<p>All the EPROM pins are accessible through the edge connector of the PCB, so the extra board converts the cartridge to a simple 28 pin AT27C256R EPROM.</p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/top%20-%20out.png" alt="Top - out" /></p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/top%20-%20in.png" alt="Top - in" /></p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/side%20-%20pinheader.png" alt="Side - pinheader" /></p>
<p>To get the AT27C256R into program mode, VCC needs to rise to 6.5V and VPP to 13V.<br />
Jumper 1 switches between 5V or 13V going to VPP of the EPROM. While programming, the jumper needs to connect the middle and bottom pad.<br />
<img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/programming-JP1.png" alt="JP1" /></p>
<p>Jumper 2 isolates the whole board, except the EPROM, from the 6.5V.<br />
<img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/programming-JP2.png" alt="JP2" /></p>
<p>After you’re done programming, bridge JP2 and change JP1 so that the middle and top pad are connected.</p>
<hr />
<p><br /></p>
<h3 id="original-gbdso">Original GBDSO</h3>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/original/GBDSO_F.jpg" alt="original - front" /></p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/original/GBDSO_Shell_Side.jpg" alt="original - shell" /></p>
<p><img src="https://github.com/pyroesp/GBDSO/raw/master/pictures/original/GBDSO_Warning.jpg" alt="original - warning" /></p>
<hr />
<p><br /></p>
<h3 id="bom-list">BOM list</h3>
<p>Here’s the list with links: <a href="https://docs.google.com/spreadsheets/d/1vu9Xc1Mw5STfz_mAsAOrmmyRrHJMRS4_JKM7iif-KBE/edit?usp=sharing">Google Sheet</a></p>
<p>Total Price: 31.33€<br />
Total Components: 70</p>
<hr />In the October/November magazine of Elektor 2000, there was an article from Steve Willis who made a cartridge for the Game Boy named GBDSO. This cartridge made the Game Boy into a 2 channel oscilloscope. These are it’s key features : Dual trace display Sampling Rate: DC to 1 Msps Time Base: 100 s to 5 µs/Div Inputs: AC/DC 1 MegOhm Input gain: 50 mV to 10 V/Div Line or chart recorder trace modes Real-time FFT mode with dB scale Variable persistence XY mode PC link for screen or data transfer 5 hrs operation from NiMH batteries Averaging and Auto trigger functions Reference trace storage As you can see from the features, this thing is pretty damn cool. Who knew the Game Boy could do even half of it, let alone real-time FFT? The GBDSO was a kit sold by Elektor, but because this project is old, they don’t seem to be selling it anymore. I’m interested in having one of these, so I thought: Why don’t I make one? Research All the info I needed could be found in the article. The schematic and PCB layout were there, as well as a BOM list. Here you can find the article online : http://www.radanpro.com/Radan2400/TestShematics/GameBoyScope.pdf Schematic Design I first started by creating a BOM list on digikey. What I couldn’t find I substitued with something similar. You can find the BOM list at the bottom of the page. I’m using KiCad as my EDA software. It’s easy to use, open source and it’s free. There’s nothing much to say about the design. The schematic is essentially the same as the one in the Elektor magazine. PCB Design The first PCB design I did was pretty simple. The size of the board matched a Game Boy cartridge. I did however forget that there’s a notch in the top right corner of the board. When the PCB arrived, I tried putting it in the shell of a game just to realise it wouldn’t fit. The other thing I realised is that this board was thicker than the PCB of the game I have. This could potentially damage the connector of the Game Boy, so I opted to redo the PCB. Before I started the new version, I made a technical drawing of the dimensions of the PCB of an actual game. After that I changed the board size in KiCad and started moving components around. Then I got the idea of programming the EPROM directly onto the PCB. This prompted me to make a small extension to the PCB which would convert the cartridge to a DIP 28 pin version of the EPROM (AT27C256R). The second board arrived and here are a couple of pictures: See part 2 for the assembly! Programming The AT27C256R EPROM on the board needs to be programmed with the GBDSO software. I wanted to make it as easy as possible, so I added two jumpers on the board and a small extension. Because the EPROM is in a PLCC32 package, you need an adapter board to program it as all universal programmers use some sort of wide DIP ZIF socket. All the EPROM pins are accessible through the edge connector of the PCB, so the extra board converts the cartridge to a simple 28 pin AT27C256R EPROM. To get the AT27C256R into program mode, VCC needs to rise to 6.5V and VPP to 13V. Jumper 1 switches between 5V or 13V going to VPP of the EPROM. While programming, the jumper needs to connect the middle and bottom pad. Jumper 2 isolates the whole board, except the EPROM, from the 6.5V. After you’re done programming, bridge JP2 and change JP1 so that the middle and top pad are connected. Original GBDSO BOM list Here’s the list with links: Google Sheet Total Price: 31.33€ Total Components: 70Repairing the Kurakake Game Boy2018-09-11T03:00:00+00:002018-09-11T03:00:00+00:00/electronics/repair/nintendo/2018/09/11/Repairing-the-Kurakake-Game-Boy<p>A couple of weeks ago I bought myself a red Nintendo Game Boy of off eBay.<br />
This one was listed as “JUNK”, so a non-working unit.</p>
<p>I’ve dubbed it the Kurakake Game Boy, because it has a sticker on the back with the name of the previous owner: N. Kurakake.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/front.jpg" alt="Game Boy - Front" /></p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/back.jpg" alt="Game Boy - Back" /></p>
<hr />
<p><br /></p>
<h3 id="inspecting-the-game-boy">Inspecting the Game Boy</h3>
<p>Upon opening the battery compartiment, I saw this :</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/battery compartiment.jpeg" alt="Game Boy - battery compartiment" /></p>
<p>That’s really bad…<br />
I tried putting in batteries, but there’s just too much corrosion so the Game Boy doesn’t turn on.</p>
<p>Looking at the motherboard of the Game Boy I can see corrosion there too.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (1).jpg" alt="Game Boy - Corrosion PCB 1" /></p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (2).jpg" alt="Game Boy - Corrosion PCB 2" /></p>
<p>The audio jack PCB is completely corroded.<br />
It’s so bad that I’m thinking of redoing the PCB entirely.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion audio.jpg" alt="Game Boy - Corrosion Audio" /></p>
<hr />
<p><br /></p>
<h3 id="cleaning-battery-contact">Cleaning battery contact</h3>
<p>I started with the battery contacts first.<br />
Removing them is fairly easy. These have a little tab on the back.<br />
You just have to push the tabs in and then you can push the contacts out.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion battery.jpg" alt="Game Boy - Corrosion Battery" /></p>
<p>I cleaned the contacts first with water and soap, then Isopropyl Alcohol.<br />
Some spots were very corroded so I had to remove it by scratching it off with a small flathead screwdriver (I didn’t have anything else).</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion battery cleaned 1.jpeg" alt="Game Boy - Battery Contact cleaned 1" /></p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion battery cleaned 2.jpeg" alt="Game Boy - Battery Contact cleaned 2" /></p>
<p>I put the contacts back in and they look good now.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion battery replaced.jpg" alt="Game Boy - Battery Contact replaced" /></p>
<p>I put in some fresh batteries and it started!<br />
This tells me a few things:</p>
<ul>
<li>The motherboard is fine, no corroded traces to the point they’re broken.</li>
<li>The audio works, but cracks a bit.</li>
<li>The screen is impeccable, no lines or dead pixels.</li>
</ul>
<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/Aa2UDvbr94U" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></p>
<hr />
<p><br /></p>
<h3 id="removing-corrosion-from-the-motherboard">Removing corrosion from the motherboard</h3>
<p>As mentioned before, when I opened the Game Boy you could see some corrosion on the motherboard.</p>
<p>This was worse than I had thought. With the point of my tweezers I could very easily scrape off the solder mask.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (3).jpg" alt="Game Boy - Corrosion PCB 3" /></p>
<p>Trying to desolder components from the motherboard, peels the solder mask off the board too.<br />
I’ve never desoldered anything that looked as bad as those battery contacts through holes.</p>
<p>I could litteraly peel of the solder mask that was behind the cartridge connector!</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (6).jpg" alt="Game Boy - Corrosion PCB 6" /></p>
<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/Hu7WHmsKPR0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></p>
<p>The good thing here is that the copper underneath wasn’t corroded at all.<br />
At this point I had removed the audio jack PCB, see top right corner of the next picture. Keep this in mind for the next chapter.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (7).jpg" alt="Game Boy - Corrosion PCB 7" /></p>
<p>I was afraid that the copper traces would start to corrode just from the moisture in the air.<br />
Not having any solder mask paint or coating on hand I applied a thin layer of solder.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (4).jpg" alt="Game Boy - Corrosion PCB 4" /></p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/corrosion pcb (8).jpg" alt="Game Boy - Corrosion PCB 8" /></p>
<p>I admit it doesn’t look great, but it should protect the copper traces.</p>
<p>After putting it all back together, I turned it on and… no sound.</p>
<hr />
<p><br /></p>
<h3 id="an-afternoon-lost">An afternoon lost</h3>
<p>Why did the audio stop working? Broken trace due to corrosion?<br />
The speaker is still fine, so that’s not it.<br />
The ribbon cable between the LCD board and the CPU board is fine.<br />
The audio amp is not outputting audio… That’s weird.</p>
<p>I have to say it wasn’t easy to follow traces due to them jumping from top layer to bottom layer.<br />
Plus, this version of the CPU board has epoxy blobs instead of ICs.</p>
<p>You can see the epoxy blobs on the last picture in the previous chapter.</p>
<p>Using my oscilloscope I measured PWM out of the CPU, so that’s fine. The potentiometer on the side for volume control is fine too.<br />
The PWM goes to the amplifier, but nothing comes out of it.<br />
I was a bit worried I blew the amplifier up at this point.</p>
<p>Not knowing what to do I opened my other Game Boy which had the same CPU board, with the same epoxy blobs.<br />
Using my multimeter I found a discrepency on one or two traces going to the amplifier.<br />
Following these traces I found out that they go to the audio jack board.</p>
<p>Could the audio jack board have some feedback to the amplifier?</p>
<p>I soldered the bad audio jack board to the main board and what do you know, the sound is back.</p>
<p>I’m glad the audio is back, but I’m frustrated it took me an afternoon to figure that out.</p>
<p><img src="/assets/2018-09-11-Repairing-the-Kurakake-Game-Boy/fixed.jpg" alt="Game Boy - Fixed" /></p>
<p align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/rj2O1cerSGA" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></p>
<hr />A couple of weeks ago I bought myself a red Nintendo Game Boy of off eBay. This one was listed as “JUNK”, so a non-working unit.