Introduction: HackerBoxes 0002: Stepping Up to ARM32, MCU Video, Wii Nunchuck
This Instructable shares the basics of working with HackerBoxes #0002. HackerBoxes is the monthly subscription box service for electronics hobbyists, makers, and hackers. If you would like to receive a box like this right to your mailbox each month, you can SUBSCRIBE HERE anytime. We hope subscribers to HackerBoxes will use this Instructable to make the most of their box contents.
Of course, this Instructable is for non-subscribers too. Box contents are presented in enough detail so that anyone can join in the fun with their own components and modules. Where possible, we include links to online merchants where the items may be purchased individually. Also, extra HackerBoxes (when available) may be purchased at the HackerBoxes web store.
Step 1: Box Contents
- ARM 32-bit Cortex-M4 STM32L476 Nucleo Board (buy from Amazon)
- TFT LCD Touchscreen Shield with micro SD Socket (buy from Amazon)
- Arduino DUO "Cool Version" (buy from Amazon)
- Wii Nunchuck Controller (buy from Amazon)
- USB A-B cable for Arduino UNO (buy from Amazon)
- USB A-miniB cable for STM32 (buy from Amazon)
- Dual RCA Pigtail
- Dupont cables F-F
- Small Signal Switching Diodes
- HD15 D-Sub (aka VGA) Connectors
- Resistors: ten each of 68,75,470, 1K, and 2K OHM
- Fone Phreak Auto Decal
- Heat shrink tubing
- Single row headers
Step 2: The Story of 2600 Hz
2600 Hz is the frequency of a tone emitted by the Blue Box to reset a telco trunk line. The Blue Box was classic tool of telephone system hackers also known as Phreakers.
Enjoy the video on this page to learn about the phone phreaking exploits of Steve Wozniak and Steve Jobs before they went on to found Apple Computer. Here is another entertaining video. Sport your 2600 sticker with pride for the thus far short, but rich, history of the hacker culture. Worse case, people will just think that you ran one hundred marathons. :)
Step 3: ARM 32-bit Cortex-M4 Nucelo Development Board
Disguised as a mere Arduino, this computer board is a BEAST:
- ARM 32-bit Cortex-M4 Processor
- 1MB Flash Memory supporting zero-wait-state execution
- Operating Frequency up to 80 MHz
- Floating Point Unit with DSP Instructions
- Arduino Compatible Pin Headers
Get started with the documentation and tools available here.
Video for Learning Embedded Design on ARM micros.
Video for Learning DSP on ARM micros.
“RISC architecture is gonna change everything. Yeah. RISC is good.”
-Hackers (The Movie) 1995
Step 4: LCD Shield
- 2.4″ diagonal LCD TFT display
- 240×320 resolution
- 18-bit (262,000) color
- SPFD5408 controller or ILI9341 controller
- 8 bit digital interface + 4 control lines
- Onboard 3.3V 300mA LDO regulator
- (5V interface compatible)
- Four white LED backlight
- Four-wire resistive touchscreen
- MicroSD slot
This particular UNO is called the "cool version" because of its colorful connectors. Note that these Arduino modules have the new CH340/CH341 serial driver chip instead of the traditional FTDI serial chip. A driver (available for OS X, Windows, and Linux) for the CH34x chip generally needs to be installed on your computer for the Arduino IDE to communicate to these boards. Here is a video on the topic.
Step 5: Video Output Options
The LCD shield is a great way to display output directly from your microcontroller projects, but sometimes it is nice to be able to drive a regular display such as a television set or a computer monitor.
The current preferred video interface is of course HDMI, which is available on certain higher end microntroller platforms such as the Raspberry Pi and BeagleBone Black. Driving the HDMI bus generally requires a dedicated memory and video driver. It isn't really possible (or at least not reasonable) to bit bang HDMI from a basic micro.
Step 6: Composite Video
Using a couple of RCA pigtails, three resistors, and some heat shrink tubing, we can make a composite video (with audio) cable to use with almost any microcontroller platform. It can be very useful to "connectorize" modules, devices, and cables by soldering half of a Dupont cable onto each terminal. You can finish each connection with a very narrow piece of shrink tubing and then finish the entire thing with one larger piece of tubing. It looks very neat and provides for a strain relief.
For the cable in the pictures, a label was printed with the signal names (use about 6 point font) and cut with an exacto knife to label each tiny Dupont connector. If you use female connectors you can gender-bend them with a pin from a SIP header (or a piece of hookup wire) to create a connector that works on F or M interface blocks.
Once the cable is made, test out the video output using the TVout Arduino Library.
The Hackvision project is a very cool retro gaming system using the TVout library. Once you test out the Wii Nuncheck controller, give it a shot with Hackvision.
Step 7: VGA Video
This tutorial covers basic VGA generation from an Arduino using the schematic shown here. The parts are included to make this basic VGA interface. Consider using some of the shrink tubing as shown to make a nice connectorized cable as we did for the composite video cable.
Step 8: Wii Nunchuck
The Wii Nunchuck controller (WiiChuck) includes a Joystick, Two Buttons, and a 3-axis Accelerometer interfaced over a simple I2C serial bus.
The image here shows how to prep the WiiChuck cable into Dupont connectors as we did for the composite video cable. You can just unscrew the connector and pull it off. There is no magic to the assigned wire colors (they may vary) but the controller that we've opened from this batch used these wire colors:
- Pin 1 (PWR): Red
- Pin 2 (SLC): Green
- Pin 3 (DET): Black (connected to PWR in controller)
- Pin 4 (NC):
- Pin 5 (SDA): Blue
- Pin 6 (GND): White
Some suggest using two 2K resistors to pull-up SDA and SLC to PWR.
Here is a library for using the Wiichuck with an Arduino. Note that aftermarket off-brand Wiichucks need to be initialized differently than the original OEM Wiichucks. This library handles the initialization properly for both types.
Wikipedia has a nice entry for the I2C serial interface.
Step 9: Hack the Planet!
If you enjoyed this Instrucable and you would like to have a box like this delivered to your house each month, please SUBSCRIBE HERE.
Can you get some video output modes going on the Arduino DUO? Did you bring up the Hackvision retro gaming system? With Wii Nunchuck? Please share your success (below or on the HackerBox Facebook page) or certainly let us know if you have any questions.
Who can post the first example of overcoming the inherent video limitations of the Arduino by leveraging the horsepower of the STM32 for gaming or otherwise?
Thank you for being part of the HackerBox adventure. Please keep your suggestions and feedback coming. HackerBoxes are your boxes. Let's make something great!
We have a be nice policy.
Please be positive and constructive.