Game Boy Cartridge Emulator Uses STM32

Game Boys may be old tech, but they still provide challenges to modern hackers. [Dhole] has come up with a cartridge emulator which uses an STMicroelectronics STM32F4 discovery board to do all the work. Until now, most flash cartridges used programmable logic devices, either CPLDs or FPGAs to handle the high-speed logic requirements. [Alex] proved that a microcontroller could emulate a cartridge by using an Arduino to display the “Nintendo” Game Boy boot logo. The Arduino wasn’t fast enough to actually handle high-speed accesses required for game play.

[Dhole] kicked the speed up by moving to the ARM Cortex-M4 based 168 MHz STM32F4. The F4’s  70 GPIO pins can run via internal peripherals at up to 100MHz, which is plenty to handle the 1MHz clock speed of the Game Boy’s bus. Logic levels are an issue, as the STM32 uses 3.3V logic while the Game Boy is a 5V device. Thankfully the STM32’s inputs are 5V tolerant, so things worked just fine.

Simple Game Boy cartridges like Tetris were able to directly map a ROM device into the Game Boys memory space. More complex titles used Memory Block Controller (MBC) chips to map sections of ROM and perform other duties. There were several MBC chips used for various titles, but [Dhole] can emulate MBC1, which is compatible with the largest code base.

One of the coolest tricks [Dhole] implemented was displaying a custom boot logo. The Game Boy used the “Nintendo” logo as a method of copyright protection. If a cartridge didn’t have the logo, the Game Boy wouldn’t run. The logo is actually read twice – once to check the copyright info, and once to display it on the screen. By telling the emulator to change the data available at those addresses after the first read, any graphic can be displayed.

If you’re wondering what a cartridge emulator would be useful for (other than pirating games), you should check out [Jeff Frohwein’s] Gameboy Dev page! [Jeff] has been involved in Game Boy development since the early days. There are literally decades of demos and homebrew games out there for the Game Boy and various derivatives. .

Continue reading “Game Boy Cartridge Emulator Uses STM32”

Trinket EDC Contest Entry: Shorty

Sometimes finding a short-circuit is easy, especially after the magic smoke has escaped. Finding a short on a newly etched or milled board though, can be a maddening task. Many of us have been there – wrestling with multimeter probes under a magnifier trying to find the offending bit of copper that is the source of all our problems. [Jaromir] designed Shorty to make this task a little bit easier.

Shorty is a short-circuit finder – but it’s not exactly like the one you would find on a typical multimeter.  [Jaromir] used MCP6041 Op-Amp to detect resistances down to the order of tens of milliohms. Determining an exact resistance measurement at these levels would require a heck of a lot of calibration. When looking for a short though, [Jaromir] is only concerned with the relative value – is he getting closer to or further away from the short. He determines this by sound. The Op-Amp output is sent to the Pro Trinket’s ADC input. The trinket drives a speaker with lower or higher tones based upon the ADC voltage. Much like the childhood game of “hot and cold”, Shorty will direct you right to your short!

There’s still time to enter the Trinket Everyday Carry Contest. The main contest runs until January 2, but we’re having random drawings every week! Don’t forget to write a project log before the next drawing at 9pm EST on Tuesday, December 30th. You and all of the other entrants have a chance to win a Teensy 3.1 from The Hackaday Store!

Learning I2C With The Bus Pirate

When an air quality display project needed a display, [Inderpreet] looked into small character-based LCDs. [Inderpreet’s] chosen LCD used an I2C interface, which was new to him. Rather than shy away, [Inderpreet] grabbed his Bus Pirate and dove in!

I2C or Inter-Integrated Circuit serial interfaces are often mentioned here on Hackaday. They generally are easy to use, but as with all things, there are little gotchas which can make the road a bit more bumpy the first time you travel it. One of those things is voltage interfacing – I2C uses bidirectional open drain lines, so interfacing 3.3 V and 5V circuits requires a voltage level shifter circuit designed to handle that requirement. Thankfully in [Inderpreet’s] case, both his TI launchpad target devboard and the LCD used 3.3 volt logic levels.

