AVR Assembler 101
There is a good reason to learn assmebler, the more you know about the inner workings of the processor the more capable a programmer you will become. And even if you do decide that you need to write portions of your code in Assembler you are not restricted to just using Assmbler or higher level language we can mix them as long as we observe a few simple rules. For instance we could use 'C' as our main language but write the interrupt routines in assembler.
SPI Master and USI Slave communications
Serial Peripheral Interface or SPI might be referred to as a non-standard standard as there doesn't seem to be any official specification on the subject. The best reference I've found are in the Atmel datasheets and "AVR319: Using the USI module for SPI communication". The older Atmel chips did not use the SPI protocol they instead had a Universal Serial Interface or USI that was close to SPI and with a little effort can be used to communicate with a device using the SPI protocol.
AVR Studio and C++
C++ is generally not a good choice for programming Micro controllers as it consumes more program and data memory but if memory is not a primary concern then C++ can be a viable option. This also assumes that timing is not a critical consideration for your application, in this case C or Assembler would be the obvious choice. But for those who would like to benefit from the advatages that C++ has to offer a solution is presented here using AVR Stduio and GCC++.
Square Wave Generator
In this on-going series of articles or tutorials if you wish, I attempt
to provide a usable application that demonstrate the ideas or areas of
learning that I am attempting to convey. In this article I have
provided an application that uses a windows application that
communicates with an ATMega1280 running a program that provides a
configurable PWM (Pulse Width Modulation). The windows application
transmits commands to the MPU to manage the output of the PWM
controlling the frequency and duty cycle, turning the output on or off
and setting the prescale value, all of which will be discussed in this
text.
ATMega1280 + Button Debounce
The debounce logic I came up with was a combination of several that I found while googling, but I already had a preconception of what I needed and none that I found quite fit the bill. The logic uses a state machine where the transition between states is dictated by a timer that is read at periodic intervals and a delta time extracted. The delta time is used in conjunction with a set of time intervals for press and release based on common intervals defined for the average time it takes for a device to settle.
ATMega1280 + Shift Register
In this tutorial I'll be explaining how to interface an ATMega1280 Micro controller to a shift register, in this case an SN74HC595D, but the theory should be the same for most shift registers except perhaps the pin out. I will present 3 different ways that this can be accomplished, the 3 forms are; 1) Brute force, I call this the manual procedure, 2) using a timer and 3) using the Serial Peripheral Interface (SPI). Each method has it's pros and cons so deciding on a method is entirely a; matter of choice.
ATMega1280 + 16x2 LCD Module Tutorial
Article describing one way to interface to an LCD device and use Peter Fleury's AVR-GCC LCD Library to output data to the device.
Setting up programming environment for ATMega1280
This will be the first in a series of articles about the ATMega1280 Micro Controller and the best place to start is at the beginning. This article will lead you through the various environments that may be used to program, debug, simulate and upload the software for your device. Also included will be helpful documentation that I have found indispensable during the design stage.
I have a little electronics background (just enough to be dangerous as they say) so saying this my emphasis will be on the software, the schematics I provide will be mostly the result of articles that I found on the internet and have used in the projects I submit here.