There’s no holy war holier than establishing whether PC games are superior to console games (they are). But even so, there’s no denying that there are some good console titles out there. What if you’d still like to play them using a mouse and keyboard? If you’re [Agent86], you’d build up the most ridiculous chain of fun electronics to get the job done.
Now there is an overpriced off-the-shelf solution for this problem, and a pre-existing open-source project that’ll get the same job done for only a few bucks in parts. But there’s nothing like the fun in solving a problem your own way, with your own tangle of wires, darn it all! The details of the build span four (4!) pages in [Agent86]’s blog, so settle down with a warm cup of coffee.
Here’s the summary: an Xbox 360 controller is taken apart and turned into an Xbox controller. The buttons and joysticks are put under computer control via a Teensy microcontroller. GPIOs press the controller’s buttons, and digipots replace the analog sticks. Software on the Teensy drives the digipots and presses the buttons, interpreting a custom protocol sent over USB from the computer, which also gets some custom software to send the signals.
So if you’re keeping score: a button press on a keyboard is converted to USB, sent to a PC, converted to a custom serial protocol, sent to a Teensy which emulates a human for a controller that then coverts the signals back into the Xbox’s USB protocol. Pshwew!
Along the way, there’s learning at every stage, which is really the point of an exercise like this. And [Agent86] says that it mostly works, with some glitches in the mouse-to-joystick mapping. But if you’re interested in any part of this crazy chain, you’ve now got a model for each of them.
Certainly everyone remembers passing time in a boring high school class playing games on a graphing calculator. Whether it was a Mario-esque game, Tetris, or BlockDude, there are plenty of games out there for pretty much all of the graphing calculators that exist. [Christopher], [Tim], and their colleagues from Cemetech took their calculator game a little bit farther than we did, and built something that’ll almost surely disrupt whatever class you’re attempting to pay attention in: They built a graphing calculator whac-a-mole game.
This game isn’t the standard whac-a-mole game, though, and it isn’t played on the calculator’s screen. Instead of phyiscal “moles” the game uses LEDs and light sensors enclosed in a box to emulate the function of the moles. In order to whack a mole, the player only needs to interrupt the light beam which can be done with any physical object. The team made extensive use of the ArTICL library which allows graphing calculators to interface with microcontrollers like the MSP432 that they used, and drove the whole thing with a classic TI-84.
This project is a fun way to show what can be done with a graphing calculator and embedded electronics, and it was a big hit at this past year’s World Maker Faire. Calculators are versatile in other ways as well. We’ve seen them built with open hardware and free software, And we’ve even seen them get their own Wi-Fi.
Continue reading “The Newest Graphing Calculator Game”
The Arduino is a popular microcontroller platform for getting stuff done quickly: it’s widely available, there’s a wealth of online resources, and it’s a ready-to-use prototyping platform. On the opposite end of the spectrum, if you want to enjoy programming every bit of the microcontroller’s flash ROM, you can start with an arbitrarily tight resource constraint and see how far you can push it.
[lucas][Radical Brad]’s demo that can output VGA and stereo audio on an eight-pin DIP microcontroller is a little bit more amazing than just blinking an LED.
[lucas][RB] is using an ATtiny85, the larger of the ATtiny series of microcontrollers. After connecting the required clock signal to the microcontroller to get the 25.175 Mhz signal required by VGA, he was left with only four pins to handle the four-colors and stereo audio. This is accomplished essentially by sending audio out at a time when the VGA monitor wouldn’t be expecting a signal (and [lucas][Rad Brad] does a great job explaining this process on his project page). He programmed the video core in assembly which helps to optimize the program, and only used passive components aside from the clock and the microcontroller.
Be sure to check out the video after the break to see how a processor with only 512 bytes of RAM can output an image that would require over 40 KB. It’s a true testament to how far you can push these processors if you’re determined. We’ve also seen these chips do over-the-air NTSC, bluetooth, and even Ethernet.
Continue reading “ATtiny Does 170×240 VGA With 8 Colors”
We’ve all been there. You’re building up a microcontroller project and you wish that you could just add “one more feature” but you’re limited by the hardware. Time to start thinking. (Or, arguably, buy the next model up.)
[Sam Feller] found himself in this position, adding a knob to set the time and a button to arm the alarm for his Analog Voltmeter Clock, and he came up with a way to implement an on-off switch, and poll a button and a potentiometer with only two pins of a microcontroller.
The problem with potentiometers in low-power designs is that they’re always leaking power. That is, unless you switch them off when you’re not using them. So the ideal solution is to power the potentiometer from one GPIO pin on the microcontroller, and read its value with another. That’s two GPIO pins just for the potentiometer. But [Sam] needed to read input from a button too, and he was out of pins.
Not pressed: pot sees VCC and VCC/2
Pressed: pot sees VCC/2 and GND
His clever solution is to switch two resistors in or out of the circuit depending on the status of the pushbutton, so that the voltage range at the potentiometer is between either VCC and VCC/2 when the switch is pressed, or between VCC/2 and GND when the switch is not pressed.
If the ADC reads something higher than VCC/2, the microcontroller knows that the button is pressed, and vice-versa. The potentiometer’s setting determines exactly where the voltage lies within either range.
Done and done. If you find yourself in the similar situation of needing to read in values from a whole bunch of buttons instead of a potentiometer, then you can try using an R-2R DAC wired up to the pushbuttons and reading the (analog) value to figure out which buttons are pressed. (If you squint your eyes just right, this solution is the same as the R-2R DAC one with the potentiometer replacing all but the most-significant bit of the R-2R DAC.)
Another tool for the toolbox. Thanks [Sam].
For years now, people have been trying to stuff an Intel processor on a credit card sized board. An x86 board that can fit in your pocket is an intriguing device – after all, that’s what Gumstix, the forerunner of the Raspberry Pi, were. Efforts to put x86 on a dev board have included the Minnowboard, the Intel Galileo and Edison, and even the Intel Compute Stick. These have not seen the uptake you would expect from a small x86-powered board, but that tide may soon turn. The UP board is exactly what you would expect from a Raspberry Pi-inspired board with a real Intel processor.
The feature set for the UP board is impressive for a credit card sized board; it’s powered by a quad-core Intel Atom x5-Z8300 CPU running at 1.84 GHz. The board comes equipped with 1GB of RAM, 16GB of eMMC Flash, Gigabit Ethernet, five USB 2.0 ports (one on a pin header) and one USB 3.0 port. Up also includes a real-time clock, HDMI, the same 40-pin GPIO pin connector found in the Raspberry Pi Model B Plus, and DSI and CSI connectors for the Raspberry Pi camera and touch screen.
To be fair to all the previous attempts at making a board built around an x86 chip that borrows heavily from the Raspberry Pi, there haven’t been many chips out there that have been suitable for credit card-sized applications. Only in the last year or so has Intel released chips suitable for an x86 single board computer, and the growing market of Windows 10 tablets bears this out. While it remains to be seen if the UP board will be a success, more than a few people will pick one of these up for a miniature Skype box.
With everything that’s been happening in the news lately, [Jarek] decided it was finally time to finish up his latest project. The Internet of Things has been exploding with projects lately, and this clock that also alerts him of the weather is the latest addition. Plus it has the added bonus of using everybody’s favorite display: nixie tubes!
Of course, using high voltage for the nixies can be terror-inducing, but [Jarek] found a power supply on eBay that was able to power the tubes for not too much money. The controller is an HV5622 which can control up to 32 nixies while only using up three pins on a microcontroller which is pretty handy if you have a limited number of output pins.
The clock also has another device hidden behind all of the wires for the tubes: an ESP8266 to give it network connectivity. The clock connects to the Internet and searches for the nine-hour weather forecast. There are a few nixie lights behind the display which illuminate cutouts in the case to indicate a few different weather statuses. It’s a very polished project, and since it’s enclosed in a nice case it’s not likely to be mistaken for any movie props. Of course, other nixie projects don’t have the same comforting look.
Continue reading “Nixie Tube Clock Isn’t Just a Clock”
What’s the biggest difference between writing code for your big computer and a microcontroller? OK, the memory and limited resources, sure. But we were thinking more about the need to directly interface with hardware. And for that purpose, one of the most useful, and naturally also dangerous, tools in your embedded toolchest is the interrupt.
Interrupts do exactly what it sounds like they do — they interrupt the normal flow of your program’s operation when something happens — and run another chunk of code (an interrupt service routine, or ISR) instead. When the ISR is done, the microcontroller picks up exactly where it left off in your main flow.
Say you’ve tied your microcontroller to an accelerometer, and that accelerometer has a “data ready” pin that is set high when it has a new sample ready to read. You can wire that pin to an input on the microcontroller that’s interrupt-capable, write an ISR to handle the accelerometer data, and configure the microcontroller’s interrupt system to run that code when the accelerometer has new data ready. And from then on everything accelerometer-related happens automagically! (In theory.)
This is the first part of a three-part series: Interrupts, the Good, the Bad, and the Ugly. In this column, we’ll focus on how interrupts work and how to get the most out of them: The Good. The second column will deal with the hazards of heavyweight interrupt routines, priority mismatches, and main loop starvation: the Bad side of interrupts. Finally, we’ll cover some of the downright tricky bugs that can crop up when using interrupts, mainly due to a failure of atomicity, that can result in logical failures and corrupted data; that’s certainly Ugly.
Continue reading “Embed with Elliot: Interrupts, The Good…”