buspirate2Before using the TI though, [Inderpreet] wanted to test with the Bus Pirate first. This would allow him to verify the hardware, and to make sure he was correctly using the I2C bus. The Bus Pirate can operate at 3.3V or 5V logic levels, and has on-board programming specific to the I2C bus. Controlling the Bus Pirate is as easy as hooking up a serial terminal program and plugging in a USB cable.

The I2C bus protocol is relatively simple, but can still be confusing to a new user. Each transaction needs an address, read/write bit, and a start command sent in the proper sequence before the data bytes can begin flowing. There are also acknowledge bits which prove that the data bytes are actually being received by the LCD. The Bus Pirate made all this easy, allowing [Inderpreet] to quickly display “Hello” on his LCD module.

The I2C bus is just the tip of the iceberg for the Bus Pirate. If you’re interested in learning more, check it out over at The Hackaday Store!

[via Dangerous Prototypes]

TRINKET EDC CONTEST DRAWING #4 RESULTS

The fourth of five random drawings for Hackaday’s Trinket Everyday Carry Contest was held tonight. The winner is [davish] with his entry, Trinket Watch. 

twatch3[davish] loves the current crop of smartwatches, but he wants one he can truly call his own. He’s using the Pro Trinket along with an Adafruit 1.3″ OLED for display duties. That little OLED can show a lot more than just numbers though. [davish] already has Adafruit’s logo demo running on the device. Trinket Watch is going to start out as a simple Arduino coded “dumbwatch”. After the basics of time and date are out of the way, [davish] hopes to add a Bluetooth module and turn Trinket Watch into a full-fledged smartwatch.

trinket-prize-cordwoodWe hope [davish] enjoys his new Cordwood Puzzle from The Hackaday Store. No jigsaws here, cordwood is a puzzle that involves solder! If you get a piece wrong, it’s time to break out that solder wick and fix your mistake. The puzzle is built using the cordwood assembly technique which was popular in the 1950’s and 1960s. We’re not kidding about it being a puzzle either – there are no instructions for this kit! [davish] will know he’s got it right when all 3 LEDs light up.

teensy-3-point-1-in-storeIf you didn’t win this week, all is not lost, you still have one more chance to win a random drawing! Our next drawing will be on 12/30/2014 at 9pm EST. The prize will be a Teensy 3.1 and audio adapter as a prize. To be eligible you need to submit your project as an official entry and publish at least one project log during the week.

The main contest entry window closes on January 2, 2015 – but don’t wait for the last minute! Hit the contest page and build some awesome wearable or pocketable electronics!

Arduino Plays White Tiles On Your Mobile Touchscreen

Like many mobile gamers, [Daniel] has found himself caught up by the addictive “White Tiles” game. Rather than play the game himself though,  [Daniel] decided to write his own automatic White Tiles player. While this hack has been pulled off before, it’s never been well documented. [Daniel] used knowledge he gleaned on Hackaday and Hackaday.io to achieve his hack.

The basic problem is sensing white vs black tiles and activating the iPad’s capacitive touch screen. On the sensing end, [Daniel] could have used phototransistors, but it turned out that simple CdS cells, or photoresistors, were fast enough in this application. Activating the screen proved to be a bit harder. [Daniel] initially tried copper tape tied to transistors, but found they wouldn’t reliably trigger the screen. He switched over to relays, and that worked perfectly. We’re guessing that changing the wire length causes enough of a capacitance change to cause the screen to detect a touch.

The final result is a huge success, as [Daniel’s] Arduino-based player tears through the classic game in only 3.9 seconds! Nice work [Daniel]!

Click past the break to see [Daniel’s] device at work, and to see a video of him explaining his creation.

Continue reading “Arduino Plays White Tiles On Your Mobile Touchscreen”

TRINKET EDC CONTEST ENTRY: Lazydoro

[Vasilis] has entered Lazydoro in the Trinket Everyday Carry Contest.  Lazydoro is designed to get him up off his backside, and walking around. Recent medical research has determined that sitting too long is a bad thing. In fact,  Dr. David Agus has been quoted by Nike as saying that sitting for several hours is as bad as smoking (wayback machine link). While we’re not exactly up on the latest medical trends, we can definitely see that getting up and walking around a bit never hurt anyone. Lazydoro will alert [Vasilis] once every 20 minutes or so to get up and stretch his legs a bit.

