Receiving Asynchronous Data Bursts

[Johan’s] been working on a chunk of code for about seven years and he thinks it’s ready to help you with your next project. He calls it D1 (The One) and it lets you receive asynchronous data without the need for a hardware USART. It’s capable of working with signals from an IR or RF remote, as well as tangentially related transmissions like RFID and magstripe readers.

It uses timer and port interrupts to sample the incoming data. Once it’s captured a transmission, the code sets a flag so that you can pull what it got into your own application. If you’re expecting to receive a protocol that sends packets several times in a row a verification module is also included which runs as a precondition of setting the received flag. The package is written in PIC assembly, but with all the information that [Johan] included in his post this shouldn’t be hard to port over to other chip architecture.

DCPU-16 Running Pac-Man

If you’ve been trying to think of stuff you can do with the DCPU-16 this may inspire you to write a clone of  a classic game.

This version of Pac-Man was written using a sprite system with a 16 color pallette. It runs in an HTML-based emulator, so you can even monkey around with the assembly code to help you figure out how it works. But if you’re not into writing code that is this machine-close, you can just click the ‘run’ button and use your keyboard arrows to play through a level or two. You’ll notice there’s only one game board available so far and some things are still missing like that familiar waka-waka as he gobbles up the dots. Let us know if you mange to extend the features of this version.

In case you missed it, this emulator is running the DCPU-16 spec from Notch’s new game, 0x10c (. We have no idea how that’s going to shape up, but getting in on the game early will pay off it turns out to be as popular as Minecraft.

Interesting Substrate Used To Position LEDs Of This Word Clock

[Ivan] decided to build a Word Clock as holiday gift for his parents. He pulled it off, but as you can see above, it meant a lot of point-to-point soldering. One small piece of proto-board is used to host the power supply and a few integrated circuits, with the rest of the device mounted on an interesting choice of material.

The substrate that holds the LED array for the display is a plastic mesh. You’ll find the stuff in any craft store, it’s meant for use in yarn work. It comes rated in several different sizes designated by holes-per-linear-inch. This is fantastic because it makes precision spacing a snap. The face plate itself looks great, especially when you consider that all of the letters were cut out from a piece of black foam board by hand. This bezel was then put in a picture frame, with a bit of tissue paper as a diffuser.

They tell us that the code was written in assembly for an ATtiny2313 microcontroller. It uses a DS1305 RTC chip to keep time and you might be interested to see how the communication protocol was implemented in assembly. The project is based on [Doug’s] Word Clock which we covered in this links post.

8-pin Micro Plays Pong On Your Widescreen

[Fernando] sent in a tangential project update that uses an ATtiny45 to play Pong on his television. Last time we looked in on his work he had just finished getting the eight-pin chip to display a big number on the TV via the VGA port. This expands on the idea while he continues to wait for parts.

Right now the chip plays against itself, but he’s got one input pin left and we’d love to see a button added for a simple one-player game. We’re thinking the paddle would always be moving in one direction or the other, with a click of the button to reverse that direction. The part that he’s waiting for is a Bluetooth module, which we’d love to see used for 2-player games via a pair of Wiimotes (we’re just wishing at this point and don’t know if that would even be possible). The end goal for the hardware is a Bluetooth connected scoreboard for Android devices.

The code is written in Assembly, and we found it relatively easy to follow what [Fernando] is doing with the game logic. On the graphics side of things he gets away with a 120×96 resolution because Pong is supposed to look pixelated. We love the result, which you can see for yourself after the break.

Continue reading “8-pin Micro Plays Pong On Your Widescreen”

ATtiny Hacks: ATtiny10 Game – Doing More With Less

ATtiny Hacks Theme Banner

Okay, you’ve got a six-pin microcontroller with 1k of program memory, 32 bytes of SRAM, and it can’t be programmed using an In-System-Programmer. Do you think you can use it to develop a game? [Wrtlprnft] managed to build a Simon Says game based on the diminutive device that has four buttons and four LEDs. Judging from the video after the break, we’d say he nailed it!

There are so many design challenges here. First off, with only six pins total getting eight devices connected and working means doubling up on each I/O pin and using the reset pin as a doubled-up I/O. We’ve seen momentary push buttons on the same pins as LEDs before, so that’s not too hard to get working.

But if you’re using the reset pin how do you flash the thing? It doesn’t use the same ISP programming protocol that it’s bigger cousins do, so [Wrtlprnft] used an ATmega1284P to program it, hooking up to the three I/O pins and using a transistor to push 12V on the reset pin. But there’s still the matter of writing the code. It has half of the 32 registers you’d expect to find. He ended up ditching C and went straight to writing Assembly because of the diminished instruction set. It’s the first thing he’s written in Assembly, and a great way to learn the ropes.

It may not be as polished, but we do like it just as much as the Karate Chop Simon Says game which has a lot of other bells and whistles.

Continue reading “ATtiny Hacks: ATtiny10 Game – Doing More With Less”

Have You Got What It Takes To Code Android Apps Using Assembly?

Do you have a rooted Android device and a computer running Linux? If so, you’re already on your way to coding for Android in Assembly. Android devices use ARM processors, and [Vikram] makes the argument that ARM provides the least-complicated Assembly platform, making it a great choice for those new to Assembly programming. We think his eight-part tutorial does a great job of introducing the language and explaining how to get the development tools up and running. You’ll need to know some basic programming concepts, but from what we saw you don’t need any prior experience with ARM or Android.

So why learn Assembly at all? We took a stab at Assembly for AVR a few months ago and really learned a lot about the hardware that we just never needed to know writing in C. It’s a great way to optimise functions that waste too much time because of quirks with higher-level language compilers. That means you don’t need to write your entire application in Assembly. You can simply use it to streamline hairy parts of your code, then include those Assembly files at compile time.

A Study In AVR Power Saving Techniques

amtel_avr

[Scott] found the iCufflinks from Adafruit Industries pretty interesting, but he thought that the stated run time of 24 hours was a bit short. He figured he could improve the product’s power consumption at least a little bit, to improve the overall battery life.

From their schematics, he placed an order for parts and built two identical iCufflink mock-ups side by side – one running their code and one running his. He took baseline current draw measurements, then got busy slimming down the cufflinks’ software. It had been 20 years since he touched assembly, and he has never written it for an AVR, but judging by his work he’s not rusty in the least.

He slowed the ATtiny’s clock down and tweaked a few other settings for a savings of 53μA, but the real improvements came via a fairly simple fix. The original code called for the processor to institute a counting loop to sleep, which he found to be very wasteful. Instead, he chose to put the processor in an idle state, using the chip’s watchdog timer to wake it when it was time to pulse the LED. The power savings from this change alone was a whopping 261μA!

When he was said and done, the changes save about 315μA of current draw, and should allow the cufflinks to run for up to 38 hours without swapping batteries. In [Scott’s] opinion, a nearly 60% improvement in battery life is pretty good for a day’s work, and we’re inclined to agree.