Basic understanding of microcontroller interrupts

Earlier I’ve made a mistake by referring this tutorial to first AVR family microcontrollers like Atmega8/16/32/64/128. But AVR is being continuously changed with various new tweaks and updates like enhanced pin control or different register names. Since now tutorial will be based on Atmega328 microcontroller which is popular in Arduino boards. So you’ll be able to test all code examples on Arduino as it can serve as general purpose AVR test board with no problem. Understanding Interrupts Probably you won’t be able to find a microcontroller without interrupt capability. These are essential attributes of any modern microcontroller or processor. They may seem confusing and tricky at first glance, but during the time you will find out that normal MCU operation is impossible without interrupts. Interrupts can be compared to real life events. Look around – all your activities are full of them. For instance, you are reading this tutorial and find it interesting, so you are all in it. But suddenly your cell phone rings. What do you do? You remember the last stroke you’ve read and answered the phone.… Continue reading

Wake up with sun anywhere you are

Direct sunlight is perfect for waking up in the morning. But it happens that there is no sun or simply your bedroom is in western side of the house. Then there is the only way – start cheating with sun simulator. It is based on ATTiny13 microcontroller which takes care of dimming the 150W halogen lamp. Alarm clock can be set to reach its maximum intensity from 2 minutes up to 8 hours. Microcontroller takes alarm signals from regular digital radio alarm clock so no need to do additional time tracking. I agree it looks a bit dangerous to have halogen lamp near pillow, but it is worth to risk for a bit of sun. Continue reading

The Outstanding Arduino Strobe Algae Bioreactor

We all knew that Arduino is definitely a very special electronic device, as you can do many incredible electronic projects with a simple arduino! Well, if you’re looking for a home décor, but you don’t want to spend huge money out from your wallet, maybe this fantastic Arduino Strobe Algae Bioreactor is your ideal choice. Why? Believe it or not, the Arduino Strobe Algae Bioreactor is only cost you about $60 and less than three hours to accomplish it! Honestly, you don’t need to be an expert to build this project, as it only require basic power tools. For your information, algae has been recognized as one of the most potential environmental friendly powers, where many researchers have been involved in the algae experiment to cultivate the unknown parts of algae. In this project, it’s a very easy one, where you use a platform for one technique that is broadly used with to trick the algae into reproducing. The algae species reacts differently in many ways to its environment. You can create a microcontroller platform that can be variably set… Continue reading

Der Kapellmeister – Direct Musical Performance through Only Visible Gestures

Have you ever thought that is it possible to direct musical performance by only moving your hands in the air without even get in touch with the musical instrument? Well, it might be sounded crazy, but believe it or not, you can really do it with Der Kapellmeister! For your information, the project is implemented with a glove. Then, it resembles with a conducting baton that has the ability to analyze visible gestures and interprets them into musical elements. Der Kapellmeister is a very simple device that can be used to test a user’s ability in basic conducting, by using a real conducting baton. Let’s take an example. When a user performs a gesture, the device is automatically display the tempo, time signature and beat number on the LCD screen. It will then output a tick sound through the speaker. The system can analyze up to four different time signatures at one time! Honestly, Der Kapellmeister is a very suitable device, especially for the beginners of conducting. Der Kapellmeister is a compact mobile set that consist of a baton and… Continue reading

How to Interface a Microcontroller with a PS/2 Keyboard

In most of the case, it’s highly important when you’re moving from basic microcontroller programming to advanced microcontroller programming, especially if you wants to interrupt the code. Technically, interrupts are pieces of code that much likes functions. The interrupts are executed automatically when outside events occur. People always used the interrupts to react to all sorts of outside inputs; including pin changes that driven by outside devices. By using the interrupts, it enables the users to give the code an ability to react to events as they happen. In this case, we don’t have to wait for the code to get to a place where it can handle an event. For your information, the project uses interrupts to interface a PS/2 keyboard with the USB NerdKit. To be honest, the simplicity of the protocol and the asynchronous nature of the clock generated by the keyboard make it a great start, especially for the amateur to get familiar with interrupts and interrupt handlers. The PS/2 keyboard is quite cheap and very easy to obtain, at the garage sales, online auction or… Continue reading

The Superb Crystal Real Time Clock

You might probably involve with Crystal Real Time Clock development project before, but have you ever done it with the system interrupts? If you don’t know what the system interrupts for, it’s a process that stops a microprocessor/microcontroller from what it is doing. By doing this step, it will enable you to do other task instead of the previous one. Please allow me to give you an example here. Let’s say that the main program is running and performing some function in a circuit, suddenly an interrupt applying into the program. It caused the program halted immediately. In the same time, another routine is carried out. When the routine had finished, the processor goes back to main routine again! Sounds simple, isn’t it? For this project, you’ll have to use the USB NerdKits, which is already included a 14.7456MHz crystal. The main purpose of this feature is to clock each instruction that microcontroller executes. Meanwhile, we still can use the same crystal to keep track of “wall time”, either it’s measured in seconds, minutes, hours, days and so on. Well,… Continue reading