Beginner Concepts: All About AVR Interrupts

Microcontroller interrupts are one of the big tools in our embedded programming arsenal. They make the chip listen for particular events, and once detected they stop what they’re doing and run a separate set of code called and Interrupt Service Routine. We’ve come across two fairly new tutorials on the subject that you should check out if you’re not yet a master on the topic. One is a ProtoShack tutorial on ATmega168 external interrupts, and the other is a Newbie’s Guide to AVR Interrupts by [Dean Camera] (we’ve been a fan of his tutorials for some time). Both cover a range of topics from what interrupts are, to avoiding the common problems of volatile data types and the compiler optimization caveats.

What can you do with interrupts? External interrupts can be used to wake up a project like this LED menorah from sleep mode. Interrupts can be used to monitor a timer for a certain value or an overflow for use in generating a pulse-width modulation signal. The TI Launchpad uses an interval timer interrupt for button debouncing in projects like this code which was ported from an AVR chip. The source for both is available if you wanted to compare how the two differ.

Interrupts are powerful. Learn them, love them, use them.

Full-featured AVR Time-lapse

This time-lapse photo trigger was built [Lukasz Goralczyk]. It is controlled by an ATmega168 and we were surprised to read that it uses about 12k of code. Curious about what takes up that much space, we were impressed to see all the features demonstrated in the video after the break. The small device, running on two AA batteries, has a well-designed user interface displayed on a 3V character LCD that is navigated with a clickable rotary encoder.

It isn’t the smallest intervalometer we’ve ever seen, but it deserves respect for the features packed into a diminutive form-factor.

Continue reading “Full-featured AVR Time-lapse”

Cheap Cable Reused To Add USB To Your Project

You get what you pay for. [Jkx] wanted to see how a USB to RS232 cable could be sold for just $1.70 and found out that it’s not actually RS232 compliant. The cable communicated as TTL levels, not the 12V expected of RS232 (although it can handle 12V incoming). He didn’t really want to use them for their intended purpose anyway. By betting rid of the DB9 plug and reusing the enclosed circuit board he now has a really cheap way to interface a microcontroller with the Universal Serial Bus. He worked out a couple of short subroutines that take care of receiving and sending data over the connection.

Open Source Version Of The Play Station 3 Jailbreak

Don’t steal. It’s a lesson that children are taught from the youngest age and a core principle in every society. The PSGroove sets out to follow this mantra in several ways. It is an open source implementation of the PSJailbreak hardware we covered a couple of weeks back. It’s difficult to find a definitive source of information on that hardware but many have speculated that the original device contains stolen code. Whether that’s true or not is moot as the PSGroove doesn’t include the backup manager program alleged to violate copyright.

The device is also aimed at running homebrew, and doesn’t natively allow one to play backups. It runs on a variety of AVR hardware, including the Teensy boards. If you have one of them, it’s just a matter of compiling the code and unlocking the potential of your PlayStation 3.

[Thanks Mark via PS3news]

Pressure Mapping Sensor Mat

[imsolidstate] built his own pressure sensitive mat. It utilizes two discs of copper clad board with a piece of foam in between for each of 64 sensors. As the foam gets compressed, the capacitance between the two pieces of copper changes, a measurement that is fairly easy to make with an analog to digital converter. The mat is being used to measure how well a horse saddle fits the animal. Data is read in through a serial port and then mapped using Excel. This prototype proves that the concept works but [imsolidstate] mentions that there’s room to improve the sensitivity and that there could be more noise filtering incorporated into the design.

ATtiny2313 Prime Number Generator

[Scott Harden’s] prime number generator exhibits a great way to use an LED matrix to present readable information. The project resides in a hinged wooden box with a grid of holes on the lid for the LEDs. [Scott] has overlaid the matrix with a printout showing powers of two that represent different prime numbers. Inside you’ll find an ATtiny2313 microcontroller that handles the column scanning and prime number testing. We’ve embedded a video the break where [Scott] explains the project in great detail, but you should also check out his prototyping and construction pages.

Continue reading “ATtiny2313 Prime Number Generator”

FPSLIC Powered LED Matrix

[Mathieu] built this display in hopes that he can play pong on it. You can imagine the headache that awaits when trying to figure out how to drive the 6144 bi-color LEDs. I must have worked out because the thing looks great in the video after the break. The solution he chose was a bit unfamiliar to us though. He used a Field Programmable System Level Integrated Circuit produced by Atmel, or FPSLIC. This is a kind of mash-up of components we’re more accustomed to.

The AT94K is a single chip that houses an 8-bit AVR microcontroller, and FPGA, and SRAM. This project uses that FPGA to handle the multiplexing of the display via code written in VHDL. The AVR core receives data via a USB port, stores two images in the SRAM (one for each LED color), and then outputs it to be drawn on the display. On second thought, this project sounds like fun and it’s a great way to get start learning that VHDL you’ve been putting off. Continue reading “FPSLIC Powered LED Matrix”