uJ – Java machine for microcontrollers

Some people just know Java very well and in order to program microcontrollers it would be best choice. But microcontrollers don’t have java Virtual Machine (VM) running in them. So there is a difficulty which has to be removed. Dmitry decided to change things a bit and programmed uJ – Java VM for microcontrollers. Its written purely in C so can be used for most microcontrollers including AVR, PIC and ARM. Lots of things are already done and many are in to do list. But results are speaking for themselves. Biggest constrains here are RAM limits, so few workarounds are implemented in order to work correctly like not coppying classes to RAM, custom stack control and other. JVM is modular so for smaller microcontrollers some features can be turned off … Continue reading

Programming AVR chips manually

Once your program is written and compiled, next concern is flashing and running on real device. Any programmer adapter dos this job quickly. But what if you don’t have adapter or you are lost in the island with attiny13 in your hands… then you can program chip manually. With some knowledge and patience you can do this with couple buttons. As you may know avr microcontrollers are programmed through SPI interface. It consists of four wires – reset, MOSI, MISO and SCK. So all we need is to control these signals manually. Manually keying it is possible to program chip bit by bit. SPI programming speed isn’t limited towards slow. With buttons connected to these wires bits can be clocked in. As example a successful blinking LED program was programmed … Continue reading

Basic understanding of microcontroller interrupts

Earlier I’ve made a mistake by referring this tutorial to older AVR family microcontrollers like Atmega8/16/32/64/128. But AVR is being changed constantly 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 easily compared to … Continue reading

Setting up AVR development platform

You can be encouraged to use various types of AVR development tools. Most of them cost money to get full functionality and support. Most common commercial packages are: CodeVisionAVR, Imagecraft ICCV, IAR Workbench. All they are great tools out of box with fast support that you have to pay for. Of course you can give a try with their limited versions to se capabilities. As we mentioned before we are going to use free tools that great enough comparing to commercial. WinAVR or AVR-GCC tools WinAVR is a toolset for C programming the AVR microcontrollers. It is actually a bunch of small programs that make development as easy as possible. Main tools here are avr-gcc compiler, avrdude programmer, avr-gdb debugger and even more. These actually are command line tools so … Continue reading

AVR at a glance

Any AVR microcontroller is an 8 bit computer in a chip designed and manufactured by ATMEL Corporation. It has some RAM memory and ROM (Flash) as well. To make things more attractive and useful there is also an EEPROM memory. Including AVR core CPU all these are more than enough to say that it is a small computer where you can execute programs stored in Flash memory, run them while operating data in SRAM and storing some constant values in EEPROM. Comparing to real computer that sits on your table you can say that AVR core is a CPU like AMD or Pentium. Flash memory would be your hard drive where programs are stored, RAM is RAM nothing to add there. EEPROM probably can be compared to some media device … Continue reading