Setup AVR Eclipse plugin to work with WinAVR

Probably many of you (including me) are using Programmers Notepad or AVR Studio to set up AVR projects. Each of them has advantages and disadvantages. For instance Programmers Notepad is great GUI, but there are lots of manual routines required to start compiling project – like setting up makefile, creating file dependencies, etc. AVR Studio is a great solution which generates makefiles automatically, and it has great simulator for immediate debugging. So why would we need another IDE? Actually Eclipse IDE is one of the best open source tools hat is widely used by programmers – so it is optimized for managing projects, code writing with auto-complete functionality. So why not to give a try for it. So lets set up Eclipse environment to work with AVR. Firs of all lets download Eclipse from https://www.eclipse.org/downloads/ site. Choose Eclipse IDE for C/C++ Developers as we want program AVR in C. Open…

Continue reading

Easy start with AVR EEPROM using WinAVR

AVR microcontrollers are loaded with some amount of EEPROM (Electronically Erasable Read-Only memory ) memory. This is handy feature allowing developers to store program parameters like service information, constants, menu strings etc. Atmel states that AVR EEPROM memory can be rewritten over 1000000 times. Reading is unlimited. In this article I am going to show how to store data to EEPROM by defining a variables. For this we need to include eeprom.h header from avr directory (#include “avr/eeprom.h” ). Then we can just write simple variable declaration using simple attribute EEMEM: #include “inttypes.h” #include “avr/io.h” #include “avr/iom8.h” #include “avr/eeprom.h” //store initial byte to eeprom uint8_t EEMEM eeprombyte=0x10; //store initial word to eeprom uint16_t EEMEM eepromword=0x5555; //store string to eeprom uint8_t EEMEM eepromstring[5]={“Test\0”}; int main(void) { //RAM byte variable uint8_t RAMbyte; //RAM word variable uint16_t RAMword; //RAM array of bytes uint8_t RAMstring[5]; //read byte from EEPROm and store to RAM RAMbyte…

Continue reading