[Vasilis] plans to pair a Pro Trinket with an accelerometer module, specifically an ADXL377 from Analog Devices. The accelerometer will allow Lazydoro to determine if [Vasilis] has moved around. If 20 or 30 minutes go by without major movement, Lazydoro will nudge him to get up and take a walk.

Since shipping to Greece takes awhile, [Vasilis] is developing with an Arduino Uno and a ADXL345 while he waits for his parts to arrive. He’s hacked this into a wrist mounted device for testing. One thing  [Vasilis]  hasn’t figured out yet is how to alert the user to move around. A small vibrating motor would probably work – but we’d suggest electric shocks. A good zap always puts the spring in our step!

There is still plenty of time to enter the Trinket Everyday Carry Contest.  The main contest runs until January 2, but we’re having random drawings every week! Don’t forget to write a project log before the next drawing at 9pm EDT on Tuesday, December 23. You and all of the other entrants have a chance to win a Cordwood Puzzle from The Hackaday Store!

Hacklet 27 – Holiday Hacks

It’s beginning to look a lot like the holidays around here. That means it’s time for holiday hacks here on The Hacklet! This week we’re looking at the coolest festive hacks created by YOU on Hackaday.io!

xmashdrWe start with [charliex] and Cypress PSOC 4 + ESP8266 WS2812 RGB XMAS Lights. The name might be a mouthful, but the goal of the project is a simple one: Awesome Christmas lights! [Charliex] has created WiFi controllable Christmas lights. To do this, he’s utilized ARM core based PSOC4 chips from Cypress. WiFi duty is handled by the popular ESP8266 module, and the lights themselves are WS2812 addressable strips.

[charliex] really outdid himself this time, creating a complete solution from the ground up. He started with a Cypress dev board, but quickly moved to a board of his own design. The PCBs  first were milled at home, then sent out for manufacturing.
Control of the strip is via UDP through a WiFi network. [Charliex] found the strips have plenty of WiFi range to place outside his home.  The last part of the puzzle was control – which [charliex] handled in style by creating his own GUI to handle synchronizing several strips to music played on a central computer.

snowflakeNext up is [nsted] with another LED hack, Glowing Xmas Snowflake Sculpture. [Nsted] was contracted to add some extra LED bling to a sculpture. The problem was that these LEDs would be filling in gaps left in the primary interactive lighting system which ran the entire sculpture. Any time you have to meld two systems, things can get crazy. [Nsted] found this out as he added WS2812B Adafruit NeoPixel strips to the Sensacell modules already designed into the sculpture. Communications happen via RS485, with Arduino Due and Megas handling the processing. Power was a concern with this sculpture, as it was pulling over 100 amps at low voltage. Like many art installations, this was a “work down to the wire” event. Everything came together at the last-minute though, and the project was a success!

musicNext up is [Jeremy Weatherford] with Christmas Orchestra.  [Jeremy] has taken on the task of making the most epic retro electronics orchestra ever created. He’s playing Trans-Siberian Orchestra’s Wizards in Winter on four floppies, three scanners, and an ancient inkjet printer. LED strips on the moving elements add lights to the sound. An Arduino Mega with a RAMPS board controls the show. [Jeremy] had his orchestra professionally recorded both on audio and in video. We’re anxiously awaiting the final video upload so we can rock out to some old hardware!

xmaslightsFinally, we’ve got [crenn6977] with his Solar powered Christmas Light Controller. This was [crenn6977’s] entry in the The Hackaday Prize. While it didn’t take him to space, we’re sure it will bring Santa to his door. Rather than run lots of tiny solar cells for his Sun powered Christmas lights, [crenn6977] is going for a single large panel and wireless control. The nRF24L01+ is handling the wireless connectivity, while a STM32F042 ARM cortex M0 processor is the brains of the operation. Solar power demands efficient design, so [crenn6977] is digging deep into op-amp circuits to keep those LEDs running through the night, and the batteries charging through the day.

It’s just about time for us to settle our brains for a long winter’s nap, so we’ll close this edition of The Hacklet here.  As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!